Skip to content

Commit

Permalink
cargo: bump the minor group across 1 directory with 2 updates (#2689)
Browse files Browse the repository at this point in the history
Bumps the minor group with 2 updates in the
/src/exercises/bare-metal/rtc directory:
[arm-gic](https://github.com/google/arm-gic) and
[bitflags](https://github.com/bitflags/bitflags).

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Walbran <[email protected]>
  • Loading branch information
dependabot[bot] and qwandor authored Mar 6, 2025
1 parent b24914a commit a20d3f1
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 13 deletions.
64 changes: 60 additions & 4 deletions src/exercises/bare-metal/rtc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/exercises/bare-metal/rtc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
publish = false

[dependencies]
arm-gic = "0.1.2"
bitflags = "2.8.0"
arm-gic = "0.2.2"
bitflags = "2.9.0"
chrono = { version = "0.4.40", default-features = false }
log = "0.4.26"
smccc = "0.1.1"
Expand Down
14 changes: 7 additions & 7 deletions src/exercises/bare-metal/rtc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ mod pl011;
mod pl031;

use crate::pl031::Rtc;
use arm_gic::gicv3::{IntId, Trigger};
use arm_gic::{irq_enable, wfi};
use arm_gic::{irq_enable, wfi, IntId, Trigger};
use chrono::{TimeZone, Utc};
use core::hint::spin_loop;
// ANCHOR: imports
Expand Down Expand Up @@ -63,8 +62,9 @@ extern "C" fn main(x0: u64, x1: u64, x2: u64, x3: u64) {
// SAFETY: `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base
// addresses of a GICv3 distributor and redistributor respectively, and
// nothing else accesses those address ranges.
let mut gic = unsafe { GicV3::new(GICD_BASE_ADDRESS, GICR_BASE_ADDRESS) };
gic.setup();
let mut gic =
unsafe { GicV3::new(GICD_BASE_ADDRESS, GICR_BASE_ADDRESS, 1, 0x20000) };
gic.setup(0);
// ANCHOR_END: main

// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and
Expand All @@ -75,10 +75,10 @@ extern "C" fn main(x0: u64, x1: u64, x2: u64, x3: u64) {
info!("RTC: {time}");

GicV3::set_priority_mask(0xff);
gic.set_interrupt_priority(PL031_IRQ, 0x80);
gic.set_trigger(PL031_IRQ, Trigger::Level);
gic.set_interrupt_priority(PL031_IRQ, None, 0x80);
gic.set_trigger(PL031_IRQ, None, Trigger::Level);
irq_enable();
gic.enable_interrupt(PL031_IRQ, true);
gic.enable_interrupt(PL031_IRQ, None, true);

// Wait for 3 seconds, without interrupts.
let target = timestamp + 3;
Expand Down

0 comments on commit a20d3f1

Please sign in to comment.