asteroids game rewrite

This commit is contained in:
FantasyPvP
2023-12-04 10:42:17 +00:00
parent f400a1cf22
commit b0da71942a
17 changed files with 569 additions and 265 deletions
+2
View File
@@ -0,0 +1,2 @@
pub mod thread;
mod thread_switch;
+9
View File
@@ -0,0 +1,9 @@
use x86_64::VirtAddr;
use crate::system::kernel::memory::{StackBounds, ThreadId};
#[derive(Debug)]
pub struct Thread {
id: ThreadId,
stack_ptr: Option<VirtAddr>,
stack_bounds: Option<StackBounds>,
}
@@ -0,0 +1,12 @@
.intel_syntax noprefix
pushfq
mov rax, rsp
mov rsp, rdi
mov rdi, rax
call add_paused_thread
popfq
ret
@@ -0,0 +1,2 @@
use core::arch::global_asm;
global_asm!(include_str!("thread_switch.asm"));