mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-02-07 13:02:11 -05:00
naming changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use super::Driver;
|
||||
use crate::interrupts::{InterruptDescriptor, InterruptHandler};
|
||||
use crate::local_per_cpu;
|
||||
use crate::per_cpu_private;
|
||||
use crate::sync::OnceLock;
|
||||
use alloc::{collections::binary_heap::BinaryHeap, sync::Arc};
|
||||
use core::{
|
||||
@@ -308,6 +308,6 @@ pub fn schedule_preempt(when: Instant) {
|
||||
|
||||
static SYS_TIMER: OnceLock<Arc<SysTimer>> = OnceLock::new();
|
||||
|
||||
local_per_cpu! {
|
||||
per_cpu_private! {
|
||||
static WAKEUP_Q: BinaryHeap<WakeupEvent> = BinaryHeap::new;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
local_per_cpu,
|
||||
per_cpu_private,
|
||||
process::{Task, owned::OwnedTask},
|
||||
};
|
||||
use alloc::{boxed::Box, sync::Arc};
|
||||
@@ -10,7 +10,7 @@ use core::{
|
||||
ptr,
|
||||
};
|
||||
|
||||
local_per_cpu! {
|
||||
per_cpu_private! {
|
||||
pub(super) static CUR_TASK_PTR: CurrentTaskPtr = CurrentTaskPtr::new;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::kernel::cpu_id::CpuId;
|
||||
use crate::process::owned::OwnedTask;
|
||||
use crate::{
|
||||
arch::Arch,
|
||||
local_per_cpu, per_cpu,
|
||||
per_cpu_private, per_cpu_shared,
|
||||
process::{TASK_LIST, TaskDescriptor, TaskState},
|
||||
};
|
||||
use alloc::{boxed::Box, collections::btree_map::BTreeMap, sync::Arc};
|
||||
@@ -60,7 +60,7 @@ impl CpuStat<AtomicUsize> {
|
||||
}
|
||||
}
|
||||
|
||||
per_cpu! {
|
||||
per_cpu_shared! {
|
||||
pub static CPU_STAT: CpuStat<AtomicUsize> = CpuStat::default;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ pub fn get_cpu_stat(cpu_id: CpuId) -> CpuStat<usize> {
|
||||
CPU_STAT.get_by_cpu(cpu_id.value()).to_usize()
|
||||
}
|
||||
|
||||
local_per_cpu! {
|
||||
per_cpu_private! {
|
||||
static SCHED_STATE: SchedState = SchedState::new;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ impl SchedState {
|
||||
None
|
||||
}
|
||||
|
||||
local_per_cpu! {
|
||||
per_cpu_private! {
|
||||
static LAST_UPDATE: Option<Instant> = none;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/// A declarative macro to define a static `PerCpu` variable and register it
|
||||
/// for automatic initialization.
|
||||
#[macro_export]
|
||||
macro_rules! per_cpu {
|
||||
macro_rules! per_cpu_shared {
|
||||
($vis:vis static $name:ident: $type:ty = $initializer:expr;) => {
|
||||
$vis static $name: libkernel::sync::per_cpu::PerCpu<$type, $crate::arch::ArchImpl> =
|
||||
libkernel::sync::per_cpu::PerCpu::new($initializer);
|
||||
@@ -19,7 +19,7 @@ macro_rules! per_cpu {
|
||||
|
||||
/// Wraps with a [`RefCell`] for convenience
|
||||
#[macro_export]
|
||||
macro_rules! local_per_cpu {
|
||||
macro_rules! per_cpu_private {
|
||||
($vis:vis static $name:ident: $type:ty = $initializer:expr;) => {
|
||||
$vis static $name: libkernel::sync::per_cpu::PerCpu<
|
||||
core::cell::RefCell<$type>,
|
||||
|
||||
Reference in New Issue
Block a user