mirror of
https://git.checksum.fail/alec/erythros
synced 2025-12-10 13:09:55 +02:00
System/Jakt/OS: Fix @os_call() binding to use U64 addr instead of hash table lookup
This commit is contained in:
@@ -9,20 +9,13 @@ U0 _Z8os_blinkPKc()
|
||||
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;
|
||||
if (!StrLen(function_name))
|
||||
return NULL;
|
||||
CHash* h = HashFind(function_name, Fs->hash_table, Fs->hash_table->mask);
|
||||
if (!h)
|
||||
return NULL;
|
||||
if (h->type & HTT_FUN == HTT_FUN) {
|
||||
CallInd(h(CHashFun*)->exe_addr, arg);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
U64 (*func)(U64 arg);
|
||||
func = addr;
|
||||
return func(val);
|
||||
}
|
||||
|
||||
U0 _Z7os_callmm()
|
||||
|
||||
Reference in New Issue
Block a user