Support Push/Pop in DS

This commit is contained in:
2024-06-01 16:37:00 +02:00
parent 658eed7b46
commit 7dbc829fe8
6 changed files with 98 additions and 41 deletions

View File

@@ -3,6 +3,10 @@
namespace JabyEngine {
struct Thread {
static uintptr_t get_pic() {
return table_of_tables.processes->current_tcb->epc;
}
static constexpr uint32_t idx_from_handle(SysCall::ThreadHandle thread) {
return thread & 0xFFFF;
}
@@ -25,6 +29,10 @@ namespace JabyEngine {
};
struct MainThread {
static uintptr_t get_pic() {
return table_of_tables.threads[0].epc;
}
static void prepare_if_main(SysCall::ThreadHandle handle) {
if(table_of_tables.processes->current_tcb == &table_of_tables.threads[0]) {
Thread::prepare_next(handle);