Break devctl() up into smaller syscalls
This commit is contained in:
@ -6,7 +6,7 @@ Dev_t ps2kbdev;
|
||||
Dev_t termdev;
|
||||
|
||||
void tb_runinitscript(void) {
|
||||
devctl(&termdev, DEVCTL_GET_HANDLE, (uint8_t *)"termdev", 0, 0);
|
||||
dev_gethandle(&termdev, "termdev");
|
||||
|
||||
char *tbargs[] = { "-m", "runfile", "-f", "base:/scripts/init.tb" };
|
||||
int32_t tb = proc_spawn("base:/bin/tb", tbargs, ARRLEN(tbargs));
|
||||
@ -20,7 +20,7 @@ void tb_runinitscript(void) {
|
||||
string_memset(buf, 0, sizeof(buf));
|
||||
r = ipc_piperead(tb, 0, (uint8_t *const)buf, sizeof(buf)-1);
|
||||
if (r > 0) {
|
||||
devctl(&termdev, DEV_TERMDEV_PUTCH, (uint8_t *)buf, string_len(buf), 0);
|
||||
dev_cmd(&termdev, DEV_TERMDEV_PUTCH, buf, string_len(buf), NULL);
|
||||
} else {
|
||||
schedrelease();
|
||||
}
|
||||
@ -29,8 +29,8 @@ void tb_runinitscript(void) {
|
||||
|
||||
void main(void) {
|
||||
PID = proc_getpid();
|
||||
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);
|
||||
|
||||
tb_runinitscript();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user