diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 05:12:19 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 05:12:19 +0000 |
commit | 6fe4222e3408e460e52471a7c77eb6a734d91f2b (patch) | |
tree | 9dd617b4d939e74f383056e84674bca46fdf3dbb /sys/kern | |
parent | 2f5d579dd9378450f2c2f1627bb16331ed82f9e7 (diff) |
kmem allocation changes for uvm
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sys_pipe.c | 23 | ||||
-rw-r--r-- | sys/kern/sys_process.c | 7 |
2 files changed, 27 insertions, 3 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 990fd6b79e4..202046283de 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.9 1999/02/16 21:27:37 art Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.10 1999/02/26 05:12:18 art Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -215,6 +215,12 @@ void pipespace(cpipe) struct pipe *cpipe; { +#if defined(UVM) + cpipe->pipe_buffer.buffer = (caddr_t) uvm_km_valloc(kernel_map, + cpipe->pipe_buffer.size); + if (cpipe->pipe_buffer.buffer == NULL) + panic("pipespace: out of kvm"); +#else int npages, error; npages = round_page(cpipe->pipe_buffer.size)/PAGE_SIZE; @@ -248,6 +254,7 @@ pipespace(cpipe) if (error != KERN_SUCCESS) panic("pipeinit: cannot allocate pipe -- out of kvm -- code = %d", error); +#endif amountpipekva += cpipe->pipe_buffer.size; } @@ -739,9 +746,15 @@ pipe_write(fp, uio, cred) if (wpipe->pipe_buffer.buffer) { amountpipekva -= wpipe->pipe_buffer.size; +#if defined(UVM) + uvm_km_free(kernel_map, + (vm_offset_t)wpipe->pipe_buffer.buffer, + wpipe->pipe_buffer.size); +#else kmem_free(kernel_map, (vm_offset_t)wpipe->pipe_buffer.buffer, wpipe->pipe_buffer.size); +#endif } #ifndef PIPE_NODIRECT @@ -770,7 +783,7 @@ pipe_write(fp, uio, cred) } - if( wpipe->pipe_buffer.buffer == NULL) { + if (wpipe->pipe_buffer.buffer == NULL) { if ((error = pipelock(wpipe,1)) == 0) { pipespace(wpipe); pipeunlock(wpipe); @@ -1113,9 +1126,15 @@ pipeclose(cpipe) if (cpipe->pipe_buffer.size > PIPE_SIZE) --nbigpipe; amountpipekva -= cpipe->pipe_buffer.size; +#if defined(UVM) + uvm_km_free(kernel_map, + (vm_offset_t)cpipe->pipe_buffer.buffer, + cpipe->pipe_buffer.size); +#else kmem_free(kernel_map, (vm_offset_t)cpipe->pipe_buffer.buffer, cpipe->pipe_buffer.size); +#endif } #ifndef PIPE_NODIRECT if (cpipe->pipe_map.kva) { diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 544921f4150..3ef263137e9 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.6 1998/06/27 07:32:13 deraadt Exp $ */ +/* $OpenBSD: sys_process.c,v 1.7 1999/02/26 05:12:18 art Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -64,6 +64,11 @@ #include <sys/mount.h> #include <sys/syscallargs.h> +#if defined(UVM) +#include <vm/vm.h> +#include <uvm/uvm_extern.h> +#endif + #include <machine/reg.h> #include <miscfs/procfs/procfs.h> |