Remove PS/2 keyboard function KB_READ_KEY_NONBLOCK

This commit is contained in:
2026-03-18 23:21:58 +01:00
parent fdd016e9fd
commit 837f7fa7ba
6 changed files with 0 additions and 43 deletions

View File

@@ -188,7 +188,6 @@ static void ps2kb_device_init (void) {
device_op_func_t ops[] = {
[KB_READ_KEY] = &ps2kb_read_key,
[KB_READ_KEY_NONBLOCK] = &ps2kb_read_key_nonblock,
};
device_create ("kb", ops, lengthof (ops), &ps2kb_init, &ps2kb_fini, NULL, thiscpu->kproc, &rctx);
}

View File

@@ -213,33 +213,6 @@ DEFINE_DEVICE_OP (ps2kb_read_key) {
return ST_OK;
}
DEFINE_DEVICE_OP (ps2kb_read_key_nonblock) {
uint64_t frb;
uint8_t* chbuf = (uint8_t*)a1;
if (chbuf == NULL)
return -ST_BAD_ADDRESS_SPACE;
spin_lock (&ps2kb_ringbuffer_lock, &frb);
size_t prev_count = ps2kb_ringbuffer.count;
ringbuffer_pop (uint8_t, &ps2kb_ringbuffer, chbuf);
size_t new_count = ps2kb_ringbuffer.count;
/* didn't pop anything */
if (prev_count == new_count) {
spin_unlock (&ps2kb_ringbuffer_lock, frb);
return -ST_TRY_AGAIN;
}
spin_unlock (&ps2kb_ringbuffer_lock, frb);
return ST_OK;
}
static void ps2kb_set_typematic (uint8_t delay, uint8_t rate) {
while (inb (KB_CTL_STATUS) & 0x02)
;

View File

@@ -11,8 +11,6 @@ struct device;
DEFINE_DEVICE_OP (ps2kb_read_key);
DEFINE_DEVICE_OP (ps2kb_read_key_nonblock);
DEFINE_DEVICE_INIT (ps2kb_init);
DEFINE_DEVICE_FINI (ps2kb_fini);