Skip to content

Commit e572a5a

Browse files
committed
Use NotificationBits in Idol
1 parent 0e2977a commit e572a5a

55 files changed

Lines changed: 106 additions & 121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ gimlet-inspector-protocol = { git = "https://github.com/oxidecomputer/gimlet-ins
151151
hif = { git = "https://github.com/oxidecomputer/hif", default-features = false }
152152
humpty = { git = "https://github.com/oxidecomputer/humpty", default-features = false, version = "0.1.3" }
153153
hubtools = { git = "https://github.com/oxidecomputer/hubtools", default-features = false, version = "0.4.6" }
154-
idol = { git = "https://github.com/oxidecomputer/idolatry.git", default-features = false }
155-
idol-runtime = { git = "https://github.com/oxidecomputer/idolatry.git", default-features = false }
154+
idol = { git = "https://github.com/oxidecomputer/idolatry.git", default-features = false, branch = "mkeeter/notification-bits" }
155+
idol-runtime = { git = "https://github.com/oxidecomputer/idolatry.git", default-features = false, branch = "mkeeter/notification-bits" }
156156
lpc55_sign = { git = "https://github.com/oxidecomputer/lpc55_support", default-features = false }
157157
measurement-token = { git = "https://github.com/oxidecomputer/lpc55_support", default-features = false }
158158
ordered-toml = { git = "https://github.com/oxidecomputer/ordered-toml", default-features = false }

app/medusa/base.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ task-slots = [
125125
"auxflash",
126126
"packrat",
127127
{front_io = "ecp5_front_io"}]
128-
notifications = ["timer"]
129128

130129
[tasks.transceivers]
131130
name = "drv-transceivers-server"

drv/auxflash-server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ impl NotificationHandler for ServerImpl {
484484
0
485485
}
486486

487-
fn handle_notification(&mut self, _bits: u32) {
487+
fn handle_notification(&mut self, _bits: userlib::NotificationBits) {
488488
unreachable!()
489489
}
490490
}

drv/cosmo-hf/src/hf.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,8 @@ impl NotificationHandler for ServerImpl {
785785
notifications::TIMER_MASK
786786
}
787787

788-
fn handle_notification(&mut self, bits: u32) {
789-
if (bits & notifications::TIMER_MASK) != 0
790-
&& userlib::sys_get_timer().deadline.is_none()
791-
{
788+
fn handle_notification(&mut self, bits: userlib::NotificationBits) {
789+
if bits.is_timer_set(notifications::TIMER_MASK) {
792790
self.step_hash();
793791
}
794792
}

drv/cosmo-seq-server/src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,14 +888,12 @@ impl NotificationHandler for ServerImpl {
888888
notifications::TIMER_MASK | notifications::SEQ_IRQ_MASK
889889
}
890890

891-
fn handle_notification(&mut self, bits: u32) {
892-
if (bits & notifications::SEQ_IRQ_MASK) != 0 {
891+
fn handle_notification(&mut self, bits: userlib::NotificationBits) {
892+
if bits.is_set_unconditional(notifications::SEQ_IRQ_MASK) {
893893
self.handle_sequencer_interrupt();
894894
}
895895

896-
if (bits & notifications::TIMER_MASK) == 0
897-
|| sys_get_timer().deadline.is_some()
898-
{
896+
if !bits.is_timer_set(notifications::TIMER_MASK) {
899897
return;
900898
}
901899
let state = self.log_state_registers();

drv/eeprom/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl NotificationHandler for EepromServer {
9797
0
9898
}
9999

100-
fn handle_notification(&mut self, _bits: u32) {
100+
fn handle_notification(&mut self, _bits: userlib::NotificationBits) {
101101
unreachable!()
102102
}
103103
}

drv/fpga-server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ impl<'a, Device: Fpga<'a> + FpgaUserDesign> idol_runtime::NotificationHandler
608608
0
609609
}
610610

611-
fn handle_notification(&mut self, _bits: u32) {
611+
fn handle_notification(&mut self, _bits: userlib::NotificationBits) {
612612
unreachable!()
613613
}
614614
}

drv/gimlet-hf-server/src/main.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -947,10 +947,8 @@ impl NotificationHandler for ServerImpl {
947947
notifications::TIMER_MASK
948948
}
949949

950-
fn handle_notification(&mut self, bits: u32) {
951-
if (bits & notifications::TIMER_MASK) != 0
952-
&& userlib::sys_get_timer().deadline.is_none()
953-
{
950+
fn handle_notification(&mut self, bits: userlib::NotificationBits) {
951+
if bits.is_timer_set(notifications::TIMER_MASK) {
954952
self.step_hash();
955953
}
956954
}

drv/gimlet-seq-server/src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,12 @@ impl<S: SpiServer> NotificationHandler for ServerImpl<S> {
540540
notifications::TIMER_MASK | self.vcore.mask()
541541
}
542542

543-
fn handle_notification(&mut self, bits: u32) {
544-
if (bits & self.vcore.mask()) != 0 {
543+
fn handle_notification(&mut self, bits: userlib::NotificationBits) {
544+
if bits.is_set_unconditional(self.vcore.mask()) {
545545
self.vcore.handle_notification(self.ereport_buf);
546546
}
547547

548-
if (bits & notifications::TIMER_MASK) == 0
549-
|| sys_get_timer().deadline.is_some()
550-
{
548+
if !bits.is_timer_set(notifications::TIMER_MASK) {
551549
return;
552550
}
553551

0 commit comments

Comments
 (0)