Skip to content

Commit 012bc4c

Browse files
committed
fix: 修正 hardware_enable 方法中的类型转换以确保安全性
1 parent 9b4a8d1 commit 012bc4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pcpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Aarch64PerCpu {
2626
pub fn hardware_enable(&mut self) {
2727
// Set current `VBAR_EL2` to `exception_vector_base_vcpu`
2828
// defined in this crate.
29-
VBAR_EL2.set(exception_vector_base_vcpu as usize as _);
29+
VBAR_EL2.set(exception_vector_base_vcpu as *const () as usize as _);
3030

3131
HCR_EL2.modify(
3232
HCR_EL2::VM::Enable + HCR_EL2::RW::EL1IsAarch64 + HCR_EL2::TSC::EnableTrapEl1SmcToEl2,

0 commit comments

Comments
 (0)