diff options
| author | taitep <taitep@taitep.se> | 2025-12-28 12:01:39 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-28 12:01:39 +0100 |
| commit | 9a9bef7dd7dce7d5c10b7cf49a42478ad85829ac (patch) | |
| tree | ea832693678899e97aecf12bd620f0123b6ce3d2 /src/basic_uart.rs | |
| parent | 8024af6b1348b5f47fabe5a1949de54607a33888 (diff) | |
Remove consts.rs and just use plain types
Diffstat (limited to 'src/basic_uart.rs')
| -rw-r--r-- | src/basic_uart.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/basic_uart.rs b/src/basic_uart.rs index e5b91f3..8317950 100644 --- a/src/basic_uart.rs +++ b/src/basic_uart.rs @@ -13,7 +13,6 @@ use std::time::Duration; use nix::fcntl::fcntl; use nix::fcntl::{FcntlArg, OFlag}; -use trve::consts::{Addr, Byte}; use trve::exceptions::{MemoryException, MemoryExceptionType}; use trve::mem::MemDeviceInterface; @@ -78,7 +77,7 @@ impl BasicUart { } impl MemDeviceInterface for BasicUart { - fn write_byte(&self, addr: Addr, value: Byte) -> Result<(), MemoryException> { + fn write_byte(&self, addr: u64, value: u8) -> Result<(), MemoryException> { match addr { 0 => { self.write(value); @@ -90,7 +89,7 @@ impl MemDeviceInterface for BasicUart { }), } } - fn read_byte(&self, addr: Addr) -> Result<Byte, MemoryException> { + fn read_byte(&self, addr: u64) -> Result<u8, MemoryException> { match addr { 0 => Ok(self.read()), 1 => Ok(1 | (self.can_read() as u8) << 1), |
