Age | Commit message (Collapse) | Author |
|
We were filling much more than the mapwindows array, thus overwriting in
at least debugger variables.
* i386/intel/pmap.c (pmap_bootstrap): Make sure to limit mapwindows
initialization within PMAP_NMAPWINDOWS.
|
|
PCI devices expose their memory etc. way beyond last_phys_addr. Userland
drivers opening /dev/mem need to open those too, even if phystokv() will
not work for them.
* i386/intel/pmap.h (pmap_mapwindow_t): New type.
(pmap_get_mapwindow, pmap_put_mapwindow): New prototypes.
(PMAP_NMAPWINDOWS): New macro.
* i386/intel/pmap.c (mapwindows): New array.
(pmap_get_mapwindow, pmap_put_mapwindow): New functions.
(pmap_bootstrap, pmap_virtual_space): Reserve virtual pages for the mapping
windows.
* i386/i386/phys.c: Include <i386/model_dep.h>
(INTEL_PTE_W, INTEL_PTE_R): New macros
(pmap_zero_page, pmap_copy_page, copy_to_phys, copy_from_phys): Use
`pmap_get_mapwindow' to temporarily map physical pages beyond last_phys_addr.
|
|
Found by Coverity
* i386/i386at/com.c (comstart): Make `nch' an int. When `getc' returns
-1, just return.
|
|
Found by Coverity
* i386/i386/user_ldt.c (i386_get_ldt): Fetch `pcb' field of `thread'
only after looking for `thread' being NULL.
|
|
Found by Coverity
* i386/i386/db_trace.c (db_find_kthread): Handle case when task is NULL.
|
|
Found by Coverity.
* i386/i386at/com.c (comopen): On com_reprobe() returning success, check
for `isai' again.
|
|
* i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix size of
`user_fp_regs' access.
|
|
* i386/i386at/kd.c (kdintr, kd_senddata, kd_sendcmd, kd_getgata,
kd_cmdreg_read, kd_cmdreg_write, kd_mouse_drain): Move semi colon of
empty while loops on a single line to make it more visible.
|
|
Found by coverity.
* i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix out of bound
`user_fp_regs' access.
|
|
* i386/i386at/kd_mouse.c (mouseopen): Fix typo.
|
|
Found by Coverity
* i386/i386at/kd_mouse.c (mouseopen): Add missing break.
|
|
* i386/i386at/kd.c (kd_xga_init): Add start, stop variables, read them
from CRT registers, make sure the cursor is enabled and is not reduced
to 0, and write them back to CRT registers.
* i386/i386at/kd.h (C_START, C_STOP): New macros.
|
|
* i386/include/mach/i386/mach_i386_types.h (MACH_KERNEL): Add comments after else and endif.
|
|
* i386/i386/io_perm.h (_I386_IO_PERM_H_): Add comment after endif.
|
|
|
|
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.
|
|
* i386/i386at/kd_event.h: Add missing includes.
|
|
|
|
* ddb/db_command.h (db_error): Mark with attribute noreturn.
* i386/i386/setjmp.h (_longjmp): Likewise.
|
|
* i386/i386/db_trace.c (db_lookup_i386_kreg) (kregp): Use (long *) instead of an (int *).
|
|
|
|
Thanks Marin Ramesa and Richard Braun for investigating.
* i386/i386at/kd.c (kdintr): Make `char_idx' and `max' unsigned.
(kdstate2idx): Make function take and return unsigned ints for the state.
* i386/i386at/kd.h (kdstate2idx): Likewise.
|
|
* 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.
|
|
* i386/i386/ldt.c (syscall): Remove forward declaration.
Include locore.h.
* i386/i386/locore.h (syscall): Add prototype.
|
|
|
|
* i386/i386at/kd_mouse.c (kd_mouse_open) (kdintr): Remove forward declaration.
|
|
* i386/i386at/kd.c (kdinit) (kd_xga_init): Remove forward declaration.
* i386/i386at/kd.h (kd_xga_init): Add prototype.
|
|
Variable off is already an unsigned int.
* i386/i386at/kd.c (kdmmap) (off): Remove unnecessary cast.
|
|
* i386/i386at/kd.c (kd_getdata, state2leds, kdstart, kdstop): Remove forward declarations.
* i386/i386at/kd.h (kd_getdata, state2leds, kdstart, kdstop): Add prototypes.
Include device/tty.h.
|
|
Argument to INKERNEL() is already cast to vm_offset_t in the macro itself.
* i386/i386/db_trace.c (db_i386_stack_trace) (INKERNEL) (callpc): Don't cast to unsigned long.
(db_i386_stack_trace) (INKERNEL) (frame): Likewise.
|
|
* i386/Makefrag.am: List i386/i386/db_trace.h.
* i386/i386/db_trace.c: Include machine/db_trace.h.
(db_i386_stack_trace): Remove forward declaration.
* i386/i386/db_trace.h: New file.
Add copyright.
[_I386_DB_TRACE_H_]: Add ifndef.
(i386_frame): Declare forward.
(db_i386_stack_trace): Add prototype.
|
|
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.
|
|
This is more in line with how the function db_user_to_kernel_address() is
called. In this way there is one cast less and several GCC warnings are
silenced.
* i386/i386/db_interface.c (db_set_hw_watchpoint) (kern_addr): Use vm_offset_t instead of an unsigned int.
(db_user_to_kernel_address) (kaddr): Likewise.
(db_user_to_kernel_address) (ptetokv): Don't cast return value.
(db_read_bytes) (kern_addr): Use vm_offset_t instead of an unsigned int.
(db_write_bytes_user_space) (kern_addr): Likewise.
(db_task_name) (vaddr, kaddr): Likewise.
* i386/i386/db_interface.h (db_user_to_kernel_address) (kaddr): Likewise.
|
|
* i386/i386at/kd_event.c (X_kdb_enter_init, X_kdb_exit_init): Cast first arguments to (unsigned int *).
|
|
This fixes the implicit declarations in kern/machine.c and kern/debug.c.
* i386/i386/model_dep.h (halt_cpu, halt_all_cpus): Add prototypes.
* i386/i386at/model_dep.h (halt_cpu, halt_all_cpus): Remove prototypes.
|
|
In this way everything falls into place and there is one cast less.
Function db_task_printsym() is already always called with the cast to
db_addr_t in the first argument.
* ddb/db_aout.c (aout_db_line_at_pc): Use db_addr_t instead of db_expr_t.
(aout_db_search_by_addr): Don't cast to vm_offset_t. Argument is already
db_addr_t.
* ddb/db_aout.h (aout_db_line_at_pc): Use db_addr_t instead of db_expr_t.
* ddb/db_sym.c (db_task_printsym): Likewise.
(db_line_at_pc): Likewise.
* ddb/db_sym.h (db_task_printsym): Likewise.
(db_line_at_pc): Likewise.
* i386/i386/db_trace.c (db_task_printsym): Cast to db_addr_t instead of db_expr_t.
Member swap_func is a pointer to void.
|
|
Struct uio is nowhere defined and in device/buf.h the string uio is defined
as io_req. Remove all declarations of uio structure and use io_req_t instead
of it.
* device/buf.h (uio, io_req): Remove definition.
* i386/i386at/kd.c: Remove comment.
(kdread): Use io_req_t.
(kdwrite): Likewise.
* i386/i386at/kd.h (kdread, kdwrite): Use io_req_t as argument type.
|
|
* i386/i386/db_interface.c (db_write_bytes_user_space): Remove forward declaration.
* i386/i386/db_interface.h (db_write_bytes_user_space): Add prototype.
|
|
* i386/i386at/lpr.c (lprprobe): Modify argument types.
* i386/i386at/lpr.h (lprprobe): Likewise.
|
|
* i386/i386at/com.c (comprobe): Modify argument types.
(comprobe): Cast from (struct bus_ctrl *) to (struct bus_device *).
comprobe_general() uses only a small subset of members, so it's all
the same which struct it is.
* i386/i386at/com.h (comprobe): Modify argument types.
|
|
* i386/Makefrag.am: Include i386/i386/hardclock.h.
* i386/i386/hardclock.h: New file.
Add copyright.
[_I386_HARDCLOCK_H_]: Add ifndef.
(hardclock): Add prototype.
* i386/i386at/pic_isa.c (hardclock): Remove forward declaration.
Include i386/hardclock.h.
|
|
* i386/i386at/model_dep.c (timemmap): Fix argument list.
|
|
* i386/i386at/lpr.c (lprprobe): Fix argument list.
|
|
* i386/intel/pmap.c (end): Remove unused variable.
|
|
* i386/intel/pmap.c (pmap_debug): Use boolean instead of an int.
|
|
* i386/i386at/rtc.c (tz): Remove unused variable.
* xen/time.c (tz): Remove unused variable.
|
|
* i386/i386at/rtc.c (first_rtcopen_ever): Use boolean instead of an int.
|
|
* i386/i386at/kd.c (kd_bellstate): Use boolean instead of an unsigned int.
|
|
* i386/i386at/kd.c (mouse_in_use): Use boolean instead of an int.
Remove duplicate declaration.
|
|
* i386/i386at/kd.c (rebootflag): Use boolean instead of an int.
Remove duplicate variable declaration.
* i386/i386at/model_dep.c (rebootflag): Use boolean instead of an int.
|