#include #include #include #if defined(__x86_64__) #include #include static uacpi_interrupt_ret handle_power_button(uacpi_handle ctx) { (void)ctx; poweroff::reboot(); return UACPI_INTERRUPT_HANDLED; } void drivers::powerbutton::init() { uacpi_install_fixed_event_handler( UACPI_FIXED_EVENT_POWER_BUTTON, handle_power_button, UACPI_NULL ); klibc::printf("PowerButton: Registered powerbutton at ip 0x%p\r\n",(std::uint64_t)handle_power_button); } #else void drivers::powerbutton::init() { } #endif