Pass implicit PID into syscalls

This commit is contained in:
2025-10-18 12:10:59 +02:00
parent d1d777ec75
commit a5fe64b253
15 changed files with 56 additions and 34 deletions

View File

@ -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) {
dev_cmd(&termdev, DEV_TERMDEV_PUTCH, buf, string_len(buf), NULL);
dev_cmd(&termdev, DEV_TERMDEV_PUTCH, buf, string_len(buf));
} else {
schedrelease();
}
@ -30,7 +30,7 @@ void tb_runinitscript(void) {
void main(void) {
PID = proc_getpid();
dev_gethandle(&ps2kbdev, "ps2kbdev");
dev_cmd(&ps2kbdev, DEV_PS2KBDEV_ATTCHCONS, (void *)PID, 0, NULL);
dev_cmd(&ps2kbdev, DEV_PS2KBDEV_ATTCHCONS, NULL, 0);
tb_runinitscript();

View File

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

View File

@ -90,7 +90,7 @@ void do_mode_interactive(void) {
uint8_t b = 0;
for (;;) {
int32_t key = dev_cmd(&ps2kbdev, DEV_PS2KBDEV_READCH, (void *)PID, 0, NULL);
int32_t key = dev_cmd(&ps2kbdev, DEV_PS2KBDEV_READCH, NULL, 0);
if (key > 0) {
b = (uint8_t)key;
switch (b) {
@ -140,7 +140,7 @@ void main(void) {
if (CONFIG.mode == MODE_INTERACTIVE) {
dev_gethandle(&ps2kbdev, "ps2kbdev");
dev_cmd(&ps2kbdev, DEV_PS2KBDEV_ATTCHCONS, (void *)PID, 0, NULL);
dev_cmd(&ps2kbdev, DEV_PS2KBDEV_ATTCHCONS, NULL, 0);
do_mode_interactive();
} else if (CONFIG.mode == MODE_RUNFILE) {
if (CONFIG.filepath == NULL) {