diff options
| author | Tianhao Wang <wth@riseup.net> | 2024-01-30 02:33:26 +0100 |
|---|---|---|
| committer | Tianhao Wang <wth@riseup.net> | 2024-01-30 02:33:26 +0100 |
| commit | 5232a899ca7537a4493a7fbd1bd8e03287ff1e26 (patch) | |
| tree | 87ded44101daa8832ad264996bde74160ab2db93 /src/arch/x86_64/io_port.rs | |
| parent | 553657a0b527ae8ce09ac628da6122fbdd57157b (diff) | |
formatting code, use tab identation -- before it's too late
Diffstat (limited to 'src/arch/x86_64/io_port.rs')
| -rw-r--r-- | src/arch/x86_64/io_port.rs | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/src/arch/x86_64/io_port.rs b/src/arch/x86_64/io_port.rs index 4f629b8..f5755f4 100644 --- a/src/arch/x86_64/io_port.rs +++ b/src/arch/x86_64/io_port.rs @@ -1,36 +1,29 @@ extern "C" { - fn _inb(port:u16) -> u8; - fn _inw(port:u16) -> u16; - fn _outb(port:u16, val:u8); - fn _outw(port:u16, val:u16); + fn _inb(port: u16) -> u8; + fn _inw(port: u16) -> u16; + fn _outb(port: u16, val: u8); + fn _outw(port: u16, val: u16); } // The port addr is 16-bit wide. // wrappers for in/out[b,w] -// Also I don't feel necessary to have a IO_Port Class give how +// Also I don't feel necessary to have a IO_Port Class give how // trivial it is // TODO perhaps use inline asm, because the code is short -pub fn inw(p:u16) -> u16 { - unsafe{ - _inw(p) - } +pub fn inw(p: u16) -> u16 { + unsafe { _inw(p) } } -pub fn inb(p:u16) -> u8 { - unsafe{ - _inb(p) - } +pub fn inb(p: u16) -> u8 { + unsafe { _inb(p) } } -pub fn outb(p:u16, val:u8){ - unsafe{ - _outb(p,val); - } +pub fn outb(p: u16, val: u8) { + unsafe { + _outb(p, val); + } } -pub fn outw(p:u16, val:u16){ - unsafe{ - _outw(p,val) - } +pub fn outw(p: u16, val: u16) { + unsafe { _outw(p, val) } } - |
