Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aarch32-cpu/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Mark `asm::irq_enable()` as unsafe to match `interrupt::enable()`

## [aarch32-cpu v0.1.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion aarch32-cpu/src/asmv4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn irq_disable() {
/// Unmask IRQ
#[cfg_attr(not(feature = "check-asm"), inline)]
#[cfg_attr(target_arch = "arm", instruction_set(arm::a32))]
pub fn irq_enable() {
pub unsafe fn irq_enable() {
#[cfg(target_arch = "arm")]
unsafe {
core::arch::asm!(r#"
Expand Down
2 changes: 1 addition & 1 deletion aarch32-cpu/src/asmv7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn irq_disable() {

/// Unmask IRQ
#[cfg_attr(not(feature = "check-asm"), inline)]
pub fn irq_enable() {
pub unsafe fn irq_enable() {
unsafe {
core::arch::asm!("cpsie i");
}
Expand Down
5 changes: 4 additions & 1 deletion aarch32-cpu/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ use core::sync::atomic::{compiler_fence, Ordering};
pub unsafe fn enable() {
// Ensure no preceeding memory accesses are reordered to after interrupts are enabled.
compiler_fence(Ordering::SeqCst);
crate::asm::irq_enable();
// Safety: as per outer function
unsafe {
crate::asm::irq_enable();
}
}

/// Disable IRQ
Expand Down