From 8a46d785199bcae03d0469a55b99e08fe33263fa Mon Sep 17 00:00:00 2001 From: "Thordur I. Bjornsson" Date: Sun, 27 Jun 2010 03:03:50 +0000 Subject: uvm constraints. Add two mandatory MD symbols, uvm_md_constraints which contains the constraints for DMA/memory allocation for each architecture, and dma_constraints which contains the range of addresses that are dma accessable by the system. This is based on ariane@'s physcontig diff, with lots of bugfixes and additions the following additions by my self: Introduce a new function pool_set_constraints() which sets the address range for which we allocate pages for the pool from, this is now used for the mbuf/mbuf cluster pools to keep them dma accessible. The !direct archs no longer stuff pages into the kernel object in uvm_km_getpage_pla but rather do a pmap_extract() in uvm_km_putpages. Tested heavily by my self on i386, amd64 and sparc64. Some tests on alpha and SGI. "commit it" beck, art, oga, deraadt "i like the diff" deraadt --- sys/arch/i386/i386/machdep.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/arch/i386') diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 2bf83682dc7..aa57e7c8821 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.473 2010/06/10 17:54:13 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.474 2010/06/27 03:03:48 thib Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -195,6 +195,14 @@ int bufpages = 0; #endif int bufcachepercent = BUFCACHEPERCENT; +struct uvm_constraint_range isa_constraint = { 0x0, 0x00ffffffUL }; +struct uvm_constraint_range dma_constraint = { 0x0, 0xffffffffUL }; +struct uvm_constraint_range *uvm_md_constraints[] = { + &isa_constraint, + &dma_constraint, + NULL +}; + extern int boothowto; int physmem; -- cgit v1.2.3