s/sun3_/_/ in sun3_(round|trunc)_(page|seg) macros
This commit is contained in:
parent
7c7f4379a0
commit
032d13fc7d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pte.h,v 1.13 1997/01/27 19:41:08 gwr Exp $ */
|
||||
/* $NetBSD: pte.h,v 1.14 1997/03/13 15:58:49 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -88,15 +88,16 @@
|
||||
|
||||
/*
|
||||
* Mach derived conversion macros
|
||||
* Used only in sys/arch/_MACHINE
|
||||
*/
|
||||
#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 _round_seg(x) ((((unsigned)(x)) + SEGOFSET) & ~SEGOFSET)
|
||||
#define _trunc_seg(x) ((unsigned)(x) & ~SEGOFSET)
|
||||
#define _btos(x) ((unsigned)(x) >> SEGSHIFT)
|
||||
#define _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)
|
||||
#define _round_page(x) ((((unsigned)(x)) + PGOFSET) & ~PGOFSET)
|
||||
#define _trunc_page(x) ((unsigned)(x) & ~PGOFSET)
|
||||
#define _btop(x) ((unsigned)(x) >> PGSHIFT)
|
||||
#define _ptob(x) ((unsigned)(x) << PGSHIFT)
|
||||
|
||||
#endif /* !_MACHINE_PTE_H*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pte3.h,v 1.13 1997/01/27 19:41:08 gwr Exp $ */
|
||||
/* $NetBSD: pte3.h,v 1.14 1997/03/13 15:58:49 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -88,15 +88,16 @@
|
||||
|
||||
/*
|
||||
* Mach derived conversion macros
|
||||
* Used only in sys/arch/_MACHINE
|
||||
*/
|
||||
#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 _round_seg(x) ((((unsigned)(x)) + SEGOFSET) & ~SEGOFSET)
|
||||
#define _trunc_seg(x) ((unsigned)(x) & ~SEGOFSET)
|
||||
#define _btos(x) ((unsigned)(x) >> SEGSHIFT)
|
||||
#define _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)
|
||||
#define _round_page(x) ((((unsigned)(x)) + PGOFSET) & ~PGOFSET)
|
||||
#define _trunc_page(x) ((unsigned)(x) & ~PGOFSET)
|
||||
#define _btop(x) ((unsigned)(x) >> PGSHIFT)
|
||||
#define _ptob(x) ((unsigned)(x) << PGSHIFT)
|
||||
|
||||
#endif /* !_MACHINE_PTE_H*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dvma.c,v 1.7 1997/02/05 17:33:46 gwr Exp $ */
|
||||
/* $NetBSD: dvma.c,v 1.8 1997/03/13 15:58:51 gwr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Gordon W. Ross
|
||||
@ -106,7 +106,7 @@ dvma_mapout(char *addr, int len)
|
||||
char *
|
||||
dvma_alloc(int len)
|
||||
{
|
||||
len = sun3_round_page(len);
|
||||
len = _round_page(len);
|
||||
dvma_end -= len;
|
||||
return((char*)dvma_end);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: promdev.c,v 1.7 1996/01/29 23:41:10 gwr Exp $ */
|
||||
/* $NetBSD: promdev.c,v 1.8 1997/03/13 15:58:51 gwr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Gordon W. Ross
|
||||
@ -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 = _round_page(addr);
|
||||
si->si_dmaaddr = (char*) addr;
|
||||
#ifdef DEBUG_PROM
|
||||
if (debug)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_memrw.c,v 1.16 1997/01/27 20:43:53 gwr Exp $ */
|
||||
/* $NetBSD: db_memrw.c,v 1.17 1997/03/13 15:58:52 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -117,7 +117,7 @@ db_write_text(dst, size, data)
|
||||
if (size <= 0)
|
||||
return;
|
||||
|
||||
pgva = sun3_trunc_page((long)dst);
|
||||
pgva = _trunc_page((long)dst);
|
||||
|
||||
goto firstpage;
|
||||
do {
|
||||
@ -127,7 +127,7 @@ db_write_text(dst, size, data)
|
||||
* for the previous page, and make the new
|
||||
* page writable.
|
||||
*/
|
||||
pgva = sun3_trunc_page((long)dst);
|
||||
pgva = _trunc_page((long)dst);
|
||||
if (pgva != prevpg) {
|
||||
/*
|
||||
* Restore old PTE. No cache flush,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dvma.c,v 1.8 1997/01/27 20:43:54 gwr Exp $ */
|
||||
/* $NetBSD: dvma.c,v 1.9 1997/03/13 15:58:53 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -115,7 +115,7 @@ caddr_t dvma_malloc(bytes)
|
||||
|
||||
if (!bytes)
|
||||
return NULL;
|
||||
new_size = sun3_round_page(bytes);
|
||||
new_size = _round_page(bytes);
|
||||
new_mem = (caddr_t) kmem_alloc(phys_map, new_size);
|
||||
if (!new_mem)
|
||||
panic("dvma_malloc: no space in phys_map");
|
||||
@ -130,7 +130,7 @@ void dvma_free(addr, size)
|
||||
caddr_t addr;
|
||||
size_t size;
|
||||
{
|
||||
vm_size_t sz = sun3_round_page(size);
|
||||
vm_size_t sz = _round_page(size);
|
||||
|
||||
kmem_free(phys_map, (vm_offset_t)addr, sz);
|
||||
}
|
||||
@ -185,7 +185,7 @@ caddr_t dvma_mapin(char *kva, int len)
|
||||
seg_kva -= seg_off;
|
||||
seg_len += seg_off;
|
||||
/* seg-align length */
|
||||
seg_len = sun3_round_seg(seg_len);
|
||||
seg_len = _round_seg(seg_len);
|
||||
|
||||
s = splimp();
|
||||
|
||||
@ -244,7 +244,7 @@ void dvma_mapout(char *dma, int len)
|
||||
seg_dma -= seg_off;
|
||||
seg_len += seg_off;
|
||||
/* seg-align length */
|
||||
seg_len = sun3_round_seg(seg_len);
|
||||
seg_len = _round_seg(seg_len);
|
||||
|
||||
s = splimp();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: locore2.c,v 1.63 1997/02/18 15:30:01 gwr Exp $ */
|
||||
/* $NetBSD: locore2.c,v 1.64 1997/03/13 15:58:56 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -318,7 +318,7 @@ _vm_init(kehp)
|
||||
/* This will advance esym past the symbols. */
|
||||
_save_symtab(kehp);
|
||||
#endif
|
||||
virtual_avail = sun3_round_page(esym);
|
||||
virtual_avail = _round_page(esym);
|
||||
virtual_end = VM_MAX_KERNEL_ADDRESS;
|
||||
|
||||
/*
|
||||
@ -335,7 +335,7 @@ _vm_init(kehp)
|
||||
/* PROM version 1 or later. */
|
||||
avail_end = *rvec->memoryAvail;
|
||||
}
|
||||
avail_end = sun3_trunc_page(avail_end);
|
||||
avail_end = _trunc_page(avail_end);
|
||||
|
||||
/*
|
||||
* Steal some special-purpose, already mapped pages.
|
||||
@ -396,7 +396,7 @@ _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 = _round_seg(virtual_avail);
|
||||
while (va < virtual_avail) {
|
||||
set_pte(va, PG_INVAL);
|
||||
va += NBPG;
|
||||
@ -439,8 +439,8 @@ _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 = _trunc_seg(DVMA_SPACE_START);
|
||||
eva = _trunc_seg(DVMA_SPACE_END); /* Yes trunc! */
|
||||
while (va < eva) {
|
||||
set_segmap(va, SEGINV);
|
||||
va += NBSG;
|
||||
@ -510,7 +510,7 @@ _vm_init(kehp)
|
||||
|
||||
/* text */
|
||||
va = (vm_offset_t) kernel_text;
|
||||
eva = sun3_trunc_page(etext);
|
||||
eva = _trunc_page(etext);
|
||||
while (va < eva) {
|
||||
pte = get_pte(va);
|
||||
if ((pte & (PG_VALID|PG_TYPE)) != PG_VALID) {
|
||||
@ -524,7 +524,7 @@ _vm_init(kehp)
|
||||
}
|
||||
|
||||
/* data and bss */
|
||||
eva = sun3_round_page(end);
|
||||
eva = _round_page(end);
|
||||
while (va < eva) {
|
||||
pte = get_pte(va);
|
||||
if ((pte & (PG_VALID|PG_TYPE)) != PG_VALID) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.70 1997/02/28 19:55:37 gwr Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.71 1997/03/13 15:58:55 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -525,7 +525,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, _trunc_seg(va), sme);
|
||||
#endif
|
||||
/* Did cache flush above (whole context). */
|
||||
set_segmap(va, SEGINV);
|
||||
@ -1550,7 +1550,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 += _round_page(hole_size);
|
||||
|
||||
/* Any available memory remaining? */
|
||||
if (avail_next >= avail_end)
|
||||
@ -1795,7 +1795,7 @@ pmap_remove_range_mmu(pmap, sva, eva)
|
||||
}
|
||||
#endif
|
||||
|
||||
va = sun3_trunc_seg(sva);
|
||||
va = _trunc_seg(sva);
|
||||
sme = get_segmap(va);
|
||||
#ifdef DIAGNOSTIC
|
||||
/* Make sure it is valid and known. */
|
||||
@ -1885,7 +1885,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(), _trunc_seg(sva),
|
||||
pmegp->pmeg_index);
|
||||
}
|
||||
#endif
|
||||
@ -1970,7 +1970,7 @@ pmap_remove_range(pmap, sva, eva)
|
||||
PMAP_LOCK();
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (sun3_trunc_seg(sva) != sun3_trunc_seg(eva-NBPG))
|
||||
if (_trunc_seg(sva) != _trunc_seg(eva-NBPG))
|
||||
panic("pmap_remove_range: bad range!");
|
||||
#endif
|
||||
|
||||
@ -2054,7 +2054,7 @@ pmap_remove(pmap, sva, eva)
|
||||
|
||||
va = sva;
|
||||
while (va < eva) {
|
||||
neva = sun3_trunc_seg(va) + NBSG;
|
||||
neva = _trunc_seg(va) + NBSG;
|
||||
if (neva > eva)
|
||||
neva = eva;
|
||||
pmap_remove_range(pmap, va, neva);
|
||||
@ -2115,14 +2115,14 @@ pmap_enter_kernel(va, pa, prot, wired, new_pte)
|
||||
new_pte |= PG_NC;
|
||||
}
|
||||
|
||||
seg_va = sun3_trunc_seg(va);
|
||||
seg_va = _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, _trunc_seg(va));
|
||||
sme = pmegp->pmeg_index;
|
||||
set_segmap_allctx(va, sme);
|
||||
#ifdef PMAP_DEBUG
|
||||
@ -2130,7 +2130,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(_trunc_seg(va));
|
||||
#endif
|
||||
/* There are no existing mappings to deal with. */
|
||||
old_pte = 0;
|
||||
@ -2255,7 +2255,7 @@ pmap_enter_user(pmap, va, pa, prot, wired, new_pte)
|
||||
#endif
|
||||
|
||||
segnum = VA_SEGNUM(va);
|
||||
seg_va = sun3_trunc_seg(va);
|
||||
seg_va = _trunc_seg(va);
|
||||
do_pv = TRUE;
|
||||
|
||||
PMAP_LOCK();
|
||||
@ -2552,7 +2552,7 @@ int pmap_fault_reload(pmap, va, ftype)
|
||||
}
|
||||
if (va >= VM_MAXUSER_ADDRESS)
|
||||
return (0);
|
||||
seg_va = sun3_trunc_seg(va);
|
||||
seg_va = _trunc_seg(va);
|
||||
|
||||
/* Make sure context is correct. */
|
||||
ctx = get_context();
|
||||
@ -2901,7 +2901,7 @@ pmap_protect_range_mmu(pmap, sva, eva)
|
||||
}
|
||||
#endif
|
||||
|
||||
va = sun3_trunc_seg(sva);
|
||||
va = _trunc_seg(sva);
|
||||
sme = get_segmap(va);
|
||||
#ifdef DIAGNOSTIC
|
||||
/* Make sure it is valid and known. */
|
||||
@ -3030,7 +3030,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 (_trunc_seg(sva) != _trunc_seg(eva-NBPG))
|
||||
panic("pmap_protect_range: bad range!");
|
||||
#endif
|
||||
|
||||
@ -3123,7 +3123,7 @@ pmap_protect(pmap, sva, eva, prot)
|
||||
|
||||
va = sva;
|
||||
while (va < eva) {
|
||||
neva = sun3_trunc_seg(va) + NBSG;
|
||||
neva = _trunc_seg(va) + NBSG;
|
||||
if (neva > eva)
|
||||
neva = eva;
|
||||
pmap_protect_range(pmap, va, neva);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sun3_startup.c,v 1.63 1997/02/18 15:30:01 gwr Exp $ */
|
||||
/* $NetBSD: sun3_startup.c,v 1.64 1997/03/13 15:58:56 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -318,7 +318,7 @@ _vm_init(kehp)
|
||||
/* This will advance esym past the symbols. */
|
||||
_save_symtab(kehp);
|
||||
#endif
|
||||
virtual_avail = sun3_round_page(esym);
|
||||
virtual_avail = _round_page(esym);
|
||||
virtual_end = VM_MAX_KERNEL_ADDRESS;
|
||||
|
||||
/*
|
||||
@ -335,7 +335,7 @@ _vm_init(kehp)
|
||||
/* PROM version 1 or later. */
|
||||
avail_end = *rvec->memoryAvail;
|
||||
}
|
||||
avail_end = sun3_trunc_page(avail_end);
|
||||
avail_end = _trunc_page(avail_end);
|
||||
|
||||
/*
|
||||
* Steal some special-purpose, already mapped pages.
|
||||
@ -396,7 +396,7 @@ _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 = _round_seg(virtual_avail);
|
||||
while (va < virtual_avail) {
|
||||
set_pte(va, PG_INVAL);
|
||||
va += NBPG;
|
||||
@ -439,8 +439,8 @@ _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 = _trunc_seg(DVMA_SPACE_START);
|
||||
eva = _trunc_seg(DVMA_SPACE_END); /* Yes trunc! */
|
||||
while (va < eva) {
|
||||
set_segmap(va, SEGINV);
|
||||
va += NBSG;
|
||||
@ -510,7 +510,7 @@ _vm_init(kehp)
|
||||
|
||||
/* text */
|
||||
va = (vm_offset_t) kernel_text;
|
||||
eva = sun3_trunc_page(etext);
|
||||
eva = _trunc_page(etext);
|
||||
while (va < eva) {
|
||||
pte = get_pte(va);
|
||||
if ((pte & (PG_VALID|PG_TYPE)) != PG_VALID) {
|
||||
@ -524,7 +524,7 @@ _vm_init(kehp)
|
||||
}
|
||||
|
||||
/* data and bss */
|
||||
eva = sun3_round_page(end);
|
||||
eva = _round_page(end);
|
||||
while (va < eva) {
|
||||
pte = get_pte(va);
|
||||
if ((pte & (PG_VALID|PG_TYPE)) != PG_VALID) {
|
||||
|
Loading…
Reference in New Issue
Block a user