Unlock user mode in callback (buggy in XEBRA?)

This commit is contained in:
jaby 2024-05-13 22:29:23 +02:00
parent c5cb59caa8
commit 31f8de76c1
1 changed files with 8 additions and 14 deletions

View File

@ -112,18 +112,7 @@ namespace JabyEngine {
} break;
case CD_IO::Interrupt::DataEnd: {
//set_tcb(get_tcb_of_th(thread));
/*printf("EPC: 0x%p; SR: 0x%p\n", get_current_tcb().reg[31], get_current_tcb().sr);
get_current_tcb().reg[31] = (uint32_t)(void(*)())[]() {
printf("Wuff! Now crash!\n");
while(true);
};
printf("EPC: 0x%p; SR: 0x%p\n", get_current_tcb().reg[31], get_current_tcb().sr); while(true);*/
//SysCall::ReturnFromException();
if(thread != 0) {
if(thread != 0 && table_of_tables.processes->current_tcb == &table_of_tables.threads[0]) {
//changeThread(thread);
printf("About to change...\n");
table_of_tables.processes->current_tcb = &table_of_tables.threads[thread&0xFFFF];
@ -169,13 +158,18 @@ namespace JabyEngine {
printf("Hallo!\n");
CD_IO::PortIndex0::change_to();
Command::send<CD_IO::PortIndex0>(CD_IO::Command::SetLoc, static_cast<uint8_t>(0x0), static_cast<uint8_t>(0x09), static_cast<uint8_t>(0x0));
printf("Wait...\n");
Command::send_wait<CD_IO::PortIndex0>(CD_IO::Command::SetLoc, static_cast<uint8_t>(0x0), static_cast<uint8_t>(0x09), static_cast<uint8_t>(0x0));
printf("Done!\n");
Command::send<CD_IO::PortIndex0>(CD_IO::Command::Play);
table_of_tables.processes->current_tcb = &table_of_tables.threads[0];
SysCall::ReturnFromException();
}, reinterpret_cast<uint32_t*>(0x80010000), SysCall::get_gp());
}, &stack[1023], SysCall::get_gp());
SysCall::ExitCriticalSection();
table_of_tables.threads[thread&0xFFFF].sr = table_of_tables.threads[0].sr;
printf(">>> 0x%X\n", table_of_tables.threads[0].sr);
}
Command::wait_completed();