Support Callback

This commit is contained in:
jaby 2024-06-14 19:29:28 +02:00
parent d8aee97397
commit 5540d80d34
2 changed files with 12 additions and 2 deletions

View File

@ -155,6 +155,14 @@ namespace JabyEngine {
return __syscall_function_cast(Table_B, ThreadHandle(*)(void(*)(), uint32_t*, uint32_t*))(thread_func, stack_ptr, gp);
}
// No return??????
static __always_inline void ChangeThread(ThreadHandle handle) {
register uint32_t FuncID asm("t1") = 0x10;
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));
__syscall_function_cast(Table_B, void(*)(ThreadHandle))(handle);
}
static __always_inline void InitPad(uint8_t *portA, uint32_t portASize, uint8_t *portB, uint32_t portBSize) {
register uint32_t FuncID asm("t1") = 0x12;
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));

View File

@ -155,8 +155,10 @@ namespace JabyEngine {
}
void data_ready_handler(uint32_t data) {
printf("Data: %i\n", data);
MainThread::restore();
while(true) {
printf("Data: %i\n", data);
SysCall::ChangeThread(0xFF000000);
}
}
}