0.3.0: converge kernel onto upstream master
- Rebase all Red Bear kernel changes onto upstream master (4d5d36d4).
- Update version to 0.5.12+rb0.3.0 and add Red Bear author attribution.
- Switch redox_syscall direct dependency to local fork path (../syscall).
- Bump rust-toolchain.toml to nightly-2026-05-24.
- Regenerate Cargo.lock for +rb0.3.0 suffixes and path deps.
This commit is contained in:
+13
-14
@@ -12,14 +12,11 @@ use syscall::PtraceFlags;
|
||||
|
||||
use crate::{
|
||||
arch::device::ArchPercpuMisc,
|
||||
context::{
|
||||
empty_cr3,
|
||||
memory::{AddrSpaceSwitchReadGuard, AddrSpaceWrapper},
|
||||
switch::ContextSwitchPercpu,
|
||||
},
|
||||
context::{empty_cr3, memory::AddrSpaceWrapper, switch::ContextSwitchPercpu},
|
||||
cpu_set::{LogicalCpuId, MAX_CPU_COUNT},
|
||||
cpu_stats::{CpuStats, CpuStatsData},
|
||||
ptrace::Session,
|
||||
sync::CleanLockToken,
|
||||
syscall::debug::SyscallDebugInfo,
|
||||
};
|
||||
|
||||
@@ -33,8 +30,9 @@ pub struct PercpuBlock {
|
||||
|
||||
pub current_addrsp: RefCell<Option<Arc<AddrSpaceWrapper>>>,
|
||||
pub new_addrsp_tmp: Cell<Option<Arc<AddrSpaceWrapper>>>,
|
||||
pub new_addrsp_guard: Cell<Option<AddrSpaceSwitchReadGuard>>,
|
||||
pub wants_tlb_shootdown: AtomicBool,
|
||||
pub balance: Cell<[usize; 40]>,
|
||||
pub last_queue: Cell<usize>,
|
||||
|
||||
// TODO: Put mailbox queues here, e.g. for TLB shootdown? Just be sure to 128-byte align it
|
||||
// first to avoid cache invalidation.
|
||||
@@ -134,7 +132,6 @@ pub unsafe fn switch_arch_hook() {
|
||||
|
||||
let cur_addrsp = percpu.current_addrsp.borrow();
|
||||
let next_addrsp = percpu.new_addrsp_tmp.take();
|
||||
let next_addrsp_guard = percpu.new_addrsp_guard.take();
|
||||
|
||||
let retain_pgtbl = match (&*cur_addrsp, &next_addrsp) {
|
||||
(Some(p), Some(n)) => Arc::ptr_eq(p, n),
|
||||
@@ -167,13 +164,14 @@ pub unsafe fn switch_arch_hook() {
|
||||
// space.
|
||||
*percpu.current_addrsp.borrow_mut() = next_addrsp;
|
||||
|
||||
if let Some(next_addrsp) = &*percpu.current_addrsp.borrow() {
|
||||
next_addrsp.used_by.atomic_set(percpu.cpu_id);
|
||||
}
|
||||
match next_addrsp_guard {
|
||||
match &*percpu.current_addrsp.borrow() {
|
||||
Some(next_addrsp) => {
|
||||
next_addrsp.table.utable.make_current();
|
||||
drop(next_addrsp);
|
||||
next_addrsp.used_by.atomic_set(percpu.cpu_id);
|
||||
let mut token = CleanLockToken::new();
|
||||
let mut token = token.token();
|
||||
let next = next_addrsp.acquire_read(token.downgrade());
|
||||
|
||||
next.table.utable.make_current();
|
||||
}
|
||||
_ => {
|
||||
crate::memory::RmmA::set_table(rmm::TableKind::User, empty_cr3());
|
||||
@@ -188,8 +186,9 @@ impl PercpuBlock {
|
||||
switch_internals: ContextSwitchPercpu::default(),
|
||||
current_addrsp: RefCell::new(None),
|
||||
new_addrsp_tmp: Cell::new(None),
|
||||
new_addrsp_guard: Cell::new(None),
|
||||
wants_tlb_shootdown: AtomicBool::new(false),
|
||||
balance: Cell::new([0; 40]),
|
||||
last_queue: Cell::new(39),
|
||||
ptrace_flags: Cell::new(PtraceFlags::empty()),
|
||||
ptrace_session: RefCell::new(None),
|
||||
inside_syscall: Cell::new(false),
|
||||
|
||||
Reference in New Issue
Block a user