From 13e3eca8ac3f6bd8c7a8fddde8b1937757e358ee Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Mon, 10 Jun 2024 20:47:54 +0200 Subject: proc: basic task/stack creation Now we can do a simple context swap (without scheduler though) --- src/arch/x86_64/arch_regs.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/arch') diff --git a/src/arch/x86_64/arch_regs.rs b/src/arch/x86_64/arch_regs.rs index a49926e..6bdccb0 100644 --- a/src/arch/x86_64/arch_regs.rs +++ b/src/arch/x86_64/arch_regs.rs @@ -15,6 +15,21 @@ pub struct Context64 { pub fpu: [u8; 108], } +impl Default for Context64 { + fn default() -> Context64 { + Context64 { + rbx: 0, + r12: 0, + r13: 0, + r14: 0, + r15: 0, + rbp: 0, + rsp: 0, + fpu: [0; 108], + } + } +} + /// arch specific registers #[repr(C)] #[repr(packed)] -- cgit v1.2.3-70-g09d2