We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a64d07 commit 3a06a94Copy full SHA for 3a06a94
framework_lib/src/chromium_ec/portio_mec.rs
@@ -25,8 +25,14 @@ const _MEC_LPC_DATA_REGISTER3: u16 = 0x0807;
25
pub fn init() {
26
#[cfg(target_os = "linux")]
27
unsafe {
28
- ioperm(EC_LPC_ADDR_HOST_DATA as u64, 8, 1);
29
- ioperm(MEC_LPC_ADDRESS_REGISTER0 as u64, 10, 1);
+ println!("Init MEC");
+ let res = ioperm(EC_LPC_ADDR_HOST_DATA as u64, 8, 1);
30
+ if res != 0 {
31
+ error!("ioperm failed. portio driver is likely block by Linux kernel lockdown mode");
32
+ return false;
33
+ }
34
+ let res = ioperm(MEC_LPC_ADDRESS_REGISTER0 as u64, 10, 1);
35
+ assert_eq!(res, 0);
36
}
37
38
0 commit comments