Break devctl() up into smaller syscalls

This commit is contained in:
2025-10-14 21:35:10 +02:00
parent 0c3250e8d6
commit fa6c194163
20 changed files with 199 additions and 164 deletions

View File

@ -217,7 +217,7 @@ bool interp_runstring(char *string, InterpResult **res, bool logcmds, bool inter
while(proc_pollstate(app) != 4) {
if (interactive) {
int32_t key = devctl(&ps2kbdev, DEV_PS2KBDEV_READCH, (uint8_t *)PID, 0, 0);
int32_t key = dev_cmd(&ps2kbdev, DEV_PS2KBDEV_READCH, (void *)PID, 0, NULL);
if (key > 0 && (uint8_t)key == C('S')) {
proc_kill(app);
goto cleanup;

View File

@ -102,7 +102,7 @@ void do_mode_interactive(void) {
uint8_t b = 0;
for (;;) {
int32_t key = devctl(&ps2kbdev, DEV_PS2KBDEV_READCH, (uint8_t *)PID, 0, 0);
int32_t key = dev_cmd(&ps2kbdev, DEV_PS2KBDEV_READCH, (void *)PID, 0, NULL);
if (key > 0) {
b = (uint8_t)key;
switch (b) {
@ -151,8 +151,8 @@ void main(void) {
do_file("base:/scripts/rc.tb");
if (CONFIG.mode == MODE_INTERACTIVE) {
devctl(&ps2kbdev, DEVCTL_GET_HANDLE, (uint8_t *)"ps2kbdev", 0, 0);
devctl(&ps2kbdev, DEV_PS2KBDEV_ATTCHCONS, (uint8_t *)PID, 0, 0);
dev_gethandle(&ps2kbdev, "ps2kbdev");
dev_cmd(&ps2kbdev, DEV_PS2KBDEV_ATTCHCONS, (void *)PID, 0, NULL);
do_mode_interactive();
} else if (CONFIG.mode == MODE_RUNFILE) {
if (CONFIG.filepath == NULL) {