From: niklas Date: Fri, 21 Feb 1997 08:55:13 +0000 (+0000) Subject: copypage/zeropage adaption. cputype setting needs more work. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b2e1f3487f50f4a82c8476a388289d58c31e886b;p=openbsd copypage/zeropage adaption. cputype setting needs more work. --- 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 @@ -1173,36 +1175,6 @@ _esigcode: */ #include -/* - * 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; /*