summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-09-07 14:05:22 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-09-07 14:05:22 +0000
commit18bd159a580a44b19af5d98064b823eaeab285d7 (patch)
treebe28b92f9eba618327f77417e37358a2c85ff846 /sys/arch
parent925d364360069859bf8d2b8eca85530aac12b5fa (diff)
switch from private Mach derived conversion macros to m68k ones
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sun3/include/param.h15
-rw-r--r--sys/arch/sun3/stand/libsa/dvma.c2
-rw-r--r--sys/arch/sun3/stand/libsa/promdev.c2
-rw-r--r--sys/arch/sun3/sun3/autoconf.c4
-rw-r--r--sys/arch/sun3/sun3/db_memrw.c6
-rw-r--r--sys/arch/sun3/sun3/dvma.c10
-rw-r--r--sys/arch/sun3/sun3/pmap.c30
-rw-r--r--sys/arch/sun3/sun3/sun3_startup.c16
8 files changed, 36 insertions, 49 deletions
diff --git a/sys/arch/sun3/include/param.h b/sys/arch/sun3/include/param.h
index b9884ddb106..a6bca6b8ca7 100644
--- a/sys/arch/sun3/include/param.h
+++ b/sys/arch/sun3/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.13 1997/02/14 23:50:18 kstailey Exp $ */
+/* $OpenBSD: param.h,v 1.14 1997/09/07 14:05:17 kstailey Exp $ */
/* $NetBSD: param.h,v 1.34 1996/03/04 05:04:40 cgd Exp $ */
/*
@@ -137,19 +137,6 @@
#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
/*
- * Mach derived conversion macros
- */
-#define sun3_round_seg(x) ((((unsigned)(x)) + SEGOFSET) & ~SEGOFSET)
-#define sun3_trunc_seg(x) ((unsigned)(x) & ~SEGOFSET)
-#define sun3_btos(x) ((unsigned)(x) >> SEGSHIFT)
-#define sun3_stob(x) ((unsigned)(x) << SEGSHIFT)
-
-#define sun3_round_page(x) ((((unsigned)(x)) + PGOFSET) & ~PGOFSET)
-#define sun3_trunc_page(x) ((unsigned)(x) & ~PGOFSET)
-#define sun3_btop(x) ((unsigned)(x) >> PGSHIFT)
-#define sun3_ptob(x) ((unsigned)(x) << PGSHIFT)
-
-/*
* spl functions; all are done in-line
*/
diff --git a/sys/arch/sun3/stand/libsa/dvma.c b/sys/arch/sun3/stand/libsa/dvma.c
index deb039edabc..cf9f2b625b3 100644
--- a/sys/arch/sun3/stand/libsa/dvma.c
+++ b/sys/arch/sun3/stand/libsa/dvma.c
@@ -108,7 +108,7 @@ dvma_mapout(char *addr, int len)
char *
dvma_alloc(int len)
{
- len = sun3_round_page(len);
+ len = m68k_round_page(len);
dvma_end -= len;
return((char*)dvma_end);
}
diff --git a/sys/arch/sun3/stand/libsa/promdev.c b/sys/arch/sun3/stand/libsa/promdev.c
index 35fe364c1c5..5ce7ee01fb9 100644
--- a/sys/arch/sun3/stand/libsa/promdev.c
+++ b/sys/arch/sun3/stand/libsa/promdev.c
@@ -105,7 +105,7 @@ prom_iopen(si)
/* try page-aligned address... */
size = dip->d_dmabytes + NBPG;
addr = (int) dvma_alloc(size);
- addr = sun3_round_page(addr);
+ addr = m68k_round_page(addr);
si->si_dmaaddr = (char*) addr;
#ifdef DEBUG_PROM
if (debug)
diff --git a/sys/arch/sun3/sun3/autoconf.c b/sys/arch/sun3/sun3/autoconf.c
index d65d17684c7..7f30bb1a435 100644
--- a/sys/arch/sun3/sun3/autoconf.c
+++ b/sys/arch/sun3/sun3/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.6 1997/01/16 04:04:11 kstailey Exp $ */
+/* $OpenBSD: autoconf.c,v 1.7 1997/09/07 14:05:19 kstailey Exp $ */
/* $NetBSD: autoconf.c,v 1.37 1996/11/20 18:57:22 gwr Exp $ */
/*-
@@ -270,7 +270,7 @@ bus_mapin(bustype, paddr, sz)
off = paddr & PGOFSET;
pa = paddr - off;
sz += off;
- sz = sun3_round_page(sz);
+ sz = m68k_round_page(sz);
pmt = bustype_to_pmaptype[bustype];
pmt |= PMAP_NC; /* non-cached */
diff --git a/sys/arch/sun3/sun3/db_memrw.c b/sys/arch/sun3/sun3/db_memrw.c
index 2213dd4bfab..6c6c1b52db7 100644
--- a/sys/arch/sun3/sun3/db_memrw.c
+++ b/sys/arch/sun3/sun3/db_memrw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_memrw.c,v 1.6 1997/01/16 04:04:17 kstailey Exp $ */
+/* $OpenBSD: db_memrw.c,v 1.7 1997/09/07 14:05:20 kstailey Exp $ */
/* $NetBSD: db_memrw.c,v 1.13 1996/11/20 18:57:28 gwr Exp $ */
/*-
@@ -117,7 +117,7 @@ db_write_text(addr, size, data)
return;
dst = (char*)addr;
- pgva = sun3_trunc_page((long)dst);
+ pgva = m68k_trunc_page((long)dst);
goto firstpage;
do {
@@ -127,7 +127,7 @@ db_write_text(addr, size, data)
* for the previous page, and make the new
* page writable.
*/
- pgva = sun3_trunc_page((long)dst);
+ pgva = m68k_trunc_page((long)dst);
if (pgva != prevpg) {
/*
* Restore old PTE. No cache flush,
diff --git a/sys/arch/sun3/sun3/dvma.c b/sys/arch/sun3/sun3/dvma.c
index 7c35db8b28e..8f7f8301e83 100644
--- a/sys/arch/sun3/sun3/dvma.c
+++ b/sys/arch/sun3/sun3/dvma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvma.c,v 1.6 1997/01/16 04:04:19 kstailey Exp $ */
+/* $OpenBSD: dvma.c,v 1.7 1997/09/07 14:05:20 kstailey Exp $ */
/* $NetBSD: dvma.c,v 1.5 1996/11/20 18:57:29 gwr Exp $ */
/*-
@@ -118,7 +118,7 @@ dvma_malloc(bytes)
if (!bytes)
return NULL;
- new_size = sun3_round_page(bytes);
+ new_size = m68k_round_page(bytes);
new_mem = (caddr_t) kmem_alloc(phys_map, new_size);
if (!new_mem)
panic("dvma_malloc: no space in phys_map");
@@ -134,7 +134,7 @@ dvma_free(addr, size)
caddr_t addr;
size_t size;
{
- vm_size_t sz = sun3_round_page(size);
+ vm_size_t sz = m68k_round_page(size);
kmem_free(phys_map, (vm_offset_t)addr, sz);
}
@@ -193,7 +193,7 @@ dvma_mapin(kva, len)
seg_kva -= seg_off;
seg_len += seg_off;
/* seg-align length */
- seg_len = sun3_round_seg(seg_len);
+ seg_len = m68k_round_seg(seg_len);
s = splimp();
@@ -255,7 +255,7 @@ dvma_mapout(dma, len)
seg_dma -= seg_off;
seg_len += seg_off;
/* seg-align length */
- seg_len = sun3_round_seg(seg_len);
+ seg_len = m68k_round_seg(seg_len);
s = splimp();
diff --git a/sys/arch/sun3/sun3/pmap.c b/sys/arch/sun3/sun3/pmap.c
index fc5d42a9fa7..e6d75679033 100644
--- a/sys/arch/sun3/sun3/pmap.c
+++ b/sys/arch/sun3/sun3/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.13 1997/02/19 00:03:36 kstailey Exp $ */
+/* $OpenBSD: pmap.c,v 1.14 1997/09/07 14:05:21 kstailey Exp $ */
/* $NetBSD: pmap.c,v 1.64 1996/11/20 18:57:35 gwr Exp $ */
/*-
@@ -536,7 +536,7 @@ context_free(pmap) /* :) */
panic("context_free: unknown sme at va=0x%x", va);
if (pmap_debug & PMD_SEGMAP)
printf("pmap: set_segmap ctx=%d v=%x old=%x new=ff (cf)\n",
- ctxnum, sun3_trunc_seg(va), sme);
+ ctxnum, m68k_trunc_seg(va), sme);
#endif
/* Did cache flush above (whole context). */
set_segmap(va, SEGINV);
@@ -1551,7 +1551,7 @@ pmap_next_page(paddr)
{
/* Is it time to skip over the hole? */
if (avail_next == hole_start)
- avail_next += sun3_round_page(hole_size);
+ avail_next += m68k_round_page(hole_size);
/* Any available memory remaining? */
if (avail_next >= avail_end)
@@ -1800,7 +1800,7 @@ pmap_remove_range_mmu(pmap, sva, eva)
}
#endif
- va = sun3_trunc_seg(sva);
+ va = m68k_trunc_seg(sva);
sme = get_segmap(va);
#ifdef DIAGNOSTIC
/* Make sure it is valid and known. */
@@ -1890,7 +1890,7 @@ pmap_remove_range_mmu(pmap, sva, eva)
#ifdef PMAP_DEBUG
if (pmap_debug & PMD_SEGMAP) {
printf("pmap: set_segmap ctx=%d v=%x old=%x new=ff (rm2)\n",
- get_context(), sun3_trunc_seg(sva),
+ get_context(), m68k_trunc_seg(sva),
pmegp->pmeg_index);
}
#endif
@@ -1975,7 +1975,7 @@ pmap_remove_range(pmap, sva, eva)
PMAP_LOCK();
#ifdef DIAGNOSTIC
- if (sun3_trunc_seg(sva) != sun3_trunc_seg(eva-NBPG))
+ if (m68k_trunc_seg(sva) != m68k_trunc_seg(eva-NBPG))
panic("pmap_remove_range: bad range!");
#endif
@@ -2059,7 +2059,7 @@ pmap_remove(pmap, sva, eva)
va = sva;
while (va < eva) {
- neva = sun3_trunc_seg(va) + NBSG;
+ neva = m68k_trunc_seg(va) + NBSG;
if (neva > eva)
neva = eva;
pmap_remove_range(pmap, va, neva);
@@ -2120,14 +2120,14 @@ pmap_enter_kernel(va, pa, prot, wired, new_pte)
new_pte |= PG_NC;
}
- seg_va = sun3_trunc_seg(va);
+ seg_va = m68k_trunc_seg(va);
do_pv = TRUE;
PMAP_LOCK();
sme = get_segmap(va);
if (sme == SEGINV) {
- pmegp = pmeg_allocate(kernel_pmap, sun3_trunc_seg(va));
+ pmegp = pmeg_allocate(kernel_pmap, m68k_trunc_seg(va));
sme = pmegp->pmeg_index;
set_segmap_allctx(va, sme);
#ifdef PMAP_DEBUG
@@ -2135,7 +2135,7 @@ pmap_enter_kernel(va, pa, prot, wired, new_pte)
printf("pmap: set_segmap pmap=%p va=%x sme=%x (ek1)\n",
kernel_pmap, seg_va, sme);
}
- pmeg_verify_empty(sun3_trunc_seg(va));
+ pmeg_verify_empty(m68k_trunc_seg(va));
#endif
/* There are no existing mappings to deal with. */
old_pte = 0;
@@ -2260,7 +2260,7 @@ pmap_enter_user(pmap, va, pa, prot, wired, new_pte)
#endif
segnum = VA_SEGNUM(va);
- seg_va = sun3_trunc_seg(va);
+ seg_va = m68k_trunc_seg(va);
do_pv = TRUE;
PMAP_LOCK();
@@ -2513,7 +2513,7 @@ int pmap_fault_reload(pmap, va, ftype)
}
if (va >= VM_MAXUSER_ADDRESS)
return (0);
- seg_va = sun3_trunc_seg(va);
+ seg_va = m68k_trunc_seg(va);
/* Make sure context is correct. */
ctx = get_context();
@@ -2862,7 +2862,7 @@ pmap_protect_range_mmu(pmap, sva, eva)
}
#endif
- va = sun3_trunc_seg(sva);
+ va = m68k_trunc_seg(sva);
sme = get_segmap(va);
#ifdef DIAGNOSTIC
/* Make sure it is valid and known. */
@@ -2991,7 +2991,7 @@ pmap_protect_range(pmap, sva, eva)
printf("pmap_protect_range(%p, %x, %x)\n", pmap, sva, eva);
#endif
#ifdef DIAGNOSTIC
- if (sun3_trunc_seg(sva) != sun3_trunc_seg(eva-NBPG))
+ if (m68k_trunc_seg(sva) != m68k_trunc_seg(eva-NBPG))
panic("pmap_protect_range: bad range!");
#endif
@@ -3084,7 +3084,7 @@ pmap_protect(pmap, sva, eva, prot)
va = sva;
while (va < eva) {
- neva = sun3_trunc_seg(va) + NBSG;
+ neva = m68k_trunc_seg(va) + NBSG;
if (neva > eva)
neva = eva;
pmap_protect_range(pmap, va, neva);
diff --git a/sys/arch/sun3/sun3/sun3_startup.c b/sys/arch/sun3/sun3/sun3_startup.c
index 9f9ed0b70b0..90ff80a11e7 100644
--- a/sys/arch/sun3/sun3/sun3_startup.c
+++ b/sys/arch/sun3/sun3/sun3_startup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sun3_startup.c,v 1.9 1997/01/16 08:08:41 kstailey Exp $ */
+/* $OpenBSD: sun3_startup.c,v 1.10 1997/09/07 14:05:21 kstailey Exp $ */
/* $NetBSD: sun3_startup.c,v 1.55 1996/11/20 18:57:38 gwr Exp $ */
/*-
@@ -377,7 +377,7 @@ sun3_vm_init(kehp)
/* This will advance esym past the symbols. */
sun3_save_symtab(kehp);
#endif
- virtual_avail = sun3_round_page(esym);
+ virtual_avail = m68k_round_page(esym);
virtual_end = VM_MAX_KERNEL_ADDRESS;
/*
@@ -394,7 +394,7 @@ sun3_vm_init(kehp)
/* PROM version 1 or later. */
avail_end = *romp->memoryAvail;
}
- avail_end = sun3_trunc_page(avail_end);
+ avail_end = m68k_trunc_page(avail_end);
/*
* Steal some special-purpose, already mapped pages.
@@ -471,7 +471,7 @@ sun3_vm_init(kehp)
* clean out the rest of the last used segment.
* After this point, virtual_avail is seg-aligned.
*/
- virtual_avail = sun3_round_seg(virtual_avail);
+ virtual_avail = m68k_round_seg(virtual_avail);
while (va < virtual_avail) {
set_pte(va, PG_INVAL);
va += NBPG;
@@ -512,8 +512,8 @@ sun3_vm_init(kehp)
* Clear-out pmegs left in DVMA space by the PROM.
* DO NOT kill the last one! (owned by the PROM!)
*/
- va = sun3_trunc_seg(DVMA_SPACE_START);
- eva = sun3_trunc_seg(DVMA_SPACE_END); /* Yes trunc! */
+ va = m68k_trunc_seg(DVMA_SPACE_START);
+ eva = m68k_trunc_seg(DVMA_SPACE_END); /* Yes trunc! */
while (va < eva) {
set_segmap(va, SEGINV);
va += NBSG;
@@ -583,7 +583,7 @@ sun3_vm_init(kehp)
/* text */
va = (vm_offset_t) kernel_text;
- eva = sun3_trunc_page(etext);
+ eva = m68k_trunc_page(etext);
while (va < eva) {
pte = get_pte(va);
if ((pte & (PG_VALID|PG_TYPE)) != PG_VALID) {
@@ -597,7 +597,7 @@ sun3_vm_init(kehp)
}
/* data and bss */
- eva = sun3_round_page(end);
+ eva = m68k_round_page(end);
while (va < eva) {
pte = get_pte(va);
if ((pte & (PG_VALID|PG_TYPE)) != PG_VALID) {