Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k Use m68k_page_offset and m68k_trunc_page macros,
details: https://anonhg.NetBSD.org/src/rev/b8b7dae46d07
branches: trunk
changeset: 504084:b8b7dae46d07
user: minoura <minoura%NetBSD.org@localhost>
date: Wed Feb 21 12:39:16 2001 +0000
description:
Use m68k_page_offset and m68k_trunc_page macros,
instead of using PGOFSET directly.
diffstat:
sys/arch/x68k/include/pte.h | 4 ++--
sys/arch/x68k/x68k/bus.c | 12 ++++++------
sys/arch/x68k/x68k/db_memrw.c | 4 ++--
sys/arch/x68k/x68k/mem.c | 4 ++--
sys/arch/x68k/x68k/sys_machdep.c | 10 +++++-----
sys/arch/x68k/x68k/trap.c | 4 ++--
sys/arch/x68k/x68k/vm_machdep.c | 4 ++--
7 files changed, 21 insertions(+), 21 deletions(-)
diffs (175 lines):
diff -r d3b59651787f -r b8b7dae46d07 sys/arch/x68k/include/pte.h
--- a/sys/arch/x68k/include/pte.h Wed Feb 21 12:16:07 2001 +0000
+++ b/sys/arch/x68k/include/pte.h Wed Feb 21 12:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.1.1.1 1996/05/05 12:17:03 oki Exp $ */
+/* $NetBSD: pte.h,v 1.2 2001/02/21 12:39:16 minoura Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -147,6 +147,6 @@
#define ptetokv(pt) \
((((pt_entry_t *)(pt) - Sysmap) << PGSHIFT) + VM_MIN_KERNEL_ADDRESS)
#define kvtophys(va) \
- ((PG_PFNUM((int)kvtopte(va)) << PGSHIFT) | ((int)(va) & PGOFSET))
+ ((PG_PFNUM((int)kvtopte(va)) << PGSHIFT) | m68k_page_offset(va))
#endif /* !_X68K_PTE_H_ */
diff -r d3b59651787f -r b8b7dae46d07 sys/arch/x68k/x68k/bus.c
--- a/sys/arch/x68k/x68k/bus.c Wed Feb 21 12:16:07 2001 +0000
+++ b/sys/arch/x68k/x68k/bus.c Wed Feb 21 12:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.c,v 1.11 2001/02/21 05:53:35 minoura Exp $ */
+/* $NetBSD: bus.c,v 1.12 2001/02/21 12:39:17 minoura Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -434,7 +434,7 @@
size_t size;
{
#ifdef DIAGNOSTIC
- if ((u_long)kva & PGOFSET)
+ if (m68k_page_offset(kva))
panic("x68k_bus_dmamem_unmap");
#endif
@@ -459,11 +459,11 @@
for (i = 0; i < nsegs; i++) {
#ifdef DIAGNOSTIC
- if (off & PGOFSET)
+ if (m68k_page_offset(off))
panic("x68k_bus_dmamem_mmap: offset unaligned");
- if (segs[i].ds_addr & PGOFSET)
+ if (m68k_page_offset(segs[i].ds_addr))
panic("x68k_bus_dmamem_mmap: segment unaligned");
- if (segs[i].ds_len & PGOFSET)
+ if (m68k_page_offset(segs[i].ds_len))
panic("x68k_bus_dmamem_mmap: segment size not multiple"
" of page size");
#endif
@@ -533,7 +533,7 @@
/*
* Compute the segment size, and adjust counts.
*/
- sgsize = NBPG - ((u_long)vaddr & PGOFSET);
+ sgsize = NBPG - m68k_page_offset(vaddr);
if (buflen < sgsize)
sgsize = buflen;
diff -r d3b59651787f -r b8b7dae46d07 sys/arch/x68k/x68k/db_memrw.c
--- a/sys/arch/x68k/x68k/db_memrw.c Wed Feb 21 12:16:07 2001 +0000
+++ b/sys/arch/x68k/x68k/db_memrw.c Wed Feb 21 12:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_memrw.c,v 1.11 2000/06/29 07:07:55 mrg Exp $ */
+/* $NetBSD: db_memrw.c,v 1.12 2001/02/21 12:39:17 minoura Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -136,7 +136,7 @@
* with this mapping and subtract it from the
* total size.
*/
- limit = NBPG - ((u_long)dst & PGOFSET);
+ limit = NBPG - m68k_page_offset(dst);
if (limit > size)
limit = size;
size -= limit;
diff -r d3b59651787f -r b8b7dae46d07 sys/arch/x68k/x68k/mem.c
--- a/sys/arch/x68k/x68k/mem.c Wed Feb 21 12:16:07 2001 +0000
+++ b/sys/arch/x68k/x68k/mem.c Wed Feb 21 12:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.c,v 1.23 2001/02/21 05:53:35 minoura Exp $ */
+/* $NetBSD: mem.c,v 1.24 2001/02/21 12:39:17 minoura Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -137,7 +137,7 @@
VM_PROT_WRITE;
pmap_enter(pmap_kernel(), (vaddr_t)vmmap,
trunc_page(v), prot, prot|PMAP_WIRED);
- o = uio->uio_offset & PGOFSET;
+ o = m68k_page_offset(uio->uio_offset);
c = min(uio->uio_resid, (int)(NBPG - o));
error = uiomove((caddr_t)vmmap + o, c, uio);
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
diff -r d3b59651787f -r b8b7dae46d07 sys/arch/x68k/x68k/sys_machdep.c
--- a/sys/arch/x68k/x68k/sys_machdep.c Wed Feb 21 12:16:07 2001 +0000
+++ b/sys/arch/x68k/x68k/sys_machdep.c Wed Feb 21 12:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_machdep.c,v 1.22 2000/12/13 18:13:11 jdolecek Exp $ */
+/* $NetBSD: sys_machdep.c,v 1.23 2001/02/21 12:39:17 minoura Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -113,7 +113,7 @@
addr = addr & ~0xF;
inc = 16;
} else {
- addr = addr & ~PGOFSET;
+ addr = m68k_trunc_page(addr);
inc = NBPG;
}
}
@@ -124,7 +124,7 @@
* entire cache (XXX is this a rational thing to do?)
*/
if (!doall &&
- (pa == 0 || ((int)addr & PGOFSET) == 0)) {
+ (pa == 0 || m68k_page_offset(addr) == 0)) {
if (pmap_extract(p->p_vmspace->vm_map.pmap,
addr, &pa) == FALSE)
doall = 1;
@@ -217,14 +217,14 @@
addr = (caddr_t)((int)addr & ~0xF);
inc = 16;
} else {
- addr = (caddr_t)((int)addr & ~PGOFSET);
+ addr = (caddr_t) m68k_trunc_page(addr);
inc = NBPG;
}
do {
/*
* Convert to physical address.
*/
- if (pa == 0 || ((int)addr & PGOFSET) == 0) {
+ if (pa == 0 || m68k_page_offset(addr) == 0) {
pa = kvtop(addr);
}
if (inc == 16) {
diff -r d3b59651787f -r b8b7dae46d07 sys/arch/x68k/x68k/trap.c
--- a/sys/arch/x68k/x68k/trap.c Wed Feb 21 12:16:07 2001 +0000
+++ b/sys/arch/x68k/x68k/trap.c Wed Feb 21 12:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.49 2001/02/20 15:55:08 minoura Exp $ */
+/* $NetBSD: trap.c,v 1.50 2001/02/21 12:39:17 minoura Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -793,7 +793,7 @@
pmap_enter(pmap_kernel(), (vaddr_t)vmmap,
trunc_page(f->f_fa), VM_PROT_WRITE,
VM_PROT_WRITE|PMAP_WIRED);
- fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0xF];
+ fa = (u_int)&vmmap[m68k_page_offset(f->f_fa) & ~0xF];
bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
(void) pmap_extract(pmap_kernel(), (paddr_t)fa, &pa);
DCFL(pa);
diff -r d3b59651787f -r b8b7dae46d07 sys/arch/x68k/x68k/vm_machdep.c
--- a/sys/arch/x68k/x68k/vm_machdep.c Wed Feb 21 12:16:07 2001 +0000
+++ b/sys/arch/x68k/x68k/vm_machdep.c Wed Feb 21 12:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.33 2001/02/20 15:54:29 minoura Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.34 2001/02/21 12:39:17 minoura Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -212,7 +212,7 @@
boolean_t rv;
#ifdef DEBUG
- if (size & PGOFSET)
+ if (m68k_page_offset(size))
panic("pagemove");
#endif
while (size > 0) {
Home |
Main Index |
Thread Index |
Old Index