Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- **Breaking:** Changed the return type of `Uart16550::config(&self)` from
`(&Config, &B::Address)` to `(&Config, &B)`

## 0.6.0 - 2026-03-28

- Rename `Uart16550::try_send_bytes()` to `Uart16550::send_bytes()`
Expand Down
10 changes: 4 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ mod tty;
#[derive(Debug)]
pub struct Uart16550<B: Backend> {
backend: B,
base_address: B::Address,
// The currently active config.
config: Config,
}
Expand Down Expand Up @@ -325,7 +324,6 @@ impl Uart16550<PioBackend> {

Ok(Self {
backend,
base_address,
// Will be replaced by the actual config in init() afterwards.
config: Config::default(),
})
Expand Down Expand Up @@ -375,7 +373,6 @@ impl Uart16550<MmioBackend> {

Ok(Self {
backend,
base_address,
// Will be replaced by the actual config in init() afterwards.
config: Config::default(),
})
Expand Down Expand Up @@ -911,12 +908,13 @@ impl<B: Backend> Uart16550<B> {
/* ----- Misc ----------------------------------------------------------- */

/// Returns the config from the last call to [`Self::init`] together with
/// the base address of the underlying hardware.
/// the corresponding [`Backend`].
///
/// Via the backend, you can get the base address using [`Backend::base()`].
/// To get the values that are currently in the registers, consider using
/// [`Self::config_register_dump`].
pub const fn config(&self) -> (&Config, B::Address) {
(&self.config, self.base_address)
pub const fn config(&self) -> (&Config, &B) {
(&self.config, &self.backend)
}

/// Queries the device and returns a [`ConfigRegisterDump`].
Expand Down
6 changes: 3 additions & 3 deletions test/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ opt-level = "s"
anyhow = { version = "1.0", default-features = false }
log = { version = "0.4", default-features = false }
uart_16550 = { path = "../." }
qemu-exit = { version = "3.0.2", default-features = false }
qemu-exit = { version = "4.0.0", default-features = false }
3 changes: 2 additions & 1 deletion test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ extern "C" fn rust_entry() -> ! {
fn exit_qemu(success: bool) -> ! {
// configured in Makefile
let port = 0xf4;
let exit = qemu_exit::X86::new(port, 73);
// SAFETY: we have exclusive access and the port is valid
let exit = unsafe { qemu_exit::X86::new(port, 73) };
if success {
exit.exit_success()
} else {
Expand Down