Skip to content

Commit

Permalink
[Closes nuta#107] Wrap SpinLock<SignalDelivery> in Arc<>
Browse files Browse the repository at this point in the history
  • Loading branch information
michalfita committed Mar 24, 2022
1 parent 5f10bc2 commit 46ee790
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions kernel/process/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub struct Process {
vm: AtomicRefCell<Option<Arc<SpinLock<Vm>>>>,
opened_files: SpinLock<OpenedFileTable>,
root_fs: Arc<SpinLock<RootFs>>,
signals: SpinLock<SignalDelivery>,
signals: Arc<SpinLock<SignalDelivery>>,
signaled_frame: AtomicCell<Option<PtRegs>>,
sigset: SpinLock<SigSet>,
}
Expand All @@ -141,7 +141,7 @@ impl Process {
pid: PId::new(0),
root_fs: INITIAL_ROOT_FS.clone(),
opened_files: SpinLock::new(OpenedFileTable::new()),
signals: SpinLock::new(SignalDelivery::new()),
signals: Arc::new(SpinLock::new(SignalDelivery::new())),
signaled_frame: AtomicCell::new(None),
sigset: SpinLock::new(SigSet::ZERO),
});
Expand Down Expand Up @@ -202,7 +202,7 @@ impl Process {
vm: AtomicRefCell::new(Some(Arc::new(SpinLock::new(entry.vm)))),
opened_files: SpinLock::new(opened_files),
root_fs,
signals: SpinLock::new(SignalDelivery::new()),
signals: Arc::new(SpinLock::new(SignalDelivery::new())),
signaled_frame: AtomicCell::new(None),
sigset: SpinLock::new(SigSet::ZERO),
});
Expand Down Expand Up @@ -515,7 +515,7 @@ impl Process {
opened_files: SpinLock::new(opened_files),
root_fs: parent.root_fs().clone(),
arch,
signals: SpinLock::new(SignalDelivery::new()),
signals: Arc::new(SpinLock::new(SignalDelivery::new())), // TODO: #88 has to address this
signaled_frame: AtomicCell::new(None),
sigset: SpinLock::new(*sig_set),
});
Expand Down
3 changes: 2 additions & 1 deletion runtime/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub mod spinlock;
mod x64;

pub mod arch {
#[cfg(target_arch = "x86_64")]
pub use super::x64::{
enable_irq, halt, idle, read_clock_counter, semihosting_halt, x64_specific, Backtrace,
PageFaultReason, PageTable, PtRegs, SavedInterruptStatus, SemihostingExitStatus,
Expand Down Expand Up @@ -88,7 +89,7 @@ impl Handler for NopHandler {
_a5: usize,
_a6: usize,
_n: usize,
_frame: *mut x64::PtRegs,
_frame: *mut arch::PtRegs,
) -> isize {
0
}
Expand Down

0 comments on commit 46ee790

Please sign in to comment.