summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-02-21 08:55:15 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-02-21 08:55:15 +0000
commita6f5f24a48e1a05bfed3c144d5724d6f0b8610e5 (patch)
tree94fb6f8e217035d288a33140f1b462656525c6e5
parent61118a5337e87356d7138317b1e3e91f6726e767 (diff)
copypage/zeropage adaption. cputype setting needs more work.
-rw-r--r--sys/arch/amiga/amiga/locore.s38
-rw-r--r--sys/arch/amiga/amiga/mem.c20
2 files changed, 16 insertions, 42 deletions
diff --git a/sys/arch/amiga/amiga/locore.s b/sys/arch/amiga/amiga/locore.s
index f63557eeb69..eb819bd7d08 100644
--- a/sys/arch/amiga/amiga/locore.s
+++ b/sys/arch/amiga/amiga/locore.s
@@ -1,4 +1,4 @@
-/* $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 $ */
/*
@@ -1013,6 +1013,8 @@ Lsetcpu040:
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
@@ -1174,36 +1176,6 @@ _esigcode:
#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)
*/
@@ -2405,9 +2377,11 @@ _fpeaemu60:
.data
.space NBPG
tmpstk:
- .globl _mmutype,_fputype,_protorp
+ .globl _mmutype,_cputype,_fputype,_protorp
_mmutype:
.long 0
+_cputype:
+ .long 0
_fputype:
.long 0
_protorp:
diff --git a/sys/arch/amiga/amiga/mem.c b/sys/arch/amiga/amiga/mem.c
index d4021068483..67619867e83 100644
--- a/sys/arch/amiga/amiga/mem.c
+++ b/sys/arch/amiga/amiga/mem.c
@@ -1,4 +1,4 @@
-/* $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 $ */
/*
@@ -59,7 +59,7 @@
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 *));
@@ -157,14 +157,14 @@ mmrw(dev, uio, flags)
* 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);
@@ -187,13 +187,13 @@ mmrw(dev, uio, flags)
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;
/*