PS/2 kb allow only one suspended proc at a time
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m19s

This commit is contained in:
2026-02-17 15:17:27 +01:00
parent a0c63ebb92
commit 35454a087e

View File

@@ -215,8 +215,18 @@ int ps2kb_read_key (struct device* device, struct device_op_ctx* op_ctx, void* a
/* didn't pop anything */ /* didn't pop anything */
if (prev_count == new_count) { if (prev_count == new_count) {
spin_lock (&ps2kb_sq.lock);
struct list_node_link* node = ps2kb_sq.proc_list;
spin_unlock (&ps2kb_sq.lock);
if (node != NULL) {
spin_unlock (&ps2kb_ringbuffer_lock);
return -ST_PERMISSION_ERROR;
}
*op_ctx->reschedule = *op_ctx->reschedule =
proc_sq_suspend (op_ctx->proc, &ps2kb_sq, &ps2kb_ringbuffer_lock, op_ctx->reschedule_cpu); proc_sq_suspend (op_ctx->proc, &ps2kb_sq, &ps2kb_ringbuffer_lock, op_ctx->reschedule_cpu);
return ST_OK; return ST_OK;
} }