From 3463eeac0160abfcf62015fbf019114d33a7c5c0 Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Wed, 30 Dec 2020 17:54:33 +0100 Subject: [PATCH] openfirmware: add a menu entry to go back to the firmware prompt It's annoying to need to reboot the machine everytime I test a change to the bootloader. Change-Id: I1bc8530f397b2a6d66ec26f08527dab9b2a2699b Reviewed-on: https://review.haiku-os.org/c/haiku/+/3564 Reviewed-by: waddlesplash --- src/system/boot/platform/openfirmware/menu.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/system/boot/platform/openfirmware/menu.cpp b/src/system/boot/platform/openfirmware/menu.cpp index 47f9c6ff48..feaf39bb75 100644 --- a/src/system/boot/platform/openfirmware/menu.cpp +++ b/src/system/boot/platform/openfirmware/menu.cpp @@ -7,15 +7,30 @@ #include #include #include +#include + + +static bool +of_exit_hook(Menu *menu, MenuItem *item) +{ + of_exit(); + return true; +} void platform_add_menus(Menu *menu) { - // ToDo: implement me! + MenuItem* item; switch (menu->Type()) { case MAIN_MENU: + item = new(std::nothrow) MenuItem("Exit to OpenFirmware"); + if (item != NULL) { + menu->AddItem(item); + item->SetTarget(of_exit_hook); + item->SetShortcut('q'); + } break; case SAFE_MODE_MENU: break;