File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1698,10 +1698,14 @@ impl VcpuFd {
1698
1698
// which union field to use and the type of extension_id is 'enum sbi_ext_id'.
1699
1699
match unsafe { run. __bindgen_anon_1 . riscv_sbi . extension_id } as u32 {
1700
1700
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
1701
1703
let ch = unsafe { run. __bindgen_anon_1 . riscv_sbi . args [ 0 ] } ;
1702
1704
Ok ( VcpuExit :: SbiExt0_1ConsolePutchar ( ch) )
1703
1705
}
1704
1706
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
1705
1709
let ch = unsafe { & mut run. __bindgen_anon_1 . riscv_sbi . ret [ ..1 ] } ;
1706
1710
Ok ( VcpuExit :: SbiExt0_1ConsoleGetchar ( ch) )
1707
1711
}
You can’t perform that action at this time.
0 commit comments