From 9dd94bc684d3e240d8ae5cf6676afbb1e5c1d69b Mon Sep 17 00:00:00 2001 From: mycroft Date: Sat, 8 Jan 1994 05:26:10 +0000 Subject: [PATCH] Still more prototypes. --- sys/vm/vm_kern.c | 30 +++++++++++++++++++----------- sys/vm/vm_kern.h | 26 +++++++++++++------------- sys/vm/vm_map.h | 19 +++++++------------ 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 3a8facec5c4c..c0bc70df6a5d 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_kern.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_kern.c,v 1.9 1994/01/08 04:17:31 mycroft Exp $ + * $Id: vm_kern.c,v 1.10 1994/01/08 05:26:10 mycroft Exp $ * * * Copyright (c) 1987, 1990 Carnegie-Mellon University. @@ -81,8 +81,8 @@ * Allocate pageable memory to the kernel's address map. * map must be "kernel_map" below. */ - -vm_offset_t kmem_alloc_pageable(map, size) +vm_offset_t +kmem_alloc_pageable(map, size) vm_map_t map; register vm_size_t size; { @@ -115,7 +115,8 @@ vm_offset_t kmem_alloc_pageable(map, size) * Allocate wired-down memory in the kernel's address map * or a submap. */ -vm_offset_t kmem_alloc(map, size) +vm_offset_t +kmem_alloc(map, size) register vm_map_t map; register vm_size_t size; { @@ -220,7 +221,8 @@ vm_offset_t kmem_alloc(map, size) * with kmem_alloc, and return the physical pages * associated with that region. */ -void kmem_free(map, addr, size) +void +kmem_free(map, addr, size) vm_map_t map; register vm_offset_t addr; vm_size_t size; @@ -248,7 +250,8 @@ void kmem_free(map, addr, size) * min, max Returned endpoints of map * pageable Can the region be paged */ -vm_map_t kmem_suballoc(parent, min, max, size, pageable) +vm_map_t +kmem_suballoc(parent, min, max, size, pageable) register vm_map_t parent; vm_offset_t *min, *max; register vm_size_t size; @@ -300,7 +303,8 @@ vm_map_t kmem_suballoc(parent, min, max, size, pageable) * * Returns new destination address or 0 (if a failure occurs). */ -vm_offset_t vm_move(src_map,src_addr,dst_map,num_bytes,src_dealloc) +vm_offset_t +vm_move(src_map,src_addr,dst_map,num_bytes,src_dealloc) vm_map_t src_map; register vm_offset_t src_addr; register vm_map_t dst_map; @@ -495,7 +499,8 @@ kmem_malloc(map, size, canwait) * has no room, the caller sleeps waiting for more memory in the submap. * */ -vm_offset_t kmem_alloc_wait(map, size) +vm_offset_t +kmem_alloc_wait(map, size) vm_map_t map; vm_size_t size; { @@ -546,7 +551,8 @@ thread_wakeup(&vm_pages_needed); /* XXX */ * has no room, the caller sleeps waiting for more memory in the submap. * */ -vm_offset_t kmem_alloc_wired_wait(map, size) +vm_offset_t +kmem_alloc_wired_wait(map, size) vm_map_t map; vm_size_t size; { @@ -596,7 +602,8 @@ thread_wakeup(&vm_pages_needed); /* XXX */ * Returns memory to a submap of the kernel, and wakes up any threads * waiting for memory in that map. */ -void kmem_free_wakeup(map, addr, size) +void +kmem_free_wakeup(map, addr, size) vm_map_t map; vm_offset_t addr; vm_size_t size; @@ -614,7 +621,8 @@ void kmem_free_wakeup(map, addr, size) * Initialize the kernel's virtual memory map, taking * into account all memory allocated up to this time. */ -void kmem_init(start, end) +void +kmem_init(start, end) vm_offset_t start; vm_offset_t end; { diff --git a/sys/vm/vm_kern.h b/sys/vm/vm_kern.h index c37a402db7fb..bd5b1098540a 100644 --- a/sys/vm/vm_kern.h +++ b/sys/vm/vm_kern.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_kern.h 7.2 (Berkeley) 4/21/91 - * $Id: vm_kern.h,v 1.4 1993/07/07 06:04:13 cgd Exp $ + * $Id: vm_kern.h,v 1.5 1994/01/08 05:26:13 mycroft Exp $ * * * Copyright (c) 1987, 1990 Carnegie-Mellon University. @@ -67,19 +67,19 @@ #define _VM_VM_KERN_H_ /* - * Kernel memory management definitions. + * Kernel memory management functions. */ - -void kmem_init(); -vm_offset_t kmem_alloc(); -vm_offset_t kmem_alloc_pageable(); -void kmem_free(); -vm_map_t kmem_suballoc(); - -vm_offset_t vm_move(); - -vm_offset_t kmem_alloc_wait(); -void kmem_free_wakeup(); +vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t)); +vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t)); +void kmem_free __P((vm_map_t, vm_offset_t, vm_size_t)); +vm_map_t kmem_suballoc + __P((vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t, + boolean_t)); +vm_offset_t kmem_malloc __P((vm_map_t, vm_size_t, boolean_t)); +vm_offset_t kmem_alloc_wait __P((vm_map_t, vm_size_t)); +vm_offset_t kmem_alloc_wired_wait __P((vm_map_t, vm_size_t)); +void kmem_free_wakeup __P((vm_map_t, vm_offset_t, vm_size_t)); +void kmem_init __P((vm_offset_t, vm_offset_t)); vm_map_t kernel_map; vm_map_t mb_map; diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index dfb4f2050516..7c3abedd8092 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_map.h 7.3 (Berkeley) 4/21/91 - * $Id: vm_map.h,v 1.5 1994/01/08 01:11:29 mycroft Exp $ + * $Id: vm_map.h,v 1.6 1994/01/08 05:26:14 mycroft Exp $ * * * Copyright (c) 1987, 1990 Carnegie-Mellon University. @@ -160,17 +160,6 @@ typedef struct { int share_timestamp; } vm_map_version_t; -/* - * Macros: vm_map_lock, etc. - * Function: - * Perform locking on the data portion of a map. - */ - -#define vm_map_lock(map) { lock_write(&(map)->lock); (map)->timestamp++; } -#define vm_map_unlock(map) lock_write_done(&(map)->lock) -#define vm_map_lock_read(map) lock_read(&(map)->lock) -#define vm_map_unlock_read(map) lock_read_done(&(map)->lock) - /* * Exported procedures that operate on vm_map_t. */ @@ -181,6 +170,7 @@ int vm_map_copy vm_offset_t, boolean_t, boolean_t)); vm_map_t vm_map_create __P((pmap_t, vm_offset_t, vm_offset_t, boolean_t)); +void vm_map_deallocate __P((vm_map_t)); int vm_map_delete __P((vm_map_t, vm_offset_t, vm_offset_t)); int vm_map_find __P((vm_map_t, vm_object_t, vm_offset_t, vm_offset_t *, @@ -215,6 +205,11 @@ int vm_map_submap /* * Functions implemented as macros */ +#define vm_map_lock(map) { lock_write(&(map)->lock); (map)->timestamp++; } +#define vm_map_unlock(map) lock_write_done(&(map)->lock) +#define vm_map_lock_read(map) lock_read(&(map)->lock) +#define vm_map_unlock_read(map) lock_read_done(&(map)->lock) + #define vm_map_min(map) ((map)->min_offset) #define vm_map_max(map) ((map)->max_offset) #define vm_map_pmap(map) ((map)->pmap)