Skip to content

Commit

Permalink
nfc: io: unified switch form
Browse files Browse the repository at this point in the history
Signed-off-by: smallkirby <ssmallkirby@gmail.com>
  • Loading branch information
smallkirby committed Nov 14, 2024
1 parent f62cb55 commit e3d8ea4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ymir/arch/x86/vmx/io.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ pub fn handleIo(vcpu: *Vcpu, qual: QualIo) VmxError!void {
fn handleIoIn(vcpu: *Vcpu, qual: QualIo) VmxError!void {
const regs = &vcpu.guest_regs;
switch (qual.port) {
0x0020, 0x0021 => try handlePicIn(vcpu, qual),
0x0020...0x0021 => try handlePicIn(vcpu, qual),
0x0060...0x0064 => regs.rax = 0, // PS/2. Unimplemented.
0x0070, 0x0071 => regs.rax = 0, // RTC. Unimplemented.
0x0070...0x0071 => regs.rax = 0, // RTC. Unimplemented.
0x0080...0x008F => {}, // DMA. Unimplemented.
0x00A0, 0x00A1 => try handlePicIn(vcpu, qual),
0x00A0...0x00A1 => try handlePicIn(vcpu, qual),
0x02E8...0x02EF => {}, // Fourth serial port. Ignore.
0x02F8...0x02FF => {}, // Second serial port. Ignore.
0x03B0...0x03DF => regs.rax = 0, // VGA. Uniimplemented.
Expand All @@ -44,11 +44,11 @@ fn handleIoIn(vcpu: *Vcpu, qual: QualIo) VmxError!void {

fn handleIoOut(vcpu: *Vcpu, qual: QualIo) VmxError!void {
switch (qual.port) {
0x0020, 0x0021 => try handlePicOut(vcpu, qual),
0x0020...0x0021 => try handlePicOut(vcpu, qual),
0x0060...0x0064 => {}, // PS/2. Unimplemented.
0x0070, 0x0071 => {}, // RTC. Unimplemented.
0x0070...0x0071 => {}, // RTC. Unimplemented.
0x0080...0x008F => {}, // DMA. Unimplemented.
0x00A0, 0x00A1 => try handlePicOut(vcpu, qual),
0x00A0...0x00A1 => try handlePicOut(vcpu, qual),
0x02E8...0x02EF => {}, // Fourth serial port. Ignore.
0x02F8...0x02FF => {}, // Second serial port. Ignore.
0x03B0...0x03DF => {}, // VGA. Uniimplemented.
Expand Down

0 comments on commit e3d8ea4

Please sign in to comment.