WIP: x86: allow non-64bit counters in HPET

This commit is contained in:
Mark Poliakov 2025-01-27 16:57:20 +02:00
parent 5b1b69e467
commit 1bc99bc05f

View File

@ -123,8 +123,12 @@ impl InterruptHandler for HpetTimer {
impl Device for HpetTimer {
unsafe fn init(self: Arc<Self>) -> Result<(), Error> {
// TODO support arbitrary configurations
assert!(self.bits64);
if self.period > u32::MAX as u64 && !self.bits64 {
log::error!(
"HPET period is >32bit and the HPET itself does not support 64bit counters"
);
return Err(Error::InvalidArgument);
}
let intc = external_interrupt_controller()?;