summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-03-24 00:36:05 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-03-24 00:36:05 +0000
commitd1a910ddea1d936919bc41da319916bbf007279a (patch)
tree9c9500e5028328add0a30c668a90a3ded4dc9172 /sys/arch/amd64
parentbce2f051822693eb68d990472e07259acdac9503 (diff)
Bring back PHYSLOAD_DEVICE for uvm_page_physload.
ok kettenis@ beck@ (tentatively) and ariane@. deraadt asked for it to be commited now. original commit message: 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@, beck@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/machdep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 71d31ce611b..7289cea0d5f 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.105 2010/03/08 03:40:50 jolan Exp $ */
+/* $OpenBSD: machdep.c,v 1.106 2010/03/24 00:36:04 oga Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1657,10 +1657,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 */