feat: disconnect Bluetooth devices, flush disks on shutdown/reboot, display progress in login.elf window

This commit is contained in:
2026-06-06 18:27:19 +02:00
parent b51ab42eb9
commit cee21738ee
24 changed files with 418 additions and 12 deletions
+20
View File
@@ -13,8 +13,28 @@
#include <ACPI/AcpiShutdown.hpp>
#include <ACPI/AcpiSleep.hpp>
#include "Syscall.hpp"
namespace Montauk {
// Pending graceful power-off request, set by the desktop and consumed by
// login.elf. Kernel-global IPC channel (one outstanding request system-wide).
// `inline` so the single definition is shared across translation units.
inline int g_pendingPowerAction = POWER_REQ_QUERY;
// SYS_POWER_REQUEST. action == POWER_REQ_QUERY reads and clears the pending
// action; any other value records it as the pending action. Returns the
// pending action for queries, or 0 when recording one.
static int64_t Sys_PowerRequest(int action) {
if (action == POWER_REQ_QUERY) {
int pending = g_pendingPowerAction;
g_pendingPowerAction = POWER_REQ_QUERY;
return (int64_t)pending;
}
g_pendingPowerAction = action;
return 0;
}
static void Sys_Reset() {
if (Efi::g_ResetSystem) {
/* Switch to kernel PML4 which has identity-mapped UEFI runtime regions */