mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
rust: use MaybeUninit::zeroed() in const context
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
use std::ptr::addr_of_mut;
|
||||
|
||||
use qemu_api::{cell::bql_locked, impl_zeroable, zeroable::Zeroable};
|
||||
use qemu_api::{cell::bql_locked, zeroable::Zeroable};
|
||||
|
||||
/// Each `HPETState` represents a Event Timer Block. The v1 spec supports
|
||||
/// up to 8 blocks. QEMU only uses 1 block (in PC machine).
|
||||
@@ -18,7 +18,7 @@ pub struct HPETFwEntry {
|
||||
pub min_tick: u16,
|
||||
pub page_prot: u8,
|
||||
}
|
||||
impl_zeroable!(HPETFwEntry);
|
||||
unsafe impl Zeroable for HPETFwEntry {}
|
||||
|
||||
#[repr(C, packed)]
|
||||
#[derive(Copy, Clone, Default)]
|
||||
@@ -26,7 +26,7 @@ pub struct HPETFwConfig {
|
||||
pub count: u8,
|
||||
pub hpet: [HPETFwEntry; HPET_MAX_NUM_EVENT_TIMER_BLOCK],
|
||||
}
|
||||
impl_zeroable!(HPETFwConfig);
|
||||
unsafe impl Zeroable for HPETFwConfig {}
|
||||
|
||||
#[allow(non_upper_case_globals)]
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user