Unlock user mode in callback (buggy in XEBRA?)

This commit is contained in:
Jaby 2024-05-13 22:29:23 +02:00
parent b0a552249d
commit 5f45070961
1 changed files with 8 additions and 14 deletions

View File

@ -112,18 +112,7 @@ namespace JabyEngine {
} break; } break;
case CD_IO::Interrupt::DataEnd: { case CD_IO::Interrupt::DataEnd: {
if(thread != 0 && table_of_tables.processes->current_tcb == &table_of_tables.threads[0]) {
//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) {
//changeThread(thread); //changeThread(thread);
printf("About to change...\n"); printf("About to change...\n");
table_of_tables.processes->current_tcb = &table_of_tables.threads[thread&0xFFFF]; table_of_tables.processes->current_tcb = &table_of_tables.threads[thread&0xFFFF];
@ -169,13 +158,18 @@ namespace JabyEngine {
printf("Hallo!\n"); printf("Hallo!\n");
CD_IO::PortIndex0::change_to(); 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); Command::send<CD_IO::PortIndex0>(CD_IO::Command::Play);
table_of_tables.processes->current_tcb = &table_of_tables.threads[0]; table_of_tables.processes->current_tcb = &table_of_tables.threads[0];
SysCall::ReturnFromException(); SysCall::ReturnFromException();
}, reinterpret_cast<uint32_t*>(0x80010000), SysCall::get_gp()); }, &stack[1023], SysCall::get_gp());
SysCall::ExitCriticalSection(); 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(); Command::wait_completed();