summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/bus_dma.c2
-rw-r--r--sys/arch/amd64/amd64/bus_space.c4
-rw-r--r--sys/arch/amd64/amd64/machdep.c14
-rw-r--r--sys/arch/amd64/amd64/mem.c8
-rw-r--r--sys/arch/amd64/amd64/pmap.c14
-rw-r--r--sys/arch/amd64/include/param.h6
-rw-r--r--sys/arch/amd64/include/pmap.h4
7 files changed, 24 insertions, 28 deletions
diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c
index 890ed861318..45c3b3e309f 100644
--- a/sys/arch/amd64/amd64/bus_dma.c
+++ b/sys/arch/amd64/amd64/bus_dma.c
@@ -535,7 +535,7 @@ _bus_dmamem_mmap(t, segs, nsegs, off, prot, flags)
continue;
}
- return (x86_btop((caddr_t)segs[i].ds_addr + off));
+ return (atop(segs[i].ds_addr + off));
}
/* Page not found. */
diff --git a/sys/arch/amd64/amd64/bus_space.c b/sys/arch/amd64/amd64/bus_space.c
index e0518f9f447..0153e7dcb2c 100644
--- a/sys/arch/amd64/amd64/bus_space.c
+++ b/sys/arch/amd64/amd64/bus_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_space.c,v 1.2 2005/10/21 18:55:00 martin Exp $ */
+/* $OpenBSD: bus_space.c,v 1.3 2005/10/26 18:46:06 martin Exp $ */
/* $NetBSD: bus_space.c,v 1.2 2003/03/14 18:47:53 christos Exp $ */
/*-
@@ -469,5 +469,5 @@ x86_memio_mmap(t, addr, off, prot, flags)
* Note we are called for each "page" in the device that
* the upper layers want to map.
*/
- return (x86_btop(addr + off));
+ return (atop(addr + off));
}
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 152a13c6701..13c4f60e6ed 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.36 2005/09/19 01:28:04 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.37 2005/10/26 18:46:06 martin Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1614,10 +1614,10 @@ init_x86_64(first_avail)
SDT_SYSLDT, SEL_KPL, 0);
set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE_SEL), 0,
- x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 0, 1);
+ atop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 0, 1);
set_mem_segment(GDT_ADDR_MEM(gdtstore, GUDATA_SEL), 0,
- x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMRWA, SEL_UPL, 1, 0, 1);
+ atop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMRWA, SEL_UPL, 1, 0, 1);
/* make ldt gates and memory segments */
setgate((struct gate_descriptor *)(ldtstore + LSYS5CALLS_SEL),
@@ -1634,19 +1634,19 @@ init_x86_64(first_avail)
*/
set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE32_SEL), 0,
- x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 1, 0);
+ atop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 1, 0);
set_mem_segment(GDT_ADDR_MEM(gdtstore, GUDATA32_SEL), 0,
- x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMRWA, SEL_UPL, 1, 1, 0);
+ atop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMRWA, SEL_UPL, 1, 1, 0);
/*
* 32 bit LDT entries.
*/
ldt_segp = (struct mem_segment_descriptor *)(ldtstore + LUCODE32_SEL);
- set_mem_segment(ldt_segp, 0, x86_btop(VM_MAXUSER_ADDRESS32) - 1,
+ set_mem_segment(ldt_segp, 0, atop(VM_MAXUSER_ADDRESS32) - 1,
SDT_MEMERA, SEL_UPL, 1, 1, 0);
ldt_segp = (struct mem_segment_descriptor *)(ldtstore + LUDATA32_SEL);
- set_mem_segment(ldt_segp, 0, x86_btop(VM_MAXUSER_ADDRESS32) - 1,
+ set_mem_segment(ldt_segp, 0, atop(VM_MAXUSER_ADDRESS32) - 1,
SDT_MEMRWA, SEL_UPL, 1, 1, 0);
/*
diff --git a/sys/arch/amd64/amd64/mem.c b/sys/arch/amd64/amd64/mem.c
index 103244be107..d1c483ee695 100644
--- a/sys/arch/amd64/amd64/mem.c
+++ b/sys/arch/amd64/amd64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 2005/05/27 19:32:39 art Exp $ */
+/* $OpenBSD: mem.c,v 1.5 2005/10/26 18:46:06 martin Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -203,7 +203,7 @@ mmmmap(dev, off, prot)
case 0:
if ((paddr_t)off > (paddr_t)ctob(physmem) && suser(p, 0) != 0)
return -1;
- return btop((paddr_t)off);
+ return atop(off);
#ifdef APERTURE
/* minor device 4 is aperture driver */
@@ -213,7 +213,7 @@ mmmmap(dev, off, prot)
/* Allow mapping of the VGA framebuffer & BIOS only */
if ((off >= VGA_START && off <= BIOS_END) ||
(unsigned)off > (unsigned)ctob(physmem))
- return btop((paddr_t)off);
+ return atop(off);
else
return -1;
case 2:
@@ -221,7 +221,7 @@ mmmmap(dev, off, prot)
for x86emu */
if (off <= BIOS_END ||
(unsigned)off > (unsigned)ctob(physmem))
- return btop((paddr_t)off);
+ return atop(off);
else
return -1;
default:
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index 28522d327cf..d1ff3c53ca0 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.12 2005/09/25 20:48:18 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.13 2005/10/26 18:46:06 martin Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
@@ -747,7 +747,7 @@ pmap_bootstrap(vaddr_t kva_start, paddr_t max_pa)
kpm->pm_pdir = (pd_entry_t *)(proc0.p_addr->u_pcb.pcb_cr3 + KERNBASE);
kpm->pm_pdirpa = (u_int32_t) proc0.p_addr->u_pcb.pcb_cr3;
kpm->pm_stats.wired_count = kpm->pm_stats.resident_count =
- btop(kva_start - VM_MIN_KERNEL_ADDRESS);
+ atop(kva_start - VM_MIN_KERNEL_ADDRESS);
/*
* the above is just a rough estimate and not critical to the proper
@@ -1790,7 +1790,7 @@ pmap_remove_ptes(pmap, ptp, ptpva, startva, endva, cpumaskp, flags)
if ((opte & PG_PVLIST) == 0) {
#ifdef DIAGNOSTIC
- if (vm_physseg_find(btop(opte & PG_FRAME), &off)
+ if (vm_physseg_find(atop(opte & PG_FRAME), &off)
!= -1)
panic("pmap_remove_ptes: managed page without "
"PG_PVLIST for 0x%lx", startva);
@@ -1798,7 +1798,7 @@ pmap_remove_ptes(pmap, ptp, ptpva, startva, endva, cpumaskp, flags)
continue;
}
- bank = vm_physseg_find(btop(opte & PG_FRAME), &off);
+ bank = vm_physseg_find(atop(opte & PG_FRAME), &off);
#ifdef DIAGNOSTIC
if (bank == -1)
panic("pmap_remove_ptes: unmanaged page marked "
@@ -1869,7 +1869,7 @@ pmap_remove_pte(pmap, ptp, pte, va, cpumaskp, flags)
if ((opte & PG_PVLIST) == 0) {
#ifdef DIAGNOSTIC
- if (vm_physseg_find(btop(opte & PG_FRAME), &off) != -1) {
+ if (vm_physseg_find(atop(opte & PG_FRAME), &off) != -1) {
panic("pmap_remove_pte: managed page without "
"PG_PVLIST for 0x%lx", va);
}
@@ -1877,7 +1877,7 @@ pmap_remove_pte(pmap, ptp, pte, va, cpumaskp, flags)
return(TRUE);
}
- bank = vm_physseg_find(btop(opte & PG_FRAME), &off);
+ bank = vm_physseg_find(atop(opte & PG_FRAME), &off);
#ifdef DIAGNOSTIC
if (bank == -1)
panic("pmap_remove_pte: unmanaged page marked "
@@ -2348,7 +2348,7 @@ pmap_write_protect(pmap, sva, eva, prot)
pmap_pte_clearbits(spte, PG_RW);
pmap_pte_setbits(spte, nx);
if (opte != *spte)
- pmap_tlb_shootdown(pmap, ptob(spte - ptes),
+ pmap_tlb_shootdown(pmap, ptoa(spte - ptes),
*spte, &cpumask);
}
}
diff --git a/sys/arch/amd64/include/param.h b/sys/arch/amd64/include/param.h
index b0cd6e3a805..40a703b9693 100644
--- a/sys/arch/amd64/include/param.h
+++ b/sys/arch/amd64/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.7 2005/10/21 18:55:00 martin Exp $ */
+/* $OpenBSD: param.h,v 1.8 2005/10/26 18:46:07 martin Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -153,9 +153,5 @@
#define x86_trunc_pdr(x) ((unsigned long)(x) & ~(NBPD_L2 - 1))
#define x86_btod(x) ((unsigned long)(x) >> L2_SHIFT)
#define x86_dtob(x) ((unsigned long)(x) << L2_SHIFT)
-#define x86_btop(x) ((unsigned long)(x) >> PGSHIFT)
-#define x86_ptob(x) ((unsigned long)(x) << PGSHIFT)
-#define btop(x) x86_btop(x)
-#define ptob(x) x86_ptob(x)
#define round_pdr(x) x86_round_pdr(x)
diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h
index e7d9b7a74f1..90a1f519f88 100644
--- a/sys/arch/amd64/include/pmap.h
+++ b/sys/arch/amd64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.8 2005/07/12 21:18:11 hshoexer Exp $ */
+/* $OpenBSD: pmap.h,v 1.9 2005/10/26 18:46:07 martin Exp $ */
/* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */
/*
@@ -391,7 +391,7 @@ extern pd_entry_t *pdes[];
#define pmap_is_modified(pg) pmap_test_attrs(pg, PG_M)
#define pmap_is_referenced(pg) pmap_test_attrs(pg, PG_U)
#define pmap_move(DP,SP,D,L,S)
-#define pmap_phys_address(ppn) ptob(ppn)
+#define pmap_phys_address(ppn) ptoa(ppn)
#define pmap_valid_entry(E) ((E) & PG_V) /* is PDE or PTE valid? */
#define pmap_proc_iflush(p,va,len) /* nothing */