summaryrefslogtreecommitdiffstats
path: root/sys/sys/kbio.h
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-06-22 14:14:06 +0000
committeryokota <yokota@FreeBSD.org>1999-06-22 14:14:06 +0000
commit4f4eb0cfe54e001639240b3b63551c42280cdcc0 (patch)
tree75738e04df5c55c7d14fd6fb083ab1062bd92a85 /sys/sys/kbio.h
parentd252fb51781d3bcdc1697ebd89678c9a00d94124 (diff)
downloadFreeBSD-src-4f4eb0cfe54e001639240b3b63551c42280cdcc0.zip
FreeBSD-src-4f4eb0cfe54e001639240b3b63551c42280cdcc0.tar.gz
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize some of complicated functions. - Many static variables are moved to the softc structure. - Added a new key function, PREV. When this key is pressed, the vty immediately before the current vty will become foreground. Analogue to PREV, which is usually assigned to the PrntScrn key. PR: kern/10113 Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de> - Modified the kernel console input function sccngetc() so that it handles function keys properly. - Reorganized the screen update routine. - VT switching code is reorganized. It now should be slightly more robust than before. - Added the DEVICE_RESUME function so that syscons no longer hooks the APM resume event directly. - New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING, SC_NO_HISTORY and SC_NO_SYSMOUSE. Various parts of syscons can be omitted so that the kernel size is reduced. SC_PIXEL_MODE Made the VESA 800x600 mode an option, rather than a standard part of syscons. SC_DISABLE_DDBKEY Disables the `debug' key combination. SC_ALT_MOUSE_IMAGE Inverse the character cell at the mouse cursor position in the text console, rather than drawing an arrow on the screen. Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG) SC_DFLT_FONT makeoptions "SC_DFLT_FONT=_font_name_" Include the named font as the default font of syscons. 16-line, 14-line and 8-line font data will be compiled in. This option replaces the existing STD8X16FONT option, which loads 16-line font data only. - The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c. - The video driver provides a set of ioctl commands to manipulate the frame buffer. - New kernel configuration option: VGA_WIDTH90 Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These modes are mot always supported by the video card. PR: i386/7510 Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx. - The header file machine/console.h is reorganized; its contents is now split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h (another new file). machine/console.h is still maintained for compatibility reasons. - Kernel console selection/installation routines are fixed and slightly rebumped so that it should now be possible to switch between the interanl kernel console (sc or vt) and a remote kernel console (sio) again, as it was in 2.x, 3.0 and 3.1. - Screen savers and splash screen decoders Because of the header file reorganization described above, screen savers and splash screen decoders are slightly modified. After this update, /sys/modules/syscons/saver.h is no longer necessary and is removed.
Diffstat (limited to 'sys/sys/kbio.h')
-rw-r--r--sys/sys/kbio.h228
1 files changed, 228 insertions, 0 deletions
diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h
new file mode 100644
index 0000000..c8e9947
--- /dev/null
+++ b/sys/sys/kbio.h
@@ -0,0 +1,228 @@
+/*-
+ * $Id: $
+ */
+
+#ifndef _SYS_KBIO_H_
+#define _SYS_KBIO_H_
+
+#ifndef KERNEL
+#include <sys/types.h>
+#endif
+#include <sys/ioccom.h>
+
+/* get/set keyboard I/O mode */
+#define K_RAW 0 /* keyboard returns scancodes */
+#define K_XLATE 1 /* keyboard returns ascii */
+#define K_CODE 2 /* keyboard returns keycodes */
+#define KDGKBMODE _IOR('K', 6, int)
+#define KDSKBMODE _IO('K', 7 /*, int */)
+
+/* make tone */
+#define KDMKTONE _IO('K', 8 /*, int */)
+
+/* see console.h for the definitions of the following ioctls */
+#if notdef
+#define KDGETMODE _IOR('K', 9, int)
+#define KDSETMODE _IO('K', 10 /*, int */)
+#define KDSBORDER _IO('K', 13 /*, int */)
+#endif
+
+/* get/set keyboard lock state */
+#define CLKED 1 /* Caps locked */
+#define NLKED 2 /* Num locked */
+#define SLKED 4 /* Scroll locked */
+#define ALKED 8 /* AltGr locked */
+#define LOCK_MASK (CLKED | NLKED | SLKED | ALKED)
+#define KDGKBSTATE _IOR('K', 19, int)
+#define KDSKBSTATE _IO('K', 20 /*, int */)
+
+/* enable/disable I/O access */
+#define KDENABIO _IO('K', 60)
+#define KDDISABIO _IO('K', 61)
+
+/* make sound */
+#define KIOCSOUND _IO('K', 63 /*, int */)
+
+/* get keyboard model */
+#define KB_OTHER 0 /* keyboard not known */
+#define KB_84 1 /* 'old' 84 key AT-keyboard */
+#define KB_101 2 /* MF-101 or MF-102 keyboard */
+#define KDGKBTYPE _IOR('K', 64, int)
+
+/* get/set keyboard LED state */
+#define LED_CAP 1 /* Caps lock LED */
+#define LED_NUM 2 /* Num lock LED */
+#define LED_SCR 4 /* Scroll lock LED */
+#define LED_MASK (LED_CAP | LED_NUM | LED_SCR)
+#define KDGETLED _IOR('K', 65, int)
+#define KDSETLED _IO('K', 66 /*, int */)
+
+/* set keyboard repeat rate (obsolete, use KDSETREPEAT below) */
+#define KDSETRAD _IO('K', 67 /*, int */)
+
+/* see console.h for the definition of the following ioctl */
+#if notdef
+#define KDRASTER _IOW('K', 100, scr_size_t)
+#endif
+
+/* get keyboard information */
+struct keyboard_info {
+ int kb_index; /* kbdio index# */
+ char kb_name[16]; /* driver name */
+ int kb_unit; /* unit# */
+ int kb_type; /* KB_84, KB_101, KB_OTHER,... */
+ int kb_config; /* device configuration flags */
+ int kb_flags; /* internal flags */
+};
+typedef struct keyboard_info keyboard_info_t;
+#define KDGKBINFO _IOR('K', 101, keyboard_info_t)
+
+/* set keyboard repeat rate (new interface) */
+struct keyboard_repeat {
+ int kb_repeat[2];
+};
+typedef struct keyboard_repeat keyboard_repeat_t;
+#define KDSETREPEAT _IOW('K', 102, keyboard_repeat_t)
+
+/* get/set key map/accent map/function key strings */
+
+#define NUM_KEYS 256 /* number of keys in table */
+#define NUM_STATES 8 /* states per key */
+#define ALTGR_OFFSET 128 /* offset for altlock keys */
+
+#define NUM_DEADKEYS 15 /* number of accent keys */
+#define NUM_ACCENTCHARS 52 /* max number of accent chars */
+
+#define NUM_FKEYS 96 /* max number of function keys */
+#define MAXFK 16 /* max length of a function key str */
+
+#ifndef _KEYMAP_DECLARED
+#define _KEYMAP_DECLARED
+
+struct keyent_t {
+ u_char map[NUM_STATES];
+ u_char spcl;
+ u_char flgs;
+#define FLAG_LOCK_O 0
+#define FLAG_LOCK_C 1
+#define FLAG_LOCK_N 2
+};
+
+struct keymap {
+ u_short n_keys;
+ struct keyent_t key[NUM_KEYS];
+};
+typedef struct keymap keymap_t;
+
+#endif /* !_KEYMAP_DECLARED */
+
+/* defines for "special" keys (spcl bit set in keymap) */
+#define NOP 0x00 /* nothing (dead key) */
+#define LSH 0x02 /* left shift key */
+#define RSH 0x03 /* right shift key */
+#define CLK 0x04 /* caps lock key */
+#define NLK 0x05 /* num lock key */
+#define SLK 0x06 /* scroll lock key */
+#define LALT 0x07 /* left alt key */
+#define BTAB 0x08 /* backwards tab */
+#define LCTR 0x09 /* left control key */
+#define NEXT 0x0a /* switch to next screen */
+#define F_SCR 0x0b /* switch to first screen */
+#define L_SCR 0x1a /* switch to last screen */
+#define F_FN 0x1b /* first function key */
+#define L_FN 0x7a /* last function key */
+/* 0x7b-0x7f reserved do not use ! */
+#define RCTR 0x80 /* right control key */
+#define RALT 0x81 /* right alt (altgr) key */
+#define ALK 0x82 /* alt lock key */
+#define ASH 0x83 /* alt shift key */
+#define META 0x84 /* meta key */
+#define RBT 0x85 /* boot machine */
+#define DBG 0x86 /* call debugger */
+#define SUSP 0x87 /* suspend power (APM) */
+#define SPSC 0x88 /* toggle splash/text screen */
+
+#define F_ACC DGRA /* first accent key */
+#define DGRA 0x89 /* grave */
+#define DACU 0x8a /* acute */
+#define DCIR 0x8b /* circumflex */
+#define DTIL 0x8c /* tilde */
+#define DMAC 0x8d /* macron */
+#define DBRE 0x8e /* breve */
+#define DDOT 0x8f /* dot */
+#define DUML 0x90 /* umlaut/diaresis */
+#define DDIA 0x90 /* diaresis */
+#define DSLA 0x91 /* slash */
+#define DRIN 0x92 /* ring */
+#define DCED 0x93 /* cedilla */
+#define DAPO 0x94 /* apostrophe */
+#define DDAC 0x95 /* double acute */
+#define DOGO 0x96 /* ogonek */
+#define DCAR 0x97 /* caron */
+#define L_ACC DCAR /* last accent key */
+
+#define STBY 0x98 /* Go into standby mode (apm) */
+#define PREV 0x99 /* switch to previous screen */
+
+#define F(x) ((x)+F_FN-1)
+#define S(x) ((x)+F_SCR-1)
+#define ACC(x) ((x)+F_ACC)
+
+struct acc_t {
+ u_char accchar;
+ u_char map[NUM_ACCENTCHARS][2];
+};
+
+struct accentmap {
+ u_short n_accs;
+ struct acc_t acc[NUM_DEADKEYS];
+};
+typedef struct accentmap accentmap_t;
+
+struct keyarg {
+ u_short keynum;
+ struct keyent_t key;
+};
+typedef struct keyarg keyarg_t;
+
+struct fkeytab {
+ u_char str[MAXFK];
+ u_char len;
+};
+typedef struct fkeytab fkeytab_t;
+
+struct fkeyarg {
+ u_short keynum;
+ char keydef[MAXFK];
+ char flen;
+};
+typedef struct fkeyarg fkeyarg_t;
+
+#define GETFKEY _IOWR('k', 0, fkeyarg_t)
+#define SETFKEY _IOWR('k', 1, fkeyarg_t)
+#if notdef /* see console.h */
+#define GIO_SCRNMAP _IOR('k', 2, scrmap_t)
+#define PIO_SCRNMAP _IOW('k', 3, scrmap_t)
+#endif
+#define GIO_KEYMAP _IOR('k', 6, keymap_t)
+#define PIO_KEYMAP _IOW('k', 7, keymap_t)
+#define GIO_DEADKEYMAP _IOR('k', 8, accentmap_t)
+#define PIO_DEADKEYMAP _IOW('k', 9, accentmap_t)
+#define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t)
+#define PIO_KEYMAPENT _IOW('k', 11, keyarg_t)
+
+/* flags set to the return value in the KD_XLATE mode */
+
+#define NOKEY 0x100 /* no key pressed marker */
+#define FKEY 0x200 /* function key marker */
+#define MKEY 0x400 /* meta key marker (prepend ESC)*/
+#define BKEY 0x800 /* backtab (ESC [ Z) */
+
+#define SPCLKEY 0x8000 /* special key */
+#define RELKEY 0x4000 /* key released */
+#define ERRKEY 0x2000 /* error */
+
+#define KEYCHAR(c) ((c) & 0x00ff)
+#define KEYFLAGS(c) ((c) & ~0x00ff)
+
+#endif /* !_SYS_KBIO_H_ */
OpenPOWER on IntegriCloud