diff options
author | jake <jake@FreeBSD.org> | 2003-03-25 00:07:06 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2003-03-25 00:07:06 +0000 |
commit | 783ae539c3e44d35afb500b405ff986b3033bc4a (patch) | |
tree | 553401a4d58eb98b1e208a82c3ba2c32b848a225 | |
parent | 0079e3d786d0b0a2647229d3498a426a039a5016 (diff) | |
download | FreeBSD-src-783ae539c3e44d35afb500b405ff986b3033bc4a.zip FreeBSD-src-783ae539c3e44d35afb500b405ff986b3033bc4a.tar.gz |
- Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
with PAE.
- Use this to represent physical addresses in the MI vm system and in the
i386 pmap code. This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
detection code, and due to kvtop returning vm_paddr_t instead of u_long.
Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.
Sponsored by: DARPA, Network Associates Laboratories
Discussed with: re, phk (cdevsw change)
81 files changed, 307 insertions, 275 deletions
diff --git a/sys/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c index 48dd885..e88089b 100644 --- a/sys/alpha/alpha/mem.c +++ b/sys/alpha/alpha/mem.c @@ -218,7 +218,7 @@ kmemphys: * instead of going through read/write * \*******************************************************/ static int -memmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { /* * /dev/mem is the only one that makes sense through this diff --git a/sys/alpha/include/_types.h b/sys/alpha/include/_types.h index 01ec08e..4b7249c 100644 --- a/sys/alpha/include/_types.h +++ b/sys/alpha/include/_types.h @@ -89,6 +89,7 @@ typedef __uint64_t __uint_least64_t; typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index a2e260b..9f02e93 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -181,7 +181,7 @@ int acpi_sleep_machdep(struct acpi_softc *sc, int state) { ACPI_STATUS status; - vm_offset_t oldphys; + vm_paddr_t oldphys; struct pmap *pm; vm_page_t page; static vm_page_t opage = NULL; diff --git a/sys/amd64/amd64/busdma_machdep.c b/sys/amd64/amd64/busdma_machdep.c index 4fe748c..ca0db65 100644 --- a/sys/amd64/amd64/busdma_machdep.c +++ b/sys/amd64/amd64/busdma_machdep.c @@ -100,7 +100,7 @@ static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map); -static vm_offset_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); @@ -158,8 +158,9 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, newtag->parent = parent; newtag->alignment = alignment; newtag->boundary = boundary; - newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_offset_t)highaddr) + (PAGE_SIZE - 1); + newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + + (PAGE_SIZE - 1); newtag->filter = filter; newtag->filterarg = filterarg; newtag->maxsize = maxsize; @@ -191,7 +192,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, atomic_add_int(&parent->ref_count, 1); } - if (newtag->lowaddr < ptoa(Maxmem) && (flags & BUS_DMA_ALLOCNOW) != 0) { + if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) && + (flags & BUS_DMA_ALLOCNOW) != 0) { /* Must bounce */ if (lowaddr > bounce_lowaddr) { @@ -262,7 +264,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) error = 0; - if (dmat->lowaddr < ptoa(Maxmem)) { + if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem)) { /* Must bounce */ int maxpages; @@ -344,7 +346,8 @@ bus_dmamem_alloc_size(bus_dma_tag_t dmat, void** vaddr, int flags, /* If we succeed, no mapping/bouncing will be required */ *mapp = NULL; - if ((size <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) { + if ((size <= PAGE_SIZE) && + dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) { *vaddr = malloc(size, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK); } else { @@ -386,7 +389,7 @@ bus_dmamem_free_size(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map, */ if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); - if ((size <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) + if ((size <= PAGE_SIZE) && dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) free(vaddr, M_DEVBUF); else { mtx_lock(&Giant); @@ -412,7 +415,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, void *callback_arg, int flags) { vm_offset_t vaddr; - vm_offset_t paddr; + vm_paddr_t paddr; #ifdef __GNUC__ bus_dma_segment_t dm_segments[dmat->nsegments]; #else @@ -421,7 +424,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, bus_dma_segment_t *sg; int seg; int error; - vm_offset_t nextpaddr; + vm_paddr_t nextpaddr; if (map == NULL) map = &nobounce_dmamap; @@ -431,7 +434,8 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, * If we are being called during a callback, pagesneeded will * be non-zero, so we can avoid doing the work twice. */ - if (dmat->lowaddr < ptoa(Maxmem) && map->pagesneeded == 0) { + if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem) && + map->pagesneeded == 0) { vm_offset_t vendaddr; /* @@ -626,7 +630,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, #endif int nsegs, error; - KASSERT(dmat->lowaddr >= ptoa(Maxmem) || map != NULL, + KASSERT(dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) || map != NULL, ("bus_dmamap_load_mbuf: No support for bounce pages!")); KASSERT(m0->m_flags & M_PKTHDR, ("bus_dmamap_load_mbuf: no packet header")); @@ -682,7 +686,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct iovec *iov; struct thread *td = NULL; - KASSERT(dmat->lowaddr >= ptoa(Maxmem) || map != NULL, + KASSERT(dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) || map != NULL, ("bus_dmamap_load_uio: No support for bounce pages!")); resid = uio->uio_resid; @@ -846,7 +850,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map) return (pages); } -static vm_offset_t +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_size_t size) { diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index d3f0ee6..aca9abf 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -170,7 +170,7 @@ static void freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask, long Maxmem = 0; -vm_offset_t phys_avail[10]; +vm_paddr_t phys_avail[10]; /* must be 2 less so 0 0 can signal end of chunks */ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) @@ -197,8 +197,8 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %u (%u MB)\n", ptoa(Maxmem), - ptoa(Maxmem) / 1048576); + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), + ptoa((uintmax_t)Maxmem) / 1048576); /* * Display any holes after the first chunk of extended memory. */ @@ -207,19 +207,22 @@ cpu_startup(dummy) printf("Physical memory chunk(s):\n"); for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - unsigned int size1; + vm_paddr_t size; - size1 = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08x - 0x%08x, %u bytes (%u pages)\n", - phys_avail[indx], phys_avail[indx + 1] - 1, size1, - size1 / PAGE_SIZE); + size = phys_avail[indx + 1] - phys_avail[indx]; + printf( + "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); } } vm_ksubmap_init(&kmi); - printf("avail memory = %u (%u MB)\n", ptoa(cnt.v_free_count), - ptoa(cnt.v_free_count) / 1048576); + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)cnt.v_free_count), + ptoa((uintmax_t)cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. @@ -1463,6 +1466,8 @@ sdtossd(sd, ssd) * * Total memory size may be set by the kernel environment variable * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. */ static void getmemsize(int first) @@ -1472,7 +1477,7 @@ getmemsize(int first) u_int basemem, extmem; struct vm86frame vmf; struct vm86context vmc; - vm_offset_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa, physmap[PHYSMAP_SIZE]; pt_entry_t *pte; char *cp; struct bios_smap *smap; @@ -1559,12 +1564,8 @@ int15e820: if (i || vmf.vmf_eax != SMAP_SIG) break; if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%08x %08x len=%08x %08x\n", - smap->type, - *(u_int32_t *)((char *)&smap->base + 4), - (u_int32_t)smap->base, - *(u_int32_t *)((char *)&smap->length + 4), - (u_int32_t)smap->length); + printf("SMAP type=%02x base=%016llx len=%016llx\n", + smap->type, smap->base, smap->length); if (smap->type != 0x01) goto next_run; @@ -1742,7 +1743,7 @@ physmap_done: * extend the last memory segment to the new limit. */ if (atop(physmap[physmap_idx + 1]) < Maxmem) - physmap[physmap_idx + 1] = ptoa(Maxmem); + physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); /* call pmap initialization to make new kernel address space */ pmap_bootstrap(first, 0); @@ -1761,9 +1762,9 @@ physmap_done: * round up the start address and round down the end address. */ for (i = 0; i <= physmap_idx; i += 2) { - vm_offset_t end; + vm_paddr_t end; - end = ptoa(Maxmem); + end = ptoa((vm_paddr_t)Maxmem); if (physmap[i + 1] < end) end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index cae4f6a..37a9cec 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/mem.c @@ -211,7 +211,7 @@ mmrw(dev_t dev, struct uio *uio, int flags) * instead of going through read/write * \*******************************************************/ static int -memmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { switch (minor(dev)) { diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index edd83e3..12d7578 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -2576,7 +2576,7 @@ ap_init(void) if (PCPU_GET(cpuid) != apic_id) { printf("SMP: cpuid = %d\n", PCPU_GET(cpuid)); printf("SMP: apic_id = %d\n", apic_id); - printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); + printf("PTD[MPPTDI] = %#jx\n", (uintmax_t)PTD[MPPTDI]); panic("cpuid mismatch! boom!!"); } diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index edd83e3..12d7578 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -2576,7 +2576,7 @@ ap_init(void) if (PCPU_GET(cpuid) != apic_id) { printf("SMP: cpuid = %d\n", PCPU_GET(cpuid)); printf("SMP: apic_id = %d\n", apic_id); - printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); + printf("PTD[MPPTDI] = %#jx\n", (uintmax_t)PTD[MPPTDI]); panic("cpuid mismatch! boom!!"); } diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index ae6c091..daa99c4 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -154,8 +154,8 @@ LIST_HEAD(pmaplist, pmap); static struct pmaplist allpmaps; static struct mtx allpmaps_lock; -vm_offset_t avail_start; /* PA of first available physical page */ -vm_offset_t avail_end; /* PA of last available physical page */ +vm_paddr_t avail_start; /* PA of first available physical page */ +vm_paddr_t avail_end; /* PA of last available physical page */ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ static boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ @@ -288,8 +288,8 @@ pmap_kmem_choose(vm_offset_t addr) */ void pmap_bootstrap(firstaddr, loadaddr) - vm_offset_t firstaddr; - vm_offset_t loadaddr; + vm_paddr_t firstaddr; + vm_paddr_t loadaddr; { vm_offset_t va; pt_entry_t *pte; @@ -515,7 +515,7 @@ pmap_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) */ void pmap_init(phys_start, phys_end) - vm_offset_t phys_start, phys_end; + vm_paddr_t phys_start, phys_end; { int i; int initial_pvs; @@ -842,12 +842,12 @@ pmap_pte_quick(pmap, va) * Extract the physical page address associated * with the given map/virtual_address pair. */ -vm_offset_t +vm_paddr_t pmap_extract(pmap, va) register pmap_t pmap; vm_offset_t va; { - vm_offset_t rtval; /* XXX FIXME */ + vm_paddr_t rtval; vm_offset_t pdirindex; if (pmap == 0) @@ -878,7 +878,7 @@ pmap_extract(pmap, va) * Note: not SMP coherent. */ PMAP_INLINE void -pmap_kenter(vm_offset_t va, vm_offset_t pa) +pmap_kenter(vm_offset_t va, vm_paddr_t pa) { pt_entry_t *pte; @@ -912,7 +912,7 @@ pmap_kremove(vm_offset_t va) * region. */ vm_offset_t -pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) +pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) { vm_offset_t va, sva; @@ -1295,7 +1295,7 @@ pmap_pinit(pmap) register struct pmap *pmap; { vm_page_t ptdpg[NPGPTD]; - vm_offset_t pa; + vm_paddr_t pa; int i; /* @@ -1376,7 +1376,8 @@ _pmap_allocpte(pmap, ptepindex) pmap_t pmap; unsigned ptepindex; { - vm_offset_t pteva, ptepa; /* XXXPA */ + vm_paddr_t ptepa; + vm_offset_t pteva; vm_page_t m; /* @@ -1559,7 +1560,7 @@ pmap_growkernel(vm_offset_t addr) { struct pmap *pmap; int s; - vm_offset_t ptppaddr; + vm_paddr_t ptppaddr; vm_page_t nkpg; pd_entry_t newpdir; @@ -2044,9 +2045,9 @@ void pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired) { - vm_offset_t pa; + vm_paddr_t pa; register pt_entry_t *pte; - vm_offset_t opa; + vm_paddr_t opa; pt_entry_t origpte, newpte; vm_page_t mpte; @@ -2086,8 +2087,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, * Page Directory table entry not valid, we need a new PT page */ if (pte == NULL) { - panic("pmap_enter: invalid page directory, pdir=%p, va=0x%x\n", - (void *)pmap->pm_pdir[PTDPTDI], va); + panic("pmap_enter: invalid page directory pdir=%#jx, va=%#x\n", + (uintmax_t)pmap->pm_pdir[PTDPTDI], va); } pa = VM_PAGE_TO_PHYS(m) & PG_FRAME; @@ -2219,7 +2220,7 @@ static vm_page_t pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte) { pt_entry_t *pte; - vm_offset_t pa; + vm_paddr_t pa; /* * In the case that a page table page is not @@ -2960,11 +2961,11 @@ pmap_remove_pages(pmap, sva, eva) m = PHYS_TO_VM_PAGE(tpte); KASSERT(m->phys_addr == (tpte & PG_FRAME), - ("vm_page_t %p phys_addr mismatch %08x %08x", - m, m->phys_addr, tpte)); + ("vm_page_t %p phys_addr mismatch %016jx %016jx", + m, (uintmax_t)m->phys_addr, (uintmax_t)tpte)); KASSERT(m < &vm_page_array[vm_page_array_size], - ("pmap_remove_pages: bad tpte %x", tpte)); + ("pmap_remove_pages: bad tpte %#jx", (uintmax_t)tpte)); pv->pv_pmap->pm_stats.resident_count--; @@ -3231,7 +3232,7 @@ i386_protection_init() */ void * pmap_mapdev(pa, size) - vm_offset_t pa; + vm_paddr_t pa; vm_size_t size; { vm_offset_t va, tmpva, offset; @@ -3293,7 +3294,7 @@ pmap_mincore(pmap, addr) } if ((pte = *ptep) != 0) { - vm_offset_t pa; + vm_paddr_t pa; val = MINCORE_INCORE; if ((pte & PG_MANAGED) == 0) @@ -3455,7 +3456,7 @@ pads(pm) pmap_t pm; { int i, j; - vm_offset_t va; + vm_paddr_t va; pt_entry_t *ptep; if (pm == kernel_pmap) @@ -3477,7 +3478,7 @@ pads(pm) void pmap_pvdump(pa) - vm_offset_t pa; + vm_paddr_t pa; { pv_entry_t pv; vm_page_t m; diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 45148e9..fdd9568 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -405,15 +405,15 @@ cpu_wait(p) /* * Convert kernel VA to physical address */ -u_long +vm_paddr_t kvtop(void *addr) { - vm_offset_t va; + vm_paddr_t pa; - va = pmap_kextract((vm_offset_t)addr); - if (va == 0) + pa = pmap_kextract((vm_offset_t)addr); + if (pa == 0) panic("kvtop: zero page frame"); - return((int)va); + return (pa); } /* diff --git a/sys/amd64/include/_types.h b/sys/amd64/include/_types.h index 155f55f..69b6a0d 100644 --- a/sys/amd64/include/_types.h +++ b/sys/amd64/include/_types.h @@ -87,6 +87,7 @@ typedef __uint64_t __uint_least64_t; typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 5f52c259..9143d19 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -96,7 +96,7 @@ int i586_copyout(const void *kaddr, void *udaddr, size_t len); void i686_pagezero(void *addr); void init_AMD_Elan_sc520(void); int is_physical_memory(vm_offset_t addr); -u_long kvtop(void *addr); +vm_paddr_t kvtop(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); void swi_vm(void *); int user_dbreg_trap(void); diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index edd83e3..12d7578 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -2576,7 +2576,7 @@ ap_init(void) if (PCPU_GET(cpuid) != apic_id) { printf("SMP: cpuid = %d\n", PCPU_GET(cpuid)); printf("SMP: apic_id = %d\n", apic_id); - printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); + printf("PTD[MPPTDI] = %#jx\n", (uintmax_t)PTD[MPPTDI]); panic("cpuid mismatch! boom!!"); } diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 92493e1..8688b46 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -70,7 +70,7 @@ /* Our various interpretations of the above */ #define PG_W PG_AVAIL1 /* "Wired" pseudoflag */ #define PG_MANAGED PG_AVAIL2 -#define PG_FRAME (~PAGE_MASK) +#define PG_FRAME (~((vm_paddr_t)PAGE_MASK)) #define PG_PROT (PG_RW|PG_U) /* all protection bits . */ #define PG_N (PG_NC_PWT|PG_NC_PCD) /* Non-cacheable */ @@ -168,10 +168,11 @@ extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ * Extract the physical page address associated * kernel virtual address. */ -static __inline vm_offset_t +static __inline vm_paddr_t pmap_kextract(vm_offset_t va) { - vm_offset_t pa; + vm_paddr_t pa; + if ((pa = (vm_offset_t) PTD[va >> PDRSHIFT]) & PG_PS) { pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1)); } else { @@ -237,19 +238,19 @@ extern struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR]; extern caddr_t CADDR1; extern pt_entry_t *CMAP1; -extern vm_offset_t avail_end; -extern vm_offset_t avail_start; +extern vm_paddr_t avail_end; +extern vm_paddr_t avail_start; extern vm_offset_t clean_eva; extern vm_offset_t clean_sva; -extern vm_offset_t phys_avail[]; +extern vm_paddr_t phys_avail[]; extern char *ptvmmap; /* poor name! */ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; -void pmap_bootstrap(vm_offset_t, vm_offset_t); -void pmap_kenter(vm_offset_t va, vm_offset_t pa); +void pmap_bootstrap(vm_paddr_t, vm_paddr_t); +void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); pt_entry_t *pmap_pte(pmap_t, vm_offset_t) __pure2; void pmap_set_opt(void); diff --git a/sys/amd64/isa/isa_dma.c b/sys/amd64/isa/isa_dma.c index 3b6e231..381bd75 100644 --- a/sys/amd64/isa/isa_dma.c +++ b/sys/amd64/isa/isa_dma.c @@ -213,7 +213,7 @@ isa_dmacascade(chan) void isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) { - vm_offset_t phys; + vm_paddr_t phys; int waport; caddr_t newaddr; @@ -373,7 +373,8 @@ isa_dmadone(int flags, caddr_t addr, int nbytes, int chan) static int isa_dmarangecheck(caddr_t va, u_int length, int chan) { - vm_offset_t phys, priorpage = 0, endva; + vm_paddr_t phys, priorpage = 0; + vm_offset_t endva; u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1); GIANT_REQUIRED; diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h index cb3a7e3..f761835 100644 --- a/sys/arm/include/_types.h +++ b/sys/arm/include/_types.h @@ -95,6 +95,7 @@ typedef __uint64_t __uint_least64_t; typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; typedef __int64_t __vm_ooffset_t; +typedef __uint32_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 8c59946..5ff2446 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -716,7 +716,7 @@ agp_ioctl(dev_t kdev, u_long cmd, caddr_t data, int fflag, struct thread *td) } static int -agp_mmap(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr, int prot) +agp_mmap(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { device_t dev = KDEV2DEV(kdev); struct agp_softc *sc = device_get_softc(dev); diff --git a/sys/dev/bktr/bktr_os.c b/sys/dev/bktr/bktr_os.c index c088510..22b1458 100644 --- a/sys/dev/bktr/bktr_os.c +++ b/sys/dev/bktr/bktr_os.c @@ -749,7 +749,7 @@ bktr_ioctl( dev_t dev, ioctl_cmd_t cmd, caddr_t arg, int flag, struct thread *td * */ static int -bktr_mmap( dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot ) +bktr_mmap( dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot ) { int unit; bktr_ptr_t bktr; diff --git a/sys/dev/drm/drm_vm.h b/sys/dev/drm/drm_vm.h index a2ea15d..40fcb7b 100644 --- a/sys/dev/drm/drm_vm.h +++ b/sys/dev/drm/drm_vm.h @@ -3,7 +3,7 @@ */ #if defined(__FreeBSD__) && __FreeBSD_version >= 500102 -static int DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr, +static int DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) #elif defined(__FreeBSD__) static int DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, int prot) @@ -32,7 +32,7 @@ static paddr_t DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, int prot) } #if defined(__FreeBSD__) && __FreeBSD_version >= 500102 -int DRM(mmap)(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr, +int DRM(mmap)(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) #elif defined(__FreeBSD__) int DRM(mmap)(dev_t kdev, vm_offset_t offset, int prot) diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 8d1c849..c84daf3 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -568,7 +568,7 @@ ed_probe_WD80x3_generic(dev, flags, intr_vals) for (i = 0; i < memsize; ++i) { if (sc->mem_start[i]) { - device_printf(dev, "failed to clear shared memory at %lx - check configuration\n", + device_printf(dev, "failed to clear shared memory at %x - check configuration\n", kvtop(sc->mem_start + i)); /* @@ -903,7 +903,7 @@ ed_probe_3Com(dev, port_rid, flags) for (i = 0; i < memsize; ++i) if (sc->mem_start[i]) { - device_printf(dev, "failed to clear shared memory at %lx - check configuration\n", + device_printf(dev, "failed to clear shared memory at %x - check configuration\n", kvtop(sc->mem_start + i)); return (ENXIO); } diff --git a/sys/dev/ed/if_ed_cbus.c b/sys/dev/ed/if_ed_cbus.c index b3be8d5..624c2da 100644 --- a/sys/dev/ed/if_ed_cbus.c +++ b/sys/dev/ed/if_ed_cbus.c @@ -939,7 +939,7 @@ ed_probe_SIC98(dev, port_rid, flags) for (i = 0; i < sc->mem_size; i++) { if (sc->mem_start[i]) { device_printf(dev, "failed to clear shared memory " - "at %lx - check configuration\n", + "at %x - check configuration\n", kvtop(sc->mem_start + i)); return (ENXIO); @@ -1112,7 +1112,7 @@ ed_probe_CNET98(dev, port_rid, flags) /* Check window area address */ tmp_s = kvtop(sc->mem_start) >> 12; if (tmp_s < 0x80) { - device_printf(dev, "Please change window address(0x%lx)\n", + device_printf(dev, "Please change window address(0x%x)\n", kvtop(sc->mem_start)); return (ENXIO); } @@ -1121,7 +1121,7 @@ ed_probe_CNET98(dev, port_rid, flags) tmp = rman_get_start(sc->port_res) >> 12; if ((tmp_s <= tmp) && (tmp < (tmp_s + 4))) { device_printf(dev, "Please change iobase address(0x%lx) " - "or window address(0x%lx)\n", + "or window address(0x%x)\n", rman_get_start(sc->port_res), kvtop(sc->mem_start)); return (ENXIO); } @@ -1173,7 +1173,7 @@ ed_probe_CNET98(dev, port_rid, flags) for (i = 0; i < sc->mem_size; i++) { if (sc->mem_start[i]) { device_printf(dev, "failed to clear shared memory " - "at %lx - check configuration\n", + "at %x - check configuration\n", kvtop(sc->mem_start + i)); return (ENXIO); diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c index 073ffd8..8dd9da8 100644 --- a/sys/dev/fb/fb.c +++ b/sys/dev/fb/fb.c @@ -498,7 +498,7 @@ fbioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) } static int -fbmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +fbmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { int unit; diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h index ce9869e..c607337 100644 --- a/sys/dev/fb/fbreg.h +++ b/sys/dev/fb/fbreg.h @@ -82,7 +82,7 @@ typedef int vi_blank_display_t(video_adapter_t *adp, int mode); #define V_DISPLAY_SUSPEND 3 */ typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset, - vm_offset_t *paddr, int prot); + vm_paddr_t *paddr, int prot); typedef int vi_ioctl_t(video_adapter_t *adp, u_long cmd, caddr_t data); typedef int vi_clear_t(video_adapter_t *adp); typedef int vi_fill_rect_t(video_adapter_t *adp, int val, int x, int y, diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c index 358bc32..410b1f5 100644 --- a/sys/dev/fb/vga.c +++ b/sys/dev/fb/vga.c @@ -2449,7 +2449,7 @@ vga_blank_display(video_adapter_t *adp, int mode) * all adapters */ static int -vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr, +vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr, int prot) { if (adp->va_info.vi_flags & V_INFO_LINEAR) diff --git a/sys/dev/gfb/gfb_pci.c b/sys/dev/gfb/gfb_pci.c index 904f536..5fc9f42 100644 --- a/sys/dev/gfb/gfb_pci.c +++ b/sys/dev/gfb/gfb_pci.c @@ -313,7 +313,7 @@ pcigfb_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) } int -pcigfb_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +pcigfb_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { struct gfb_softc *sc; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 838028c..65ff150 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -986,7 +986,7 @@ dsp_poll(dev_t i_dev, int events, struct thread *td) } static int -dsp_mmap(dev_t i_dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +dsp_mmap(dev_t i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { struct pcm_channel *wrch = NULL, *rdch = NULL, *c; intrmask_t s; diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 88c59e8..e966885 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -3365,7 +3365,7 @@ next_code: } static int -scmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +scmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { scr_stat *scp; diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index 6349751..74d3824 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -434,7 +434,7 @@ tdfx_close(dev_t dev, int fflag, int devtype, struct thread *td) } static int -tdfx_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +tdfx_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { /* * mmap(2) is called by a user process to request that an area of memory diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index a2e260b..9f02e93 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -181,7 +181,7 @@ int acpi_sleep_machdep(struct acpi_softc *sc, int state) { ACPI_STATUS status; - vm_offset_t oldphys; + vm_paddr_t oldphys; struct pmap *pm; vm_page_t page; static vm_page_t opage = NULL; diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index 4fe748c..ca0db65 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -100,7 +100,7 @@ static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map); -static vm_offset_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); @@ -158,8 +158,9 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, newtag->parent = parent; newtag->alignment = alignment; newtag->boundary = boundary; - newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_offset_t)highaddr) + (PAGE_SIZE - 1); + newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + + (PAGE_SIZE - 1); newtag->filter = filter; newtag->filterarg = filterarg; newtag->maxsize = maxsize; @@ -191,7 +192,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, atomic_add_int(&parent->ref_count, 1); } - if (newtag->lowaddr < ptoa(Maxmem) && (flags & BUS_DMA_ALLOCNOW) != 0) { + if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) && + (flags & BUS_DMA_ALLOCNOW) != 0) { /* Must bounce */ if (lowaddr > bounce_lowaddr) { @@ -262,7 +264,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) error = 0; - if (dmat->lowaddr < ptoa(Maxmem)) { + if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem)) { /* Must bounce */ int maxpages; @@ -344,7 +346,8 @@ bus_dmamem_alloc_size(bus_dma_tag_t dmat, void** vaddr, int flags, /* If we succeed, no mapping/bouncing will be required */ *mapp = NULL; - if ((size <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) { + if ((size <= PAGE_SIZE) && + dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) { *vaddr = malloc(size, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK); } else { @@ -386,7 +389,7 @@ bus_dmamem_free_size(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map, */ if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); - if ((size <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) + if ((size <= PAGE_SIZE) && dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) free(vaddr, M_DEVBUF); else { mtx_lock(&Giant); @@ -412,7 +415,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, void *callback_arg, int flags) { vm_offset_t vaddr; - vm_offset_t paddr; + vm_paddr_t paddr; #ifdef __GNUC__ bus_dma_segment_t dm_segments[dmat->nsegments]; #else @@ -421,7 +424,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, bus_dma_segment_t *sg; int seg; int error; - vm_offset_t nextpaddr; + vm_paddr_t nextpaddr; if (map == NULL) map = &nobounce_dmamap; @@ -431,7 +434,8 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, * If we are being called during a callback, pagesneeded will * be non-zero, so we can avoid doing the work twice. */ - if (dmat->lowaddr < ptoa(Maxmem) && map->pagesneeded == 0) { + if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem) && + map->pagesneeded == 0) { vm_offset_t vendaddr; /* @@ -626,7 +630,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, #endif int nsegs, error; - KASSERT(dmat->lowaddr >= ptoa(Maxmem) || map != NULL, + KASSERT(dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) || map != NULL, ("bus_dmamap_load_mbuf: No support for bounce pages!")); KASSERT(m0->m_flags & M_PKTHDR, ("bus_dmamap_load_mbuf: no packet header")); @@ -682,7 +686,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct iovec *iov; struct thread *td = NULL; - KASSERT(dmat->lowaddr >= ptoa(Maxmem) || map != NULL, + KASSERT(dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) || map != NULL, ("bus_dmamap_load_uio: No support for bounce pages!")); resid = uio->uio_resid; @@ -846,7 +850,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map) return (pages); } -static vm_offset_t +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_size_t size) { diff --git a/sys/i386/i386/elan-mmcr.c b/sys/i386/i386/elan-mmcr.c index e0492b50..be209f0 100644 --- a/sys/i386/i386/elan-mmcr.c +++ b/sys/i386/i386/elan-mmcr.c @@ -304,7 +304,7 @@ elan_write(dev_t dev, struct uio *uio, int ioflag) } static int -elan_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +elan_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { if (minor(dev) != ELAN_MMCR) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index d3f0ee6..aca9abf 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -170,7 +170,7 @@ static void freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask, long Maxmem = 0; -vm_offset_t phys_avail[10]; +vm_paddr_t phys_avail[10]; /* must be 2 less so 0 0 can signal end of chunks */ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) @@ -197,8 +197,8 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %u (%u MB)\n", ptoa(Maxmem), - ptoa(Maxmem) / 1048576); + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), + ptoa((uintmax_t)Maxmem) / 1048576); /* * Display any holes after the first chunk of extended memory. */ @@ -207,19 +207,22 @@ cpu_startup(dummy) printf("Physical memory chunk(s):\n"); for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - unsigned int size1; + vm_paddr_t size; - size1 = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08x - 0x%08x, %u bytes (%u pages)\n", - phys_avail[indx], phys_avail[indx + 1] - 1, size1, - size1 / PAGE_SIZE); + size = phys_avail[indx + 1] - phys_avail[indx]; + printf( + "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); } } vm_ksubmap_init(&kmi); - printf("avail memory = %u (%u MB)\n", ptoa(cnt.v_free_count), - ptoa(cnt.v_free_count) / 1048576); + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)cnt.v_free_count), + ptoa((uintmax_t)cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. @@ -1463,6 +1466,8 @@ sdtossd(sd, ssd) * * Total memory size may be set by the kernel environment variable * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. */ static void getmemsize(int first) @@ -1472,7 +1477,7 @@ getmemsize(int first) u_int basemem, extmem; struct vm86frame vmf; struct vm86context vmc; - vm_offset_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa, physmap[PHYSMAP_SIZE]; pt_entry_t *pte; char *cp; struct bios_smap *smap; @@ -1559,12 +1564,8 @@ int15e820: if (i || vmf.vmf_eax != SMAP_SIG) break; if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%08x %08x len=%08x %08x\n", - smap->type, - *(u_int32_t *)((char *)&smap->base + 4), - (u_int32_t)smap->base, - *(u_int32_t *)((char *)&smap->length + 4), - (u_int32_t)smap->length); + printf("SMAP type=%02x base=%016llx len=%016llx\n", + smap->type, smap->base, smap->length); if (smap->type != 0x01) goto next_run; @@ -1742,7 +1743,7 @@ physmap_done: * extend the last memory segment to the new limit. */ if (atop(physmap[physmap_idx + 1]) < Maxmem) - physmap[physmap_idx + 1] = ptoa(Maxmem); + physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); /* call pmap initialization to make new kernel address space */ pmap_bootstrap(first, 0); @@ -1761,9 +1762,9 @@ physmap_done: * round up the start address and round down the end address. */ for (i = 0; i <= physmap_idx; i += 2) { - vm_offset_t end; + vm_paddr_t end; - end = ptoa(Maxmem); + end = ptoa((vm_paddr_t)Maxmem); if (physmap[i + 1] < end) end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c index cae4f6a..37a9cec 100644 --- a/sys/i386/i386/mem.c +++ b/sys/i386/i386/mem.c @@ -211,7 +211,7 @@ mmrw(dev_t dev, struct uio *uio, int flags) * instead of going through read/write * \*******************************************************/ static int -memmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { switch (minor(dev)) { diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index edd83e3..12d7578 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -2576,7 +2576,7 @@ ap_init(void) if (PCPU_GET(cpuid) != apic_id) { printf("SMP: cpuid = %d\n", PCPU_GET(cpuid)); printf("SMP: apic_id = %d\n", apic_id); - printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); + printf("PTD[MPPTDI] = %#jx\n", (uintmax_t)PTD[MPPTDI]); panic("cpuid mismatch! boom!!"); } diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index edd83e3..12d7578 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -2576,7 +2576,7 @@ ap_init(void) if (PCPU_GET(cpuid) != apic_id) { printf("SMP: cpuid = %d\n", PCPU_GET(cpuid)); printf("SMP: apic_id = %d\n", apic_id); - printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); + printf("PTD[MPPTDI] = %#jx\n", (uintmax_t)PTD[MPPTDI]); panic("cpuid mismatch! boom!!"); } diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index ae6c091..daa99c4 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -154,8 +154,8 @@ LIST_HEAD(pmaplist, pmap); static struct pmaplist allpmaps; static struct mtx allpmaps_lock; -vm_offset_t avail_start; /* PA of first available physical page */ -vm_offset_t avail_end; /* PA of last available physical page */ +vm_paddr_t avail_start; /* PA of first available physical page */ +vm_paddr_t avail_end; /* PA of last available physical page */ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ static boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ @@ -288,8 +288,8 @@ pmap_kmem_choose(vm_offset_t addr) */ void pmap_bootstrap(firstaddr, loadaddr) - vm_offset_t firstaddr; - vm_offset_t loadaddr; + vm_paddr_t firstaddr; + vm_paddr_t loadaddr; { vm_offset_t va; pt_entry_t *pte; @@ -515,7 +515,7 @@ pmap_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) */ void pmap_init(phys_start, phys_end) - vm_offset_t phys_start, phys_end; + vm_paddr_t phys_start, phys_end; { int i; int initial_pvs; @@ -842,12 +842,12 @@ pmap_pte_quick(pmap, va) * Extract the physical page address associated * with the given map/virtual_address pair. */ -vm_offset_t +vm_paddr_t pmap_extract(pmap, va) register pmap_t pmap; vm_offset_t va; { - vm_offset_t rtval; /* XXX FIXME */ + vm_paddr_t rtval; vm_offset_t pdirindex; if (pmap == 0) @@ -878,7 +878,7 @@ pmap_extract(pmap, va) * Note: not SMP coherent. */ PMAP_INLINE void -pmap_kenter(vm_offset_t va, vm_offset_t pa) +pmap_kenter(vm_offset_t va, vm_paddr_t pa) { pt_entry_t *pte; @@ -912,7 +912,7 @@ pmap_kremove(vm_offset_t va) * region. */ vm_offset_t -pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) +pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) { vm_offset_t va, sva; @@ -1295,7 +1295,7 @@ pmap_pinit(pmap) register struct pmap *pmap; { vm_page_t ptdpg[NPGPTD]; - vm_offset_t pa; + vm_paddr_t pa; int i; /* @@ -1376,7 +1376,8 @@ _pmap_allocpte(pmap, ptepindex) pmap_t pmap; unsigned ptepindex; { - vm_offset_t pteva, ptepa; /* XXXPA */ + vm_paddr_t ptepa; + vm_offset_t pteva; vm_page_t m; /* @@ -1559,7 +1560,7 @@ pmap_growkernel(vm_offset_t addr) { struct pmap *pmap; int s; - vm_offset_t ptppaddr; + vm_paddr_t ptppaddr; vm_page_t nkpg; pd_entry_t newpdir; @@ -2044,9 +2045,9 @@ void pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired) { - vm_offset_t pa; + vm_paddr_t pa; register pt_entry_t *pte; - vm_offset_t opa; + vm_paddr_t opa; pt_entry_t origpte, newpte; vm_page_t mpte; @@ -2086,8 +2087,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, * Page Directory table entry not valid, we need a new PT page */ if (pte == NULL) { - panic("pmap_enter: invalid page directory, pdir=%p, va=0x%x\n", - (void *)pmap->pm_pdir[PTDPTDI], va); + panic("pmap_enter: invalid page directory pdir=%#jx, va=%#x\n", + (uintmax_t)pmap->pm_pdir[PTDPTDI], va); } pa = VM_PAGE_TO_PHYS(m) & PG_FRAME; @@ -2219,7 +2220,7 @@ static vm_page_t pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte) { pt_entry_t *pte; - vm_offset_t pa; + vm_paddr_t pa; /* * In the case that a page table page is not @@ -2960,11 +2961,11 @@ pmap_remove_pages(pmap, sva, eva) m = PHYS_TO_VM_PAGE(tpte); KASSERT(m->phys_addr == (tpte & PG_FRAME), - ("vm_page_t %p phys_addr mismatch %08x %08x", - m, m->phys_addr, tpte)); + ("vm_page_t %p phys_addr mismatch %016jx %016jx", + m, (uintmax_t)m->phys_addr, (uintmax_t)tpte)); KASSERT(m < &vm_page_array[vm_page_array_size], - ("pmap_remove_pages: bad tpte %x", tpte)); + ("pmap_remove_pages: bad tpte %#jx", (uintmax_t)tpte)); pv->pv_pmap->pm_stats.resident_count--; @@ -3231,7 +3232,7 @@ i386_protection_init() */ void * pmap_mapdev(pa, size) - vm_offset_t pa; + vm_paddr_t pa; vm_size_t size; { vm_offset_t va, tmpva, offset; @@ -3293,7 +3294,7 @@ pmap_mincore(pmap, addr) } if ((pte = *ptep) != 0) { - vm_offset_t pa; + vm_paddr_t pa; val = MINCORE_INCORE; if ((pte & PG_MANAGED) == 0) @@ -3455,7 +3456,7 @@ pads(pm) pmap_t pm; { int i, j; - vm_offset_t va; + vm_paddr_t va; pt_entry_t *ptep; if (pm == kernel_pmap) @@ -3477,7 +3478,7 @@ pads(pm) void pmap_pvdump(pa) - vm_offset_t pa; + vm_paddr_t pa; { pv_entry_t pv; vm_page_t m; diff --git a/sys/i386/i386/vm86.c b/sys/i386/i386/vm86.c index dd7624f..72dca8b 100644 --- a/sys/i386/i386/vm86.c +++ b/sys/i386/i386/vm86.c @@ -599,7 +599,7 @@ vm86_datacall(intnum, vmf, vmc) struct vm86context *vmc; { pt_entry_t *pte = (pt_entry_t *)vm86paddr; - u_int page; + vm_paddr_t page; int i, entry, retval; mtx_lock(&vm86_lock); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 45148e9..fdd9568 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -405,15 +405,15 @@ cpu_wait(p) /* * Convert kernel VA to physical address */ -u_long +vm_paddr_t kvtop(void *addr) { - vm_offset_t va; + vm_paddr_t pa; - va = pmap_kextract((vm_offset_t)addr); - if (va == 0) + pa = pmap_kextract((vm_offset_t)addr); + if (pa == 0) panic("kvtop: zero page frame"); - return((int)va); + return (pa); } /* diff --git a/sys/i386/include/_types.h b/sys/i386/include/_types.h index 847d9fd..ad57438 100644 --- a/sys/i386/include/_types.h +++ b/sys/i386/include/_types.h @@ -102,6 +102,7 @@ typedef __uint64_t __uint_least64_t; typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; typedef __int64_t __vm_ooffset_t; +typedef __uint32_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 5f52c259..9143d19 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -96,7 +96,7 @@ int i586_copyout(const void *kaddr, void *udaddr, size_t len); void i686_pagezero(void *addr); void init_AMD_Elan_sc520(void); int is_physical_memory(vm_offset_t addr); -u_long kvtop(void *addr); +vm_paddr_t kvtop(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); void swi_vm(void *); int user_dbreg_trap(void); diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index edd83e3..12d7578 100644 --- a/sys/i386/include/mptable.h +++ b/sys/i386/include/mptable.h @@ -2576,7 +2576,7 @@ ap_init(void) if (PCPU_GET(cpuid) != apic_id) { printf("SMP: cpuid = %d\n", PCPU_GET(cpuid)); printf("SMP: apic_id = %d\n", apic_id); - printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); + printf("PTD[MPPTDI] = %#jx\n", (uintmax_t)PTD[MPPTDI]); panic("cpuid mismatch! boom!!"); } diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 54fe27a..4da42a9 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -127,14 +127,14 @@ */ #define trunc_page(x) ((x) & ~PAGE_MASK) #define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK) -#define trunc_4mpage(x) ((unsigned)(x) & ~PDRMASK) -#define round_4mpage(x) ((((unsigned)(x)) + PDRMASK) & ~PDRMASK) +#define trunc_4mpage(x) ((x) & ~PDRMASK) +#define round_4mpage(x) ((((x)) + PDRMASK) & ~PDRMASK) -#define atop(x) ((unsigned)(x) >> PAGE_SHIFT) -#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT) +#define atop(x) ((x) >> PAGE_SHIFT) +#define ptoa(x) ((x) << PAGE_SHIFT) -#define i386_btop(x) ((unsigned)(x) >> PAGE_SHIFT) -#define i386_ptob(x) ((unsigned)(x) << PAGE_SHIFT) +#define i386_btop(x) ((x) >> PAGE_SHIFT) +#define i386_ptob(x) ((x) << PAGE_SHIFT) #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 92493e1..8688b46 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -70,7 +70,7 @@ /* Our various interpretations of the above */ #define PG_W PG_AVAIL1 /* "Wired" pseudoflag */ #define PG_MANAGED PG_AVAIL2 -#define PG_FRAME (~PAGE_MASK) +#define PG_FRAME (~((vm_paddr_t)PAGE_MASK)) #define PG_PROT (PG_RW|PG_U) /* all protection bits . */ #define PG_N (PG_NC_PWT|PG_NC_PCD) /* Non-cacheable */ @@ -168,10 +168,11 @@ extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ * Extract the physical page address associated * kernel virtual address. */ -static __inline vm_offset_t +static __inline vm_paddr_t pmap_kextract(vm_offset_t va) { - vm_offset_t pa; + vm_paddr_t pa; + if ((pa = (vm_offset_t) PTD[va >> PDRSHIFT]) & PG_PS) { pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1)); } else { @@ -237,19 +238,19 @@ extern struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR]; extern caddr_t CADDR1; extern pt_entry_t *CMAP1; -extern vm_offset_t avail_end; -extern vm_offset_t avail_start; +extern vm_paddr_t avail_end; +extern vm_paddr_t avail_start; extern vm_offset_t clean_eva; extern vm_offset_t clean_sva; -extern vm_offset_t phys_avail[]; +extern vm_paddr_t phys_avail[]; extern char *ptvmmap; /* poor name! */ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; -void pmap_bootstrap(vm_offset_t, vm_offset_t); -void pmap_kenter(vm_offset_t va, vm_offset_t pa); +void pmap_bootstrap(vm_paddr_t, vm_paddr_t); +void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); pt_entry_t *pmap_pte(pmap_t, vm_offset_t) __pure2; void pmap_set_opt(void); diff --git a/sys/i386/isa/isa_dma.c b/sys/i386/isa/isa_dma.c index 3b6e231..381bd75 100644 --- a/sys/i386/isa/isa_dma.c +++ b/sys/i386/isa/isa_dma.c @@ -213,7 +213,7 @@ isa_dmacascade(chan) void isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) { - vm_offset_t phys; + vm_paddr_t phys; int waport; caddr_t newaddr; @@ -373,7 +373,8 @@ isa_dmadone(int flags, caddr_t addr, int nbytes, int chan) static int isa_dmarangecheck(caddr_t va, u_int length, int chan) { - vm_offset_t phys, priorpage = 0, endva; + vm_paddr_t phys, priorpage = 0; + vm_offset_t endva; u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1); GIANT_REQUIRED; diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index e795180..b5d0063 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -417,7 +417,7 @@ pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) * driver mmap *---------------------------------------------------------------------------*/ static int -pcvt_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +pcvt_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { if (offset > 0x20000 - PAGE_SIZE) return -1; diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index 1a7bfec..2cbdc39 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -268,7 +268,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[unit]; } static int -spigot_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +spigot_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[0]; diff --git a/sys/i4b/layer1/isic/i4b_tel_s016.c b/sys/i4b/layer1/isic/i4b_tel_s016.c index b84da2c..0305ac1 100644 --- a/sys/i4b/layer1/isic/i4b_tel_s016.c +++ b/sys/i4b/layer1/isic/i4b_tel_s016.c @@ -220,7 +220,7 @@ isic_probe_s016(device_t dev) break; default: - printf("isic%d: Error, invalid memory address 0x%lx for Teles S0/16!\n", + printf("isic%d: Error, invalid memory address 0x%x for Teles S0/16!\n", unit, kvtop(sc->sc_vmem_addr)); isic_detach_common(dev); return(ENXIO); diff --git a/sys/i4b/layer1/isic/i4b_tel_s08.c b/sys/i4b/layer1/isic/i4b_tel_s08.c index a789e66..f1a0575 100644 --- a/sys/i4b/layer1/isic/i4b_tel_s08.c +++ b/sys/i4b/layer1/isic/i4b_tel_s08.c @@ -181,7 +181,7 @@ isic_probe_s08(device_t dev) if((kvtop(sc->sc_vmem_addr) < 0xa0000) || (kvtop(sc->sc_vmem_addr) > 0xdf000)) { - printf("isic%d: Error, mem addr 0x%lx outside 0xA0000-0xDF000 for Teles S0/8!\n", + printf("isic%d: Error, mem addr 0x%x outside 0xA0000-0xDF000 for Teles S0/8!\n", unit, kvtop(sc->sc_vmem_addr)); bus_release_resource(dev,SYS_RES_MEMORY, sc->sc_resources.mem_rid, diff --git a/sys/ia64/ia64/mem.c b/sys/ia64/ia64/mem.c index f83da08..75b65ae 100644 --- a/sys/ia64/ia64/mem.c +++ b/sys/ia64/ia64/mem.c @@ -217,7 +217,7 @@ kmemphys: * instead of going through read/write * \*******************************************************/ static int -memmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { /* * /dev/mem is the only one that makes sense through this diff --git a/sys/ia64/include/_types.h b/sys/ia64/include/_types.h index 49029ab..0c10cde 100644 --- a/sys/ia64/include/_types.h +++ b/sys/ia64/include/_types.h @@ -89,6 +89,7 @@ typedef __uint64_t __uint_least64_t; typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; diff --git a/sys/isa/vga_isa.c b/sys/isa/vga_isa.c index 52844f3..e0da2c3 100644 --- a/sys/isa/vga_isa.c +++ b/sys/isa/vga_isa.c @@ -191,7 +191,7 @@ isavga_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) } static int -isavga_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +isavga_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { return vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, paddr, prot); } diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c index 671b9cb..70799e6 100644 --- a/sys/kern/subr_devstat.c +++ b/sys/kern/subr_devstat.c @@ -452,7 +452,7 @@ static TAILQ_HEAD(, statspage) pagelist = TAILQ_HEAD_INITIALIZER(pagelist); static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics"); static int -devstat_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +devstat_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { struct statspage *spp; diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c index 448a8e2..ce92a9b 100644 --- a/sys/kern/subr_xxx.c +++ b/sys/kern/subr_xxx.c @@ -135,7 +135,7 @@ int nommap(dev, offset, paddr, nprot) dev_t dev; vm_offset_t offset; - vm_offset_t *paddr; + vm_paddr_t *paddr; int nprot; { diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 32c9384..8557065 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -620,7 +620,8 @@ pipe_build_write_buffer(wpipe, uio) { u_int size; int i; - vm_offset_t addr, endaddr, paddr; + vm_offset_t addr, endaddr; + vm_paddr_t paddr; GIANT_REQUIRED; PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); diff --git a/sys/kern/uipc_cow.c b/sys/kern/uipc_cow.c index 4cded3f..26b3f4c 100644 --- a/sys/kern/uipc_cow.c +++ b/sys/kern/uipc_cow.c @@ -104,7 +104,7 @@ socow_setup(struct mbuf *m0, struct uio *uio) { struct sf_buf *sf; vm_page_t pp; - vm_offset_t pa; + vm_paddr_t pa; struct iovec *iov; struct vmspace *vmspace; struct vm_map *map; diff --git a/sys/kern/uipc_jumbo.c b/sys/kern/uipc_jumbo.c index d82a1f4..30e91f7 100644 --- a/sys/kern/uipc_jumbo.c +++ b/sys/kern/uipc_jumbo.c @@ -212,7 +212,7 @@ void jumbo_pg_free(vm_offset_t addr) { struct jumbo_kmap *entry; - vm_offset_t paddr; + vm_paddr_t paddr; vm_page_t pg; paddr = pmap_kextract((vm_offset_t)addr); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index cf25ff4..f904aec 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3622,7 +3622,7 @@ int vmapbuf(struct buf *bp) { caddr_t addr, kva; - vm_offset_t pa; + vm_paddr_t pa; int pidx, i; struct vm_page *m; struct pmap *pmap = &curproc->p_vmspace->vm_pmap; diff --git a/sys/pc98/cbus/gdc.c b/sys/pc98/cbus/gdc.c index 01a63ad..b6d302f 100644 --- a/sys/pc98/cbus/gdc.c +++ b/sys/pc98/cbus/gdc.c @@ -392,7 +392,7 @@ gdcioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) } static int -gdcmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +gdcmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { gdc_softc_t *sc; diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index f02c6b9..ea42cdc 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -190,7 +190,7 @@ long Maxmem = 0; int Maxmem_under16M = 0; #endif -vm_offset_t phys_avail[10]; +vm_paddr_t phys_avail[10]; /* must be 2 less so 0 0 can signal end of chunks */ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) @@ -217,8 +217,8 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %u (%u MB)\n", ptoa(Maxmem), - ptoa(Maxmem) / 1048576); + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), + ptoa((uintmax_t)Maxmem) / 1048576); /* * Display any holes after the first chunk of extended memory. */ @@ -227,19 +227,22 @@ cpu_startup(dummy) printf("Physical memory chunk(s):\n"); for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - unsigned int size1; + vm_paddr_t size; - size1 = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08x - 0x%08x, %u bytes (%u pages)\n", - phys_avail[indx], phys_avail[indx + 1] - 1, size1, - size1 / PAGE_SIZE); + size = phys_avail[indx + 1] - phys_avail[indx]; + printf( + "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); } } vm_ksubmap_init(&kmi); - printf("avail memory = %u (%u MB)\n", ptoa(cnt.v_free_count), - ptoa(cnt.v_free_count) / 1048576); + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)cnt.v_free_count), + ptoa((uintmax_t)cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. @@ -1483,6 +1486,8 @@ sdtossd(sd, ssd) * * Total memory size may be set by the kernel environment variable * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. */ static void getmemsize(int first) @@ -1498,7 +1503,7 @@ getmemsize(int first) u_int basemem, extmem; struct vm86frame vmf; struct vm86context vmc; - vm_offset_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa, physmap[PHYSMAP_SIZE]; pt_entry_t *pte; char *cp; struct bios_smap *smap; @@ -1592,12 +1597,8 @@ getmemsize(int first) if (i || vmf.vmf_eax != SMAP_SIG) break; if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%08x %08x len=%08x %08x\n", - smap->type, - *(u_int32_t *)((char *)&smap->base + 4), - (u_int32_t)smap->base, - *(u_int32_t *)((char *)&smap->length + 4), - (u_int32_t)smap->length); + printf("SMAP type=%02x base=%016llx len=%016llx\n", + smap->type, smap->base, smap->length); if (smap->type != 0x01) goto next_run; @@ -1810,7 +1811,7 @@ physmap_done: * extend the last memory segment to the new limit. */ if (atop(physmap[physmap_idx + 1]) < Maxmem) - physmap[physmap_idx + 1] = ptoa(Maxmem); + physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); /* call pmap initialization to make new kernel address space */ pmap_bootstrap(first, 0); @@ -1829,9 +1830,9 @@ physmap_done: * round up the start address and round down the end address. */ for (i = 0; i <= physmap_idx; i += 2) { - vm_offset_t end; + vm_paddr_t end; - end = ptoa(Maxmem); + end = ptoa((vm_paddr_t)Maxmem); if (physmap[i + 1] < end) end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index f02c6b9..ea42cdc 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -190,7 +190,7 @@ long Maxmem = 0; int Maxmem_under16M = 0; #endif -vm_offset_t phys_avail[10]; +vm_paddr_t phys_avail[10]; /* must be 2 less so 0 0 can signal end of chunks */ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) @@ -217,8 +217,8 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %u (%u MB)\n", ptoa(Maxmem), - ptoa(Maxmem) / 1048576); + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), + ptoa((uintmax_t)Maxmem) / 1048576); /* * Display any holes after the first chunk of extended memory. */ @@ -227,19 +227,22 @@ cpu_startup(dummy) printf("Physical memory chunk(s):\n"); for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - unsigned int size1; + vm_paddr_t size; - size1 = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08x - 0x%08x, %u bytes (%u pages)\n", - phys_avail[indx], phys_avail[indx + 1] - 1, size1, - size1 / PAGE_SIZE); + size = phys_avail[indx + 1] - phys_avail[indx]; + printf( + "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); } } vm_ksubmap_init(&kmi); - printf("avail memory = %u (%u MB)\n", ptoa(cnt.v_free_count), - ptoa(cnt.v_free_count) / 1048576); + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)cnt.v_free_count), + ptoa((uintmax_t)cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. @@ -1483,6 +1486,8 @@ sdtossd(sd, ssd) * * Total memory size may be set by the kernel environment variable * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. */ static void getmemsize(int first) @@ -1498,7 +1503,7 @@ getmemsize(int first) u_int basemem, extmem; struct vm86frame vmf; struct vm86context vmc; - vm_offset_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa, physmap[PHYSMAP_SIZE]; pt_entry_t *pte; char *cp; struct bios_smap *smap; @@ -1592,12 +1597,8 @@ getmemsize(int first) if (i || vmf.vmf_eax != SMAP_SIG) break; if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%08x %08x len=%08x %08x\n", - smap->type, - *(u_int32_t *)((char *)&smap->base + 4), - (u_int32_t)smap->base, - *(u_int32_t *)((char *)&smap->length + 4), - (u_int32_t)smap->length); + printf("SMAP type=%02x base=%016llx len=%016llx\n", + smap->type, smap->base, smap->length); if (smap->type != 0x01) goto next_run; @@ -1810,7 +1811,7 @@ physmap_done: * extend the last memory segment to the new limit. */ if (atop(physmap[physmap_idx + 1]) < Maxmem) - physmap[physmap_idx + 1] = ptoa(Maxmem); + physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); /* call pmap initialization to make new kernel address space */ pmap_bootstrap(first, 0); @@ -1829,9 +1830,9 @@ physmap_done: * round up the start address and round down the end address. */ for (i = 0; i <= physmap_idx; i += 2) { - vm_offset_t end; + vm_paddr_t end; - end = ptoa(Maxmem); + end = ptoa((vm_paddr_t)Maxmem); if (physmap[i + 1] < end) end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { diff --git a/sys/pc98/pc98/pc98gdc.c b/sys/pc98/pc98/pc98gdc.c index 01a63ad..b6d302f 100644 --- a/sys/pc98/pc98/pc98gdc.c +++ b/sys/pc98/pc98/pc98gdc.c @@ -392,7 +392,7 @@ gdcioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) } static int -gdcmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot) +gdcmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { gdc_softc_t *sc; diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c index f2ad080..ff1d69d 100644 --- a/sys/pc98/pc98/syscons.c +++ b/sys/pc98/pc98/syscons.c @@ -3384,7 +3384,7 @@ next_code: } static int -scmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +scmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { scr_stat *scp; diff --git a/sys/pci/agp.c b/sys/pci/agp.c index 8c59946..5ff2446 100644 --- a/sys/pci/agp.c +++ b/sys/pci/agp.c @@ -716,7 +716,7 @@ agp_ioctl(dev_t kdev, u_long cmd, caddr_t data, int fflag, struct thread *td) } static int -agp_mmap(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr, int prot) +agp_mmap(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { device_t dev = KDEV2DEV(kdev); struct agp_softc *sc = device_get_softc(dev); diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c index 96bc7d5..71f49a0 100644 --- a/sys/pci/meteor.c +++ b/sys/pci/meteor.c @@ -2102,7 +2102,7 @@ meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) } int -meteor_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +meteor_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { int unit; diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c index 0c269d4..eca1a11 100644 --- a/sys/pci/xrpu.c +++ b/sys/pci/xrpu.c @@ -129,7 +129,7 @@ xrpu_close(dev_t dev, int flag, int mode, struct thread *td) } static int -xrpu_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot) +xrpu_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { struct softc *sc = dev->si_drv1; if (offset >= 0x1000000) diff --git a/sys/powerpc/include/_types.h b/sys/powerpc/include/_types.h index 5374079..e86ee8d 100644 --- a/sys/powerpc/include/_types.h +++ b/sys/powerpc/include/_types.h @@ -102,6 +102,7 @@ typedef __uint64_t __uint_least64_t; typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; typedef __int64_t __vm_ooffset_t; +typedef __uint32_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; diff --git a/sys/sparc64/include/_types.h b/sys/sparc64/include/_types.h index 3118596..933a7a3 100644 --- a/sys/sparc64/include/_types.h +++ b/sys/sparc64/include/_types.h @@ -89,6 +89,7 @@ typedef __uint64_t __uint_least64_t; typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; diff --git a/sys/sys/conf.h b/sys/sys/conf.h index a83ebfe..effec04 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -154,7 +154,7 @@ typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag); typedef int d_write_t(dev_t dev, struct uio *uio, int ioflag); typedef int d_poll_t(dev_t dev, int events, struct thread *td); typedef int d_kqfilter_t(dev_t dev, struct knote *kn); -typedef int d_mmap_t(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, +typedef int d_mmap_t(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot); typedef int l_open_t(dev_t dev, struct tty *tp); diff --git a/sys/sys/jumbo.h b/sys/sys/jumbo.h index d4129a1..f8c7941 100644 --- a/sys/sys/jumbo.h +++ b/sys/sys/jumbo.h @@ -46,7 +46,7 @@ jumbo_phys_to_kva(vm_offset_t pa) pg = PHYS_TO_VM_PAGE(pa); pg->flags &= ~PG_BUSY; - return (caddr_t)(ptoa(pg->pindex) + jumbo_basekva); + return (caddr_t)(ptoa((vm_offset_t)pg->pindex) + jumbo_basekva); } int jumbo_vm_init(void); diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h index a83ebfe..effec04 100644 --- a/sys/sys/linedisc.h +++ b/sys/sys/linedisc.h @@ -154,7 +154,7 @@ typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag); typedef int d_write_t(dev_t dev, struct uio *uio, int ioflag); typedef int d_poll_t(dev_t dev, int events, struct thread *td); typedef int d_kqfilter_t(dev_t dev, struct knote *kn); -typedef int d_mmap_t(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, +typedef int d_mmap_t(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot); typedef int l_open_t(dev_t dev, struct tty *tp); diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 3d2d2cf..aa92da9 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -103,7 +103,7 @@ extern struct mtx malloc_mtx; /* XXX struct malloc_type is unused for contig*(). */ void contigfree(void *addr, unsigned long size, struct malloc_type *type); void *contigmalloc(unsigned long size, struct malloc_type *type, int flags, - unsigned long low, unsigned long high, unsigned long alignment, + vm_paddr_t low, vm_paddr_t high, unsigned long alignment, unsigned long boundary); void free(void *addr, struct malloc_type *type); void *malloc(unsigned long size, struct malloc_type *type, int flags); diff --git a/sys/sys/types.h b/sys/sys/types.h index f6bd6d8..57d2719 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -243,6 +243,7 @@ typedef __useconds_t useconds_t; /* microseconds (unsigned) */ typedef __vm_offset_t vm_offset_t; typedef __vm_ooffset_t vm_ooffset_t; +typedef __vm_paddr_t vm_paddr_t; typedef __vm_pindex_t vm_pindex_t; typedef __vm_size_t vm_size_t; diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 85f29ae..e4d80c4 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -74,7 +74,7 @@ static struct mtx dev_pager_mtx; static uma_zone_t fakepg_zone; -static vm_page_t dev_pager_getfake(vm_offset_t); +static vm_page_t dev_pager_getfake(vm_paddr_t); static void dev_pager_putfake(vm_page_t); struct pagerops devicepagerops = { @@ -107,7 +107,8 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo d_mmap_t *mapfunc; vm_object_t object; unsigned int npages; - vm_offset_t off, paddr; + vm_paddr_t paddr; + vm_offset_t off; /* * Offset should be page aligned. @@ -202,7 +203,7 @@ dev_pager_getpages(object, m, count, reqpage) int reqpage; { vm_pindex_t offset; - vm_offset_t paddr; + vm_paddr_t paddr; vm_page_t page; dev_t dev; int i, ret; @@ -262,7 +263,7 @@ dev_pager_haspage(object, pindex, before, after) static vm_page_t dev_pager_getfake(paddr) - vm_offset_t paddr; + vm_paddr_t paddr; { vm_page_t m; diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h index 7cc6926..794c764 100644 --- a/sys/vm/pmap.h +++ b/sys/vm/pmap.h @@ -106,12 +106,12 @@ void pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); void pmap_copy_page(vm_page_t, vm_page_t); void pmap_enter(pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t); -vm_offset_t pmap_extract(pmap_t pmap, vm_offset_t va); +vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va); void pmap_growkernel(vm_offset_t); -void pmap_init(vm_offset_t, vm_offset_t); +void pmap_init(vm_paddr_t, vm_paddr_t); boolean_t pmap_is_modified(vm_page_t m); boolean_t pmap_ts_referenced(vm_page_t m); -vm_offset_t pmap_map(vm_offset_t *, vm_offset_t, vm_offset_t, int); +vm_offset_t pmap_map(vm_offset_t *, vm_paddr_t, vm_paddr_t, int); void pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, vm_pindex_t pindex, vm_offset_t size, int pagelimit); diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 58666d9..51f2cd8 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -132,14 +132,15 @@ contigmalloc1( unsigned long size, /* should be size_t here and for malloc() */ struct malloc_type *type, int flags, - unsigned long low, - unsigned long high, + vm_paddr_t low, + vm_paddr_t high, unsigned long alignment, unsigned long boundary, vm_map_t map) { int i, s, start; - vm_offset_t addr, phys, tmp_addr; + vm_paddr_t phys; + vm_offset_t addr, tmp_addr; int pass; vm_page_t pga = vm_page_array; @@ -264,8 +265,8 @@ contigmalloc( unsigned long size, /* should be size_t here and for malloc() */ struct malloc_type *type, int flags, - unsigned long low, - unsigned long high, + vm_paddr_t low, + vm_paddr_t high, unsigned long alignment, unsigned long boundary) { @@ -288,8 +289,8 @@ contigfree(void *addr, unsigned long size, struct malloc_type *type) vm_offset_t vm_page_alloc_contig( vm_offset_t size, - vm_offset_t low, - vm_offset_t high, + vm_paddr_t low, + vm_paddr_t high, vm_offset_t alignment) { vm_offset_t ret; diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index 5677858..eafc300 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -80,7 +80,7 @@ int vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t); void vm_forkproc(struct thread *, struct proc *, struct thread *, int); void vm_waitproc(struct proc *); int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, void *, vm_ooffset_t); -vm_offset_t vm_page_alloc_contig(vm_offset_t, vm_offset_t, vm_offset_t, vm_offset_t); +vm_offset_t vm_page_alloc_contig(vm_offset_t, vm_paddr_t, vm_paddr_t, vm_offset_t); void vm_set_page_size(void); struct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t); struct vmspace *vmspace_fork(struct vmspace *); diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index a620576..a7780c1 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -981,7 +981,8 @@ vm_fault_unwire(map, start, end) vm_map_t map; vm_offset_t start, end; { - vm_offset_t va, pa; + vm_paddr_t pa; + vm_offset_t va; pmap_t pmap; pmap = vm_map_pmap(map); @@ -993,7 +994,7 @@ vm_fault_unwire(map, start, end) */ for (va = start; va < end; va += PAGE_SIZE) { pa = pmap_extract(pmap, va); - if (pa != (vm_offset_t) 0) { + if (pa != 0) { pmap_change_wiring(pmap, va, FALSE); vm_page_lock_queues(); vm_page_unwire(PHYS_TO_VM_PAGE(pa), 1); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index c11e842..2111268 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1980,7 +1980,7 @@ DB_SHOW_COMMAND(vmopag, vm_object_print_pages) TAILQ_FOREACH(object, &vm_object_list, object_list) { vm_pindex_t idx, fidx; vm_pindex_t osize; - vm_offset_t pa = -1, padiff; + vm_paddr_t pa = -1, padiff; int rcount; vm_page_t m; diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index a5d2886..12c15ae 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -163,18 +163,20 @@ vm_offset_t vm_page_startup(vm_offset_t starta, vm_offset_t enda, vm_offset_t vaddr) { vm_offset_t mapped; - vm_size_t npages, page_range; - vm_offset_t new_end; + vm_size_t npages; + vm_paddr_t page_range; + vm_paddr_t new_end; int i; - vm_offset_t pa; + vm_paddr_t pa; int nblocks; - vm_offset_t last_pa; + vm_paddr_t last_pa; /* the biggest memory array is the second group of pages */ - vm_offset_t end; - vm_offset_t biggestone, biggestsize; + vm_paddr_t end; + vm_paddr_t biggestsize; + int biggestone; - vm_offset_t total; + vm_paddr_t total; vm_size_t bootpages; total = 0; @@ -189,7 +191,7 @@ vm_page_startup(vm_offset_t starta, vm_offset_t enda, vm_offset_t vaddr) } for (i = 0; phys_avail[i + 1]; i += 2) { - vm_size_t size = phys_avail[i + 1] - phys_avail[i]; + vm_paddr_t size = phys_avail[i + 1] - phys_avail[i]; if (size > biggestsize) { biggestone = i; diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 67e3529..c750813 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -116,7 +116,7 @@ struct vm_page { vm_object_t object; /* which object am I in (O,P)*/ vm_pindex_t pindex; /* offset into object (O,P) */ - vm_offset_t phys_addr; /* physical address of page */ + vm_paddr_t phys_addr; /* physical address of page */ struct md_page md; /* machine dependant stuff */ u_short queue; /* page queue index */ u_short flags, /* see below */ @@ -335,7 +335,7 @@ void vm_page_dirty(vm_page_t m); void vm_page_wakeup(vm_page_t m); void vm_pageq_init(void); -vm_page_t vm_pageq_add_new_page(vm_offset_t pa); +vm_page_t vm_pageq_add_new_page(vm_paddr_t pa); void vm_pageq_enqueue(int queue, vm_page_t m); void vm_pageq_remove_nowakeup(vm_page_t m); void vm_pageq_remove(vm_page_t m); diff --git a/sys/vm/vm_pageq.c b/sys/vm/vm_pageq.c index 4ea0115..332e445 100644 --- a/sys/vm/vm_pageq.c +++ b/sys/vm/vm_pageq.c @@ -90,7 +90,7 @@ vm_pageq_enqueue(int queue, vm_page_t m) * Must be called at splhigh(). */ vm_page_t -vm_pageq_add_new_page(vm_offset_t pa) +vm_pageq_add_new_page(vm_paddr_t pa) { vm_page_t m; |