- while(!((result = io_inb(PS2_PORT_CTRL_STATUS)) & PS2_STATUS_OFULL));
-
- return io_inb(PS2_PORT_ENC_CMDREG);
-}
-
-static uint8_t ps2_issue_dev_cmd(char cmd, uint16_t arg) {
- ps2_post_cmd(PS2_PORT_ENC_CMDREG, cmd, arg);
-
- char result;
-
- // 等待PS/2控制器返回。通过轮询(polling)状态寄存器的 bit 0
- // 如置位,则表明返回代码此时就在 0x60 IO口上等待读取。
- while(!((result = io_inb(PS2_PORT_CTRL_STATUS)) & PS2_STATUS_OFULL));