Skip to content

Commit 4ac85bc

Browse files
dependabot[bot]gribozavr
authored andcommitted
cargo: bump aarch64-rt from 0.3.1 to 0.4.2 in /src/exercises/bare-metal/rtc (google#3004)
Bumps [aarch64-rt](https://github.com/google/aarch64-rt) from 0.3.1 to 0.4.2. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
1 parent fc982ae commit 4ac85bc

3 files changed

Lines changed: 44 additions & 53 deletions

File tree

src/exercises/bare-metal/rtc/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/exercises/bare-metal/rtc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish = false
88

99
[dependencies]
1010
aarch64-paging = { version = "0.11.0", default-features = false }
11-
aarch64-rt = "0.3.1"
11+
aarch64-rt = "0.4.2"
1212
arm-gic = "0.7.1"
1313
arm-pl011-uart = "0.4.0"
1414
bitflags = "2.10.0"

src/exercises/bare-metal/rtc/src/exceptions.rs

Lines changed: 41 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,66 +12,57 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use aarch64_rt::{ExceptionHandlers, RegisterStateRef, exception_handlers};
1516
use arm_gic::gicv3::{GicCpuInterface, InterruptGroup};
1617
use log::{error, info, trace};
1718
use smccc::Hvc;
1819
use smccc::psci::system_off;
1920

20-
// SAFETY: There is no other global function of this name.
21-
#[unsafe(no_mangle)]
22-
extern "C" fn sync_exception_current(_elr: u64, _spsr: u64) {
23-
error!("sync_exception_current");
24-
system_off::<Hvc>().unwrap();
25-
}
21+
struct Handlers;
2622

27-
// SAFETY: There is no other global function of this name.
28-
#[unsafe(no_mangle)]
29-
extern "C" fn irq_current(_elr: u64, _spsr: u64) {
30-
trace!("irq_current");
31-
let intid =
32-
GicCpuInterface::get_and_acknowledge_interrupt(InterruptGroup::Group1)
33-
.expect("No pending interrupt");
34-
info!("IRQ {intid:?}");
35-
}
23+
impl ExceptionHandlers for Handlers {
24+
extern "C" fn sync_current(_state: RegisterStateRef) {
25+
error!("sync_exception_current");
26+
system_off::<Hvc>().unwrap();
27+
}
3628

37-
// SAFETY: There is no other global function of this name.
38-
#[unsafe(no_mangle)]
39-
extern "C" fn fiq_current(_elr: u64, _spsr: u64) {
40-
error!("fiq_current");
41-
system_off::<Hvc>().unwrap();
42-
}
29+
extern "C" fn irq_current(_state: RegisterStateRef) {
30+
trace!("irq_current");
31+
let intid =
32+
GicCpuInterface::get_and_acknowledge_interrupt(InterruptGroup::Group1)
33+
.expect("No pending interrupt");
34+
info!("IRQ {intid:?}");
35+
}
4336

44-
// SAFETY: There is no other global function of this name.
45-
#[unsafe(no_mangle)]
46-
extern "C" fn serr_current(_elr: u64, _spsr: u64) {
47-
error!("serr_current");
48-
system_off::<Hvc>().unwrap();
49-
}
37+
extern "C" fn fiq_current(_state: RegisterStateRef) {
38+
error!("fiq_current");
39+
system_off::<Hvc>().unwrap();
40+
}
5041

51-
// SAFETY: There is no other global function of this name.
52-
#[unsafe(no_mangle)]
53-
extern "C" fn sync_lower(_elr: u64, _spsr: u64) {
54-
error!("sync_lower");
55-
system_off::<Hvc>().unwrap();
56-
}
42+
extern "C" fn serror_current(_state: RegisterStateRef) {
43+
error!("serr_current");
44+
system_off::<Hvc>().unwrap();
45+
}
5746

58-
// SAFETY: There is no other global function of this name.
59-
#[unsafe(no_mangle)]
60-
extern "C" fn irq_lower(_elr: u64, _spsr: u64) {
61-
error!("irq_lower");
62-
system_off::<Hvc>().unwrap();
63-
}
47+
extern "C" fn sync_lower(_state: RegisterStateRef) {
48+
error!("sync_lower");
49+
system_off::<Hvc>().unwrap();
50+
}
6451

65-
// SAFETY: There is no other global function of this name.
66-
#[unsafe(no_mangle)]
67-
extern "C" fn fiq_lower(_elr: u64, _spsr: u64) {
68-
error!("fiq_lower");
69-
system_off::<Hvc>().unwrap();
70-
}
52+
extern "C" fn irq_lower(_state: RegisterStateRef) {
53+
error!("irq_lower");
54+
system_off::<Hvc>().unwrap();
55+
}
7156

72-
// SAFETY: There is no other global function of this name.
73-
#[unsafe(no_mangle)]
74-
extern "C" fn serr_lower(_elr: u64, _spsr: u64) {
75-
error!("serr_lower");
76-
system_off::<Hvc>().unwrap();
57+
extern "C" fn fiq_lower(_state: RegisterStateRef) {
58+
error!("fiq_lower");
59+
system_off::<Hvc>().unwrap();
60+
}
61+
62+
extern "C" fn serror_lower(_state: RegisterStateRef) {
63+
error!("serr_lower");
64+
system_off::<Hvc>().unwrap();
65+
}
7766
}
67+
68+
exception_handlers!(Handlers);

0 commit comments

Comments
 (0)