System/Jakt/OS: Fix @os_call() binding to use U64 addr instead of hash table lookup

This commit is contained in:
Alec Murphy
2025-09-20 15:25:55 -04:00
parent b78af4911d
commit 9e4fd9c5a3

View File

@@ -9,20 +9,13 @@ U0 _Z8os_blinkPKc()
POP_SYSV_REGS POP_SYSV_REGS
} }
U64 @os_call(U8* function_name, U64 arg) U64 @os_call(U64 addr, U64 val)
{ {
if (!function_name) if (!addr || !val)
return NULL; return NULL;
if (!StrLen(function_name)) U64 (*func)(U64 arg);
return NULL; func = addr;
CHash* h = HashFind(function_name, Fs->hash_table, Fs->hash_table->mask); return func(val);
if (!h)
return NULL;
if (h->type & HTT_FUN == HTT_FUN) {
CallInd(h(CHashFun*)->exe_addr, arg);
} else {
return NULL;
}
} }
U0 _Z7os_callmm() U0 _Z7os_callmm()