diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-06-07 02:01:55 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-06-07 02:01:55 +0000 |
commit | de04e97dc207dd91524400f05ce8692dc4886fb9 (patch) | |
tree | aa3c7d5620161d7d420f34f2c13e439539e985ac /sys/arch | |
parent | c3ddcbacba908d63f313a0eb0ba8fd0010b40d2e (diff) |
extend uvm_page_physload to have the ability to add "device" pages to the
system.
This is needed in the case where you need managed pages so you can
handle faulting and pmap_page_protect() on said pages when you manage
memory in such regions (i'm looking at you, graphics cards).
these pages are flagged PG_DEV, and shall never be on the freelists,
assert this. behaviour remains unchanged in the non-device case,
specifically for all archs currently in the tree we panic if called
after bootstrap.
ok art@, kettenis@, ariane@, beck@.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index f3f42876d2f..1a836f2838c 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.93 2009/06/03 21:30:19 beck Exp $ */ +/* $OpenBSD: machdep.c,v 1.94 2009/06/07 02:01:54 oga Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -1713,10 +1713,11 @@ cpu_dump_mempagecnt(void) int amd64_pa_used(paddr_t addr) { - bios_memmap_t *bmp; + struct vm_page *pg; + bios_memmap_t *bmp; /* Kernel manages these */ - if (PHYS_TO_VM_PAGE(addr)) + if ((pg = PHYS_TO_VM_PAGE(addr)) && (pg->pg_flags & PG_DEV) == 0) return 1; /* Kernel is loaded here */ |