source: rtems/c/src/lib/libbsp/i386/pc386/console/i386kbd.h @ debbc9e

4.104.115
Last change on this file since debbc9e was f05b2ac, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/21/04 at 16:01:48

Remove duplicate white lines.

  • Property mode set to 100644
File size: 6.0 KB
Line 
1/*
2 *  linux/include/asm-i386/keyboard.h
3 *
4 *  Created 3 Nov 1996 by Geert Uytterhoeven
5 */
6
7/*
8 *  This file contains the i386 architecture specific keyboard definitions
9 */
10
11#ifndef _I386_KEYBOARD_H
12#define _I386_KEYBOARD_H
13
14#include  <i386_io.h>
15
16#define KEYBOARD_IRQ                    1
17#define DISABLE_KBD_DURING_INTERRUPTS   0
18
19extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
20extern int pckbd_getkeycode(unsigned int scancode);
21extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
22                           char raw_mode);
23extern char pckbd_unexpected_up(unsigned char keycode);
24extern void pckbd_leds(unsigned char leds);
25extern void pckbd_init_hw(void);
26extern unsigned char pckbd_sysrq_xlate[128];
27
28#define kbd_setkeycode          pckbd_setkeycode
29#define kbd_getkeycode          pckbd_getkeycode
30#define kbd_translate           pckbd_translate
31#define kbd_unexpected_up       pckbd_unexpected_up
32#define kbd_leds                      pckbd_leds
33#define kbd_init_hw                pckbd_init_hw
34#define kbd_sysrq_xlate         pckbd_sysrq_xlate
35
36#define SYSRQ_KEY 0x54
37
38/* resource allocation */
39#define kbd_request_region()     /* request_region(0x60, 16, "keyboard") */
40#define kbd_request_irq(handler) /* request_irq(KEYBOARD_IRQ, handler, 0, "keyboard", NULL) */
41
42/* How to access the keyboard macros on this platform.  */
43#define kbd_read_input() inb(KBD_DATA_REG)
44#define kbd_read_status() inb(KBD_STATUS_REG)
45#define kbd_write_output(val) outb(val, KBD_DATA_REG)
46#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
47
48/* Some stoneage hardware needs delays after some operations.  */
49#define kbd_pause() do { } while(0)
50
51/*
52 * Machine specific bits for the PS/2 driver
53 */
54
55#define AUX_IRQ 12
56
57#define aux_request_irq(hand, dev_id)  /* request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id) */
58
59#define aux_free_irq(dev_id)   /* free_irq(AUX_IRQ, dev_id) */
60
61/*
62 *      include/linux/pc_keyb.h
63 *
64 *      PC Keyboard And Keyboard Controller
65 *
66 *      (c) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
67 */
68
69/*
70 *      Configuration Switches
71 */
72
73#undef KBD_REPORT_ERR                   /* Report keyboard errors */
74#define KBD_REPORT_UNKN                 /* Report unknown scan codes */
75#define KBD_REPORT_TIMEOUTS             /* Report keyboard timeouts */
76#undef KBD_IS_FOCUS_9000                /* We have the brain-damaged FOCUS-9000 keyboard */
77#undef INITIALIZE_MOUSE                 /* Define if your PS/2 mouse needs initialization. */
78
79#define KBD_INIT_TIMEOUT 1000           /* Timeout in ms for initializing the keyboard */
80#define KBC_TIMEOUT 250                 /* Timeout in ms for sending to keyboard controller */
81#define KBD_TIMEOUT 1000                /* Timeout in ms for keyboard command acknowledge */
82
83/*
84 *      Internal variables of the driver
85 */
86
87extern unsigned char pckbd_read_mask;
88extern unsigned char aux_device_present;
89
90/*
91 *      Keyboard Controller Registers on normal PCs.
92 */
93
94#define KBD_STATUS_REG          0x64    /* Status register (R) */
95#define KBD_CNTL_REG            0x64    /* Controller command register (W) */
96#define KBD_DATA_REG            0x60    /* Keyboard data register (R/W) */
97
98/*
99 *      Keyboard Controller Commands
100 */
101
102#define KBD_CCMD_READ_MODE      0x20    /* Read mode bits */
103#define KBD_CCMD_WRITE_MODE     0x60    /* Write mode bits */
104#define KBD_CCMD_GET_VERSION    0xA1    /* Get controller version */
105#define KBD_CCMD_MOUSE_DISABLE  0xA7    /* Disable mouse interface */
106#define KBD_CCMD_MOUSE_ENABLE   0xA8    /* Enable mouse interface */
107#define KBD_CCMD_TEST_MOUSE     0xA9    /* Mouse interface test */
108#define KBD_CCMD_SELF_TEST      0xAA    /* Controller self test */
109#define KBD_CCMD_KBD_TEST       0xAB    /* Keyboard interface test */
110#define KBD_CCMD_KBD_DISABLE    0xAD    /* Keyboard interface disable */
111#define KBD_CCMD_KBD_ENABLE     0xAE    /* Keyboard interface enable */
112#define KBD_CCMD_WRITE_AUX_OBUF 0xD3    /* Write to output buffer as if
113                                           initiated by the auxiliary device */
114#define KBD_CCMD_WRITE_MOUSE    0xD4    /* Write the following byte to the mouse */
115
116/*
117 *      Keyboard Commands
118 */
119
120#define KBD_CMD_SET_LEDS        0xED    /* Set keyboard leds */
121#define KBD_CMD_SET_RATE        0xF3    /* Set typematic rate */
122#define KBD_CMD_ENABLE          0xF4    /* Enable scanning */
123#define KBD_CMD_DISABLE         0xF5    /* Disable scanning */
124#define KBD_CMD_RESET           0xFF    /* Reset */
125
126/*
127 *      Keyboard Replies
128 */
129
130#define KBD_REPLY_POR           0xAA    /* Power on reset */
131#define KBD_REPLY_ACK           0xFA    /* Command ACK */
132#define KBD_REPLY_RESEND        0xFE    /* Command NACK, send the cmd again */
133
134/*
135 *      Status Register Bits
136 */
137
138#define KBD_STAT_OBF            0x01    /* Keyboard output buffer full */
139#define KBD_STAT_IBF            0x02    /* Keyboard input buffer full */
140#define KBD_STAT_SELFTEST       0x04    /* Self test successful */
141#define KBD_STAT_CMD            0x08    /* Last write was a command write (0=data) */
142#define KBD_STAT_UNLOCKED       0x10    /* Zero if keyboard locked */
143#define KBD_STAT_MOUSE_OBF      0x20    /* Mouse output buffer full */
144#define KBD_STAT_GTO            0x40    /* General receive/xmit timeout */
145#define KBD_STAT_PERR           0x80    /* Parity error */
146
147#define AUX_STAT_OBF (KBD_STAT_OBF | KBD_STAT_MOUSE_OBF)
148
149/*
150 *      Controller Mode Register Bits
151 */
152
153#define KBD_MODE_KBD_INT        0x01    /* Keyboard data generate IRQ1 */
154#define KBD_MODE_MOUSE_INT      0x02    /* Mouse data generate IRQ12 */
155#define KBD_MODE_SYS            0x04    /* The system flag (?) */
156#define KBD_MODE_NO_KEYLOCK     0x08    /* The keylock doesn't affect the keyboard if set */
157#define KBD_MODE_DISABLE_KBD    0x10    /* Disable keyboard interface */
158#define KBD_MODE_DISABLE_MOUSE  0x20    /* Disable mouse interface */
159#define KBD_MODE_KCC            0x40    /* Scan code conversion to PC format */
160#define KBD_MODE_RFU            0x80
161
162/*
163 *      Mouse Commands
164 */
165
166#define AUX_SET_RES             0xE8    /* Set resolution */
167#define AUX_SET_SCALE11         0xE6    /* Set 1:1 scaling */
168#define AUX_SET_SCALE21         0xE7    /* Set 2:1 scaling */
169#define AUX_GET_SCALE           0xE9    /* Get scaling factor */
170#define AUX_SET_STREAM          0xEA    /* Set stream mode */
171#define AUX_SET_SAMPLE          0xF3    /* Set sample rate */
172#define AUX_ENABLE_DEV          0xF4    /* Enable aux device */
173#define AUX_DISABLE_DEV         0xF5    /* Disable aux device */
174#define AUX_RESET               0xFF    /* Reset aux device */
175#define AUX_ACK                 0xFA    /* Command byte ACK. */
176
177#define AUX_BUF_SIZE            2048    /* This might be better divisible by
178                                           three to make overruns stay in sync
179                                           but then the read function would need
180                                           a lock etc - ick */
181
182#define  mark_bh(x)
183
184#endif /* _I386_KEYBOARD_H */
Note: See TracBrowser for help on using the repository browser.