From 1fac2f5107e94102ca643ab9b031030bbcb1daa1 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 20 Jul 2008 17:05:43 +0000 Subject: 2008-07-20 Samuel Thibault * linux/pcmcia-cs/glue/wireless_glue.h (schedule_task): Add parameter to Debugger() call. * kern/lock_mon.c (retry_simple_lock, retry_bit_lock): Likewise. * kern/machine.c (Debugger): Remove declaration. 2008-07-19 Barry deFreese * device/dev_hdr.h (dev_name_lookup, dev_set_indirection): Add prototypes. * device/dev_pager.c: Include . * device/ds_routines.c: Likewise. * device/subrs.c: Likewise. * device/device_init.c: Include . * device/ds_routines.h (iowait): Add prototype. * device/net_io.h (net_kmsg_collect): Add prototype. * device/net_io.c (hash_ent_remove, net_free_dead_infp, net_free_dead_entp, bpf_validate, bpf_eq, net_add_q_info, bpf_match): Add forward declarations. * device/subrs.h: New header. * i386/i386/fpu.h: Include . Change include to . (fp_save, fp_load, fp_free, fpu_module_init, fpu_set_state, fpu_get_state, fpnoextflt, fpextovrflt, fpexterrflt, init_fpu): Add prototypes. * i386/i386/gdt.h (gdt_init): Add prototype. * i386/i386/io_map.c: Include . * vm/vm_kern.c: Likewise. * i386/i386/ktss.h (ktss_init): Add prototype. * i386/i386/ldt.h (ldt_init): Add prototype. * i386/i386/loose_ends.h: New header. * i386/i386/loose_ends.c (delay): Complete prototype. * i386/i386/model_dep.h (startrtclock): Add prototype. * i386/i386/pcb.h (load_context, stack_attach, stack_detach, switch_ktss): Add prototypes. * i386/i386/pic.h (form_pic_mask, picinit): Add prototypes. * i386/i386/pit.c: Include . * i386/i386at/kd_mouse.c: Likewise. * i386/i386/pit.h (clkstart): Add prototype. * i386/i386/trap.c: Include , , . * i386/i386/trap.h (interrupted_pc): Add prototype. * i386/i386/user_ldt.c: Include . * i386/i386at/autoconf.h: New header. * i386/i386at/com.h: New header. * i386/i386at/com.c: Include , . * i386/i386at/idt.h (idt_init): Add prototype. * i386/i386at/int_init.h: New header. * i386/i386at/kd.c: Include . * kern/debug.c: Likewise. * i386/i386at/kd_event.c: Include . * i386/i386at/kd_mouse.c: Likewise. * i386/i386at/kd_mouse.c: Include , . * i386/i386at/lpr.c: Include * i386/i386at/model_dep.c: Include: , , , , , , , , , , . * i386/i386at/rtc.h (readtodc, writetodc): Add prototypes. * i386/intel/pmap.h: Include . (pmap_bootstrap, pmap_unmap_page_zero, pmap_zero_page, pmap_copy_page, kvtophys): Add prototypes. * i386/intel/read_fault.h: New header. * kern/ast.h (ast_init, ast_check): Add prototypes. * kern/debug.c (Debugger): Move prototype to... * kern/debug.h (Debugger): ... here. * kern/eventcount.h (evc_notify_abort): Add prototype. * kern/ipc_mig.c: Include , , * kern/ipc_mig.h: New header. * kern/ipc_tt.h (mach_reply_port): Add prototype. * kern/machine.h: New header. * kern/processor.h (pset_sys_bootstrap): Move prototype outside of MACH_HOST check. * kern/sched_prim.h (thread_bind, compute_priority, thread_timeout_setup): Add prototypes. * kern/startup.c: Include , . * kern/syscall_subr.c: Include . (thread_depress_abort): Remove prototype. * kern/syscall_subr.h: Include , (thread_depress_abort): Add prototype. * kern/syscall_sw.c: Include: . * kern/task.h (consider_task_collect): Add prototype. * kern/thread.c: Include , , . * kern/thread.h (stack_collect): Add prototype. * linux/pcmcia-cs/glue/pcmcia_glue.h (Debugger): Remove prototype. * util/putchar.c: Include . * util/putchar.h: New header. * util/puts.c: Include , . * vm/memory_object.c: Include . (memory_object_data_provided): Move function below memory_object_data_supply definition. * vm/vm_init.c: Include . * vm/vm_kern.h (projected_buffer_in_range): Add prototype. * vm/vm_map.c: Include , . (vm_map_delete, vm_map_copyout_page_list, vm_map_copy_page_discard): Add forward declaration. * vm/vm_map.h (vm_map_copyin_object, vm_map_submap, _vm_map_clip_start, _vm_map_clip_end): Add prototypes. * vm/vm_pageout.c: Include , , . * vm/vm_resident.h: New header. * vm/vm_user.c: Include . * vm/pmap.h (pmap_pageable, pmap_map_bd): Add prototype. --- vm/memory_object.c | 36 +++++++++++++++++++----------------- vm/pmap.h | 22 ++++++++++++++++++++++ vm/vm_init.c | 1 + vm/vm_kern.c | 1 + vm/vm_kern.h | 5 +++++ vm/vm_map.c | 15 +++++++++++++++ vm/vm_map.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ vm/vm_pageout.c | 3 +++ vm/vm_resident.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ vm/vm_user.c | 1 + 10 files changed, 166 insertions(+), 17 deletions(-) create mode 100644 vm/vm_resident.h (limited to 'vm') diff --git a/vm/memory_object.c b/vm/memory_object.c index 6bef2c9a..57dde76b 100644 --- a/vm/memory_object.c +++ b/vm/memory_object.c @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -81,23 +82,6 @@ decl_simple_lock_data(,memory_manager_default_lock) * argument conversion. Explicit deallocation is necessary. */ -/* - * If successful, destroys the map copy object. - */ -kern_return_t memory_object_data_provided(object, offset, data, data_cnt, - lock_value) - vm_object_t object; - vm_offset_t offset; - pointer_t data; - unsigned int data_cnt; - vm_prot_t lock_value; -{ - return memory_object_data_supply(object, offset, (vm_map_copy_t) data, - data_cnt, lock_value, FALSE, IP_NULL, - 0); -} - - kern_return_t memory_object_data_supply(object, offset, data_copy, data_cnt, lock_value, precious, reply_to, reply_to_type) register @@ -323,6 +307,24 @@ retry_lookup: return(result); } + +/* + * If successful, destroys the map copy object. + */ +kern_return_t memory_object_data_provided(object, offset, data, data_cnt, + lock_value) + vm_object_t object; + vm_offset_t offset; + pointer_t data; + unsigned int data_cnt; + vm_prot_t lock_value; +{ + return memory_object_data_supply(object, offset, (vm_map_copy_t) data, + data_cnt, lock_value, FALSE, IP_NULL, + 0); +} + + kern_return_t memory_object_data_error(object, offset, size, error_value) vm_object_t object; vm_offset_t offset; diff --git a/vm/pmap.h b/vm/pmap.h index 66818a10..59fd03ab 100644 --- a/vm/pmap.h +++ b/vm/pmap.h @@ -217,6 +217,28 @@ extern vm_offset_t pmap_grab_page (void); extern boolean_t pmap_valid_page(vm_offset_t x); +/* + * Make the specified pages (by pmap, offset) + * pageable (or not) as requested. + */ +extern void pmap_pageable( + pmap_t pmap, + vm_offset_t start, + vm_offset_t end, + boolean_t pageable); + +/* + * Back-door routine for mapping kernel VM at initialization. + * Useful for mapping memory outside the range + * [phys_first_addr, phys_last_addr) (i.e., devices). + * Otherwise like pmap_map. + */ +extern vm_offset_t pmap_map_bd( + vm_offset_t virt, + vm_offset_t start, + vm_offset_t end, + vm_prot_t prot); + /* * Routines defined as macros. */ diff --git a/vm/vm_init.c b/vm/vm_init.c index b76b11b6..06317ace 100644 --- a/vm/vm_init.c +++ b/vm/vm_init.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/vm/vm_kern.c b/vm/vm_kern.c index bb6c110a..f29a0144 100644 --- a/vm/vm_kern.c +++ b/vm/vm_kern.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/vm/vm_kern.h b/vm/vm_kern.h index 228c26d9..ca93d7a4 100644 --- a/vm/vm_kern.h +++ b/vm/vm_kern.h @@ -77,4 +77,9 @@ extern vm_map_t kernel_map; extern vm_map_t kernel_pageable_map; extern vm_map_t ipc_kernel_map; +extern boolean_t projected_buffer_in_range( + vm_map_t map, + vm_offset_t start, + vm_offset_t end); + #endif /* _VM_VM_KERN_H_ */ diff --git a/vm/vm_map.c b/vm/vm_map.c index 43afe919..260eb5a8 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -42,13 +42,28 @@ #include #include #include +#include #include #include #include #include +#include #include #include +/* Forward declarations */ +kern_return_t vm_map_delete( + vm_map_t map, + vm_offset_t start, + vm_offset_t end); + +kern_return_t vm_map_copyout_page_list( + vm_map_t dst_map, + vm_offset_t *dst_addr, /* OUT */ + vm_map_copy_t copy); + +void vm_map_copy_page_discard (vm_map_copy_t copy); + /* * Macros to copy a vm_map_entry. We must be careful to correctly * manage the wired page count. vm_map_entry_copy() creates a new diff --git a/vm/vm_map.h b/vm/vm_map.h index 40c828a2..8961e1b9 100644 --- a/vm/vm_map.h +++ b/vm/vm_map.h @@ -465,6 +465,42 @@ extern kern_return_t vm_map_pageable_common(vm_map_t, vm_offset_t, */ extern vm_object_t vm_submap_object; +/* + * vm_map_copyin_object: + * + * Create a copy object from an object. + * Our caller donates an object reference. + */ +extern kern_return_t vm_map_copyin_object( + vm_object_t object, + vm_offset_t offset, /* offset of region in object */ + vm_size_t size, /* size of region in object */ + vm_map_copy_t *copy_result); /* OUT */ + +/* + * vm_map_submap: [ kernel use only ] + * + * Mark the given range as handled by a subordinate map. + * + * This range must have been created with vm_map_find using + * the vm_submap_object, and no other operations may have been + * performed on this range prior to calling vm_map_submap. + * + * Only a limited number of operations can be performed + * within this rage after calling vm_map_submap: + * vm_fault + * [Don't try vm_map_copyin!] + * + * To remove a submapping, one must first remove the + * range from the superior map, and then destroy the + * submap (if desired). [Better yet, don't try it.] + */ +extern kern_return_t vm_map_submap( + vm_map_t map, + vm_offset_t start, + vm_offset_t end, + vm_map_t submap); + /* * Wait and wakeup macros for in_transition map entries. */ @@ -477,4 +513,22 @@ extern vm_object_t vm_submap_object; #define vm_map_entry_wakeup(map) thread_wakeup((event_t)&(map)->hdr) +/* + * This routine is called only when it is known that + * the entry must be split. + */ +extern void _vm_map_clip_start( + struct vm_map_header *map_header, + vm_map_entry_t entry, + vm_offset_t start); + +/* + * vm_map_clip_end: [ internal use only ] + * + * Asserts that the given entry ends at or before + * the specified address; if necessary, + * it splits the entry into two. + */ +void _vm_map_clip_end(); + #endif /* _VM_VM_MAP_H_ */ diff --git a/vm/vm_pageout.c b/vm/vm_pageout.c index 6db1cb74..ba3b9ba5 100644 --- a/vm/vm_pageout.c +++ b/vm/vm_pageout.c @@ -34,6 +34,7 @@ * The proverbial page-out daemon. */ +#include #include #include #include @@ -42,12 +43,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include diff --git a/vm/vm_resident.h b/vm/vm_resident.h new file mode 100644 index 00000000..67f1807f --- /dev/null +++ b/vm/vm_resident.h @@ -0,0 +1,45 @@ +/* + * Resident memory management module functions. + * Copyright (C) 2008 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, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Author: Barry deFreese. + */ +/* + * Resident memory management module functions. + * + */ + +#ifndef _VM_RESIDENT_H_ +#define _VM_RESIDENT_H_ + +#include + +/* + * vm_page_replace: + * + * Exactly like vm_page_insert, except that we first + * remove any existing page at the given offset in object + * and we don't do deactivate-behind. + * + * The object and page must be locked. + */ +extern void vm_page_replace ( + register vm_page_t mem, + register vm_object_t object, + register vm_offset_t offset); + +#endif /* _VM_RESIDENT_H_ */ diff --git a/vm/vm_user.c b/vm/vm_user.c index ebe98449..813b100c 100644 --- a/vm/vm_user.c +++ b/vm/vm_user.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3