diff options
author | dg <dg@FreeBSD.org> | 1995-02-20 22:23:31 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-02-20 22:23:31 +0000 |
commit | 80d6bd62277e274c458ddf671134238fc6c0bf24 (patch) | |
tree | 843bfeb240cb65cf94c99ad6b5ea3b52fcc7f231 /sys/kern/imgact_gzip.c | |
parent | d59996f398d56d8eb85aa88910c9fd1a1200ecdc (diff) | |
download | FreeBSD-src-80d6bd62277e274c458ddf671134238fc6c0bf24.zip FreeBSD-src-80d6bd62277e274c458ddf671134238fc6c0bf24.tar.gz |
Use of vm_allocate() and vm_deallocate() has been deprecated.
Diffstat (limited to 'sys/kern/imgact_gzip.c')
-rw-r--r-- | sys/kern/imgact_gzip.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c index 4d08c49..3178d10 100644 --- a/sys/kern/imgact_gzip.c +++ b/sys/kern/imgact_gzip.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: imgact_gzip.c,v 1.10 1994/10/22 11:55:16 phk Exp $ + * $Id: imgact_gzip.c,v 1.11 1995/02/13 07:40:33 phk Exp $ * * This module handles execution of a.out files which have been run through * "gzip". This saves diskspace, but wastes cpu-cycles and VM. @@ -109,8 +109,8 @@ exec_gzip_imgact(iparams) if (igz.inbuf) { error2 = - vm_deallocate(kernel_map, (vm_offset_t) igz.inbuf, - PAGE_SIZE); + vm_map_remove(kernel_map, (vm_offset_t) igz.inbuf, + (vm_offset_t) igz.inbuf + PAGE_SIZE); } if (igz.error || error || error2) { printf("Output=%lu ", igz.output); @@ -243,16 +243,18 @@ do_aout_hdr(struct imgact_gzip * gz) gz->where = __LINE__; return (error); } - /* - * Allocate demand-zeroed area for uninitialized data "bss" = 'block - * started by symbol' - named after the IBM 7090 instruction of the - * same name. - */ - vmaddr = gz->virtual_offset + gz->a_out.a_text + gz->a_out.a_data; - error = vm_allocate(&vmspace->vm_map, &vmaddr, gz->bss_size, FALSE); - if (error) { - gz->where = __LINE__; - return (error); + if (gz->bss_size != 0) { + /* + * Allocate demand-zeroed area for uninitialized data "bss" = 'block + * started by symbol' - named after the IBM 7090 instruction of the + * same name. + */ + vmaddr = gz->virtual_offset + gz->a_out.a_text + gz->a_out.a_data; + error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, gz->bss_size, FALSE); + if (error) { + gz->where = __LINE__; + return (error); + } } /* Fill in process VM information */ vmspace->vm_tsize = gz->a_out.a_text >> PAGE_SHIFT; @@ -283,8 +285,8 @@ NextByte(void *vp) return igz->inbuf[(igz->idx++) - igz->offset]; } if (igz->inbuf) { - error = vm_deallocate(kernel_map, - (vm_offset_t) igz->inbuf, PAGE_SIZE); + error = vm_map_remove(kernel_map, (vm_offset_t) igz->inbuf, + (vm_offset_t) igz->inbuf + PAGE_SIZE); if (error) { igz->where = __LINE__; igz->error = error; |