summaryrefslogtreecommitdiff
path: root/EDK/MiniSetup/TseAdvanced/bootflowLib.c
blob: 32fdc362459ea3bb7ed62b97f3d3a986be89beb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//**                                                             **//
//**         (C)Copyright 2010, American Megatrends, Inc.        **//
//**                                                             **//
//**                     All Rights Reserved.                    **//
//**                                                             **//
//**   5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093  **//
//**                                                             **//
//**                     Phone (770)-246-8600                    **//
//**                                                             **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/TseAdvanced/bootflowLib.c $
//
// $Author: Premkumara $
//
// $Revision: 8 $
//
// $Date: 8/28/14 8:42a $
//
//*****************************************************************//
//*****************************************************************//
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/TseAdvanced/bootflowLib.c $
// 
// 8     8/28/14 8:42a Premkumara
// [TAG]       	EIP142551
// [Category]  	Bug Fix
// [Severity]		Minor
// [Symptom]		Mouse Movement is not initialized to Full Screen Resolution
// in case of quiet boot mode with high resolution OEM Logo.
// [Root Cause]	Mouse Initialization was not across the full screen incase
// of High Resolution Quiet Boot Logo.
// [Solution]		Initialised the Mouse with the Resolution Set in case of
// Quiet Boot logo so that Mouse will move acroos the Whole screen
// [Files]        Mouse.c, BootFlowLib.c, PostMgmt.c, PostMgmtExt.c,
// Notify.c, MinisetupExt.c
// 
// 7     10/18/12 5:53a Arunsb
// Updated for 2.16.1235 QA submission
// 
// 9     10/10/12 12:35p Arunsb
// Synched the source for v2.16.1232, backup with Aptio
// 
// 6     3/26/10 5:06p Madhans
// EIP 36704 : Fix for Making sure to make the Variable to NULL after it
// is Freed up.
// 
// 5     2/19/10 1:02p Madhans
// Updated for TSE 2.01. Refer Changelog.log for File change history.
// 
// 6     2/19/10 8:12a Mallikarjunanv
// updated year in copyright message
// 
// 5     1/29/10 4:37p Madhans
// To not to depend on ConsoleControl and ConOut.
// 
// 4     10/12/09 4:11p Madhans
// //EIP 28577 : Fix to avoid "Checker: SIGN_EXTENSION"
// 
// 3     7/08/09 3:35p Madhans
// In Aptio use the Text mode as is it in post screen
// 
// 2     6/12/09 7:43p Presannar
// Initial implementation of coding standards for AMITSE2.0
// 
// 1     6/04/09 8:05p Madhans
// 
// 1     4/28/09 11:16p Madhans
// Tse 2.0 Code complete Checkin.
// 
// 1     4/28/09 10:27p Madhans
// Tse 2.0 Code complete Checkin.
// 
// 2     1/07/08 10:34a Arunkumars
// Stand alone application support for x64 and nt32
// 
// 1     7/09/07 1:29p Arunkumars
// - Added elink hooks for Logo, Password management and Control Keys
// customizations
//
//*****************************************************************//
//*****************************************************************//

#include "minisetup.h"
BOOLEAN 	IsMouseSupported(VOID);
BOOLEAN 	IsSoftKbdSupported(VOID);
static MSGBOX_DATA *_gBootFlowMsg = NULL;

VOID _BootFlowCancelTimer( EFI_EVENT Event, VOID *Context )
{
	if ( _gBootFlowMsg != NULL )
		gMsgBox.Destroy( _gBootFlowMsg, TRUE );

	_gBootFlowMsg = NULL;

	TimerStopTimer( &Event );
}

VOID _BootFlowShowMessageBox( BOOT_FLOW *bootFlowPtr )
{
	AMI_IFR_MSGBOX msgBox;
	CONTROL_INFO dummy;

#ifndef STANDALONE_APPLICATION
	if ( gConsoleControl != NULL )
		gConsoleControl->SetMode( gConsoleControl, EfiConsoleControlScreenText );
#endif

	if (gST->ConOut == NULL) // Headless system/NoVideo in BIOS
		return;

	gST->ConOut->Reset( gST->ConOut, FALSE );
#if !APTIO_4_00
    SetDesiredTextMode();
#else
	//  In Aptio use the Text mode as is it in post screen
	if(EFI_ERROR(gST->ConOut->QueryMode( gST->ConOut, gST->ConOut->Mode->Mode, &gMaxCols, &gMaxRows )))
	{ 
		gMaxRows = StyleGetStdMaxRows(); 
		gMaxCols = StyleGetStdMaxCols(); 
	}
#endif

	if(IsMouseSupported()&& IsSoftKbdSupported())//Initializing the mouse at post when mouse and softkbd present
		MouseInit();

	ClearScreen( EFI_BACKGROUND_BLACK | EFI_LIGHTGRAY );

	MemSet( &msgBox, sizeof(msgBox), 0 );
	msgBox.Text = bootFlowPtr->MessageBoxToken;

	MemSet( &dummy, sizeof(dummy), 0 );
	dummy.ControlHandle = INVALID_HANDLE;
	dummy.ControlPtr = (VOID*)(UINTN)&msgBox;
	dummy.ControlFlags.ControlVisible = TRUE;

	gMsgBox.Create( &_gBootFlowMsg );
	if ( _gBootFlowMsg == NULL )
		return;

	gMsgBox.Initialize( _gBootFlowMsg, &dummy );
	gMsgBox.SetType( _gBootFlowMsg, MSGBOX_TYPE_NULL );
	gMsgBox.Draw( _gBootFlowMsg );

	if ( bootFlowPtr->MessageBoxTimeout != 0 )
	{
		EFI_EVENT Event;

		//EIP 28577 : Fix to avoid "Checker: SIGN_EXTENSION"
		TimerCreateTimer( &Event, _BootFlowCancelTimer, NULL,
			TimerRelative, MultU64x32( (UINT64)TIMER_ONE_SECOND, (UINT32) bootFlowPtr->MessageBoxTimeout ), EFI_TPL_CALLBACK );
	}
}

VOID _BootFlowSetActivePage( BOOT_FLOW *bootFlowPtr )
{
	PAGE_INFO *pageInfo;
	UINT32	i;

	for ( i = 0; i < gPages->PageCount; i++ )
	{
		pageInfo = (PAGE_INFO *)((UINTN)gSetupPkg + gPages->PageList[i]);
		if (
			( bootFlowPtr->PageClass == gPageIdInfo[pageInfo->PageIdIndex].PageClass ) &&
			( bootFlowPtr->PageSubClass == gPageIdInfo[pageInfo->PageIdIndex].PageSubClass ) &&
			( bootFlowPtr->PageFormID == pageInfo->PageFormID ) 
		   )
		{
			gEnterSetup = TRUE;
			gStartPage = i;
			break;
		}
	}

}

VOID _BootFlowSetActiveControl( BOOT_FLOW *bootFlowPtr )
{
	// select the control from the currently active page
}

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2010, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**     5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093     **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************