1
0
forked from Rativel/BurritOS

Lint: remove some warnings

This commit is contained in:
Quentin Legot
2023-04-06 13:46:59 +02:00
parent 9cc57e7f03
commit 66d6daf0b9
6 changed files with 16 additions and 68 deletions

View File

@@ -1,4 +1,4 @@
use super::{process::Process, system::ObjectType, thread_manager::SIMULATORSTACKSIZE};
use super::{process::Process, system::ObjectType};
use crate::{simulator::machine::{NUM_INT_REGS, NUM_FP_REGS, STACK_REG}};
const STACK_FENCEPOST: u32 = 0xdeadbeef;
@@ -23,7 +23,6 @@ pub struct ThreadContext {
pub struct Thread {
name: String,
pub process: Option<Process>,
// simulation_context: UContextT,
pub thread_context: ThreadContext,
pub stack_pointer: i32,
object_type: ObjectType
@@ -52,21 +51,6 @@ impl Thread {
self.thread_context.int_registers[10] = arg;
self.thread_context.int_registers[STACK_REG] = initial_sp as i64;
}
pub fn init_simulator_context(&self, base_stack_addr: [i8; SIMULATORSTACKSIZE]) {
// let res = self.simulation_context.get_context();
// if res != 0 {
// panic!("getcontext returns non-zero value {}", res);
// }
// self.simulation_context.buf.uc_stack.ss_sp = base_stack_addr;
// self.simulation_context.buf.uc_stack.ss_size = base_stack_addr.len();
// self.simulation_context.buf.uc_stack.ss_flags = 0;
// self.simulation_context.buf.uc_link = UContextT::new().buf;
// self.simulation_context.make_context(start_thread_execution, 0);
// self.simulation_context.stackBottom = base_stack_addr.to_vec();
// self.simulation_context.stackBottom[0] = STACK_FENCEPOST;
}
/// Check if a thread has overflowed its stack
///
@@ -78,14 +62,6 @@ impl Thread {
// }
}
pub fn save_simulator_state(&self) {
// todo!(); // simulator state will maybe be removed so panic call is remove. See ucontext.rs
}
pub fn restore_simulator_state(&self) {
// todo!(); // simulator state will maybe be removed so panic call is remove. See ucontext.rs
}
pub fn get_name(&self) -> String {
self.name.clone()
}