#include "ioport.h" // inb
#include "util.h" // dprintf
#include "paravirt.h" // romfile_loadint
-#include "biosvar.h" // GET_EBDA
+#include "biosvar.h" // GET_LOW
#include "ps2port.h" // ps2_kbd_command
#include "pic.h" // eoi_pic1
return 0;
}
+u8 Ps2ctr VARLOW;
+
static int
__ps2_command(int aux, int command, u8 *param)
{
int send = (command >> 12) & 0xf;
// Disable interrupts and keyboard/mouse.
- u8 ps2ctr = GET_EBDA(ps2ctr);
+ u8 ps2ctr = GET_LOW(Ps2ctr);
u8 newctr = ((ps2ctr | I8042_CTR_AUXDIS | I8042_CTR_KBDDIS)
& ~(I8042_CTR_KBDINT|I8042_CTR_AUXINT));
dprintf(6, "i8042 ctr old=%x new=%x\n", ps2ctr, newctr);
// Update ps2ctr for mouse enable/disable.
if (command == PSMOUSE_CMD_ENABLE || command == PSMOUSE_CMD_DISABLE) {
- u16 ebda_seg = get_ebda_seg();
- u8 ps2ctr = GET_EBDA2(ebda_seg, ps2ctr);
+ u8 ps2ctr = GET_LOW(Ps2ctr);
if (command == PSMOUSE_CMD_ENABLE)
ps2ctr = (ps2ctr | I8042_CTR_AUXINT) & ~I8042_CTR_AUXDIS;
else
ps2ctr = (ps2ctr | I8042_CTR_AUXDIS) & ~I8042_CTR_AUXINT;
- SET_EBDA2(ebda_seg, ps2ctr, ps2ctr);
+ SET_LOW(Ps2ctr, ps2ctr);
}
return ps2_command(1, command, param);
}
v = inb(PORT_PS2_DATA);
- if (!(GET_EBDA(ps2ctr) & I8042_CTR_AUXINT))
+ if (!(GET_LOW(Ps2ctr) & I8042_CTR_AUXINT))
// Interrupts not enabled.
goto done;
}
v = inb(PORT_PS2_DATA);
- if (!(GET_EBDA(ps2ctr) & I8042_CTR_KBDINT))
+ if (!(GET_LOW(Ps2ctr) & I8042_CTR_KBDINT))
// Interrupts not enabled.
goto done;
}
// Disable keyboard and mouse events.
- SET_EBDA(ps2ctr, I8042_CTR_KBDDIS | I8042_CTR_AUXDIS);
+ SET_LOW(Ps2ctr, I8042_CTR_KBDDIS | I8042_CTR_AUXDIS);
/* ------------------- keyboard side ------------------------*/
return;
// Keyboard Mode: disable mouse, scan code convert, enable kbd IRQ
- SET_EBDA(ps2ctr, I8042_CTR_AUXDIS | I8042_CTR_XLATE | I8042_CTR_KBDINT);
+ SET_LOW(Ps2ctr, I8042_CTR_AUXDIS | I8042_CTR_XLATE | I8042_CTR_KBDINT);
/* Enable keyboard */
ret = ps2_kbd_command(ATKBD_CMD_ENABLE, NULL);