summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2010-07-02 01:25:07 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2010-07-02 01:25:07 +0000
commit9d117e5e423280482f14797f20b9859c9ac00e9d (patch)
tree2a8ab8f99aec52ff140b81e855394929f7204892 /sys/kern
parent477e87fe3970be38615d29544b520bc46fe960e1 (diff)
add an align argument to uvm_km_kmemalloc_pla.
Use uvm_km_kmemalloc_pla with the dma constraint to allocate kernel stacks. Yes, that means DMA is possible to kernel stacks, but only until we've fixed all the scary drivers. deraadt@ ok
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_fork.c6
-rw-r--r--sys/kern/kern_malloc.c4
-rw-r--r--sys/kern/subr_pool.c8
3 files changed, 10 insertions, 8 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 83989845b69..8e4674cb6bb 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.118 2010/06/30 21:01:45 thib Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.119 2010/07/02 01:25:05 art Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -242,7 +242,9 @@ fork1(struct proc *p1, int exitsig, int flags, void *stack, size_t stacksize,
return (EAGAIN);
}
- uaddr = uvm_km_alloc1(kernel_map, USPACE, USPACE_ALIGN, 1);
+ uaddr = uvm_km_kmemalloc_pla(kernel_map, uvm.kernel_object, USPACE,
+ USPACE_ALIGN, 0, dma_constraint.ucr_low, dma_constraint.ucr_high,
+ 0, 0, USPACE/PAGE_SIZE);
if (uaddr == 0) {
chgproccnt(uid, -1);
nprocs--;
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 68186a63cab..afc39fe6790 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.82 2010/07/01 19:51:13 thib Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.83 2010/07/02 01:25:05 art Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -234,7 +234,7 @@ malloc(unsigned long size, int type, int flags)
allocsize = 1 << indx;
npg = atop(round_page(allocsize));
va = (caddr_t)uvm_km_kmemalloc_pla(kmem_map, NULL,
- (vsize_t)ptoa(npg),
+ (vsize_t)ptoa(npg), 0,
((flags & M_NOWAIT) ? UVM_KMF_NOWAIT : 0) |
((flags & M_CANFAIL) ? UVM_KMF_CANFAIL : 0),
dma_constraint.ucr_low, dma_constraint.ucr_high,
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index edcc2fe1ce8..cd856ea8e68 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.94 2010/06/29 20:39:27 thib Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.95 2010/07/02 01:25:05 art Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -1491,8 +1491,8 @@ pool_large_alloc(struct pool *pp, int flags, int *slowdown)
int s;
s = splvm();
- va = uvm_km_kmemalloc_pla(kmem_map, NULL, pp->pr_alloc->pa_pagesz, kfl,
- pp->pr_crange->ucr_low, pp->pr_crange->ucr_high,
+ va = uvm_km_kmemalloc_pla(kmem_map, NULL, pp->pr_alloc->pa_pagesz, 0,
+ kfl, pp->pr_crange->ucr_low, pp->pr_crange->ucr_high,
0, 0, pp->pr_pa_nsegs);
splx(s);
@@ -1515,7 +1515,7 @@ pool_large_alloc_ni(struct pool *pp, int flags, int *slowdown)
int kfl = (flags & PR_WAITOK) ? 0 : UVM_KMF_NOWAIT;
return ((void *)uvm_km_kmemalloc_pla(kernel_map, uvm.kernel_object,
- pp->pr_alloc->pa_pagesz, kfl,
+ pp->pr_alloc->pa_pagesz, 0, kfl,
pp->pr_crange->ucr_low, pp->pr_crange->ucr_high,
0, 0, pp->pr_pa_nsegs));
}