Age | Commit message (Collapse) | Author |
|
The slab allocator relies on the fact that kmem_cache_error does not
return. Previously, kmem_error was using printf. Use panic instead.
Found using the Clang Static Analyzer.
* kern/slab.c (kmem_error): Use panic instead of printf.
|
|
* kern/slab.c (kmem_cache_error): Use kmem_warn instead of kmem_error
to print the cache name and its address.
|
|
* kern/task.c (task_create): Initialize name with the address of the task.
* kern/task.h (TASK_NAME_SIZE): New definition.
(struct task): Add field name.
|
|
* kern/printf.c (snprintf): New function.
* kern/printf.h (snprintf): New declaration.
|
|
GNU MIG recently gained support for emitting x_server_routine
declarations in the generated server header file. Using this
declaration, the x_server_routine functions can be inlined into the
ipc_kobject_server function.
* kern/ipc_kobject.c: Include the mig-generated server headers.
|
|
* kern/slab.h (struct kmem_cache): Align kmem_cache objects using
__cacheline_aligned.
|
|
* kern/slab.h (struct kmem_cache): Reorder the fields so that all hot
fields are within the first cache line.
|
|
* kern/slab.h (KMEM_CACHE_NAME_SIZE): Explain the significance of the
chosen length.
|
|
Previously, the size of struct kmem_cache was 136 bytes, just eight
bytes larger than 128 bytes, which is typically two cache lines on
today's CPUs.
By reducing the size of the name field which holds a human-readable
description by eight bytes to 24 bytes, the struct kmem_cache can be
made fit into two cache lines. This change should not affect the
usefulness of this field. For reference, the length of the largest
hard-coded name is 17.
* kern/slab.h (KMEM_CACHE_NAME_SIZE): Define to 24.
|
|
* kern/task.h (struct task): Reduce the size of struct task by
2 * sizeof boolean_t by using a bit field for the boolean flags.
|
|
|
|
* kern/strings.c (strlen): Mark with attribute pure.
|
|
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.
|
|
* kern/eventcount.c (simpler_thread_setrun) (enqueue_head) (th): Avoid the cast.
* kern/thread.c (thread_halt_self) (enqueue_tail) (thread): Likewise.
* kern/thread_swap.c (thread_swapin) (enqueue_tail) (thread): Likewise.
|
|
|
|
|
|
* device/ds_routines.c (device_write_trap) (copyin) (data): Cast to (void *). Argument is an address.
(device_write_trap) (copyin) (io_data): Don't cast.
(device_writev_trap) (copyin) (iovec, stack_iovec): Likewise.
(device_writev_trap) (copyin) (data, p): Cast to (void *). Arguments are addresses.
* kern/bootstrap.c (build_args_and_stack) (copyout) (arg_count, string_pos, zero): Don't cast.
* kern/ipc_mig.c (syscall_vm_map) (copyin, copyout) (addr, address): Likewise.
(syscall_vm_allocate) (copyin, copyout) (addr, address): Likewise.
(syscall_task_create) (copyout) (name, child_task): Likewise.
(syscall_mach_port_allocate) (copyout) (name, namep): Likewise.
* kern/time_stamp.c (copyout) (temp, tsp): Likewise.
|
|
Attribute noreturn is used irrespective of __GNUC__. Remove
unnecessary #ifdef.
* kern/sched_prim.h [__GNUC__]: Remove #ifdef.
|
|
* kern/lock.h (simple_lock_data_empty): Define.
(decl_simple_lock_data, simple_unlock): Likewise.
* kern/sched_prim.c (lock): Declare.
[MACH_SLOCKS]: Remove #ifs.
* kern/task.c (task_lock, task_unlock): Remove address operator.
|
|
Avoid the casts by passing the address of the links thread
structure member to enqueue_tail().
* kern/sched_prim.c: Avoid casts.
|
|
* i386/i386/ast_check.c (init_ast_check, cause_ast_check): Define return type.
* i386/i386/pic.c (intnull, prtnull): Define argument types.
* i386/i386at/com.c (compr_addr): Likewise.
(compr): Likewise.
(compr_addr): Fix printf format.
* i386/i386at/kd.c (kd_cmdreg_write, kd_kbd_magic): Define argument types.
* i386/i386at/kd_mouse.c (init_mouse_hw): Likewise.
* ipc/mach_port.c (sact_count): Define return type.
* ipc/mach_rpc.c (mach_port_rpc_sig): Define argument types.
* kern/act.c (dump_act): Define return type.
* kern/lock_mon.c (simple_lock, simple_lock_try, simple_unlock, lip, lock_info_sort, lock_info_clear, print_lock_info): Define return type.
(time_lock): Define return type and argument type.
* kern/timer.c (time_trap_uexit): Define argument type.
|
|
This is mach_clock.c, not clock_prim.c.
* kern/mach_clock.c: Update comment.
|
|
|
|
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.
|
|
* kern/startup.c (reboot_on_panic): Use boolean values.
|
|
File kern/act.h includes itself. Remove this include.
* kern/act.h: Don't include kern/act.h.
|
|
* 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.
|
|
* kern/syscall_sw.c (kern_invalid_debug): Use boolean instead of an int.
|
|
File kern/refcount.h includes itself. Remove this include.
* kern/refcount.h: Don't include kern/refcount.h.
|
|
File kern/rbtree.h includes itself. Remove this include.
* kern/rbtree.h: Don't include kern/rbtree.h.
|
|
This is priority.c. Not clock_prim.c.
* kern/priority.c: Update comment.
|
|
* kern/pc_sample.c (pc_sampling_enabled, pc_sampling_lock): Remove unused variables.
|
|
* kern/lock_mon.c (scurval, ssum, sli): Remove variables.
(scurval, ssum, sli): Remove dead assignments.
|
|
Variable curr_ipl is in other files declared as spl_t.
* kern/lock_mon.c (curr_ipl): Use spl_t instead of an int.
|
|
* kern/act.h (act_create_kernel): Remove prototype without definition.
|
|
|
|
Shutdown can be optimised. Remove __volatile__.
* kern/machine.c [__GNUC__] (processor_doshutdown): Remove volatile function qualifier.
|
|
* kern/debug.c (Assert): Always call Debugger, even if db_breakpoints_insert
is not set.
|
|
* device/cons.c [MACH_KMSG]: Likewise.
[CONSBUFSIZE > 0]: Likewise.
* i386/i386/trap.c [MACH_KDB]: Likewise.
[MACH_PV_PAGETABLES]: Likewise.
* i386/i386at/kd.c [ENABLE_IMMEDIATE_CONSOLE]: Likewise.
* ipc/ipc_kmsg_queue.h [_IPC_KMSG_QUEUE_H_]: Likewise.
* kern/act.c [ACTWATCH]: Likewise.
* kern/refcount.h [MACHINE_REFCOUNT]: Likewise.
* kern/task.c [FAST_TAS]: Likewise.
|
|
* Makefrag.am: Include kern/priority.h.
* kern/mach_clock.c (thread_quantum_update): Remove forward declaration.
Include kern/priority.h.
* kern/priority.h: New file.
Add copyright.
[_KERN_PRIORITY_H_]: Add ifndef.
(thread_quantum_update): Add prototype.
|
|
* kern/time_stamp.c [multimax]: Remove code.
|
|
* kern/xpr.c (db_printf): Remove forward declaration.
[MACH_KDB] Include ddb/db_output.h.
|
|
* i386/i386/pcb.h (pcb_module_init): Add prototype.
* kern/thread.c (pcb_module_init): Remove forward declaration.
|
|
* ipc/ipc_mqueue.h: Include ipc/ipc_kmsg_queue.h.
* kern/ipc_kobject.h: Move includes into ifndef.
* kern/syscall_emulation.h: Include kern/task.h.
(eml_init, eml_task_reference, eml_task_deallocate): Add prototypes.
* kern/task.c: Include kern/syscall_emulation.h.
(eml_init, eml_task_reference, eml_task_deallocate): Remove forward declarations
|
|
* kern/eventcount.h (evc_wait_clear): Add prototype.
* kern/ipc_mig.h: Include device/device_types.h.
(syscall_vm_map, syscall_vm_allocate, syscall_vm_deallocate, syscall_task_create, syscall_task_terminate, syscall_task_suspend, syscall_task_set_special_port, syscall_mach_port_allocate, syscall_mach_port_deallocate, syscall_mach_port_insert_right, syscall_mach_port_allocate_name, syscall_thread_depress_abort, syscall_device_write_request, syscall_device_writev_request): Add prototypes.
* kern/syscall_sw.c (syscall_vm_map, syscall_vm_allocate, syscall_vm_deallocate, syscall_task_create, syscall_task_terminate, syscall_task_suspend, syscall_task_set_special_port, syscall_mach_port_allocate, syscall_mach_port_deallocate, syscall_mach_port_insert_right, syscall_mach_port_allocate_name, syscall_thread_depress_abort, evc_wait, evc_wait_clear, syscall_device_write_request, syscall_device_writev_request): Remove forward declarations.
Include kern/ipc_mig.h.
Include kern/eventcount.h.
|
|
* kern/syscall_subr.c (thread_depress_priority): Remove forward declaration.
* kern/syscall_subr.h (thread_depress_priority): Add prototype.
|
|
* 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.
|
|
* kern/sched_prim.c (set_pri, do_thread_scan, choose_pset_thread, checkrq, thread_check): Remove forward declarations.
* kern/sched_prim.h (set_pri, do_thread_scan, choose_pset_thread, checkrq, thread_check): Add prototypes.
|
|
* kern/processor.c (quantum_set, pset_init, processor_init): Remove forward declarations.
* kern/processor.h (quantum_set, pset_init, processor_init): Add prototypes.
|
|
* device/ds_routines.h (ds_device_write_trap, ds_device_writev_trap): Add prototypes.
* kern/ipc_mig.c (ds_device_write_trap, ds_device_writev_trap): Remove forward declarations.
|