Rewrite PS2KB using the new devctl interface

This commit is contained in:
2025-09-28 23:25:43 +02:00
parent f5f44da5f6
commit d7562b98c1
10 changed files with 64 additions and 75 deletions

View File

@ -7,10 +7,12 @@
#include "proc/proc.h"
#include "sysdefs/devctl.h"
#include "dev/termdev.h"
#include "dev/ps2kbdev.h"
#include "util/util.h"
Dev *DEVS[] = {
[0x10] = &TERMDEV,
[0x11] = &PS2KBDEV,
};
int32_t SYSCALL5(sys_devctl, devh1, cmd1, buffer1, len1, extra1) {
@ -35,6 +37,7 @@ int32_t SYSCALL5(sys_devctl, devh1, cmd1, buffer1, len1, extra1) {
if (proc->devs[i] == NULL) {
found = true;
proc->devs[i] = DEVS[devid];
*devh = i;
break;
}
}