120cbef82SFrançois Revol/*
220cbef82SFrançois Revol * Copyright 2004-2007, Axel D��rfler, axeld@pinc-software.de. All rights reserved.
320cbef82SFrançois Revol * Distributed under the terms of the MIT License.
420cbef82SFrançois Revol */
520cbef82SFrançois Revol
620cbef82SFrançois Revol
720cbef82SFrançois Revol#include "smp.h"
820cbef82SFrançois Revol#include "video.h"
920cbef82SFrançois Revol
1020cbef82SFrançois Revol#include <boot/menu.h>
1120cbef82SFrançois Revol#include <boot/platform/generic/text_menu.h>
1220cbef82SFrançois Revol#include <safemode.h>
1320cbef82SFrançois Revol
1420cbef82SFrançois Revol
1520cbef82SFrançois Revolvoid
1620cbef82SFrançois Revolplatform_add_menus(Menu *menu)
1720cbef82SFrançois Revol{
1820cbef82SFrançois Revol	MenuItem *item;
1920cbef82SFrançois Revol
2020cbef82SFrançois Revol	/*switch (menu->Type()) {
2120cbef82SFrançois Revol		case MAIN_MENU:
2220cbef82SFrançois Revol			menu->AddItem(item = new(nothrow) MenuItem("Select fail-safe video mode", video_mode_menu()));
2320cbef82SFrançois Revol			item->SetTarget(video_mode_hook);
2420cbef82SFrançois Revol			break;
2520cbef82SFrançois Revol		case SAFE_MODE_MENU:
2620cbef82SFrançois Revol			menu->AddItem(item = new(nothrow) MenuItem("Use fail-safe video mode"));
2720cbef82SFrançois Revol			item->SetType(MENU_ITEM_MARKABLE);
2820cbef82SFrançois Revol			item->SetData(B_SAFEMODE_FAIL_SAFE_VIDEO_MODE);
2920cbef82SFrançois Revol			item->SetHelpText("The system will use VESA mode "
3020cbef82SFrançois Revol				"and won't try to use any video graphics drivers.");
3120cbef82SFrançois Revol
3220cbef82SFrançois Revol			smp_add_safemode_menus(menu);
3320cbef82SFrançois Revol
3420cbef82SFrançois Revol			menu->AddItem(item = new(nothrow) MenuItem("Don't call the BIOS"));
3520cbef82SFrançois Revol			item->SetHelpText("Stops the system from calling BIOS functions.");
3620cbef82SFrançois Revol			item->SetType(MENU_ITEM_MARKABLE);
3720cbef82SFrançois Revol
3820cbef82SFrançois Revol			menu->AddItem(item = new(nothrow) MenuItem("Disable APM"));
3920cbef82SFrançois Revol			item->SetType(MENU_ITEM_MARKABLE);
4020cbef82SFrançois Revol			item->SetData(B_SAFEMODE_DISABLE_APM);
4120cbef82SFrançois Revol			item->SetHelpText("Disables Advanced Power Management hardware support, "
4220cbef82SFrançois Revol				"overriding the APM setting in the kernel settings file.");
4320cbef82SFrançois Revol
4420cbef82SFrançois Revol			menu->AddItem(item = new(nothrow) MenuItem("Disable ACPI"));
4520cbef82SFrançois Revol			item->SetType(MENU_ITEM_MARKABLE);
4620cbef82SFrançois Revol			item->SetData(B_SAFEMODE_DISABLE_ACPI);
4720cbef82SFrançois Revol			item->SetHelpText("Disables Advanced Configuration and Power "
4820cbef82SFrançois Revol				"Interface hardware support, overriding the ACPI setting "
4920cbef82SFrançois Revol				"in the kernel settings file.");
5020cbef82SFrançois Revol
5120cbef82SFrançois Revol			menu->AddItem(item = new(nothrow) MenuItem("Disable IO-APIC"));
5220cbef82SFrançois Revol			item->SetType(MENU_ITEM_MARKABLE);
5320cbef82SFrançois Revol			item->SetData(B_SAFEMODE_DISABLE_IOAPIC);
5420cbef82SFrançois Revol			item->SetHelpText("Disables using the IO APIC for interrupt handling, "
5520cbef82SFrançois Revol				"forcing instead the use of the PIC.");
5620cbef82SFrançois Revol			break;
5720cbef82SFrançois Revol		default:
5820cbef82SFrançois Revol			break;
5920cbef82SFrançois Revol	}*/
6020cbef82SFrançois Revol}
6120cbef82SFrançois Revol
6220cbef82SFrançois Revol
63b4aa5d34SRene Gollentvoid
6420cbef82SFrançois Revolplatform_update_menu_item(Menu *menu, MenuItem *item)
6520cbef82SFrançois Revol{
6620cbef82SFrançois Revol	platform_generic_update_text_menu_item(menu, item);
6720cbef82SFrançois Revol}
6820cbef82SFrançois Revol
6920cbef82SFrançois Revol
7020cbef82SFrançois Revolvoid
7120cbef82SFrançois Revolplatform_run_menu(Menu *menu)
7220cbef82SFrançois Revol{
7320cbef82SFrançois Revol	platform_generic_run_text_menu(menu);
7420cbef82SFrançois Revol}
7520cbef82SFrançois Revol
76b4aa5d34SRene Gollent
77b4aa5d34SRene Gollentvoid
788837310cSRene Gollentplatform_get_user_input_text(Menu *menu, MenuItem *item, char *buffer,
79b4aa5d34SRene Gollent	size_t bufferSize)
80b4aa5d34SRene Gollent{
818837310cSRene Gollent	platform_generic_get_user_input_text(menu, item, buffer, bufferSize);
82b4aa5d34SRene Gollent}
83