Skip to content

Commit 34c3316

Browse files
authored
Merge pull request #2187 from fogti/local-executor
refactor(`kernel/core_local`): swap out `StaticExecutor` with `StaticLocalExecutor`
2 parents 16a22e7 + 54a7842 commit 34c3316

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/arch/aarch64/kernel/core_local.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::ptr;
44
use core::sync::atomic::Ordering;
55

66
use aarch64_cpu::registers::{Readable, TPIDR_EL1, Writeable};
7-
use async_executor::StaticExecutor;
7+
use async_executor::StaticLocalExecutor;
88
#[cfg(feature = "smp")]
99
use hermit_sync::InterruptTicketMutex;
1010
use hermit_sync::{RawRwSpinLock, RawSpinMutex};
@@ -24,7 +24,7 @@ pub(crate) struct CoreLocal {
2424
/// Interface to the interrupt counters
2525
irq_statistics: &'static IrqStatistics,
2626
/// The core-local async executor.
27-
ex: StaticExecutor<RawSpinMutex, RawRwSpinLock>,
27+
ex: StaticLocalExecutor<RawSpinMutex, RawRwSpinLock>,
2828
/// Queues to handle incoming requests from the other cores
2929
#[cfg(feature = "smp")]
3030
pub scheduler_input: InterruptTicketMutex<SchedulerInput>,
@@ -46,7 +46,7 @@ impl CoreLocal {
4646
core_id,
4747
scheduler: Cell::new(ptr::null_mut()),
4848
irq_statistics,
49-
ex: StaticExecutor::new(),
49+
ex: StaticLocalExecutor::new(),
5050
#[cfg(feature = "smp")]
5151
scheduler_input: InterruptTicketMutex::new(SchedulerInput::new()),
5252
};
@@ -93,7 +93,7 @@ pub(crate) fn core_scheduler() -> &'static mut PerCoreScheduler {
9393
unsafe { CoreLocal::get().scheduler.get().as_mut().unwrap() }
9494
}
9595

96-
pub(crate) fn ex() -> &'static StaticExecutor<RawSpinMutex, RawRwSpinLock> {
96+
pub(crate) fn ex() -> &'static StaticLocalExecutor<RawSpinMutex, RawRwSpinLock> {
9797
&CoreLocal::get().ex
9898
}
9999

src/arch/riscv64/kernel/core_local.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::cell::Cell;
44
use core::ptr;
55
use core::sync::atomic::Ordering;
66

7-
use async_executor::StaticExecutor;
7+
use async_executor::StaticLocalExecutor;
88
#[cfg(feature = "smp")]
99
use hermit_sync::InterruptTicketMutex;
1010
use hermit_sync::{RawRwSpinLock, RawSpinMutex};
@@ -22,7 +22,7 @@ pub struct CoreLocal {
2222
/// start address of the kernel stack
2323
pub kernel_stack: Cell<u64>,
2424
/// The core-local async executor.
25-
ex: StaticExecutor<RawSpinMutex, RawRwSpinLock>,
25+
ex: StaticLocalExecutor<RawSpinMutex, RawRwSpinLock>,
2626
/// Queues to handle incoming requests from the other cores
2727
#[cfg(feature = "smp")]
2828
pub scheduler_input: InterruptTicketMutex<SchedulerInput>,
@@ -41,7 +41,7 @@ impl CoreLocal {
4141
core_id,
4242
scheduler: Cell::new(ptr::null_mut()),
4343
kernel_stack: Cell::new(0),
44-
ex: StaticExecutor::new(),
44+
ex: StaticLocalExecutor::new(),
4545
#[cfg(feature = "smp")]
4646
scheduler_input: InterruptTicketMutex::new(SchedulerInput::new()),
4747
};
@@ -84,6 +84,6 @@ pub fn set_core_scheduler(scheduler: *mut PerCoreScheduler) {
8484
CoreLocal::get().scheduler.set(scheduler);
8585
}
8686

87-
pub(crate) fn ex() -> &'static StaticExecutor<RawSpinMutex, RawRwSpinLock> {
87+
pub(crate) fn ex() -> &'static StaticLocalExecutor<RawSpinMutex, RawRwSpinLock> {
8888
&CoreLocal::get().ex
8989
}

src/arch/x86_64/kernel/core_local.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::sync::atomic::AtomicBool;
66
use core::sync::atomic::Ordering;
77
use core::{mem, ptr};
88

9-
use async_executor::StaticExecutor;
9+
use async_executor::StaticLocalExecutor;
1010
#[cfg(feature = "smp")]
1111
use hermit_sync::InterruptTicketMutex;
1212
use hermit_sync::{RawRwSpinLock, RawSpinMutex};
@@ -33,7 +33,7 @@ pub(crate) struct CoreLocal {
3333
/// Interface to the interrupt counters
3434
irq_statistics: &'static IrqStatistics,
3535
/// The core-local async executor.
36-
ex: StaticExecutor<RawSpinMutex, RawRwSpinLock>,
36+
ex: StaticLocalExecutor<RawSpinMutex, RawRwSpinLock>,
3737
#[cfg(feature = "smp")]
3838
pub hlt: AtomicBool,
3939
/// Queues to handle incoming requests from the other cores
@@ -61,7 +61,7 @@ impl CoreLocal {
6161
tss: Cell::new(ptr::null_mut()),
6262
kernel_stack: Cell::new(ptr::null_mut()),
6363
irq_statistics,
64-
ex: StaticExecutor::new(),
64+
ex: StaticLocalExecutor::new(),
6565
#[cfg(feature = "smp")]
6666
hlt: AtomicBool::new(false),
6767
#[cfg(feature = "smp")]
@@ -110,7 +110,7 @@ pub(crate) fn core_scheduler() -> &'static mut PerCoreScheduler {
110110
unsafe { CoreLocal::get().scheduler.get().as_mut().unwrap() }
111111
}
112112

113-
pub(crate) fn ex() -> &'static StaticExecutor<RawSpinMutex, RawRwSpinLock> {
113+
pub(crate) fn ex() -> &'static StaticLocalExecutor<RawSpinMutex, RawRwSpinLock> {
114114
&CoreLocal::get().ex
115115
}
116116

0 commit comments

Comments
 (0)