summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-05-03 21:01:54 +0000
committerphk <phk@FreeBSD.org>1996-05-03 21:01:54 +0000
commit5d01dc3d502f27448cc5a6c62c8f103d25ac3df0 (patch)
tree6e409b4bdf1f55b895a65877ef5486cfc5442060 /sys/amd64
parent6ed0fd2b8bab9bd3b84ab82f273df31ce328c87d (diff)
downloadFreeBSD-src-5d01dc3d502f27448cc5a6c62c8f103d25ac3df0.zip
FreeBSD-src-5d01dc3d502f27448cc5a6c62c8f103d25ac3df0.tar.gz
Another sweep over the pmap/vm macros, this time with more focus on
the usage. I'm not satisfied with the naming, but now at least there is less bogus stuff around.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/db_interface.c6
-rw-r--r--sys/amd64/amd64/machdep.c4
-rw-r--r--sys/amd64/amd64/pmap.c13
-rw-r--r--sys/amd64/amd64/support.S4
-rw-r--r--sys/amd64/amd64/support.s4
5 files changed, 15 insertions, 16 deletions
diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c
index 2f36221..db7e060 100644
--- a/sys/amd64/amd64/db_interface.c
+++ b/sys/amd64/amd64/db_interface.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_interface.c,v 1.17 1995/12/10 13:36:25 phk Exp $
+ * $Id: db_interface.c,v 1.18 1996/04/07 18:34:59 bde Exp $
*/
/*
@@ -225,8 +225,8 @@ db_write_bytes(addr, size, data)
oldmap0 = *ptep0;
*(int *)ptep0 |= /* INTEL_PTE_WRITE */ PG_RW;
- addr1 = i386_trunc_page(addr + size - 1);
- if (i386_trunc_page(addr) != addr1) {
+ addr1 = trunc_page(addr + size - 1);
+ if (trunc_page(addr) != addr1) {
/* data crosses a page boundary */
ptep1 = pmap_pte(kernel_pmap, addr1);
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index bb2698f..86bd0bb 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.187 1996/05/02 14:19:47 phk Exp $
+ * $Id: machdep.c,v 1.188 1996/05/02 22:24:57 phk Exp $
*/
#include "npx.h"
@@ -341,7 +341,7 @@ again:
bouncepages = 64;
bouncepages += ((Maxmem - 4096) / 2048) * 32;
}
- v = (caddr_t)((vm_offset_t)((vm_offset_t)v + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1));
+ v = (caddr_t)((vm_offset_t)round_page(v));
valloc(bouncememory, char, bouncepages * PAGE_SIZE);
}
#endif
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index a7d6f6b..04408ac 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.87 1996/05/02 14:19:52 phk Exp $
+ * $Id: pmap.c,v 1.88 1996/05/02 22:24:58 phk Exp $
*/
/*
@@ -630,14 +630,14 @@ pmap_growkernel(vm_offset_t addr)
kernel_vm_end = KERNBASE;
nkpt = 0;
while (pdir_pde(PTD, kernel_vm_end)) {
- kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+ kernel_vm_end = (kernel_vm_end + NBPDR) & ~(NBPDR-1);
++nkpt;
}
}
- addr = (addr + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+ addr = (addr + NBPDR) & ~(NBPDR - 1);
while (kernel_vm_end < addr) {
if (pdir_pde(PTD, kernel_vm_end)) {
- kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+ kernel_vm_end = (kernel_vm_end + NBPDR) & ~(NBPDR-1);
continue;
}
++nkpt;
@@ -659,7 +659,7 @@ pmap_growkernel(vm_offset_t addr)
}
}
*pmap_pde(kernel_pmap, kernel_vm_end) = pdir_pde(PTD, kernel_vm_end);
- kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+ kernel_vm_end = (kernel_vm_end + NBPDR) & ~(NBPDR-1);
}
splx(s);
}
@@ -839,8 +839,7 @@ init_pv_entries(npg)
* kvm space is fairly cheap, be generous!!! (the system can panic if
* this is too small.)
*/
- npvvapg = ((npg * PVSPERPAGE) * sizeof(struct pv_entry)
- + PAGE_SIZE - 1) / PAGE_SIZE;
+ npvvapg = btoc((npg * PVSPERPAGE) * sizeof(struct pv_entry));
pvva = kmem_alloc_pageable(kernel_map, npvvapg * PAGE_SIZE);
/*
* get the first batch of entries
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S
index 32bfb37..1dbf8ee 100644
--- a/sys/amd64/amd64/support.S
+++ b/sys/amd64/amd64/support.S
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: support.s,v 1.33 1996/04/06 01:06:06 davidg Exp $
+ * $Id: support.s,v 1.34 1996/05/02 14:19:53 phk Exp $
*/
#include "assym.s" /* system definitions */
@@ -414,7 +414,7 @@ ENTRY(copyout) /* copyout(from_kernel, to_user, len) */
*/
/* compute number of pages */
movl %edi,%ecx
- andl $PAGE_SIZE-1,%ecx
+ andl $PAGE_MASK,%ecx
addl %ebx,%ecx
decl %ecx
shrl $IDXSHIFT+2,%ecx
diff --git a/sys/amd64/amd64/support.s b/sys/amd64/amd64/support.s
index 32bfb37..1dbf8ee 100644
--- a/sys/amd64/amd64/support.s
+++ b/sys/amd64/amd64/support.s
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: support.s,v 1.33 1996/04/06 01:06:06 davidg Exp $
+ * $Id: support.s,v 1.34 1996/05/02 14:19:53 phk Exp $
*/
#include "assym.s" /* system definitions */
@@ -414,7 +414,7 @@ ENTRY(copyout) /* copyout(from_kernel, to_user, len) */
*/
/* compute number of pages */
movl %edi,%ecx
- andl $PAGE_SIZE-1,%ecx
+ andl $PAGE_MASK,%ecx
addl %ebx,%ecx
decl %ecx
shrl $IDXSHIFT+2,%ecx
OpenPOWER on IntegriCloud