aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64
diff options
context:
space:
mode:
authorTianhao Wang <wth@riseup.net>2024-01-30 02:33:26 +0100
committerTianhao Wang <wth@riseup.net>2024-01-30 02:33:26 +0100
commit5232a899ca7537a4493a7fbd1bd8e03287ff1e26 (patch)
tree87ded44101daa8832ad264996bde74160ab2db93 /src/arch/x86_64
parent553657a0b527ae8ce09ac628da6122fbdd57157b (diff)
formatting code, use tab identation -- before it's too late
Diffstat (limited to 'src/arch/x86_64')
-rw-r--r--src/arch/x86_64/io_port.rs37
-rw-r--r--src/arch/x86_64/misc.rs8
-rw-r--r--src/arch/x86_64/mod.rs4
-rw-r--r--src/arch/x86_64/pic.rs1
-rw-r--r--src/arch/x86_64/pit.rs1
-rw-r--r--src/arch/x86_64/plugbox.rs1
6 files changed, 24 insertions, 28 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) }
}
-
diff --git a/src/arch/x86_64/misc.rs b/src/arch/x86_64/misc.rs
index c007d99..8a2c316 100644
--- a/src/arch/x86_64/misc.rs
+++ b/src/arch/x86_64/misc.rs
@@ -3,7 +3,7 @@
// asm code goes to asm/misc.s
extern "C" {
- fn _delay();
+ fn _delay();
}
#[inline(always)]
@@ -11,7 +11,7 @@ extern "C" {
// delays for several cycles. Used to fill sequantial IO commands
// (for devices to react)
pub fn delay() {
- unsafe {
- _delay();
- }
+ unsafe {
+ _delay();
+ }
}
diff --git a/src/arch/x86_64/mod.rs b/src/arch/x86_64/mod.rs
index f48c7fd..a7f9e89 100644
--- a/src/arch/x86_64/mod.rs
+++ b/src/arch/x86_64/mod.rs
@@ -1,6 +1,6 @@
+pub mod cpu;
pub mod io_port;
+pub mod misc;
pub mod pic;
pub mod pit;
pub mod plugbox;
-pub mod cpu;
-pub mod misc;
diff --git a/src/arch/x86_64/pic.rs b/src/arch/x86_64/pic.rs
index e69de29..8b13789 100644
--- a/src/arch/x86_64/pic.rs
+++ b/src/arch/x86_64/pic.rs
@@ -0,0 +1 @@
+
diff --git a/src/arch/x86_64/pit.rs b/src/arch/x86_64/pit.rs
index e69de29..8b13789 100644
--- a/src/arch/x86_64/pit.rs
+++ b/src/arch/x86_64/pit.rs
@@ -0,0 +1 @@
+
diff --git a/src/arch/x86_64/plugbox.rs b/src/arch/x86_64/plugbox.rs
index e69de29..8b13789 100644
--- a/src/arch/x86_64/plugbox.rs
+++ b/src/arch/x86_64/plugbox.rs
@@ -0,0 +1 @@
+