MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / init

Function init

framework_lib/src/chromium_ec/portio_mec.rs:25–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23const _MEC_LPC_DATA_REGISTER3: u16 = 0x0807;
24
25pub fn init() -> bool {
26 #[cfg(target_os = "linux")]
27 unsafe {
28 let res = ioperm(EC_LPC_ADDR_HOST_DATA as u64, 8, 1);
29 if res != 0 {
30 error!("ioperm failed. portio driver is likely block by Linux kernel lockdown mode");
31 return false;
32 }
33 let res = ioperm(MEC_LPC_ADDRESS_REGISTER0 as u64, 10, 1);
34 assert_eq!(res, 0);
35 }
36
37 true
38}
39
40// TODO: Create a wrapper
41// TODO: Deduplicate this with transfer_read_mec

Callers 3

print_nvidia_detailsFunction · 0.50
print_nvidia_infoFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected