diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2007-05-05 00:30:31 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:27:09 +0200 |
commit | b10112ec96516939dc3cb5d523807fda2755fb37 (patch) | |
tree | ceffab86c66397428f23266423bc0caddc5a271b /vm | |
parent | 5ccc7791cd3ea06c70af61cf5a580e06b10bcc37 (diff) |
2007-05-05 Thomas Schwinge <tschwinge@gnu.org>
We're not in the eighties anymore. List arguments in function
prototypes and definitions for a lot of symbols. Also drop some unused
prototypes. I refrain from listing every changed symbol.
* vm/memory_object.c: Do as described.
* vm/memory_object.h: Likewise.
* vm/pmap.h: Likewise.
* vm/vm_external.c: Likewise.
* vm/vm_external.h: Likewise.
* vm/vm_fault.c: Likewise.
* vm/vm_fault.h: Likewise.
* vm/vm_kern.h: Likewise.
* vm/vm_map.c: Likewise.
* vm/vm_map.h: Likewise.
* vm/vm_pageout.h: Likewise.
* vm/vm_user.h: Likewise.
* vm/memory_object.h: Include <ipc/ipc_types.h>.
* vm/pmap.h: Include <kern/thread.h>.
* vm/vm_fault.h: Include <mach/vm_prot.h>, <vm/vm_map.h> and
<vm/vm_types.h>.
* vm/vm_map.h: Include <mach/vm_attributes.h> and <vm/vm_types.h>.
(vm_map_t, VM_MAP_NULL): Remove type and definition.
* vm/vm_object.h (vm_object_t, VM_OBJECT_NULL): Remove type and
definition.
* vm/vm_page.h: Include <vm/vm_types.h>.
(vm_page_t, VM_PAGE_NULL): Remove type and definition.
* vm/vm_user.h: Include <mach/std_types.h>.
* kern/task.h: Include <vm/vm_types.h> instead of <vm/vm_map.h>.
* vm/vm_types.h: New file: the above-removed types and definitions.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/memory_object.c | 4 | ||||
-rw-r--r-- | vm/memory_object.h | 14 | ||||
-rw-r--r-- | vm/pmap.h | 97 | ||||
-rw-r--r-- | vm/vm_external.c | 2 | ||||
-rw-r--r-- | vm/vm_external.h | 23 | ||||
-rw-r--r-- | vm/vm_fault.c | 2 | ||||
-rw-r--r-- | vm/vm_fault.h | 26 | ||||
-rw-r--r-- | vm/vm_kern.h | 45 | ||||
-rw-r--r-- | vm/vm_map.c | 2 | ||||
-rw-r--r-- | vm/vm_map.h | 112 | ||||
-rw-r--r-- | vm/vm_object.h | 7 | ||||
-rw-r--r-- | vm/vm_page.h | 5 | ||||
-rw-r--r-- | vm/vm_pageout.h | 5 | ||||
-rw-r--r-- | vm/vm_types.h | 42 | ||||
-rw-r--r-- | vm/vm_user.h | 26 |
15 files changed, 241 insertions, 171 deletions
diff --git a/vm/memory_object.c b/vm/memory_object.c index 009d736..6bef2c9 100644 --- a/vm/memory_object.c +++ b/vm/memory_object.c @@ -1119,7 +1119,7 @@ kern_return_t vm_set_default_memory_manager(host, default_manager) * valid (not IP_NULL or IP_DEAD). */ -ipc_port_t memory_manager_default_reference() +ipc_port_t memory_manager_default_reference(void) { ipc_port_t current_manager; @@ -1172,7 +1172,7 @@ boolean_t memory_manager_default_port(port) return result; } -void memory_manager_default_init() +void memory_manager_default_init(void) { memory_manager_default = IP_NULL; simple_lock_init(&memory_manager_default_lock); diff --git a/vm/memory_object.h b/vm/memory_object.h index bce3f29..ee0c963 100644 --- a/vm/memory_object.h +++ b/vm/memory_object.h @@ -28,16 +28,12 @@ #define _VM_MEMORY_OBJECT_H_ #include <mach/boolean.h> +#include <ipc/ipc_types.h> -/* - * We use "struct ipc_port *" instead of "ipc_port_t" - * to avoid include file circularities. - */ - -extern struct ipc_port *memory_manager_default_reference(); -extern boolean_t memory_manager_default_port(); -extern void memory_manager_default_init(); +extern ipc_port_t memory_manager_default_reference(void); +extern boolean_t memory_manager_default_port(ipc_port_t); +extern void memory_manager_default_init(void); -extern struct ipc_port *memory_manager_default; +extern ipc_port_t memory_manager_default; #endif /* _VM_MEMORY_OBJECT_H_ */ @@ -42,6 +42,7 @@ #include <mach/machine/vm_types.h> #include <mach/vm_prot.h> #include <mach/boolean.h> +#include <kern/thread.h> /* * The following is a description of the interface to the @@ -62,21 +63,15 @@ * but it is not part of the interface. */ -extern vm_offset_t pmap_steal_memory(); /* During VM initialization, - * steal a chunk of memory. - */ -extern unsigned int pmap_free_pages(); /* During VM initialization, - * report remaining unused - * physical pages. - */ -extern void pmap_startup(); /* During VM initialization, - * use remaining physical pages - * to allocate page frames. - */ -extern void pmap_init(); /* Initialization, - * after kernel runs - * in virtual memory. - */ +/* During VM initialization, steal a chunk of memory. */ +extern vm_offset_t pmap_steal_memory(vm_size_t); +/* During VM initialization, report remaining unused physical pages. */ +extern unsigned int pmap_free_pages(void); +/* During VM initialization, use remaining physical pages to allocate page + * frames. */ +extern void pmap_startup(vm_offset_t *, vm_offset_t *); +/* Initialization, after kernel runs in virtual memory. */ +extern void pmap_init(void); #ifndef MACHINE_PAGES /* @@ -95,14 +90,10 @@ extern void pmap_init(); /* Initialization, * However, for best performance pmap_free_pages should be accurate. */ -extern boolean_t pmap_next_page(); /* During VM initialization, - * return the next unused - * physical page. - */ -extern void pmap_virtual_space(); /* During VM initialization, - * report virtual space - * available for the kernel. - */ +/* During VM initialization, return the next unused physical page. */ +extern boolean_t pmap_next_page(vm_offset_t *); +/* During VM initialization, report virtual space available for the kernel. */ +extern void pmap_virtual_space(vm_offset_t *, vm_offset_t *); #endif /* MACHINE_PAGES */ /* @@ -139,12 +130,10 @@ void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) /* * Routines to set up hardware state for physical maps to be used. */ -extern void pmap_activate(); /* Prepare pmap_t to run - * on a given processor. - */ -extern void pmap_deactivate(); /* Release pmap_t from - * use on processor. - */ +/* Prepare pmap_t to run on a given processor. */ +extern void pmap_activate(pmap_t, thread_t, int); +/* Release pmap_t from use on processor. */ +extern void pmap_deactivate(pmap_t, thread_t, int); /* @@ -178,7 +167,6 @@ boolean_t pmap_is_modified(vm_offset_t pa); /* * Statistics routines */ -extern void pmap_statistics(); /* Return statistics */ #ifndef pmap_resident_count extern int pmap_resident_count(); @@ -187,48 +175,37 @@ extern int pmap_resident_count(); /* * Sundry required routines */ -extern vm_offset_t pmap_extract(); /* Return a virtual-to-physical - * mapping, if possible. - */ - -extern boolean_t pmap_access(); /* Is virtual address valid? */ - -extern void pmap_collect(); /* Perform garbage - * collection, if any - */ - -extern void pmap_change_wiring(); /* Specify pageability */ +/* Return a virtual-to-physical mapping, if possible. */ +extern vm_offset_t pmap_extract(pmap_t, vm_offset_t); +/* Is virtual address valid? */ +extern boolean_t pmap_access(); +/* Perform garbage collection, if any. */ +extern void pmap_collect(pmap_t); +/* Specify pageability. */ +extern void pmap_change_wiring(pmap_t, vm_offset_t, boolean_t); #ifndef pmap_phys_address -extern vm_offset_t pmap_phys_address(); /* Transform address - * returned by device - * driver mapping function - * to physical address - * known to this module. - */ +/* Transform address returned by device driver mapping function to physical + * address known to this module. */ +extern vm_offset_t pmap_phys_address(); #endif /* pmap_phys_address */ #ifndef pmap_phys_to_frame -extern int pmap_phys_to_frame(); /* Inverse of - * pmap_phys_address, - * for use by device driver - * mapping function in - * machine-independent - * pseudo-devices. - */ +/* Inverse of pmap_phys_address, for use by device driver mapping function in + * machine-independent pseudo-devices. */ +extern int pmap_phys_to_frame(); #endif /* pmap_phys_to_frame */ /* * Optional routines */ #ifndef pmap_copy -extern void pmap_copy(); /* Copy range of - * mappings, if desired. - */ +/* Copy range of mappings, if desired. */ +extern void pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, + vm_offset_t); #endif /* pmap_copy */ #ifndef pmap_attribute -extern kern_return_t pmap_attribute(); /* Get/Set special - * memory attributes - */ +/* Get/Set special memory attributes. */ +extern kern_return_t pmap_attribute(); #endif /* pmap_attribute */ /* diff --git a/vm/vm_external.c b/vm/vm_external.c index c8079c5..ac47faa 100644 --- a/vm/vm_external.c +++ b/vm/vm_external.c @@ -138,7 +138,7 @@ void vm_external_state_set(e, offset, state) e->existence_map[byte] |= (1 << (bit & 07)); } -void vm_external_module_initialize() +void vm_external_module_initialize(void) { vm_size_t size = (vm_size_t) sizeof(struct vm_external); diff --git a/vm/vm_external.h b/vm/vm_external.h index b263679..55c9e48 100644 --- a/vm/vm_external.h +++ b/vm/vm_external.h @@ -70,20 +70,21 @@ typedef int vm_external_state_t; * Routines exported by this module. */ -extern void vm_external_module_initialize(); - /* Initialize the module */ +/* Initialize the module */ +extern void vm_external_module_initialize(void); +/* Create a vm_external_t */ +extern vm_external_t vm_external_create(vm_offset_t); +/* Destroy one */ +extern void vm_external_destroy(vm_external_t); -extern vm_external_t vm_external_create(); /* Create a vm_external_t */ -extern void vm_external_destroy(); /* Destroy one */ - -extern void vm_external_state_set();/* Set state of a page. */ +/* Set state of a page. */ +extern void vm_external_state_set(vm_external_t, vm_offset_t, + vm_external_state_t); +/* Retrieve the state for a given page, if known. */ #define vm_external_state_get(e,offset) (((e) != VM_EXTERNAL_NULL) ? \ _vm_external_state_get(e, offset) : \ VM_EXTERNAL_STATE_UNKNOWN) - /* Retrieve the state - * for a given page, if known. - */ -extern vm_external_state_t _vm_external_state_get(); - /* HIDDEN routine */ +/* HIDDEN routine */ +extern vm_external_state_t _vm_external_state_get(vm_external_t, vm_offset_t); #endif /* _VM_VM_EXTERNAL_H_ */ diff --git a/vm/vm_fault.c b/vm/vm_fault.c index a09750f..540d74e 100644 --- a/vm/vm_fault.c +++ b/vm/vm_fault.c @@ -105,7 +105,7 @@ extern struct db_watchpoint *db_watchpoint_list; * Purpose: * Initialize our private data structures. */ -void vm_fault_init() +void vm_fault_init(void) { vm_fault_state_zone = zinit(sizeof(vm_fault_state_t), 0, THREAD_MAX * sizeof(vm_fault_state_t), diff --git a/vm/vm_fault.h b/vm/vm_fault.h index 5be18e5..0492ccf 100644 --- a/vm/vm_fault.h +++ b/vm/vm_fault.h @@ -33,6 +33,9 @@ #define _VM_VM_FAULT_H_ #include <mach/kern_return.h> +#include <mach/vm_prot.h> +#include <vm/vm_map.h> +#include <vm/vm_types.h> /* * Page fault handling based on vm_object only. @@ -46,19 +49,24 @@ typedef kern_return_t vm_fault_return_t; #define VM_FAULT_FICTITIOUS_SHORTAGE 4 #define VM_FAULT_MEMORY_ERROR 5 -extern void vm_fault_init(); -extern vm_fault_return_t vm_fault_page(); +extern void vm_fault_init(void); +extern vm_fault_return_t vm_fault_page(vm_object_t, vm_offset_t, vm_prot_t, + boolean_t, boolean_t, vm_prot_t *, + vm_page_t *, vm_page_t *, boolean_t, + void (*)()); -extern void vm_fault_cleanup(); +extern void vm_fault_cleanup(vm_object_t, vm_page_t); /* * Page fault handling based on vm_map (or entries therein) */ -extern kern_return_t vm_fault(); -extern void vm_fault_wire(); -extern void vm_fault_unwire(); +extern kern_return_t vm_fault(vm_map_t, vm_offset_t, vm_prot_t, boolean_t, + boolean_t, void (*)()); +extern void vm_fault_wire(vm_map_t, vm_map_entry_t); +extern void vm_fault_unwire(vm_map_t, vm_map_entry_t); -extern kern_return_t vm_fault_copy(); /* Copy pages from - * one object to another - */ +/* Copy pages from one object to another. */ +extern kern_return_t vm_fault_copy(vm_object_t, vm_offset_t, vm_size_t *, + vm_object_t, vm_offset_t, vm_map_t, + vm_map_version_t *, boolean_t); #endif /* _VM_VM_FAULT_H_ */ diff --git a/vm/vm_kern.h b/vm/vm_kern.h index 3ae4641..228c26d 100644 --- a/vm/vm_kern.h +++ b/vm/vm_kern.h @@ -37,24 +37,41 @@ #include <mach/kern_return.h> #include <vm/vm_map.h> -extern kern_return_t projected_buffer_allocate(); -extern kern_return_t projected_buffer_deallocate(); -extern kern_return_t projected_buffer_map(); -extern kern_return_t projected_buffer_collect(); +extern kern_return_t projected_buffer_allocate(vm_map_t, vm_size_t, int, + vm_offset_t *, vm_offset_t *, + vm_prot_t, vm_inherit_t); +extern kern_return_t projected_buffer_deallocate(vm_map_t, vm_offset_t, + vm_offset_t); +extern kern_return_t projected_buffer_map(vm_map_t, vm_offset_t, vm_size_t, + vm_offset_t *, vm_prot_t, + vm_inherit_t); +extern kern_return_t projected_buffer_collect(vm_map_t); -extern void kmem_init(); +extern void kmem_init(vm_offset_t, vm_offset_t); -extern kern_return_t kmem_alloc(); -extern kern_return_t kmem_alloc_pageable(); -extern kern_return_t kmem_alloc_wired(); -extern kern_return_t kmem_alloc_aligned(); -extern kern_return_t kmem_realloc(); -extern void kmem_free(); +extern kern_return_t kmem_alloc(vm_map_t, vm_offset_t *, vm_size_t); +extern kern_return_t kmem_alloc_pageable(vm_map_t, vm_offset_t *, + vm_size_t); +extern kern_return_t kmem_alloc_wired(vm_map_t, vm_offset_t *, vm_size_t); +extern kern_return_t kmem_alloc_aligned(vm_map_t, vm_offset_t *, vm_size_t); +extern kern_return_t kmem_realloc(vm_map_t, vm_offset_t, vm_size_t, + vm_offset_t *, vm_size_t); +extern void kmem_free(vm_map_t, vm_offset_t, vm_size_t); -extern vm_map_t kmem_suballoc(); +extern vm_map_t kmem_suballoc(vm_map_t, vm_offset_t *, vm_offset_t *, + vm_size_t, boolean_t); -extern kern_return_t kmem_io_map_copyout(); -extern void kmem_io_map_deallocate(); +extern kern_return_t kmem_io_map_copyout(vm_map_t, vm_offset_t *, + vm_offset_t *, vm_size_t *, + vm_map_copy_t, vm_size_t); +extern void kmem_io_map_deallocate(vm_map_t, vm_offset_t, + vm_size_t); + +extern int +copyinmap (vm_map_t map, char *fromaddr, char *toaddr, int length); + +extern int +copyoutmap (vm_map_t map, char *fromaddr, char *toaddr, int length); extern vm_map_t kernel_map; extern vm_map_t kernel_pageable_map; diff --git a/vm/vm_map.c b/vm/vm_map.c index 79b1283..54c7470 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -156,7 +156,7 @@ vm_offset_t kentry_data; vm_size_t kentry_data_size; int kentry_count = 256; /* to init kentry_data_size */ -void vm_map_init() +void vm_map_init(void) { vm_map_zone = zinit((vm_size_t) sizeof(struct vm_map), 0, 40*1024, PAGE_SIZE, 0, "maps"); diff --git a/vm/vm_map.h b/vm/vm_map.h index af85ef9..25c0065 100644 --- a/vm/vm_map.h +++ b/vm/vm_map.h @@ -43,18 +43,19 @@ #include <mach/kern_return.h> #include <mach/boolean.h> #include <mach/machine/vm_types.h> +#include <mach/vm_attributes.h> #include <mach/vm_prot.h> #include <mach/vm_inherit.h> #include <vm/pmap.h> #include <vm/vm_object.h> #include <vm/vm_page.h> +#include <vm/vm_types.h> #include <kern/lock.h> #include <kern/macro_help.h> /* * Types defined: * - * vm_map_t the high-level address map data structure. * vm_map_entry_t an entry in an address map. * vm_map_version_t a timestamp of a map, for use with vm_map_lookup * vm_map_copy_t represents memory copied from an address map, @@ -171,9 +172,6 @@ struct vm_map { boolean_t wiring_required;/* All memory wired? */ unsigned int timestamp; /* Version number */ }; -typedef struct vm_map *vm_map_t; - -#define VM_MAP_NULL ((vm_map_t) 0) #define vm_map_to_entry(map) ((struct vm_map_entry *) &(map)->hdr.links) #define vm_map_first_entry(map) ((map)->hdr.links.next) @@ -356,43 +354,73 @@ MACRO_END extern vm_offset_t kentry_data; extern vm_offset_t kentry_data_size; extern int kentry_count; -extern void vm_map_init(); /* Initialize the module */ - -extern vm_map_t vm_map_create(); /* Create an empty map */ -extern vm_map_t vm_map_fork(); /* Create a map in the image - * of an existing map */ - -extern void vm_map_reference(); /* Gain a reference to - * an existing map */ -extern void vm_map_deallocate(); /* Lose a reference */ - -extern kern_return_t vm_map_enter(); /* Enter a mapping */ -extern kern_return_t vm_map_find_entry(); /* Enter a mapping primitive */ -extern kern_return_t vm_map_remove(); /* Deallocate a region */ -extern kern_return_t vm_map_protect(); /* Change protection */ -extern kern_return_t vm_map_inherit(); /* Change inheritance */ - -extern void vm_map_print(); /* Debugging: print a map */ - -extern kern_return_t vm_map_lookup(); /* Look up an address */ -extern boolean_t vm_map_verify(); /* Verify that a previous - * lookup is still valid */ +/* Initialize the module */ +extern void vm_map_init(void); + +/* Create an empty map */ +extern vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t, + boolean_t); +/* Create a map in the image of an existing map */ +extern vm_map_t vm_map_fork(vm_map_t); + +/* Gain a reference to an existing map */ +extern void vm_map_reference(vm_map_t); +/* Lose a reference */ +extern void vm_map_deallocate(vm_map_t); + +/* Enter a mapping */ +extern kern_return_t vm_map_enter(vm_map_t, vm_offset_t *, vm_size_t, + vm_offset_t, boolean_t, vm_object_t, + vm_offset_t, boolean_t, vm_prot_t, + vm_prot_t, vm_inherit_t); +/* Enter a mapping primitive */ +extern kern_return_t vm_map_find_entry(vm_map_t, vm_offset_t *, vm_size_t, + vm_offset_t, vm_object_t, + vm_map_entry_t *); +/* Deallocate a region */ +extern kern_return_t vm_map_remove(vm_map_t, vm_offset_t, vm_offset_t); +/* Change protection */ +extern kern_return_t vm_map_protect(vm_map_t, vm_offset_t, vm_offset_t, + vm_prot_t, boolean_t); +/* Change inheritance */ +extern kern_return_t vm_map_inherit(vm_map_t, vm_offset_t, vm_offset_t, + vm_inherit_t); + +/* Debugging: print a map */ +extern void vm_map_print(vm_map_t); + +/* Look up an address */ +extern kern_return_t vm_map_lookup(vm_map_t *, vm_offset_t, vm_prot_t, + vm_map_version_t *, vm_object_t *, + vm_offset_t *, vm_prot_t *, boolean_t *); +/* Verify that a previous lookup is still valid */ +extern boolean_t vm_map_verify(vm_map_t, vm_map_version_t *); /* vm_map_verify_done is now a macro -- see below */ -extern kern_return_t vm_map_copyin(); /* Make a copy of a region */ -extern kern_return_t vm_map_copyin_page_list();/* Make a copy of a region - * using a page list copy */ -extern kern_return_t vm_map_copyout(); /* Place a copy into a map */ -extern kern_return_t vm_map_copy_overwrite();/* Overwrite existing memory - * with a copy */ -extern void vm_map_copy_discard(); /* Discard a copy without - * using it */ -extern kern_return_t vm_map_copy_discard_cont();/* Page list continuation - * version of previous */ - -extern kern_return_t vm_map_machine_attribute(); - /* Add or remove machine- - dependent attributes from - map regions */ +/* Make a copy of a region */ +extern kern_return_t vm_map_copyin(vm_map_t, vm_offset_t, vm_size_t, + boolean_t, vm_map_copy_t *); +/* Make a copy of a region using a page list copy */ +extern kern_return_t vm_map_copyin_page_list(vm_map_t, vm_offset_t, + vm_size_t, boolean_t, + boolean_t, vm_map_copy_t *, + boolean_t); +/* Place a copy into a map */ +extern kern_return_t vm_map_copyout(vm_map_t, vm_offset_t *, vm_map_copy_t); +/* Overwrite existing memory with a copy */ +extern kern_return_t vm_map_copy_overwrite(vm_map_t, vm_offset_t, + vm_map_copy_t, boolean_t); +/* Discard a copy without using it */ +extern void vm_map_copy_discard(vm_map_copy_t); +extern vm_map_copy_t vm_map_copy_copy(vm_map_copy_t); +/* Page list continuation version of previous */ +extern kern_return_t vm_map_copy_discard_cont(vm_map_copyin_args_t, + vm_map_copy_t *); + +/* Add or remove machine- dependent attributes from map regions */ +extern kern_return_t vm_map_machine_attribute(vm_map_t, vm_offset_t, + vm_size_t, + vm_machine_attribute_t, + vm_machine_attribute_val_t *); /* * Functions implemented as macros @@ -415,7 +443,9 @@ extern kern_return_t vm_map_machine_attribute(); /* * Pageability functions. Includes macro to preserve old interface. */ -extern kern_return_t vm_map_pageable_common(); +extern kern_return_t vm_map_pageable_common(vm_map_t, vm_offset_t, + vm_offset_t, vm_prot_t, + boolean_t); #define vm_map_pageable(map, s, e, access) \ vm_map_pageable_common(map, s, e, access, FALSE) diff --git a/vm/vm_object.h b/vm/vm_object.h index c5efd67..7473289 100644 --- a/vm/vm_object.h +++ b/vm/vm_object.h @@ -55,10 +55,6 @@ typedef struct ipc_port * pager_request_t; #define PAGER_REQUEST_NULL ((pager_request_t) 0) /* - * Types defined: - * - * vm_object_t Virtual memory object. - * * We use "struct ipc_port *" instead of "ipc_port_t" * to avoid include file circularities. */ @@ -162,9 +158,6 @@ struct vm_object { #endif /* MACH_PAGEMAP */ }; -typedef struct vm_object *vm_object_t; -#define VM_OBJECT_NULL ((vm_object_t) 0) - extern vm_object_t kernel_object; /* the single kernel object */ diff --git a/vm/vm_page.h b/vm/vm_page.h index ca76e93..f13b0af 100644 --- a/vm/vm_page.h +++ b/vm/vm_page.h @@ -38,6 +38,7 @@ #include <mach/vm_prot.h> #include <mach/vm_param.h> #include <vm/vm_object.h> +#include <vm/vm_types.h> #include <kern/queue.h> #include <kern/lock.h> #include <kern/zalloc.h> @@ -123,10 +124,6 @@ struct vm_page { vm_prot_t unlock_request; /* Outstanding unlock request (O) */ }; -typedef struct vm_page *vm_page_t; - -#define VM_PAGE_NULL ((vm_page_t) 0) - /* * For debugging, this macro can be defined to perform * some useful check on a page structure. diff --git a/vm/vm_pageout.h b/vm/vm_pageout.h index 946c68b..d41ee30 100644 --- a/vm/vm_pageout.h +++ b/vm/vm_pageout.h @@ -40,7 +40,8 @@ * Exported routines. */ -extern vm_page_t vm_pageout_setup(); -extern void vm_pageout_page(); +extern vm_page_t vm_pageout_setup(vm_page_t, vm_offset_t, vm_object_t, + vm_offset_t, boolean_t); +extern void vm_pageout_page(vm_page_t, boolean_t, boolean_t); #endif /* _VM_VM_PAGEOUT_H_ */ diff --git a/vm/vm_types.h b/vm/vm_types.h new file mode 100644 index 0000000..f64ebee --- /dev/null +++ b/vm/vm_types.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Written by Thomas Schwinge. + */ + +#ifndef VM_VM_TYPES_H +#define VM_VM_TYPES_H + +/* + * Types defined: + * + * vm_map_t the high-level address map data structure. + * vm_object_t Virtual memory object. + * vm_page_t See `vm/vm_page.h'. + */ + +typedef struct vm_map *vm_map_t; +#define VM_MAP_NULL ((vm_map_t) 0) + +typedef struct vm_object *vm_object_t; +#define VM_OBJECT_NULL ((vm_object_t) 0) + +typedef struct vm_page *vm_page_t; +#define VM_PAGE_NULL ((vm_page_t) 0) + + +#endif /* VM_VM_TYPES_H */ diff --git a/vm/vm_user.h b/vm/vm_user.h index 85fc6a5..3f15e5e 100644 --- a/vm/vm_user.h +++ b/vm/vm_user.h @@ -36,15 +36,23 @@ #define _VM_VM_USER_H_ #include <mach/kern_return.h> +#include <mach/std_types.h> -extern kern_return_t vm_allocate(); -extern kern_return_t vm_deallocate(); -extern kern_return_t vm_inherit(); -extern kern_return_t vm_protect(); -extern kern_return_t vm_statistics(); -extern kern_return_t vm_read(); -extern kern_return_t vm_write(); -extern kern_return_t vm_copy(); -extern kern_return_t vm_map(); +extern kern_return_t vm_allocate(vm_map_t, vm_offset_t *, vm_size_t, + boolean_t); +extern kern_return_t vm_deallocate(vm_map_t, vm_offset_t, vm_size_t); +extern kern_return_t vm_inherit(vm_map_t, vm_offset_t, vm_size_t, + vm_inherit_t); +extern kern_return_t vm_protect(vm_map_t, vm_offset_t, vm_size_t, boolean_t, + vm_prot_t); +extern kern_return_t vm_statistics(vm_map_t, vm_statistics_data_t *); +extern kern_return_t vm_read(vm_map_t, vm_address_t, vm_size_t, pointer_t *, + vm_size_t *); +extern kern_return_t vm_write(vm_map_t, vm_address_t, pointer_t, vm_size_t); +extern kern_return_t vm_copy(vm_map_t, vm_address_t, vm_size_t, + vm_address_t); +extern kern_return_t vm_map(vm_map_t, vm_offset_t *, vm_size_t, vm_offset_t, + boolean_t, ipc_port_t, vm_offset_t, boolean_t, + vm_prot_t, vm_prot_t, vm_inherit_t); #endif /* _VM_VM_USER_H_ */ |