Separate context and process IDs.

This commit is contained in:
4lDO2
2024-07-08 14:10:31 +02:00
parent 74b824f40f
commit 0da2fce64a
14 changed files with 63 additions and 56 deletions
+4 -4
View File
@@ -85,8 +85,8 @@ pub fn init() {
unsafe {
let percpu = PercpuBlock::current();
percpu.switch_internals.set_context_id(context.id);
percpu.switch_internals.set_idle_id(context.id);
percpu.switch_internals.set_current_cid(context.cid);
percpu.switch_internals.set_idle_id(context.cid);
}
}
@@ -100,8 +100,8 @@ pub fn contexts_mut() -> RwLockWriteGuard<'static, ContextList> {
CONTEXTS.write()
}
pub fn context_id() -> ContextId {
PercpuBlock::current().switch_internals.context_id()
pub fn current_cid() -> ContextId {
PercpuBlock::current().switch_internals.current_cid()
}
pub fn current() -> Result<Arc<RwSpinlock<Context>>> {