()
| 23 | const _MEC_LPC_DATA_REGISTER3: u16 = 0x0807; |
| 24 | |
| 25 | pub 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 |
no outgoing calls
no test coverage detected