mirror of
https://github.com/XunilGroup/XunilOS.git
synced 2026-06-02 13:44:25 +02:00
Patched everything for aarch64, aside from scheduler, add more linker
points to aarch64 ld, add aarch64 heap, init, page tables and usermode, make hhdm_offset a global atomic, aarch64 uses semihosting for output, add generic PageTable type, add a function that creates and maps pages, use allow to remove warnings, add a bufwriter so kernel panic always works
This commit is contained in:
@@ -86,7 +86,6 @@ impl Locked<Scheduler> {
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub fn switch_to(&self, pid: u64, should_swapgs: bool) {
|
||||
let (ctx_opt, entry, stack_top) = {
|
||||
let mut guard = safe_lock(|| self.lock());
|
||||
@@ -117,7 +116,9 @@ impl Locked<Scheduler> {
|
||||
set_current_pid(Some(pid));
|
||||
|
||||
match ctx_opt {
|
||||
#[allow(unused_variables, unused_unsafe)]
|
||||
Some(saved_ctx) => unsafe {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
run_next((&saved_ctx) as *const UserContext, saved_ctx.rsp)
|
||||
},
|
||||
None => enter_usermode(entry as u64, (stack_top & !0xF) - 8, should_swapgs),
|
||||
@@ -163,3 +164,11 @@ unsafe fn run_next(ctx: *const UserContext, user_rsp: u64) {
|
||||
"sysretq",
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
#[unsafe(naked)]
|
||||
#[unsafe(no_mangle)]
|
||||
unsafe fn run_next(ctx: *const UserContext, user_rsp: u64) {
|
||||
// TODO: add switching logic
|
||||
core::arch::naked_asm!("udf #0");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user