From 170d6bb02ef06bc878cbf3450432ea508e6a0510 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 12 Oct 2025 15:50:10 -0400 Subject: kern/amd64: reboot: Add I8042_REBOOT option Adds I8042_REBOOT config option for the AMD64 port as a workaround against certain hardware that doesn't support the i8042 reset Signed-off-by: Ian Moffett --- src/sys/arch/amd64/conf/GENERIC | 5 ++++- src/sys/arch/amd64/os/os_reboot.c | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'src/sys') diff --git a/src/sys/arch/amd64/conf/GENERIC b/src/sys/arch/amd64/conf/GENERIC index cc5fe35..93919d8 100644 --- a/src/sys/arch/amd64/conf/GENERIC +++ b/src/sys/arch/amd64/conf/GENERIC @@ -1 +1,4 @@ -// GENERIC AMD64 +// Controls if an i8042 reboot would be attempted +// as a method. Some firmware (e.g., on some laptops) +// may not handle these well and hang. +option I8042_REBOOT yes diff --git a/src/sys/arch/amd64/os/os_reboot.c b/src/sys/arch/amd64/os/os_reboot.c index e414822..3ed82af 100644 --- a/src/sys/arch/amd64/os/os_reboot.c +++ b/src/sys/arch/amd64/os/os_reboot.c @@ -33,6 +33,12 @@ #include #include +#if defined(__I8042_REBOOT) +#define I8042_REBOOT __I8042_REBOOT +#else +#define I8042_REBOOT 0 +#endif /* __I8042_REBOOT */ + /* * Actual reboot core */ @@ -42,11 +48,13 @@ __reboot(void) void *dmmy_null = NULL; /* - * Try to be gentle and simply put the CPU into a - * reboot cycle through the i8042 reset line, though - * some chipsets may not like this. + * Use the i8042 to reboot the system if we can, this + * might be disabled in some L5 kernels. */ - outb(0x64, 0xFE); + if (I8042_REBOOT) { + outb(0x64, 0xFE); + } + /* * If somehow nothing we've tried worked, be very -- cgit v1.2.3