aboutsummaryrefslogtreecommitdiff
path: root/src/proc
diff options
context:
space:
mode:
Diffstat (limited to 'src/proc')
-rw-r--r--src/proc/mod.rs1
-rw-r--r--src/proc/task.rs13
2 files changed, 14 insertions, 0 deletions
diff --git a/src/proc/mod.rs b/src/proc/mod.rs
new file mode 100644
index 0000000..cdafe4a
--- /dev/null
+++ b/src/proc/mod.rs
@@ -0,0 +1 @@
+pub mod task;
diff --git a/src/proc/task.rs b/src/proc/task.rs
new file mode 100644
index 0000000..0ff2065
--- /dev/null
+++ b/src/proc/task.rs
@@ -0,0 +1,13 @@
+use crate::arch::x86_64::arch_regs;
+
+/// currently only kernelSp and Context are important.
+/// the task struct will be placed on the starting addr (low addr) of the kernel stack.
+/// therefore we can retrive the task struct at anytime by masking the kernel stack
+#[repr(C)]
+#[repr(packed)]
+pub struct Task {
+ pub task_id: u32,
+ pub kernel_stack: u64,
+ pub user_stack: u64,
+ pub context: arch_regs::Context64,
+}