-/* $OpenBSD: pmap.h,v 1.29 2007/12/15 17:24:07 deraadt Exp $ */
+/* $OpenBSD: pmap.h,v 1.30 2008/08/30 20:45:31 martin Exp $ */
/* $NetBSD: pmap.h,v 1.37 1999/08/01 13:48:07 ragge Exp $ */
/*
struct pmap *pv_pmap; /* pmap this entry belongs to */
};
-/* ROUND_PAGE used before vm system is initialized */
-#define ROUND_PAGE(x) (((uint)(x) + PGOFSET) & ~PGOFSET)
-#define TRUNC_PAGE(x) ((uint)(x) & ~PGOFSET)
-
/* Mapping macros used when allocating SPT */
#define MAPVIRT(ptr, count) \
(vaddr_t)ptr = virtual_avail; \
-/* $OpenBSD: locore.c,v 1.34 2008/08/18 23:19:29 miod Exp $ */
+/* $OpenBSD: locore.c,v 1.35 2008/08/30 20:45:31 martin Exp $ */
/* $NetBSD: locore.c,v 1.43 2000/03/26 11:39:45 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
}
}
- avail_end = TRUNC_PAGE(avail_end); /* be sure */
+ avail_end = trunc_page(avail_end); /* be sure */
proc0.p_addr = (struct user *)proc0paddr; /* XXX */
bzero((struct user *)proc0paddr, sizeof(struct user));
-/* $OpenBSD: pmap.c,v 1.48 2008/08/30 18:58:24 martin Exp $ */
+/* $OpenBSD: pmap.c,v 1.49 2008/08/30 20:45:31 martin Exp $ */
/* $NetBSD: pmap.c,v 1.74 1999/11/13 21:32:25 matt Exp $ */
/*
* Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden.
mtpr((unsigned)Sysmap - KERNBASE, PR_SBR);
/* Map Interrupt stack and set red zone */
- istack = (vaddr_t)Sysmap + ROUND_PAGE(sysptsize * 4);
+ istack = (vaddr_t)Sysmap + round_page(sysptsize * 4);
mtpr(istack + ISTACK_SIZE, PR_ISP);
*kvtopte(istack) &= ~PG_V;
if (dep_call->cpu_init)
(*dep_call->cpu_init)();
- avail_start = ROUND_PAGE(avail_start);
- virtual_avail = ROUND_PAGE(virtual_avail);
- virtual_end = TRUNC_PAGE(virtual_end);
+ avail_start = round_page(avail_start);
+ virtual_avail = round_page(virtual_avail);
+ virtual_end = trunc_page(virtual_end);
#if 0 /* Breaks cninit() on some machines */
pte = (pt_entry_t *)mfpr(PR_P0BR);
pte += PG_PFNUM(addr);
if (bits & 2) { /* PTE reference */
- pte = (pt_entry_t *)TRUNC_PAGE(pte);
+ pte = (pt_entry_t *)trunc_page((vaddr_t)pte);
pte = kvtopte(pte);
if (pte[0] == 0) /* Check for CVAX bug */
return 1;
-/* $OpenBSD: vsbus.c,v 1.19 2008/08/15 22:40:07 miod Exp $ */
+/* $OpenBSD: vsbus.c,v 1.20 2008/08/30 20:45:31 martin Exp $ */
/* $NetBSD: vsbus.c,v 1.29 2000/06/29 07:14:37 mrg Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
bcopy(from, to, len);
return;
}
- pte = uvtopte(TRUNC_PAGE(to), (&p->p_addr->u_pcb));
+ pte = uvtopte(trunc_page((vaddr_t)to), (&p->p_addr->u_pcb));
if ((vaddr_t)to & PGOFSET) {
- int cz = ROUND_PAGE(to) - (vaddr_t)to;
+ int cz = round_page((vaddr_t)to) - (vaddr_t)to;
pa = ((*pte & PG_FRAME) << VAX_PGSHIFT) |
(NBPG - cz) | KERNBASE;
bcopy(from, to, len);
return;
}
- pte = uvtopte(TRUNC_PAGE(from), (&p->p_addr->u_pcb));
+ pte = uvtopte(trunc_page((vaddr_t)from), (&p->p_addr->u_pcb));
if ((vaddr_t)from & PGOFSET) {
- int cz = ROUND_PAGE(from) - (vaddr_t)from;
+ int cz = round_page((vaddr_t)from) - (vaddr_t)from;
pa = ((*pte & PG_FRAME) << VAX_PGSHIFT) |
(NBPG - cz) | KERNBASE;