Move CPU context implementations to a specific module

This commit is contained in:
Zhang Junyang
2025-03-05 15:17:32 +08:00
committed by Tate, Hongliang Tian
parent fc67adb1f0
commit f1c7564184
24 changed files with 49 additions and 38 deletions

View File

@ -7,7 +7,7 @@ use alloc::{
};
use ostd::{
cpu::{cpuid, CpuException, CpuExceptionInfo, RawGeneralRegs, UserContext},
cpu::context::{cpuid, CpuException, CpuExceptionInfo, RawGeneralRegs, UserContext},
Pod,
};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use ostd::cpu::{CpuException, CpuExceptionInfo, UserContext};
use ostd::cpu::context::{CpuException, CpuExceptionInfo, UserContext};
use crate::process::signal::{
constants::*, sig_num::SigNum, signals::fault::FaultSignal, SignalContext,

View File

@ -2,7 +2,7 @@
use core::{num::NonZeroU64, sync::atomic::Ordering};
use ostd::{cpu::UserContext, sync::RwArc, task::Task, user::UserContextApi};
use ostd::{cpu::context::UserContext, sync::RwArc, task::Task, user::UserContextApi};
use super::{
posix_thread::{AsPosixThread, PosixThreadBuilder, ThreadName},

View File

@ -3,7 +3,7 @@
#![expect(dead_code)]
use ostd::{
cpu::{CpuSet, UserContext},
cpu::{context::UserContext, CpuSet},
sync::RwArc,
task::Task,
};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use ostd::{cpu::UserContext, task::Task, user::UserContextApi};
use ostd::{cpu::context::UserContext, task::Task, user::UserContextApi};
use super::{builder::PosixThreadBuilder, name::ThreadName, PosixThread};
use crate::{

View File

@ -19,7 +19,7 @@ use align_ext::AlignExt;
use c_types::{siginfo_t, ucontext_t};
use constants::SIGSEGV;
pub use events::{SigEvents, SigEventsFilter};
use ostd::{cpu::UserContext, user::UserContextApi};
use ostd::{cpu::context::UserContext, user::UserContextApi};
pub use pause::{with_signal_blocked, Pause};
pub use poll::{PollAdaptor, PollHandle, Pollable, Pollee, Poller};
use sig_action::{SigAction, SigActionFlags, SigDefaultAction};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use ostd::cpu::UserContext;
use ostd::cpu::context::UserContext;
use super::SyscallReturn;
use crate::prelude::*;

View File

@ -2,7 +2,7 @@
use core::num::NonZeroU64;
use ostd::cpu::UserContext;
use ostd::cpu::context::UserContext;
use super::SyscallReturn;
use crate::{

View File

@ -2,7 +2,7 @@
use aster_rights::WriteOp;
use ostd::{
cpu::{FpuState, RawGeneralRegs, UserContext},
cpu::context::{FpuState, RawGeneralRegs, UserContext},
user::UserContextApi,
};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use ostd::cpu::UserContext;
use ostd::cpu::context::UserContext;
use super::SyscallReturn;
use crate::{

View File

@ -3,7 +3,7 @@
//! Read the Cpu ctx content then dispatch syscall to corresponding handler
//! The each sub module contains functions that handle real syscall logic.
pub use clock_gettime::ClockId;
use ostd::cpu::UserContext;
use ostd::cpu::context::UserContext;
use crate::{context::Context, cpu::LinuxAbi, prelude::*};
@ -281,7 +281,7 @@ macro_rules! impl_syscall_nums_and_dispatch_fn {
syscall_number: u64,
args: [u64; 6],
ctx: &crate::context::Context,
user_ctx: &mut ostd::cpu::UserContext,
user_ctx: &mut ostd::cpu::context::UserContext,
) -> $crate::prelude::Result<$crate::syscall::SyscallReturn> {
match syscall_number {
$(

View File

@ -2,7 +2,7 @@
use core::sync::atomic::Ordering;
use ostd::{cpu::UserContext, user::UserContextApi};
use ostd::{cpu::context::UserContext, user::UserContextApi};
use super::SyscallReturn;
use crate::{prelude::*, process::signal::c_types::ucontext_t};

View File

@ -3,7 +3,7 @@
#![expect(unused_variables)]
use aster_rights::Full;
use ostd::cpu::*;
use ostd::cpu::context::{CpuExceptionInfo, UserContext};
use crate::{
current_userspace,

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
use ostd::{
cpu::UserContext,
cpu::context::UserContext,
task::{Task, TaskOptions},
user::{ReturnReason, UserContextApi, UserMode},
};