abstract-machine,nemu: add keyboard support
Some checks failed
Build abstract machine with nix / build-abstract-machine (push) Failing after 49s
Run CTests within npc / npc-test (push) Failing after 54s

This commit is contained in:
xinyangli 2024-07-26 13:44:52 +08:00
parent c9ad69a32d
commit fed4ac225d
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
2 changed files with 4 additions and 2 deletions

View file

@ -4,6 +4,7 @@
#define KEYDOWN_MASK 0x8000
void __am_input_keybrd(AM_INPUT_KEYBRD_T *kbd) {
kbd->keydown = 0;
kbd->keycode = AM_KEY_NONE;
uint32_t keycode = inl(KBD_ADDR);
kbd->keydown = ((keycode & KEYDOWN_MASK) != 0);
kbd->keycode = keycode & (~KEYDOWN_MASK);
}

View file

@ -176,6 +176,7 @@ breakpoint_t *cpu_exec_with_bp(uint64_t n, breakpoint_t *bp, size_t len) {
}
exec_once(&s, cpu.pc);
g_nr_guest_inst++;
IFDEF(CONFIG_DEVICE, device_update());
if (nemu_state.state != NEMU_RUNNING)
return NULL;
} while (--n);