diff options
author | 2021-04-08 02:10:35 -0700 | |
---|---|---|
committer | 2021-04-08 02:10:35 -0700 | |
commit | 523296c4ecfad57ef26aabdde1446c788dbc668e (patch) | |
tree | 910cea9953116816b41c67f9550e807a2eb39cda /src/io.rs | |
parent | e9fd841a6b89133f6afe46a8ce608af2f2e4b57e (diff) | |
download | rust-x86-523296c4ecfad57ef26aabdde1446c788dbc668e.tar.gz rust-x86-523296c4ecfad57ef26aabdde1446c788dbc668e.tar.zst rust-x86-523296c4ecfad57ef26aabdde1446c788dbc668e.zip |
Fix clippy warnings.
Diffstat (limited to 'src/io.rs')
-rw-r--r-- | src/io.rs | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1,12 +1,18 @@ //! I/O port functionality. /// Write 8 bits to port +/// +/// # Safety +/// Needs IO privileges. #[inline] pub unsafe fn outb(port: u16, val: u8) { llvm_asm!("outb %al, %dx" :: "{dx}"(port), "{al}"(val)); } /// Read 8 bits from port +/// +/// # Safety +/// Needs IO privileges. #[inline] pub unsafe fn inb(port: u16) -> u8 { let ret: u8; @@ -15,12 +21,18 @@ pub unsafe fn inb(port: u16) -> u8 { } /// Write 16 bits to port +/// +/// # Safety +/// Needs IO privileges. #[inline] pub unsafe fn outw(port: u16, val: u16) { llvm_asm!("outw %ax, %dx" :: "{dx}"(port), "{al}"(val)); } /// Read 16 bits from port +/// +/// # Safety +/// Needs IO privileges. #[inline] pub unsafe fn inw(port: u16) -> u16 { let ret: u16; @@ -29,12 +41,18 @@ pub unsafe fn inw(port: u16) -> u16 { } /// Write 32 bits to port +/// +/// # Safety +/// Needs IO privileges. #[inline] pub unsafe fn outl(port: u16, val: u32) { llvm_asm!("outl %eax, %dx" :: "{dx}"(port), "{al}"(val)); } /// Read 32 bits from port +/// +/// # Safety +/// Needs IO privileges. #[inline] pub unsafe fn inl(port: u16) -> u32 { let ret: u32; |