Changeset 481c520 in mainline for arch/ia32/src/drivers/i8042.c


Ignore:
Timestamp:
2006-02-27T12:30:11Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
02f441c0
Parents:
4a2b52f
Message:

sparc64 work.
Revive OFW console code and use it before the kernel switches to standalone console.

ia32 + ia64 cosmetic changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/drivers/i8042.c

    r4a2b52f r481c520  
    4646 */
    4747
    48 #define i8042_DATA              0x60
    49 #define i8042_STATUS            0x64
     48#define i8042_DATA                      0x60
     49#define i8042_STATUS                    0x64
    5050#define i8042_BUFFER_FULL_MASK          0x01
    51 
    5251
    5352/** Keyboard commands. */
     
    5756
    5857/*
    59  60   Write 8042 Command Byte: next data byte written to port 60h is
    60       placed in 8042 command register.Format:
    61 
    62      |7|6|5|4|3|2|1|0|8042 Command Byte
    63       | | | | | | | `---- 1=enable output register full interrupt
    64       | | | | | | `----- should be 0
    65       | | | | | `------ 1=set status register system, 0=clear
    66       | | | | `------- 1=override keyboard inhibit, 0=allow inhibit
    67       | | | `-------- disable keyboard I/O by driving clock line low
    68       | | `--------- disable auxiliary device, drives clock line low
    69       | `---------- IBM scancode translation 0=AT, 1=PC/XT
    70       `----------- reserved, should be 0
    71 */
    72 
    73 #define i8042_SET_COMMAND 0x60
    74 #define i8042_COMMAND 0x49
    75 #define i8042_WAIT_MASK 0x02
    76 
     58 * 60  Write 8042 Command Byte: next data byte written to port 60h is
     59 *     placed in 8042 command register.Format:
     60 *
     61 *    |7|6|5|4|3|2|1|0|8042 Command Byte
     62 *     | | | | | | | `---- 1=enable output register full interrupt
     63 *     | | | | | | `----- should be 0
     64 *     | | | | | `------ 1=set status register system, 0=clear
     65 *     | | | | `------- 1=override keyboard inhibit, 0=allow inhibit
     66 *     | | | `-------- disable keyboard I/O by driving clock line low
     67 *     | | `--------- disable auxiliary device, drives clock line low
     68 *     | `---------- IBM scancode translation 0=AT, 1=PC/XT
     69 *     `----------- reserved, should be 0
     70 */
     71
     72#define i8042_SET_COMMAND       0x60
     73#define i8042_COMMAND           0x49
     74#define i8042_WAIT_MASK         0x02
    7775
    7876#define SPECIAL         '?'
     
    8886
    8987#define ACTIVE_READ_BUFF_SIZE 16 /*Must be power of 2*/
    90 
    9188
    9289__u8 active_read_buff[ACTIVE_READ_BUFF_SIZE]={0};
     
    272269{
    273270        exc_register(VECTOR_KBD, "i8042_interrupt", i8042_interrupt);
    274         while (inb(i8042_STATUS)&i8042_WAIT_MASK);     /*Wait*/
     271        while (inb(i8042_STATUS)&i8042_WAIT_MASK) {
     272                /* wait */
     273        }
    275274        outb(i8042_STATUS,i8042_SET_COMMAND);
    276         while (inb(i8042_STATUS)&i8042_WAIT_MASK);     /*Wait*/
     275        while (inb(i8042_STATUS)&i8042_WAIT_MASK) {
     276                /* wait */
     277        }
    277278        outb(i8042_DATA,i8042_COMMAND);
    278279
     
    406407}
    407408
    408 
    409409static __u8 active_read_buff_read(void)
    410410{
     
    428428
    429429
    430 static void active_readed_key_pressed(__u8 sc)
     430static void active_read_key_pressed(__u8 sc)
    431431{
    432432        char *map = sc_primary_map;
     
    497497}
    498498
    499 
    500499static char key_read(chardev_t *d)
    501500{
    502501        char ch;       
    503        
    504502
    505503        while(!(ch=active_read_buff_read()))
     
    511509                        key_released(x ^ KEY_RELEASE);
    512510                else
    513                         active_readed_key_pressed(x);
     511                        active_read_key_pressed(x);
    514512        }
    515513        return ch;
    516514}
    517 
    518 
Note: See TracChangeset for help on using the changeset viewer.