summaryrefslogtreecommitdiff
path: root/i386/i386at/kd.h
AgeCommit message (Collapse)Author
2015-06-28i386: improve the immediate consoleJustus Winter
Improve the immediate console to the point that it can be enabled and display e.g. assertion failures from very early on (i.e. from `c_boot_entry'). * device/cons.h (romgetc, romputc): New declarations. * i386/configfrag.ac: Add configuration variable. * i386/i386at/conf.c (dev_name_list): Add entry. * i386/i386at/cons_conf.c (constab): Add entry. * i386/i386at/immc.c: Add missing includes. (immc_cnprobe, immc_cninit, immc_cngetc, immc_romputc): New functions. (immc_cnputc): Fix signature, use virtual addresses. * i386/i386at/immc.h: New file. * i386/i386at/kd.c: Use `#if ENABLE_IMMEDIATE_CONSOLE'. * i386/i386at/kd.h (kd_setpos): Add missing declaration. * i386/i386at/model_dep.c (c_boot_entry): Install immediate console as early boot console.
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-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-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-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: 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-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-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-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-11-21i386/i386at/kd.h: fix implicit declaration of functionMarin Ramesa
* i386/i386at/kd.h [MACH_KDB] (kdb_kintr): Add prototype.
2011-09-01Fix PC samplingSamuel Thibault
interrupt.S now saves the IRQ on the stack to acknowledge it later. * i386/i386/hardclock.c (hardclock): Add irq parameter. * i386/i386at/kd.c (kdintr, kdcheckmagic): Remove regs parameter. * i386/i386at/kd.h (kdintr): Likewise.
2011-08-31Fix declarationsSamuel Thibault
* device/ds_routines.h (io_done_list): Add variable declaration. (device_io_map): Keep variable declaration and move definition to... * device/ds_routines.c: ... here. * i386/i386/fpu.c: Include <i386/pic.h> (curr_ipl): Remove declaration. (fpintr): Add int unit parameter. * linux/dev/glue/glue.h: New header. * i386/i386/fpu.h (fpintr): Add function prototype. * i386/i386/hardclock.c (clock_interrupt, linux_timer_intr): Remove prototypes. [LINUX_DEV]: Include <linux/dev/glue/glue.h> * i386/i386/ipl.h (curr_ipl): Add declaration. * i386/i386/pic.h (curr_pic_mask, pic_mask, prtnull, intnull): Add declarations. * i386/i386at/kd.h (kdintr): Add declaration. * i386/i386at/pic_isa.c: Include <i386/fpu.h> and <i386at/kd.h> (intnull, fpintr, hardclock, kdintr, prtnull): Remove prototypes. * i386/xen/xen.c: Include <kern/mach_clock.h> (clock_interrupt): Remove prototype. * linux/dev/arch/i386/kernel/irq.c: Include <linux/dev/glue/glue.h> and <machine/machspl.h> (linux_timer_intr, splhigh, spl0, curr_ipl, curr_pic_mask, pic_mask, get_options): Remove declarations. * linux/dev/drivers/block/floppy.c: Include <linux/dev/glue/glue.h> (issig, get_options): Remove declarations. * linux/dev/drivers/block/genhd.c: Include <linux/dev/glue/glue.h> (linux_intr_pri): Remove declaration. * linux/dev/glue/block.c: Include <devices/ds_routines.h> and <linux/dev/glue/glue.h>. (device_io_map, blksize_size): Remove declarations. * linux/dev/glue/kmem.c: Include <kern/printf.h> and <linux/dev/glue/glue.h> (alloc_contig_mem, printf): Remove declarations. * linux/dev/glue/misc.c: Include <printf.h> and <linux/dev/glue/glue.h> (vm_map_lookup_entry, printf): Remove prototypes. * linux/dev/glue/net.c: Include <kern/printf.h>, <device/ds_routines.h> and <linux/dev/glue/glue.h>. (linux_intr_pri, io_done_list): Remove declarations. * linux/dev/init/main.c: Include <machine/model_dep.h> and <linux/dev/glue/glue.h>. (phys_last_addr, alloc_contig_mem, free_contig_mem, init_IRQ, restore_IRQ, startrtclock, linux_version_init, linux_kmem_init, pci_init, linux_net_emulation_init, device_setup, linux_printk, linux_timer_intr, spl0, splhigh, form_pic_mask, linux_bad_intr, prtnull, intnull, linux_sched_init, pcmcia_init): Remove declarations. * linux/dev/kernel/sched.c: Include <kern/printf.h>, <machine/machspl.h> and <linux/dev/glue/glue.h>. (alloc_contig_mem, free_contig_mem, splhigh, splx, linux_soft_intr, issig, printf, linux_auto_config): Remove prototypes. * linux/dev/kernel/softirq.c: Include <linux/dev/glue/glue.h>. * linux/src/drivers/block/floppy.c: Include <linux/dev/glue/glue.h>. (get_options): Remove prototype. * linux/src/init/main.c: Include <linux/dev/glue/glue.h> (init_IRQ): Remove prototype.
2011-08-30Console declaration cleanupSamuel Thibault
* device/cons.h: Add multiple inclusion _DEVICE_CONS_H macro protector. (struct consdev): Add function members prototypes. * i386/i386/xen.h: Include <mach/xen.h>. * i386/i386at/com.c (comcnprobe, comcninit, comcngetc, comcnputc): Move prototypes... * i386/i386at/com.h: ... here. Include <device/cons.h>. * i386/i386at/cons_conf.c [MACH_HYP]: Include <xen/console.h>. [!MACH_HYP]: Include "kd.h". [!MACH_HYP && NCOM > 0]: Include "com.h". (hypcnprobe, hypcninit, hypcngetc, hypcnputc, kdcnprobe, kdcninit, kdcngetc, kdcnputc comcnprobe, comcninit, comcngetc, comcnputc): Remove prototypes. * i386/i386at/kd.c (kdcnputc): Make it return int, -1 on error, 0 on success. (kdcnprobe, kdcninit, kdcngetc, kdcnputc): Move prototypes... * i386/i386at/kd.h: ... here. Include <device/cons.h>. * xen/console.c (hypcnprobe): Remove unused `my_console' local variable. * xen/console.h: Include <device/cons.h> (hypcnputc, hypcngetc, hypcnprobe, hypcninit): Add prototypes.
2011-03-20Clean kd.[ch]Samuel Thibault
* i386/i386at/kd.h (NUMSTATES): Fix comment about NORM_STATE. * i386/i386at/kd.c (key_map): Use K_* macros instead of numeric values.
2009-11-22Rename kd_atoi into mach_atoiSamuel Thibault
* i386/i386at/kd.c: Include <util/atoi.h> (DEFAULT): Remove, replaced by MACH_ATOI_DEFAULT. (kd_parserest): Use mach_atoi instead of kd_atoi and MACH_ATOI_DEFAULT instead of DEFAULT. (kd_atoi): Move and rename function to... * util/atoi.c: ... mach_atoi in new file. * i386/i386at/kd.h (kd_atoi): Move and rename declaration to... * util/atoi.h: ... mach_atoi in new file. * Makefrag.am (libkernel_a_SOURCES): Add util/atoi.c
2009-10-20Fix warningsSamuel Thibault
* device/chario.c (ttypush): Set parameter type to void * instead of struct tty *, and implicitly cast the former into the latter instead. * i386/i386at/com.c: Include <kern/mach_clock.h>. (timeout, ttrstrt): Remove declarations. (comtimer): Add unused void * parameter. (comopen): Pass NULL to comtimer function. * i386/i386at/kd.h (kd_belloff): Add unused void * parameter. * i386/i386at/kd.c (timeout): Remove declaration. (kd_belloff): Add unused void * parameter. (feep, kdsetbell): Pass NULL to kd_belloff function. * i386/i386at/lpr.c: Include <mach_clock.h>. (timeout, ttrstrt): Remove declarations. * kern/mach_clock.c (softclock, timeout, untimeout): Set parameter type of fcn function pointer to void * instead of char *. Set type of param to void * instead of char *. * kern/mach_clock.h (timer_elt): Set parameter type of fcn member to void * instead of char *. Set time of param member to void * instead of char *. (timeout): Set parameter type of fcn function pointer parameter to void * instead of char *. (untimeout): Likewise, set type of param parameter to void * instead of char *. * kern/sched_prim.c (sched_init): Remove cast of recompute_priorities. Replace (char *)0 with NULL. (thread_timeout): Set parameter type to void * instead of thread_t, and implicitly cast the former into the latter instead. (thread_timeout_setup): Remove cast of thread_timeout, cast thread_depress_timeout into (void (*) (void*)). Remove cast of thread. (thread_recompute_priorities): Add unused void * parameter.
2009-06-182008-07-15 Barry deFreese <bddebian@comcast.net>Samuel Thibault
* i386/i386at/kd.h (kd_isupper, kd_islower, kd_senddata, kd_sendcmd, kd_cmdreg_write, kd_mouse_drain, set_kd_state, kd_setleds1, kd_setleds2, cnsetleds, kdreboot, kd_putc, kd_parseesc, kd_down, kd_up, kd_cr, kd_tab, kd_left, kd_right, kd_scrollup, kd_scrolldn, kd_cls, kd_home, kd_atoi, kd_insch, kd_cltobcur, kd_cltopcur, kd_cltoecur, kd_clfrbcur, kd_eraseln, kd_insln, kd_delln, kd_delch, kd_erase, kd_bellon, kd_belloff, kdinit, kdsetkbent, kdgetkbent, kdsetbell, kd_resend, kd_handle_ack, kd_kbd_magic, kdstate2idx, kd_parserest, kdcnmaygetc, kd_slmwd, kd_slmscu, kd_slmscd): Add prototypes. * i386/i386at/kd.c (do_modifier): Add prototype.
2009-06-182006-11-13 Barry deFreese <bddebian@comcast.net>Samuel Thibault
* i386/i386/locore.h: New file. * i386/i386/pcb.h: New file. * i386/i386/pcb.c: Include `pcb.h'. * i386/i386/pit.c (clkstart): Fix type of s into unsigned long. * i386/i386/spl.h (spl0, splsched, splx, splsoftclock, splon, sploff) (splhigh, splimp, spltty, splclock, setsoftclock): Add prototype. * i386/i386at/kd_event.h: New file. * i386/i386at/kd_event.c: Include `kd_event.h'. * i386/i386at/kd_mouse.h: New file. * i386/i386at/kd_mouse.c: Include `kd_mouse.h'. (mouseclose): Fix call of `serial_mouse_close' function. * i386/i386at/kd.c: Include `kd_event.h' and `kd_mouse.h'. * i386/i386at/kd.h (splx, spltty): Remove prototypes.h * i386/i386at/lpr.c: Likewise. * ipc/mach_msg.c: Include `machine/locore.h' and `machine/pcb.h'. * kern/mach_clock.h: New file. * kern/mach_clock.c: Include `kern/queue.h', `kern/timer.h' and `mach_clock.h'. * kern/mach_factor.h: New file. * kern/mach_factor.c: Include `mach_factor.h'. * kern/sched_prim.c: Include `kern/mach_factor.h'. * kern/thread.c: Include `machine/pcb.h'.
2009-06-182004-02-02 Marco Gerards <metgerards@student.han.nl>Marco Gerards
* i386/i386at/kd.c (kdinit): Initialize the input buffer. * i386/i386at/kd.h (KDSETLEDS): New macro. * i386/i386at/kd_event.c (kbdsetstat): Handle KDSETLEDS here to set the keyboard LEDs state.
2001-08-172001-08-18 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* i386/i386at/kd.c (kdintr): In event mode, make it so that 0xE0 scancodes are received. From Kalle Olavi Niemitalo <tosi@ees2.oulu.fi>. * i386/i386at/kd.h: New constants KAX_REVERSE, KAX_UNDERLINE, KAX_BLINK, KAX_BOLD, KAX_DIM, KAX_INVISIBLE, KAX_COL_UNDERLINE, KAX_COL_DIM. * i386/i386at/kd.c: Increase K_MAXESC to 32. New global variable color_table to map color values. New globals kd_color and kd_attrflags. (kdinit): Initialize these variables. (kd_update_kd_attr): New function. (kd_parserest): Redone to support more terminal attributes, including colors.
1999-04-261999-02-27 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>Thomas Bushnell
* i386/i386at/i386at_ds_routines.c: Include <i386/linux/device-drivers.h> instead of <linux/device-drivers.h>. * device/ds_routines.c [LINUX_DEV]: Likewise. * i386/linux/Makefile.in (linux-gen-flags): Fix an extra slash. (distclean): Remove asm links. * linux/src/COPYING: Copied from linux-2.0.36. 1999-02-02 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * i386/i386at/kd_event.c (kbdgetstat): Fix a typo DEV_GET_SIZES -> DEV_GET_SIZE. * i386/i386at/kd_mouse.c (mousegetstat): Likewise. * device/kmsg.c (kmsggetstat): Likewise. 1999-02-01 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * linux/dev/glue/block.c (dev_getstat): Fix a missing `struct'. * device/cons.c (cninit): Don't call kmsginit. * kmsg.c (kmsg_buffer): Defined as static. (kmsg_write_offset): Likewise. (kmsg_read_offset): Likewise. (kmsg_read_queue): Likewise. (kmsg_in_use): Likewise. (kmsg_lock): Likewise. (kmsginit): Likewise, and call queue_init instead of setting PREV and NEXT manually. (kmsg_done_init): New variable. (kmsg_putchar): Call kmsginit if not initialized yet. (kmsggetstat): New function. * kmsg.h (kmsggetstat): Add the prototype. * i386/i386at/kd_event.c (kbdgetstat): Handle DEV_GET_SIZE. (kbdread): Check if the amount a user specify is a multiple of sizeof(kd_event). * i386/i386at/kd_mouse.c (mousegetstat): New function. (mouseread): Check if the amount a user specify is a multiple of sizeof(kd_event). * i386/i386at/conf.c (dev_name_list): Set the mouse getstat entry to mousegetstat and the kmsg getstat entry to kmsggetstat. Use MACH_COM instead of NCOM to determine if com is used. Use MACH_LPR instead of NLPR to determine if lpr is used. * configure.in (--enable-com): New option. (--enable-lpr): Likewise. * Makefile.in (enable_com): New variable. (enable_lpr): Likewise. * i386/Makefrag (i386at-files): Remove com.c. (objfiles): Add com.o if enable_com is yes, and lpr.o if enable_lpr is yes. 1999-01-10 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * i386/i386at/kd.c: Applied a keymap patch. Reported by Marcus Brinkmann <Marcus.Brikmann@ruhr-uni-bochum.de>. * i386/i386at/kd.h: Likewise. 1998-12-06 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> Add kmsg device. * Makefile.in (device-files): Add kmsg.c and kmsg.h. * configure.in (--enable-kmsg): New option. * device/cons.c: Include kmsg.h. (cninit): Call kmsginit if MACH_KMSG is defined. (cnputc): Call kmsg_putchar if MACH_KMSG is defined. * device/kmsg.c: New file. * device/kmsg.h: Likewise. * i386/i386at/conf.c (dev_name_list): Add kmsg entry. 1998-12-01 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * i386/i386at/i386at_ds_routines.c: Include <linux/device-drivers.h> only if LINUX_DEV is defined. Reported by UCHIYAMA Yasushi <uch@nop.or.jp>. * device/ds_routines.c: Likewise. * configure.in: AC_CONFIG_SUBDIRS(linux) instead of linuxdev. (--disable-linuxdev): New option. * linux/Makefile.in (CPPFLAGS): Remove -DLINUX_DEV, and add @DEFS@. (objfiles): Add linux.o only if LINUX_DEV is defined. * linux/Drivers.in (--disable-linuxdev): New option. * i386/Makefrag (DEFINES): Remove -DLINUX_DEV.
1997-02-25Initial sourceThomas Bushnell