A helper function to write the system information to stable memory.
(config: SystemInfo)
| 71 | |
| 72 | /// A helper function to write the system information to stable memory. |
| 73 | pub fn write_system_info(config: SystemInfo) { |
| 74 | CONFIG.with(|cell| { |
| 75 | cell.borrow_mut() |
| 76 | .set(SystemState::Initialized(config)) |
| 77 | .expect("failed to write system information"); |
| 78 | }); |
| 79 | } |
| 80 | |
| 81 | // A helper function to read the system state, which can be uninitialized. |
| 82 | pub fn read_system_state() -> SystemState { |