summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-03-25 00:07:06 +0000
committerjake <jake@FreeBSD.org>2003-03-25 00:07:06 +0000
commit783ae539c3e44d35afb500b405ff986b3033bc4a (patch)
tree553401a4d58eb98b1e208a82c3ba2c32b848a225 /sys/vm
parent0079e3d786d0b0a2647229d3498a426a039a5016 (diff)
downloadFreeBSD-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)
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/device_pager.c9
-rw-r--r--sys/vm/pmap.h6
-rw-r--r--sys/vm/vm_contig.c15
-rw-r--r--sys/vm/vm_extern.h2
-rw-r--r--sys/vm/vm_fault.c5
-rw-r--r--sys/vm/vm_object.c2
-rw-r--r--sys/vm/vm_page.c18
-rw-r--r--sys/vm/vm_page.h4
-rw-r--r--sys/vm/vm_pageq.c2
9 files changed, 34 insertions, 29 deletions
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;
OpenPOWER on IntegriCloud