Remove more unjustified unsafe

pull/165/head
Andre Richter 2 years ago
parent 5e1fdf8605
commit bb2f1c79b7
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -328,7 +328,7 @@ The actual handlers referenced from the assembly can now branch to it for the ti
```rust ```rust
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(e: &mut ExceptionContext) { extern "C" fn current_elx_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
``` ```
@ -367,7 +367,7 @@ To survive this exception, the respective handler has a special demo case:
```rust ```rust
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
if e.fault_address_valid() { if e.fault_address_valid() {
let far_el1 = FAR_EL1.get(); let far_el1 = FAR_EL1.get();
@ -565,17 +565,17 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 1
+//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { +extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
+ panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") + panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { +extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
+ panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") + panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { +extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
+ panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") + panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
+} +}
+ +
@ -584,7 +584,7 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 1
+//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { +extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
+ if e.fault_address_valid() { + if e.fault_address_valid() {
+ let far_el1 = FAR_EL1.get(); + let far_el1 = FAR_EL1.get();
+ +
@ -601,12 +601,12 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 1
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn current_elx_irq(e: &mut ExceptionContext) { +extern "C" fn current_elx_irq(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { +extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +
@ -615,17 +615,17 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 1
+//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { +extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { +extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { +extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +
@ -634,17 +634,17 @@ diff -uNr 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 1
+//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { +extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { +extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +
+#[no_mangle] +#[no_mangle]
+unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { +extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
+ default_exception_handler(e); + default_exception_handler(e);
+} +}
+ +

@ -67,17 +67,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -86,7 +86,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
if e.fault_address_valid() { if e.fault_address_valid() {
let far_el1 = FAR_EL1.get(); let far_el1 = FAR_EL1.get();
@ -103,12 +103,12 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(e: &mut ExceptionContext) { extern "C" fn current_elx_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -117,17 +117,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -136,17 +136,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -67,17 +67,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -86,7 +86,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -102,12 +102,12 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(e: &mut ExceptionContext) { extern "C" fn current_elx_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -116,17 +116,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -135,17 +135,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -367,8 +367,8 @@ the the implementation of the trait's handling function:
```rust ```rust
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
``` ```
@ -887,10 +887,10 @@ diff -uNr 12_integrated_testing/kernel/src/_arch/aarch64/exception.rs 13_excepti
} }
#[no_mangle] #[no_mangle]
-unsafe extern "C" fn current_elx_irq(e: &mut ExceptionContext) { -extern "C" fn current_elx_irq(e: &mut ExceptionContext) {
- default_exception_handler(e); - default_exception_handler(e);
+unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { +extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
+ let token = &exception::asynchronous::IRQContext::new(); + let token = unsafe { &exception::asynchronous::IRQContext::new() };
+ exception::asynchronous::irq_manager().handle_pending_irqs(token); + exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }

@ -68,17 +68,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -87,7 +87,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -103,13 +103,13 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -118,17 +118,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -137,17 +137,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -68,17 +68,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -87,7 +87,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -103,13 +103,13 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -118,17 +118,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -137,17 +137,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -68,17 +68,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -87,7 +87,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -103,13 +103,13 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -118,17 +118,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -137,17 +137,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -68,17 +68,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -87,7 +87,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -103,13 +103,13 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -118,17 +118,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -137,17 +137,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -68,17 +68,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -87,7 +87,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -103,13 +103,13 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -118,17 +118,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -137,17 +137,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -72,17 +72,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -91,7 +91,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -107,13 +107,13 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -122,17 +122,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -141,17 +141,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

@ -72,17 +72,17 @@ fn default_exception_handler(exc: &ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) { extern "C" fn current_el0_synchronous(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_irq(_e: &mut ExceptionContext) { extern "C" fn current_el0_irq(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) { extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.") panic!("Should not be here. Use of SP_EL0 in EL1 is not supported.")
} }
@ -91,7 +91,7 @@ unsafe extern "C" fn current_el0_serror(_e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) { extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
#[cfg(feature = "test_build")] #[cfg(feature = "test_build")]
{ {
const TEST_SVC_ID: u64 = 0x1337; const TEST_SVC_ID: u64 = 0x1337;
@ -107,13 +107,13 @@ unsafe extern "C" fn current_elx_synchronous(e: &mut ExceptionContext) {
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) { extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
let token = &exception::asynchronous::IRQContext::new(); let token = unsafe { &exception::asynchronous::IRQContext::new() };
exception::asynchronous::irq_manager().handle_pending_irqs(token); exception::asynchronous::irq_manager().handle_pending_irqs(token);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) { extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -122,17 +122,17 @@ unsafe extern "C" fn current_elx_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
@ -141,17 +141,17 @@ unsafe extern "C" fn lower_aarch64_serror(e: &mut ExceptionContext) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_synchronous(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_irq(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }
#[no_mangle] #[no_mangle]
unsafe extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) { extern "C" fn lower_aarch32_serror(e: &mut ExceptionContext) {
default_exception_handler(e); default_exception_handler(e);
} }

Loading…
Cancel
Save