1
0
forked from Rativel/BurritOS

fix save_processor_state, move test to thread_manager

This commit is contained in:
Quentin Legot
2023-03-27 22:20:29 +02:00
parent 08ba0154f7
commit 2f986da7ae
3 changed files with 19 additions and 35 deletions

View File

@@ -16,7 +16,7 @@ macro_rules! get_new_thread {
pub struct ThreadContext {
pub int_registers: [i64; NUM_INT_REGS],
pub float_registers: [f32; NUM_FP_REGS],
pub pc: i64,
pub pc: u64,
}
#[derive(PartialEq, Debug)]
@@ -47,7 +47,7 @@ impl Thread {
}
}
pub fn init_thread_context(&mut self, initial_pc_reg: i64, initial_sp: i64, arg: i64) {
pub fn init_thread_context(&mut self, initial_pc_reg: u64, initial_sp: i64, arg: i64) {
self.thread_context.pc = initial_pc_reg;
self.thread_context.int_registers[10] = arg;
self.thread_context.int_registers[STACK_REG] = initial_sp;