diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-06 13:36:53 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-06 13:36:53 +0000 |
commit | dce408d18a14842aa7836a626a151e98665f04e7 (patch) | |
tree | a3ddb948fd94211a9af9df05d8de6c60a2081605 /sys/uvm/uvm_unix.c | |
parent | 789e8c48d1472795faa6a959068b32a1749b315d (diff) |
More sync to NetBSD.
- Use malloc/free instead of MALLOC/FREE for variable sized allocations.
- Move the memory inheritance code to sys/mman.h and rename from VM_* to MAP_*
- various cleanups and simplifications.
Diffstat (limited to 'sys/uvm/uvm_unix.c')
-rw-r--r-- | sys/uvm/uvm_unix.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/uvm/uvm_unix.c b/sys/uvm/uvm_unix.c index 69c8dc5210b..1cccce72d29 100644 --- a/sys/uvm/uvm_unix.c +++ b/sys/uvm/uvm_unix.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uvm_unix.c,v 1.14 2001/11/06 01:35:04 art Exp $ */ -/* $NetBSD: uvm_unix.c,v 1.13 2000/06/27 17:29:36 mrg Exp $ */ +/* $OpenBSD: uvm_unix.c,v 1.15 2001/11/06 13:36:52 art Exp $ */ +/* $NetBSD: uvm_unix.c,v 1.17 2000/09/07 05:01:43 chs Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -77,8 +77,8 @@ sys_obreak(p, v, retval) } */ *uap = v; struct vmspace *vm = p->p_vmspace; vaddr_t new, old; + ssize_t diff; int rv; - long diff; old = (vaddr_t)vm->vm_daddr; new = round_page((vaddr_t)SCARG(uap, nsize)); @@ -197,12 +197,13 @@ uvm_coredump(p, vp, cred, chdr) struct vmspace *vm = p->p_vmspace; vm_map_t map = &vm->vm_map; vm_map_entry_t entry; - vaddr_t start, end; + vaddr_t start, end, maxstack; struct coreseg cseg; off_t offset; int flag, error = 0; offset = chdr->c_hdrsize + chdr->c_seghdrsize + chdr->c_cpusize; + maxstack = trunc_page(USRSTACK - ctob(vm->vm_ssize)); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -253,7 +254,7 @@ uvm_coredump(p, vp, cred, chdr) offset += chdr->c_seghdrsize; error = vn_rdwr(UIO_WRITE, vp, - (caddr_t)cseg.c_addr, (int)cseg.c_size, + (caddr_t)(u_long)cseg.c_addr, (int)cseg.c_size, offset, UIO_USERSPACE, IO_NODELOCKED|IO_UNIT, cred, NULL, p); if (error) |