summaryrefslogtreecommitdiff
path: root/vm
AgeCommit message (Collapse)Author
2014-02-04Fix potential NULL dereferenceSamuel Thibault
* vm/vm_kern.c (projected_buffer_deallocate): Look for `map' being NULL or kernel_map before locking it.
2014-01-16vm: remove the declaration of memory_object_create_proxyJustus Winter
It is not clear to me why the declaration was put there in the first place. It is not used anywhere, and it conflicts with the declaration generated by mig. * vm/memory_object_proxy.h (memory_object_create_proxy): Remove declaration.
2014-01-03vm: reduce the size of struct vm_pageJustus Winter
Previously, the bit field left 31 bits unused. By reducing the size of wire_count by one bit, the size of the whole struct is reduced by four bytes. * vm/vm_page.h (struct vm_page): Reduce the size of wire_count to 15 bits.
2014-01-03vm: merge the two bit fields in struct vm_pageJustus Winter
* vm/vm_page.h (struct vm_page): Merge the two bit fields.
2014-01-03vm: remove NS32000-specific padding from struct vm_pageJustus Winter
Apparently, the NS32000 was a 32-bit CPU from the 1990ies. The string "ns32000" appears nowhere else in the source. * vm/vm_page.h (struct vm_page): Remove NS32000-specific padding.
2013-12-20Declare void argument lists (part 2)Marin Ramesa
Declare void argument lists that were not declared in the first part of this patch and * kern/sched_prim.h (recompute_priorities): Fix prototype. * kern/startup.c (setup_main) (recompute_priorities): Fix call.
2013-12-17Mark functions that don't return with attribute noreturnMarin Ramesa
2013-12-17vm: qualify pointers whose dereferenced values are constant with constMarin Ramesa
2013-12-15vm/vm_resident.c (vm_page_print): remove unnecessary castsMarin Ramesa
Members offset and phys_addr are of vm_offset_t types. * vm/vm_resident.c (vm_page_print) (offset, phys_addr): Remove unnecessary casts.
2013-12-15vm/vm_kern.c (kmem_submap): remove unnecessary castMarin Ramesa
The return value from vm_map_min() is already of vm_offset_t type. * vm/vm_kern.c (kmem_submap) (addr): Remove unnecessary cast.
2013-12-15Declare void argument listsMarin Ramesa
2013-12-11Cleanup of the memcpy(), memmove(), memcmp() and memset() callsMarin Ramesa
Addresses were cast to (void *). Pointers uncasted. * device/ds_routines.c (ds_read_done) (memset) (start_sent): Cast to (void *) instead to (char *). Argument is an address. (ds_read_done) (memset) (end_data): Likewise. * i386/i386/pcb.c (thread_getstatus) (memcpy) (pm): Don't cast. Argument is a pointer. (thread_getstatus) (memcpy) (iopb): Likewise. * i386/i386at/immc.c (immc_cnputc) (memmove): Cast first argument to (void *). Argument is an address. (immc_cnputc) (memmove): Cast second argument to (void *). Argument is an address. (immc_cnputc) (memset): Cast first argument to (void *). Argument is an address. * i386/i386at/model_dep.c (i386at_init) (memcpy) (phystokv): Cast to (void *) instead to (char *). Argument is an address. * i386/intel/pmap.c (pmap_init) (memset) (addr): Likewise. * ipc/mach_debug.c (mach_port_space_info) (memset) (table_addr + size_used): Likewise. (mach_port_space_info) (memset) (tree_addr + size_used): Likewise. * kern/host.c (host_processor_sets) (memcpy) (newaddr): Likewise. (host_processor_sets) (memcpy) (addr): Likewise. * kern/xpr.c (xprbootstrap) (memset) (addr): Likewise. * vm/vm_debug.c (mach_vm_object_pages) (memset) (addr + size_used): Likewise.
2013-12-09vm/vm_map.c: use boolean instead of an intMarin Ramesa
* vm/vm_map.c (vm_map_pmap_enter_print, vm_map_pmap_enter_enable): Use boolean instead of an int.
2013-12-09vm/vm_object.c: remove unused variableMarin Ramesa
* vm/vm_object.c (vm_object_terminate_remove_all): Remove unused variable.
2013-12-09vm/vm_pageout.c: remove forward declarationsMarin Ramesa
* vm/vm_pageout.c (vm_pageout_continue, vm_pageout_scan_continue): Remove forward declarations. * vm/vm_pageout.h (vm_pageout_continue, vm_pageout_scan_continue): Add prototypes.
2013-12-09Cleanup of the prototypesMarin Ramesa
* device/cirbuf.h (nqdb): Remove prototype without definition. * device/conf.h (dev_set_indirect): Likewise. * kern/boot_script.h (boot_script_read_file): Likewise. * kern/eventcount.h (evc_notify_abort): Remove duplicate prototype. * kern/thread.h (thread_set_own_priority): Likewise. * kern/thread_swap.h (thread_swapout): Remove prototype without definition. * kern/timer.h (softclock): Remove duplicate prototype. * vm/pmap.h (pmap_resident_count, pmap_access, pmap_phys_address, pmap_phys_to_frame): Remove prototypes without function definition. * vm/vm_page.h (vm_set_page_size): Likewise.
2013-12-09vm/vm_page.h: remove unused variablesMarin Ramesa
* vm/vm_page.h (first_phys_addr, last_phys_addr): Remove unused variables.
2013-12-05vm/vm_user.c: remove forward declarationMarin Ramesa
* vm/vm_user.c (vm_map_machine_attribute): Remove forward declaration.
2013-12-05vm/vm_resident.c: correct commentMarin Ramesa
This is vm_resident.c, not vm_page.c. * vm/vm_resident.c: Correct comment.
2013-12-05vm/vm_map.c: remove forward declarationsMarin Ramesa
* vm/vm_map.c (_vm_map_clip_start, _vm_map_copy_clip_start, _vm_map_clip_end, _vm_map_copy_clip_end): Remove forward declarations. * vm/vm_map.h (_vm_map_clip_end): Correct prototype.
2013-12-05vm/vm_kern.c: remove forward declarationsMarin Ramesa
* vm/vm_kern.c (kmem_alloc_pages, kmem_remap_pages): Remove forward declarations. * vm/vm_kern.h (kmem_alloc_pages, kmem_remap_pages): Add prototypes.
2013-12-05vm/vm_fault.c: remove forward declarationMarin Ramesa
* vm/vm_fault.c (vm_fault_wire_fast): Remove forward declaration. * vm/vm_fault.h (vm_fault_wire_fast): Add prototype.
2013-12-05kern/startup.c: remove forward declarationsMarin Ramesa
* Makefrag.am: Include kern/bootstrap.h. Include vm/vm_init.h. Include device/device_init.h. * device/device_init.h: New file. Add copyright. [_DEVICE_DEVICE_INIT_H_]: Add ifndef. (device_service_create): Add prototype. * i386/i386/mp_desc.h (start_other_cpus): Add prototype. * kern/bootstrap.h: New file. Add copyright. [_KERN_BOOTSTRAP_H_]: Add ifndef. (bootstrap_create): Add prototype. * kern/sched_prim.h (idle_thread, sched_thread): Add prototypes. * kern/startup.c: Include kern/bootstrap.h. Include kern/startup.h. Include vm/vm_init.h. Include vm/vm_pageout.h. Include device/device_init.h. (vm_mem_init, vm_mem_bootstrap, init_timeout, machine_init, idle_thread, vm_pageout, reaper_thread, swapin_thread, sched_thread, bootstrap_create, device_service_create, cpu_launch_first_thread, start_kernel_threads, start_other_cpus, action_thread): Remove forward declarations. [NCPUS > 1] Include machine/mp_desc.h and kern/machine.h. * kern/startup.h: Include kern/thread.h. (cpu_launch_first_thread, start_kernel_threads): Add prototypes. * vm/vm_init.h: New file. Add copyright. [_VM_VM_INIT_H_]: Add ifndef. (vm_mem_init, vm_mem_bootstrap): Add prototypes. * vm/vm_pageout.h (vm_pageout): Add prototype.
2013-11-24vm: move forward declarations into a header fileMarin Ramesa
* vm/vm_map.c (vm_map_delete, vm_map_copyout_page_list, vm_map_copy_page_discard, vm_map_lookup_entry): Remove forward declarations. * vm/vm_map.h (vm_map_delete, vm_map_copyout_page_list, vm_map_copy_page_discard, vm_map_lookup_entry): Add prototypes.
2013-11-24vm: move forward declarations into a header fileMarin Ramesa
* vm/vm_object.c (memory_object_release, vm_object_deactivate_pages, vm_object_copy_delayed): Remove forward declarations. * vm/vm_object.h (memory_object_release, vm_object_deactivate_pages, vm_object_copy_delayed): Add prototypes.
2013-11-24Remove leftover register qualifiersMarin Ramesa
* ddb/db_break.c: Remove register qualifiers. * i386/i386/pcb.c: Likewise. * i386/i386at/com.c: Likewise. * i386/i386at/lpr.c: Likewise. * i386/intel/pmap.c: Likewise. * kern/machine.c: Likewise. * kern/queue.h: Likewise. * kern/sched_prim.c: Likewise. * kern/sched_prim.h: Likewise. * kern/timer.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_resident.h: Likewise.
2013-11-19Add copyrightMarin Ramesa
* ddb/db_write_cmd.h: Add copyright. * ipc/ipc_print.h: Likewise. * vm/vm_print.h: Likewise.
2013-11-15i386/i386/vm_tuning.h: remove fileMarin Ramesa
* i386/Makefrag.am: Remove i386/i386/vm_tuning.h. * i386/i386/vm_tuning.h: Remove file. * vm/vm_pageout.c: Don't include i386/i386/vm_tuning.h.
2013-11-15vm/vm_user.c: remove register qualifiersMarin Ramesa
* vm/vm_user.c: Remove register qualifiers.
2013-11-15vm/vm_resident.c: remove register qualifiersMarin Ramesa
* vm/vm_resident.c: Remove register qualifiers.
2013-11-15vm/vm_pageout.c: remove register qualifiersMarin Ramesa
* vm/vm_pageout.c: Remove register qualifiers.
2013-11-15vm/vm_object.c: remove register qualifiersMarin Ramesa
* vm/vm_object.c: Remove register qualifiers.
2013-11-15vm/vm_map.c: remove register qualifiersMarin Ramesa
* vm/vm_map.c: Remove register qualifiers.
2013-11-15vm/vm_map.c: trivial stylistic fix for consistencyMarin Ramesa
* vm/vm_map.c: Trivial stylistic fix for consistency.
2013-11-15vm/vm_kern.c: remove register qualifiersMarin Ramesa
* vm/vm_kern.c: Remove register qualifiers.
2013-11-15vm/vm_fault.c: remove register qualifiersMarin Ramesa
* vm/vm_fault.c: Remove register qualifiers.
2013-11-15vm/vm_fault.c: remove unused variableMarin Ramesa
* vm/vm_fault.c: Remove unused variable.
2013-11-15vm/memory_object_proxy.h: fix definitionMarin Ramesa
* vm/memory_object_proxy.h (_VM_MEMORY_OBJECT_PROXY_H_): Fix definition.
2013-11-15vm/memory_object.c: remove register qualifiersMarin Ramesa
* vm/memory_object.c: Remove register qualifiers.
2013-11-09Remove lint codeMarin Ramesa
2013-10-10Increase kernel map entry pool sizeRichard Braun
* vm/vm_map.h (KENTRY_DATA_SIZE): Set to 256 pages.
2013-07-18vm: organize vm print function prototypesMarin Ramesa
* vm/vm_print.h: New file. Include <vm/vm_map.h>. Include <machine/db_machdep.h>. (vm_map_print): Add prototype. (vm_map_copy_print): Likewise. (vm_object_print): Likewise. (vm_page_print): Likewise. Include <vm/vm_object.h>. Include <vm/vm_page.h> * vm/vm_map.h (vm_map_print): Remove prototype. * vm/vm_map.c [MACH_KDB]: Include <vm/vm_print.h>. * vm/vm_object.h (vm_object_print): Remove prototype. * vm/vm_object.c [MACH_KDB]: Include <vm/vm_print.h>. * vm/vm_resident.c [MACH_KDB]: Include <vm/vm_print.h>.
2013-06-04Fix format warningsMiguel Figueiredo
* vm/vm_resident.c (pmap_startup): Fix printf format. * xen/block.c (hyp_block_init, device_write): Likewise. * xen/net.c (hyp_net_init): Likewise.
2013-01-13Fix task stats incrementationsSamuel Thibault
* vm/vm_fault.c (vm_fault_page): Properly increment current_task()->zero_fills and cow_faults.
2013-01-13Add statistics for task_events_infoDavid Höppner
* ipc/ipc_mqueue.c (ipc_mqueue_send, ipc_mqueue_receive): Increment counters for message sent and received. * kern/ipc_kobject.c (ipc_kobject_server): Increment sent and received counters for the kernel task. * kern/task.c (task_create): Zero statistics. * kern/task.c (task_info): Add task_events_info call. * kern/task.h: Add statistics. * vm/vm_fault.c (vm_fault_page): Increment zero_fills, pageins, reactivations and cow_faults counters. * vm/vm_fault.c (vm_fault_wire_fast): Increment faults counters. * vm/vm_pageout.c (vm_pageout_scan): Increment reactivations counter.
2013-01-06Double KENTRY_DATA_SIZESamuel Thibault
* vm/vm_map.h (KENTRY_DATA_SIZE): Bump from 32 pages to 64 pages.
2013-01-04Fix compilation warning implicit function declaration kdbprintfDavid Höppner
When kernel debugger support is requested ipc and vm need the prototype for the debugger function kdbprintf. * ddb/db_output.h: Add prototype for kdbprintf. * ipc/ipc_object.c: Add include file ddb/db_output.h * ipc/ipc_port.c: Likewise. * ipc/ipc_pset.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_resident.c: Likewise.
2012-11-20Fix calls to vm_map when size is 0Richard Braun
* vm/vm_map.c (vm_map_enter): return KERN_INVALID_ARGUMENT if size is 0. * vm/vm_user.c (vm_map): Likewise.
2012-09-23Provide basic page cache statisticsRichard Braun
* Makefrag.am (EXTRA_DIST): Add kern/gnumach.srv. (include_mach_HEADERS): Add include/mach/gnumach.defs and include/mach/vm_cache_statistics.h (nodist_libkernel_a_SOURCES): Add kern/gnumach.server.defs.c, kern/gnumach.server.h, kern/gnumach.server.c, kern/gnumach.server.msgids, kern/gnumach.server.defs. * include/mach/mach_types.h: Add #include <mach/vm_cache_statistics.h>. * kern/ipc_kobject.c (ipc_kobject_server): Declare and call gnumach_server_routine. * vm/vm_object.c (vm_object_cached_pages): New variable. (vm_object_cached_pages_lock_data): Likewise. (vm_object_deallocate): Update number of cached pages. (vm_object_lookup): Likewise. (vm_object_lookup_name): Likewise. (vm_object_destroy): Likewise. (vm_object_enter): Likewise. * vm/vm_object.h (ref_count): Declare as int. (resident_page_count): Likewise. (vm_object_cached_count): Add extern declaration. (vm_object_cached_pages): Likewise. (vm_object_cached_pages_lock_data): Likewise. (vm_object_cached_pages_update): New macro. * vm/vm_resident.c (vm_page_insert): Assert resident page count doesn't overflow, update number of cached pages as appropriate. (vm_page_replace): Likewise. (vm_page_remove): Update number of cached pages as appropriate. * vm/vm_user.c: Add #include <mach/vm_cache_statistics.h>. (vm_cache_statistics): New function. * vm/vm_user.h: Add #include <mach/mach_types.h>. (vm_cache_statistics): New declaration. * include/mach/gnumach.defs: New file.
2012-04-27Augment VM maps with a red-black treeRichard Braun
* vm/vm_map.c: Add #include <kern/rbtree.h>. (vm_map_setup): Initialize the map red-black tree. (vm_map_entry_cmp_lookup): New function. (vm_map_entry_cmp_insert): Likewise. (_vm_map_entry_link): Insert map entry in the red-black tree. (_vm_map_entry_unlink): Remove map entry from the red-black tree. (vm_map_lookup_entry): Rework the way the VM map hint is used, and replace the linear search with a binary search tree lookup. (vm_map_copy_insert): Move map entries from the map copy tree to the destination map tree. (vm_map_copyin): Initialize the map copy red-black tree. * vm/vm_map.h: Add #include <kern/rbtree.h>. (vm_map_entry): Add `tree_node' member. (vm_map_header): Add `tree' member.