kernel: fix hosted mode exception support

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-08-06 17:51:24 +08:00
parent 32eb3c202c
commit fa2a841f8a
2 changed files with 4 additions and 3 deletions

View file

@ -9,7 +9,8 @@ use std::net::TcpStream;
use std::thread_local;
use xous_kernel::{ProcessInit, ProcessKey, ThreadInit, PID, TID};
pub const INITIAL_TID: usize = 1;
pub const INITIAL_TID: usize = 2;
pub const EXCEPTION_TID: usize = 1;
pub const MAX_PROCESS_COUNT: usize = 32;
pub struct Process {
@ -241,7 +242,7 @@ impl Process {
// }
/// Set the current context number.
pub fn set_thread(&mut self, thread: TID) -> Result<(), xous_kernel::Error> {
pub fn set_tid(&mut self, thread: TID) -> Result<(), xous_kernel::Error> {
assert!(thread > 0);
PROCESS_TABLE.with(|pt| {
let mut process_table = pt.borrow_mut();

View file

@ -250,7 +250,7 @@ std::thread_local!(static SYSTEM_SERVICES: core::cell::RefCell<SystemServices> =
mapping: arch::mem::DEFAULT_MEMORY_MAPPING,
current_thread: 0 as TID,
previous_thread: INITIAL_TID as TID,
exception_thread: None,
exception_handler: None,
}; MAX_PROCESS_COUNT],
// Note we can't use MAX_SERVER_COUNT here because of how Rust's
// macro tokenization works