]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: hpet: decode HPET registers into enums
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 Feb 2025 17:19:35 +0000 (18:19 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 6 Mar 2025 11:44:47 +0000 (12:44 +0100)
commit519088b7cf6dbdef08d8753b57aa29162b83d1a1
tree9b35f28f0fc343b16d2eff5fc71f3f90c951e3aa
parentaa50bc4fb9d4fc1dc027c4d70babe0acb6c09971
rust: hpet: decode HPET registers into enums

Generalize timer_and_addr() to decode all registers into a single enum
HPETRegister, and use the TryInto derive to separate valid and
invalid values.

The main advantage lies in checking that all registers are enumerated
in the "match" statements.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/Cargo.toml
rust/hw/char/pl011/src/lib.rs
rust/hw/timer/hpet/src/hpet.rs