Remove instruction pointer etc functions in UserSpace

This commit is contained in:
Yuke Peng 2023-04-03 07:06:58 -07:00 committed by Tate, Hongliang Tian
parent 207bc1e4c2
commit 5a2f3c94b0
2 changed files with 4 additions and 16 deletions

View File

@ -26,18 +26,6 @@ impl UserSpace {
Self { vm_space, init_ctx }
}
pub fn instruction_pointer(&self) -> usize {
self.init_ctx.instruction_pointer()
}
pub fn stack_pointer(&self) -> usize {
self.init_ctx.stack_pointer()
}
pub fn syscall_ret(&self) -> usize {
self.init_ctx.syscall_ret()
}
/// Returns the VM address space.
pub fn vm_space(&self) -> &VmSpace {
&self.vm_space

View File

@ -1,7 +1,7 @@
use jinux_frame::{
cpu::UserContext,
task::Task,
user::{UserEvent, UserMode, UserSpace},
user::{UserEvent, UserMode, UserSpace, UserContextApi},
};
use crate::{
@ -19,10 +19,10 @@ pub fn create_new_user_task(user_space: Arc<UserSpace>, thread_ref: Weak<Thread>
let mut user_mode = UserMode::new(user_space);
debug!(
"[Task entry] rip = 0x{:x}",
user_space.instruction_pointer()
user_mode.context().instruction_pointer()
);
debug!("[Task entry] rsp = 0x{:x}", user_space.stack_pointer());
debug!("[Task entry] rax = 0x{:x}", user_space.syscall_ret());
debug!("[Task entry] rsp = 0x{:x}", user_mode.context().stack_pointer());
debug!("[Task entry] rax = 0x{:x}", user_mode.context().syscall_ret());
loop {
let user_event = user_mode.execute();
let context = user_mode.context_mut();