summaryrefslogtreecommitdiff
path: root/i386/i386at
AgeCommit message (Collapse)Author
2014-04-04Use explicit prototypes for struct dev_ops fieldsMarin Ramesa
* device/conf.h: Include <sys/types.h>, <mach/port.h>, <mach/vm_prot.h>. Predefine struct io_req, io_req_t and io_return_t. (dev_ops): Add explicit prototypes for d_open, d_close, d_read, d_write, d_getstat, d_setstat, d_mmap, d_port_death. (nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath): Add prototypes. (nomap): Fix prototype. * device/dev_name.c (nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath): New functions. (nomap): Fix prototype. * device/ds_routines.c (dev_close): Pass 0 as flag parameter. * device/kmsg.c (kmsgclose): Drop return value. * device/kmsg.h (kmsgclose): Fix prototype. * i386/i386at/com.c (comopen): Fix prototype. (comclose): Fix prototype, drop return value. (comread, comwrite): Fix prototype. * i386/i386at/com.h (comopen, comclose, comread, comwrite): Fix prototype. * i386/i386at/conf.c (dev_ops): Use nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath where appropriate. * i386/i386at/kd.c (kdclose, kdread, kdwrite, kdmmap): Fix prototype. * i386/i386at/kd.h (kdclose, kdread, kdwrite, kdmmap): Likewise. * i386/i386at/kd_event.c (kbdopen): Likewise. * i386/i386at/kd_event.h (kbdopen): Likewise. * i386/i386at/kd_mouse.c (mouseopen): Likewise. * i386/i386at/kd_mouse.h (mouseopen): Likewise. * i386/i386at/lpr.c (lpropen, lprclose, lprread, lprwrite): Likewise. * i386/i386at/lpr.h (lpropen, lprclose, lprread, lprwrite): Likewise. * i386/i386at/mem.c (memmmap): Likewise. * i386/i386at/mem.h (memmmap): Likewise. * i386/i386at/model_dep.c (timemmap): Likewise. * i386/i386at/model_dep.h (timemmap): Likewise. * kern/mach_clock.c (timeopen, timeclose): Likewise. * kern/mach_clock.h: Include <sys/types.h>, predefine struct io_req and io_req_t. (timeopen, timeclose): Fix prototype.
2014-03-28Assume EGA/VGA cardSamuel Thibault
CGA and MONO cards are more than hard to find nowadays, and some buggy BIOSes claim running them nowadays... * i386/i386at/kd.c (kd_xga_init): Do not handle CGA and MONO cases any more, which thus default to EGA/VGA.
2014-03-28Really default to EGA/VGA on unknown CMOS valuesSamuel Thibault
* i386/i386at/kd.c (kd_xga_init): Use CM_EGA_VGA behavior as default case for unknown values of CMOS data.
2014-02-04Fix comstart when the queue is emptySamuel Thibault
Found by Coverity * i386/i386at/com.c (comstart): Make `nch' an int. When `getc' returns -1, just return.
2014-02-04Fix potential NULL dereferenceSamuel Thibault
Found by Coverity. * i386/i386at/com.c (comopen): On com_reprobe() returning success, check for `isai' again.
2014-02-04Make empty while loops more prominentSamuel Thibault
* 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.
2014-02-04Fix typoSamuel Thibault
* i386/i386at/kd_mouse.c (mouseopen): Fix typo.
2014-02-04Add missing breakSamuel Thibault
Found by Coverity * i386/i386at/kd_mouse.c (mouseopen): Add missing break.
2014-01-02Make sure cursor is initializedSamuel Thibault
* 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.
2013-12-18i386: add missing includesJustus Winter
* i386/i386at/kd_event.h: Add missing includes.
2013-12-17i386: qualify pointers whose dereferenced values are constant with constMarin Ramesa
2013-12-15Fix gcc signedness warningSamuel Thibault
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.
2013-12-15Type definitionMarin Ramesa
* 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.
2013-12-15Declare void argument listsMarin Ramesa
2013-12-11i386/i386at/kd_mouse.c (kd_mouse_open): remove forward declarationMarin Ramesa
* i386/i386at/kd_mouse.c (kd_mouse_open) (kdintr): Remove forward declaration.
2013-12-11i386/i386at/kd.c (kdinit): remove forward declarationMarin Ramesa
* i386/i386at/kd.c (kdinit) (kd_xga_init): Remove forward declaration. * i386/i386at/kd.h (kd_xga_init): Add prototype.
2013-12-11i386/i386at/kd.c (kdmmap): remove unnecessary castMarin Ramesa
Variable off is already an unsigned int. * i386/i386at/kd.c (kdmmap) (off): Remove unnecessary cast.
2013-12-11i386/i386at/kd.c: remove forward declarationsMarin Ramesa
* 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.
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-10i386/i386at/kd_event.c (kbdsetstat): fix difference in signednessMarin Ramesa
* i386/i386at/kd_event.c (X_kdb_enter_init, X_kdb_exit_init): Cast first arguments to (unsigned int *).
2013-12-10i386: move prototypes to fix implicit declaration of functionMarin Ramesa
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.
2013-12-09i386/i386at/kd.c: use io_req instead of uioMarin Ramesa
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.
2013-12-09i386/i386at/lpr.c: fix initalization from incompatible pointer typeMarin Ramesa
* i386/i386at/lpr.c (lprprobe): Modify argument types. * i386/i386at/lpr.h (lprprobe): Likewise.
2013-12-09i386/i386at/com.c: fix initialization from incompatible pointer typeMarin Ramesa
* 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.
2013-12-09i386/i386at/pic_isa.c: remove forward declarationMarin Ramesa
* 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.
2013-12-09i386/i386at/model_dep.c: fix argument listMarin Ramesa
* i386/i386at/model_dep.c (timemmap): Fix argument list.
2013-12-09i386/i386at/lpr.c: fix argument listMarin Ramesa
* i386/i386at/lpr.c (lprprobe): Fix argument list.
2013-12-09time: remove unused variableMarin Ramesa
* i386/i386at/rtc.c (tz): Remove unused variable. * xen/time.c (tz): Remove unused variable.
2013-12-09i386/i386at/rtc.c: use boolean instead of an intMarin Ramesa
* i386/i386at/rtc.c (first_rtcopen_ever): Use boolean instead of an int.
2013-12-09i386/i386at/kd.c: use boolean instead of an unsigned intMarin Ramesa
* i386/i386at/kd.c (kd_bellstate): Use boolean instead of an unsigned int.
2013-12-09i386/i386at/kd.c: use boolean instead of an intMarin Ramesa
* i386/i386at/kd.c (mouse_in_use): Use boolean instead of an int. Remove duplicate declaration.
2013-12-09i386/i386at/model_dep.c, kd.c: use boolean instead of an intMarin Ramesa
* 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.
2013-12-09i386/i386at/immc.c, kd.c: use boolean instead of an intMarin Ramesa
* i386/i386at/immc.c (immediate_console_enable): Use boolean instead of an int. * i386/i386at/kd.c (immediate_console_enable): Likewise.
2013-12-08Make unsigned character constants unsignedSamuel Thibault
Thanks Marin Ramesa for the report. * i386/i386at/kd.h (K_DONE, NC, K_SCAN): Make constants unsigned.
2013-12-08Add ifndefsMarin Ramesa
* i386/i386at/cram.h [_CRAM_H_]: Add ifndef. * i386/i386at/disk.h [_DISK_H_]: Likewise. * i386/i386at/i8250.h [_I8250_H_]: Likewise. * i386/include/mach/i386/asm.h [_MACH_I386_ASM_H_]: Likewise. * i386/include/mach/i386/disk.h [_MACH_I386_DISK_H_]: Likewise.
2013-12-08Add comments after endifsMarin Ramesa
* 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.
2013-12-05i386/i386at/com.h: include chips/busses.h for struct bus_deviceMarin Ramesa
* i386/i386at/com.h: Include chips/busses.h.
2013-12-05i386/i386at/model_dep.c: remove forward declarationMarin Ramesa
* i386/i386at/model_dep.c (init_alloc_aligned): Remove forward declaration. * i386/i386at/model_dep.h (init_alloc_aligned): Add prototype.
2013-12-05Drop duplicate declarationSamuel Thibault
* i386/i386/model_dep.h (halt_cpu, halt_all_cpus): Remove duplicate declaration. * i386/i386at/model_dep.h (halt_cpu, halt_all_cpus): Add comments.
2013-12-05i386/i386at: remove forward declarationsMarin Ramesa
* Makefrag.am: Include kern/startup.h. * i386/i386at/model_dep.c: Include kern/startup.h. Include i386at/model_dep.h. (setup_main, halt_all_cpus, halt_cpu, inittodr): Remove forward declarations. * i386/i386at/model_dep.h (halt_all_cpus, halt_cpu, inittodr): Add prototypes. * kern/startup.h: New file. Add copyright. [_KERN_STARTUP_H_]: Add ifndef. (setup_main): Add prototype.
2013-12-05i386/i386at/kd_mouse.c: remove forward declarationsMarin Ramesa
* i386/i386at/kd_mouse.c (mouseintr, mouse_enqueue, mouse_read_done): Remove forward declarations. (mouseintr): Define argument type. * i386/i386at/kd_mouse.h (mouseintr, mouse_enqueue, mouse_read_done): Add prototypes.
2013-12-05i386/i386at/kd_event.c: remove forward declarationsMarin Ramesa
* i386/i386at/kd_event.c (kbd_enqueue, X_kdb_enter_init, X_kdb_exit_init, kbd_read_done): Remove forward declarations. * i386/i386at/kd_event.h (kbd_enqueue, X_kdb_enter_init, X_kdb_exit_init, kbd_read_done): Add prototypes.
2013-12-05i386/i386at/kd.c: remove forward declarationsMarin Ramesa
* i386/i386at/kd.c (kd_enqsc, kdcheckmagic, do_modifier, bmpch2bit, bmppaintcsr, bit2fbptr): Remove forward declarations. * i386/i386at/kd.h: Include device/buf.h. Include i386at/kdsoft.h. (kdcheckmagic, do_modifier, bmpch2bit, bmppaintcsr, bit2fbptr): Add prototypes. * i386/i386at/kd_event.h (kd_enqsc): Add prototype.
2013-12-05i386/i386at/conf.c: remove forward declarationsMarin Ramesa
* i386/Makefrag.am: Include i386/i386at/model_dep.h and i386/i386at/mem.h. * i386/i386at/com.h (comgetstat, comsetstat): Declare as extern. (comopen, comclose, comread, comwrite, comportdeath): Add prototypes. * i386/i386at/conf.c: Include kern/mach_clock.h and i386at/model_dep.h. (timeopen, timeclose, timemmap): Remove forward declarations. (kdopen, kdclose, kdread, kdwrite, kdgetstat, kdsetstat, kdportdeath, kdmmap): Likewise. (comopen, comclose, comread, comwrite, comportdeath, comgetstat, comsetstat): Likewise. (lpropen, lprclose, lprread, lprwrite, lprportdeath, lprgetstat, lprsetstat): Likewise. (kbdopen, kbdclose, kbdread, kbdgetstat, kbdsetstat): Likewise. (mouseopen, mouseclose, mouseread, mousegetstat): Likewise. (memmmap): Likewise. (kmsgopen, kmsgclose, kmsgread, kmsggetstat): Likewise. (hypcnopen, hypcnclose, hypcnread, hypcnwrite, hypcnportdeath, hypcngetstat, hypcnsetstat): Likewise. Include i386at/kd.h. Include i386at/com.h. Include i386at/lpr.h. Include i386at/kd_event.h. Include i386at/kd_mouse.h. Include i386at/mem.h. Include device/kmsg.h. Include xen/console.h. * i386/i386at/kd.h: Include device/io_req.h. (kdopen, kdclose, kdread, kdwrite, kdgetstat, kdsetstat, kdportdeath, kdmmap): Add prototypes. * i386/i386at/kd_event.h (kbdopen, kbdclose, kbdread, kbdgetstat, kbdsetstat): Likewise. * i386/i386at/kd_mouse.h (mouseopen, mouseclose, mouseread, mousegetstat): Likewise. * i386/i386at/lpr.h (lpropen, lprclose, lprread, lprwrite, lprportdeath): Likewise. (lprgetstat, lprsetstat): Declare as extern. * i386/i386at/mem.h: New file. Add copyright. [_MEM_H_]: Add ifndef. (memmmap): Add prototype. * i386/i386at/model_dep.c: Include i386/i386at/model_dep.h. (timemmap): Fix argument list. * i386/i386at/model_dep.h: New file. Add copyright. [_MODEL_DEP_H_]: Add ifndef. (timemmap): Add prototype. * kern/mach_clock.h (timeopen, timeclose): Add prototypes. * xen/console.h (hypcnopen, hypcnclose, hypcnread, hypcnwrite, hypcnportdeath, hypcngetstat, hypcnsetstat): Add prototypes.
2013-12-05i386/i386at/autoconf.c, com.c, lpr.c: remove forward declarationsMarin Ramesa
* i386/i386/autoconf.c (comintr, lprintr): Remove forward declarations. Include i386at/com.h. Include i386at/lprreg.h. * i386/i386at/com.c (comprobe, commctl, comstart, comstop, comattach, comintr, comgetstat, comsetstat): Remove forward declarations. * i386/i386at/com.h: Include device/tty.h. (comprobe, commctl, comstart, comstop, comattach, comintr, comgetstat, comsetstat): Add prototypes. * i386/i386at/lpr.c (lprprobe, lprstop, lprintr, lprstart, lprattach, lprgetstat, lprsetstat, lprpr_addr): Remove forward declarations. (lprprobe): Fix argument list. (lprpr): Define argument type. lprpr_addr): Likewise. * i386/i386at/lprreg.h (lprprobe, lprstop, lprintr, lprstart, lprattach, lprgetstat, lprsetstat, lprpr_addr): Add prototypes.
2013-12-05ddb/db_command.c: remove forward declarationMarin Ramesa
* ddb/db_command.c (db_reset_cpu): Remove forward declaration. * i386/i386/db_interface.h (db_reset_cpu): Add prototype. * i386/i386at/model_dep.c: Include i386/db_interface.h.
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-21i386/i386at/kd.h: fix implicit declaration of functionMarin Ramesa
* i386/i386at/kd.h [MACH_KDB] (kdb_kintr): Add prototype.
2013-11-20Fix implicit declaration of functionMarin Ramesa
* ddb/db_sym.c (aout_db_sym_init): Remove forward declaration. * ddb/db_sym.h (aout_db_sym_init): Add prototype. * i386/i386at/model_dep.c (aout_db_sym_init): Fix call. [MACH_KDB]: Include ddb/db_sym.h. [MACH_KDB]: Add comment after else and endif.
2013-11-15i386/i386at/rtc.h: remove register qualifiersMarin Ramesa
* i386/i386at/rtc.h: Remove register qualifiers.