oxidecomputer / hubris

A lightweight, memory-protected, message-passing kernel for deeply embedded systems.
Mozilla Public License 2.0
3.04k stars 180 forks source link

`gimlet_seq` should use `set_bytes`, not `write_bytes` when setting individual bits #1929

Closed Aaron-Hartwig closed 1 week ago

Aaron-Hartwig commented 1 week ago

Right now the sequencer kicks off A1: https://github.com/oxidecomputer/hubris/blob/master/drv/gimlet-seq-server/src/main.rs#L726

Later, it kicks off A0: https://github.com/oxidecomputer/hubris/blob/master/drv/gimlet-seq-server/src/main.rs#L782

However since write_bytes uses the Write operation, we effectively clear the A1 bit when setting the A0 bit. Using set_bytes uses a BitSet operation, allowing us to set A0 while leaving A1 in place. The FPGA has papered over this by ignoring the A1 bit while it is in A0.