diff options
| author | Tianhao Wang <shrik3@mailbox.org> | 2024-06-06 00:02:53 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:17:14 +0200 |
| commit | a86f59b32eb86a1ccb94bf1e627c1115c3b6b217 (patch) | |
| tree | a3b1c10ad4fa76be79aed1f7e8eebbd2cfa146aa /src/machine/device_io.rs | |
| parent | ca8bc76fd5319842954508484542f4beb6b591d0 (diff) | |
io: add serial output through port 0x3f8 (qemu)
not yet wrapped with fmt macros because I want some thing stateless.
(i.e. I don't want to pass `&mut self` to write_str...).
Diffstat (limited to 'src/machine/device_io.rs')
| -rw-r--r-- | src/machine/device_io.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/machine/device_io.rs b/src/machine/device_io.rs index 2a0c907..9a530f1 100644 --- a/src/machine/device_io.rs +++ b/src/machine/device_io.rs @@ -4,7 +4,7 @@ pub use crate::arch::x86_64::io_port::*; // either use the io functions directly, or via a IOPort instance. pub struct IOPort(u16); impl IOPort { - pub fn new(port: u16) -> Self { + pub const fn new(port: u16) -> Self { Self(port) } pub fn inw(&self) -> u16 { |
