1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 23:48:11 +00:00

Kernel: Move x86-specific HID code to the Arch/x86 directory

The i8042 controller with its attached devices, the PS2 keyboard and
mouse, rely on x86-specific IO instructions to work. Therefore, move
them to the Arch/x86 directory to make it easier to omit the handling
code of these devices.
This commit is contained in:
Liav A 2022-09-03 10:25:33 +03:00 committed by Linus Groh
parent 948be9674a
commit c50a81e93e
11 changed files with 23 additions and 16 deletions

View file

@ -4,10 +4,13 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Platform.h>
#include <AK/Singleton.h>
#if ARCH(I386) || ARCH(X86_64)
# include <Kernel/Arch/x86/ISABus/I8042Controller.h>
#endif
#include <Kernel/CommandLine.h>
#include <Kernel/Devices/HID/HIDManagement.h>
#include <Kernel/Devices/HID/I8042Controller.h>
#include <Kernel/Firmware/ACPI/Parser.h>
#include <Kernel/Sections.h>
@ -119,6 +122,7 @@ UNMAP_AFTER_INIT ErrorOr<void> HIDManagement::enumerate()
// set to emulate PS/2, we should not initialize the PS/2 controller.
if (kernel_command_line().disable_ps2_controller())
return {};
#if ARCH(I386) || ARCH(X86_64)
m_i8042_controller = I8042Controller::initialize();
// Note: If ACPI is disabled or doesn't indicate that we have an i8042, we
@ -140,6 +144,7 @@ UNMAP_AFTER_INIT ErrorOr<void> HIDManagement::enumerate()
if (m_i8042_controller->keyboard())
m_hid_devices.append(m_i8042_controller->keyboard().release_nonnull());
#endif
return {};
}