-/* $OpenBSD: locore.s,v 1.15 1997/02/03 15:05:04 deraadt Exp $ */
+/* $OpenBSD: locore.s,v 1.16 1997/02/21 08:55:14 niklas Exp $ */
/* $NetBSD: locore.s,v 1.72 1996/12/17 11:09:10 is Exp $ */
/*
andl d1,d5
jeq Lstartnot040 | it is not 68040
movl #MMU_68040,a0@ | same as hp300 for compat
+ RELOC(_cputype, a0)
+ movl #CPU_68040,a0@
.word 0xf4f8 | cpusha bc - push and invalidate caches
movl #CACHE40_OFF,d0 | 68040 cache disable
btst #7,sp@(3) | XXX
*/
#include <m68k/asm.h>
-/*
- * copypage(fromaddr, toaddr)
- *
- * Optimized version of bcopy for a single page-aligned NBPG byte copy.
- * dbra will work better perhaps.
- */
-ENTRY(copypage)
- movl sp@(4),a0 | source address
- movl sp@(8),a1 | destination address
- movl #NBPG/32,d0 | number of 32 byte chunks
- cmpl #MMU_68040,_mmutype
- jne Lmlloop | no, use movl
-Lm16loop:
- .long 0xf6209000 | move16 a0@+,a1@+
- .long 0xf6209000 | move16 a0@+,a1@+
- subql #1,d0
- jne Lm16loop
- rts
-Lmlloop:
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- movl a0@+,a1@+
- subql #1,d0
- jne Lmlloop
- rts
/*
* update profiling information for the user
* addupc(pc, &u.u_prof, ticks)
.data
.space NBPG
tmpstk:
- .globl _mmutype,_fputype,_protorp
+ .globl _mmutype,_cputype,_fputype,_protorp
_mmutype:
.long 0
+_cputype:
+ .long 0
_fputype:
.long 0
_protorp:
-/* $OpenBSD: mem.c,v 1.3 1996/10/31 00:39:22 niklas Exp $ */
+/* $OpenBSD: mem.c,v 1.4 1997/02/21 08:55:13 niklas Exp $ */
/* $NetBSD: mem.c,v 1.17 1996/04/23 05:14:40 veego Exp $ */
/*
extern int kernel_reload_write(struct uio *uio);
extern u_int lowram;
-caddr_t zeropage;
+caddr_t devzeropage;
int mmopen __P((dev_t, int, int, struct proc *));
int mmclose __P((dev_t, int, int, struct proc *));
* and EFAULT for writes.
*/
if (uio->uio_rw == UIO_READ) {
- if (zeropage == NULL) {
- zeropage = (caddr_t)
+ if (devzeropage == NULL) {
+ devzeropage = (caddr_t)
malloc(CLBYTES, M_TEMP,
M_WAITOK);
- bzero(zeropage, CLBYTES);
+ bzero(devzeropage, CLBYTES);
}
c = min(c, NBPG - (int)v);
- v = (vm_offset_t) zeropage;
+ v = (vm_offset_t)devzeropage;
} else
#endif
return (EFAULT);
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
+ if (devzeropage == NULL) {
+ devzeropage = (caddr_t)
malloc(CLBYTES, M_TEMP, M_WAITOK);
- bzero(zeropage, CLBYTES);
+ bzero(devzeropage, CLBYTES);
}
c = min(iov->iov_len, CLBYTES);
- error = uiomove(zeropage, c, uio);
+ error = uiomove(devzeropage, c, uio);
continue;
/*