Revert "x86: keyboad input bug fix"

This commit is contained in:
Bernard Xiong
2017-08-18 10:54:45 +08:00
committed by GitHub
parent 9388f7882f
commit 50a2ae584b
10 changed files with 122 additions and 1258 deletions
-10
View File
@@ -101,16 +101,6 @@ extern "C" {
#define KBSTATP 0x64 /* kbd controller status port(I) */
#define KBS_DIB 0x01 /* kbd data in buffer */
#define KBDATAP 0x60 /* kbd data port(I) */
/* AT keyboard */
/* 8042 ports */
#define KB_DATA 0x60 /* I/O port for keyboard data
Read : Read Output Buffer
Write: Write Input Buffer(8042 Data&8048 Command) */
#define KB_CMD 0x64 /* I/O port for keyboard command
Read : Read Status Register
Write: Write Input Buffer(8042 Command) */
#define LED_CODE 0xED
#define KB_ACK 0xFA
/*******************************************************************/
/* Serial Register */
-37
View File
@@ -11,18 +11,6 @@ static __inline unsigned char inb(int port)
__asm __volatile("inb %w1,%0" : "=a" (data) : "d" (port));
return data;
}
static __inline unsigned char inb_p(unsigned short port)
{
unsigned char _v;
__asm__ __volatile__ ("inb %1, %0\n\t"
// "outb %0,$0x80\n\t"
// "outb %0,$0x80\n\t"
// "outb %0,$0x80\n\t"
"outb %0,$0x80"
:"=a" (_v)
:"d" ((unsigned short) port));
return _v;
}
static __inline unsigned short inw(int port)
{
@@ -51,36 +39,11 @@ static __inline void outb(int port, unsigned char data)
__asm __volatile("outb %0,%w1" : : "a" (data), "d" (port));
}
static __inline void outb_p(char value, unsigned short port)
{
__asm__ __volatile__ ("outb %0,%1\n\t"
"outb %0,$0x80"
::"a" ((char) value),"d" ((unsigned short) port));
}
static __inline void outw(int port, unsigned short data)
{
__asm __volatile("outw %0,%w1" : : "a" (data), "d" (port));
}
static __inline unsigned char readcmos(int reg)
{
outb(reg,0x70);
return (unsigned char) inb(0x71);
}
#define io_delay() \
__asm__ __volatile__ ("pushal \n\t"\
"mov $0x3F6, %dx \n\t" \
"inb %dx, %al \n\t" \
"inb %dx, %al \n\t" \
"inb %dx, %al \n\t" \
"inb %dx, %al \n\t" \
"popal")
/* Gate descriptors are slightly different*/
struct Gatedesc {
unsigned gd_off_15_0 : 16; // low 16 bits of offset in segment