xref: /haiku/src/system/boot/platform/riscv/menu.cpp (revision 0fae96c5a349db3761ac2a4ab4a7fbbf23a3b76c)
1 /*
2  * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "smp.h"
8 #include "video.h"
9 
10 #include <boot/menu.h>
11 #include <boot/platform/generic/text_menu.h>
12 #include <safemode.h>
13 
14 
15 void
16 platform_add_menus(Menu* menu)
17 {
18 	MenuItem* item;
19 
20 	switch (menu->Type()) {
21 		case MAIN_MENU:
22 			menu->AddItem(item = new(nothrow) MenuItem(
23 				"Select screen resolution", video_mode_menu()));
24 			item->SetTarget(video_mode_hook);
25 			break;
26 		case SAFE_MODE_MENU:
27 			menu->AddItem(item = new(nothrow) MenuItem(
28 				"Use fail-safe graphics driver"));
29 			item->SetType(MENU_ITEM_MARKABLE);
30 			item->SetData(B_SAFEMODE_FAIL_SAFE_VIDEO_MODE);
31 			item->SetHelpText("The system will use VESA mode and won't try to "
32 				"open any video graphics driver");
33 
34 #if 0
35 			smp_add_safemode_menus(menu);
36 
37 			menu->AddItem(item = new(nothrow) MenuItem("Disable ACPI"));
38 			item->SetType(MENU_ITEM_MARKABLE);
39 			item->SetData(B_SAFEMODE_DISABLE_ACPI);
40 			item->SetHelpText("This overrides the ACPI setting in the kernel "
41 				"settings file");
42 #endif
43 			break;
44 		default:
45 			break;
46 	}
47 }
48 
49 
50 void
51 platform_update_menu_item(Menu* menu, MenuItem* item)
52 {
53 	platform_generic_update_text_menu_item(menu, item);
54 }
55 
56 
57 void
58 platform_run_menu(Menu* menu)
59 {
60 	platform_generic_run_text_menu(menu);
61 }
62 
63 
64 size_t
65 platform_get_user_input_text(Menu* menu, MenuItem* item, char* buffer,
66 	size_t bufferSize)
67 {
68 	return platform_generic_get_user_input_text(menu, item, buffer,
69 		bufferSize);
70 }
71