Crates.io | syscon-rs |
lib.rs | syscon-rs |
version | 0.1.1 |
source | src |
created_at | 2023-01-31 21:56:32.445595 |
updated_at | 2023-02-02 03:31:59.962935 |
description | A driver for syscon poweroff, and reboot in rust |
homepage | |
repository | https://github.com/archaic-archea/syscon-rs |
max_upload_size | |
id | 773055 |
size | 3,264 |
A basic syscon-poweroff and syscon-reboot driver.
Relies on log
and fdt
crates.
extern "C" fn kmain(_hartid: u64, devicetree_ptr: *const u8) {
// Initialize logger
syscon_rs::init(devicetree_ptr);
syscon_rs::power_off().expect("Failed to power off");
}
Or
extern "C" fn kmain(_hartid: u64, devicetree_ptr: *const u8) {
// Initialize logger
syscon_rs::init(devicetree_ptr);
syscon_rs::reboot().expect("Failed to reboot");
}