feat(scheduler): working scheduler

This commit is contained in:
karina
2026-04-29 17:00:11 +04:00
parent 3f51d93a4e
commit e06abbcb23
12 changed files with 220 additions and 17 deletions
+13
View File
@@ -73,3 +73,16 @@ static inline void CPUEnableMMU(Address l0PhysicalAddress) {
: "=r"(sctlr) : "r"(sctlr_flags) : "memory"
);
}
static inline void CPUSwitchAddressSpace(Address l0Physical) {
__asm__ volatile(
"dsb ishst\n" // wait till all previous writes are finished physically
"msr ttbr0_el1, %0\n" // Update TTBR0_EL1 (userspace)
"tlbi vmalle1is\n" // Reset TLB cache
"dsb ish\n" // wait for tlb cache to reset
"isb\n" // Clear instruction pipeline
:: "r" (l0Physical) : "memory"
);
}
#define CPUException(number) __asm__ volatile ("svc %0" :: "i" (number) : "memory")