File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 55#[ allow( clippy:: all) ]
66#[ allow( clippy:: undocumented_unsafe_blocks) ]
77pub mod bindings;
8- pub mod sbi_bindings;
98#[ cfg( feature = "fam-wrappers" ) ]
109pub mod fam_wrappers;
10+ pub mod sbi_bindings;
1111
1212#[ cfg( feature = "serde" ) ]
1313mod serialize;
1414
1515pub use self :: bindings:: * ;
16- pub use self :: sbi_bindings:: * ;
1716#[ cfg( feature = "fam-wrappers" ) ]
1817pub use self :: fam_wrappers:: * ;
18+ pub use self :: sbi_bindings:: * ;
Original file line number Diff line number Diff line change @@ -1696,12 +1696,16 @@ impl VcpuFd {
16961696 KVM_EXIT_RISCV_SBI => {
16971697 // SAFETY: Safe because the exit_reason (which comes from the kernel) told us
16981698 // which union field to use and the type of extension_id is 'enum sbi_ext_id'.
1699- match unsafe { run. __bindgen_anon_1 . riscv_sbi . extension_id } as u32 {
1699+ match unsafe { run. __bindgen_anon_1 . riscv_sbi . extension_id } as u32 {
17001700 SBI_EXT_0_1_CONSOLE_PUTCHAR => {
1701+ // SAFETY: Safe because the exit_reason (which comes from the kernel) told us
1702+ // which union field to use
17011703 let ch = unsafe { run. __bindgen_anon_1 . riscv_sbi . args [ 0 ] } ;
17021704 Ok ( VcpuExit :: SbiExt0_1ConsolePutchar ( ch) )
17031705 }
17041706 SBI_EXT_0_1_CONSOLE_GETCHAR => {
1707+ // SAFETY: Safe because the exit_reason (which comes from the kernel) told us
1708+ // which union field to use
17051709 let ch = unsafe { & mut run. __bindgen_anon_1 . riscv_sbi . ret [ ..1 ] } ;
17061710 Ok ( VcpuExit :: SbiExt0_1ConsoleGetchar ( ch) )
17071711 }
You can’t perform that action at this time.
0 commit comments