Skip to content

Commit a7180a7

Browse files
author
Andreas Wessing
committed
refactor: rename ps2 keyboard driver to pc-keyboard
1 parent 4db677f commit a7180a7

5 files changed

Lines changed: 7 additions & 14 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ vga = []
219219
## Enables the PS/2 keyboard driver.
220220
##
221221
## This is only useful on PCs (x86-64).
222-
keyboard = []
222+
pc-keyboard = []
223223

224224
#! ### Performance Features
225225

src/arch/x86_64/kernel/interrupts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ pub(crate) fn install() {
158158
}
159159

160160
pub(crate) fn install_handlers(#[allow(unused_mut)] mut handlers: InterruptHandlerMap) {
161-
#[cfg(feature = "keyboard")]
161+
#[cfg(feature = "pc-keyboard")]
162162
{
163-
use crate::arch::kernel::keyboard::get_keyboard_handler;
163+
use crate::arch::kernel::pc_keyboard::get_keyboard_handler;
164164
let (irq, handler) = get_keyboard_handler();
165165
handlers.entry(irq).or_default().push_back(handler);
166166
}

src/arch/x86_64/kernel/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ pub mod gdt;
2020
pub mod interrupts;
2121
#[cfg(feature = "kernel-stack")]
2222
pub mod kernel_stack;
23-
#[cfg(feature = "keyboard")]
24-
pub mod keyboard;
2523
#[cfg(all(not(feature = "pci"), feature = "virtio"))]
2624
pub mod mmio;
25+
#[cfg(feature = "pc-keyboard")]
26+
pub mod pc_keyboard;
2727
#[cfg(feature = "pci")]
2828
pub mod pci;
2929
pub mod pic;

src/syscalls/system.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@ pub extern "C" fn sys_getpagesize() -> i32 {
77
BasePageSize::SIZE.try_into().unwrap()
88
}
99

10-
#[cfg(all(target_arch = "x86_64", feature = "keyboard"))]
10+
#[cfg(all(target_arch = "x86_64", feature = "pc-keyboard"))]
1111
#[hermit_macro::system]
1212
#[unsafe(no_mangle)]
1313
pub extern "C" fn sys_read_keyboard() -> u8 {
14-
crate::kernel::keyboard::pop_scancode().unwrap_or(0)
15-
}
16-
17-
#[cfg(not(all(target_arch = "x86_64", feature = "keyboard")))]
18-
#[hermit_macro::system]
19-
#[unsafe(no_mangle)]
20-
pub extern "C" fn sys_read_keyboard() -> u8 {
21-
0
14+
crate::kernel::pc_keyboard::pop_scancode().unwrap_or(0)
2215
}

0 commit comments

Comments
 (0)