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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
|
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//** **//
//** (C)Copyright 2011, American Megatrends, Inc. **//
//** **//
//** All Rights Reserved. **//
//** **//
//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
//** **//
//** Phone (770)-246-8600 **//
//** **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
// $Archive: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/commonoem.h $
//
// $Author: Arunsb $
//
// $Revision: 18 $
//
// $Date: 5/02/14 5:45a $
//
//*****************************************************************//
//*****************************************************************//
// Revision History
// ----------------
// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/commonoem.h $
//
// 18 5/02/14 5:45a Arunsb
// [TAG] EIP156258
// [Category] Improvement
// [Description] Providing ELINK option to suppress the handle
// comparison on dynamic parsing
// [Files] AMITSE.mak, AMITSE.sdl, commonoem.c, commonoem.h and Parse.c
//
// 17 3/06/13 12:24a Premkumara
// [TAG] EIP111415
// [Category] Improvement
// [Description] Elink function for SETUP_TOGGLE_KEY_UNICODE function
// [Files] HookAnchor.h, AMITSE.sdl, commonoem.c, Commonoem.h,
// HookList.c, HookAnchor.c
//
// 16 10/18/12 5:31a Arunsb
// Updated for 2.16.1235 QA submission
//
// 13 10/10/12 12:23p Arunsb
// Synched the source for v2.16.1232 backup with Aptio
//
// 15 2/01/12 1:53a Arunsb
// [TAG] EIP74968
// [Category] Improvement
// [Description] Support for mouse drag and drop to rearrange the items
// in the Orderlist.
// [Files] Ordlistbox.c, commonoem.c and commonoem.h
//
// 14 11/20/11 6:56a Rajashakerg
// [TAG] EIP62763
// [Category] Improvement
// [Description] Utilize the Improvements done from mouse driver in
// AMITSE
// [Files] HookAnchor.h, TseCommon.h, AMITSE.sdl, CommonHelper.c,
// commonoem.c, commonoem.h, buffer.c, globals.c, HookAnchor.c,
// minisetup.h, notify.c, postmgmt.c, protocol.c, ezport.c, stylecommon.c,
// Mouse.c, Action.c, Date.c, frame.c, MessageBox.c, minisetupext.c,
// minisetupext.h, numeric.c, numeric.h, page.c, PopupEdit.c, PopupEdit.h,
// PopupPassword.c, postmgmtext.c, time.c.
//
// 13 7/20/11 3:25p Rajashakerg
// Removed the unwanted code for mouse hot click operation
//
// 11 6/29/11 1:03p Rajashakerg
// [TAG] EIP47086
// [Category] New Feature
// [Description] Right clicking from the Main page is not exiting from
// BIOS setup.
//
// [Files] minisetup.h, Ezport\style.h,Ezport\EzportBin.sdl,
// Ezport\EzportBin.mak, Ezport\ezport.c, Ezport\EzportBin.cif,
// EzportPlus\style.h, EzportPlus\EzportPlusBin.sdl, EzportPlusBin.mak,
// EzportPlus\EzportPlusBin.cif, EzportPlus\ezportplus.c, Legacy\style.h,
// Legacy\EzportPlusBin.sdl, Legacy\LegacyBin.mak, Legacy\LegacyBin.cif,
// Legacy\legacy.c, TseLiteBin.sdl, TseLite.cif, Memo.c, frame.c,
// application.h, application.c, commonoem.h, CommonHelper.c
//
// 10 6/22/11 7:18a Arunsb
// [TAG] EIP 62631, 60128
// [Category] New Feature
// [Description] Hot key boot option in TSE as per UEFI spec. section
// 3.1.6.
// TSE_CHECK_SHIFTSTATE macro redefined to
// CheckAdvShiftState
// [Files] AMITSE.sdl, CommonHelper.c, commonoem.c, commonoem.h,
// boot.c, hiistring20.c and hiistring21.c.
//
// 9 3/28/11 9:06p Madhans
// [TAG] EIP41744
// [Category] Improvement
// [Description] SoftKeyBoard Support in TSE. and Support to Work with
// new mouse driver(Label 07).
// [Files] HookAnchor.h
// AMITSE.sdl
// CommonHelper.c
// commonoem.c
// commonoem.h
// HookList.c
// HookAnchor.c
// Mouse.c
// minisetupext.c
// postmgmtext.c
// minisetupext.h
// PopupPassword.c
// PopupString.c
// TseLiteCommon.c
//
// 8 9/16/10 8:39p Madhans
// Updated for TSE 2.10. Refer changelog.log for more deatils.
//
// 11 8/18/10 6:15p Mallikarjunanv
// EIP-38089: Hook after pressing F2 key and before showing setup menu.
//
// 10 6/08/10 5:06p Blaines
// Created new AMITSE hook (hook33), called when TSE determines that
// console out is available.
//
// 9 4/13/10 6:01p Madhans
// Eip: 33100 To create new hook for BootNowLaunching. (From bbsPopoup and
// Boot override menu).
//
// 8 2/19/10 7:59a Mallikarjunanv
// updated the year in copyright message
//
// 7 2/04/10 11:06p Madhans
// Map Control Mouse Action Hook Added.
//
// 6 1/09/10 2:26a Mallikarjunanv
// Updated TSE2.01 Release sources with coding standards
//
// 5 9/15/09 9:19a Sudhirv
// added new hook entries for LoadSetupDefaults and PreResetSystem
//
// 4 7/30/09 4:16p Blaines
// Fix for EIP #23127
//
// Item #8 : Shift + Tab handling.
//
// MapControlKeys() does not handle correctly because of
// TSE_CHECK_SHIFTSTATE macro has problem.
// ControlActionNextSelection is always became true so never checks
// ControlActionPrevSelection.
//
// 3 6/24/09 6:33p Madhans
// Coding Standards
//
// 2 6/24/09 11:52a Blaines
// Coding standard update
//
// 1 6/09/09 9:52a Madhans
// TSE 2.00.1201
//
// 1 6/04/09 7:49p Madhans
// AMI TSE Advanced.
//
// 2 4/29/09 9:01p Madhans
// Bug Fixes after unit Testing..
//
// 1 4/28/09 10:49p Madhans
// Tse 2.0 Code complete Checkin.
//
// 1 4/28/09 10:24p Madhans
// Tse 2.0 Code complete Checkin.
//
// 2 1/30/09 6:06p Madhans
// Function headers added.
//
//
//*****************************************************************//
//*****************************************************************//
//<AMI_FHDR_START>
//----------------------------------------------------------------------------
//
// Name: commonoem.h
//
// Description: header of commonoem.h
//
//----------------------------------------------------------------------------
//<AMI_FHDR_END>
#ifndef _COMMONOEM_H_
#define _COMMONOEM_H_
typedef enum
{
ControlActionUnknown,
ControlActionNextLeft,
ControlActionNextRight,
ControlActionNextUp,
ControlActionNextDown,
ControlActionPageUp,
ControlActionPageDown,
ControlActionNextSelection,
ControlActionPrevSelection,
ControlActionSelect,
ControlActionIncreament,
ControlActionDecreament,
ControlActionBackSpace,
ControlActionAbort,
ControlActionAlpha,
ControlActionNumeric,
ControlActionHelpPageUp,
ControlActionHelpPageDown,
ControlActionHome,
ControlActionEnd,
ControlActionChoose,
ControlMouseActionLeftDown,
ControlMouseActionLeftUp
}CONTROL_ACTION;
typedef struct _STYLECOLORS
{
UINT8 FGColor;
UINT8 BGColor;
UINT8 SecFGColor;
UINT8 SecBGColor;
UINT8 SelFGColor;
UINT8 SelBGColor;
UINT8 NSelFGColor;
UINT8 NSelBGColor;
UINT8 LabelBGColor;
UINT8 LabelFGColor;
UINT8 NSelLabelFGColor;
UINT8 EditBGColor;
UINT8 EditFGColor;
UINT8 PopupFGColor;
UINT8 PopupBGColor;
}STYLECOLORS;
//For CLICK Event
#define TSEMOUSE_NULL_CLICK 0
#define TSEMOUSE_RIGHT_CLICK 1
#define TSEMOUSE_LEFT_CLICK 2
//#define TSEMOUSE_MIDDLE_CLICK 3
#define TSEMOUSE_LEFT_DCLICK 4
#define TSEMOUSE_RIGHT_DOWN 5
#define TSEMOUSE_LEFT_DOWN 6
//#define TSEMOUSE_MIDDLE_DOWN 7
#define TSEMOUSE_RIGHT_UP 8
#define TSEMOUSE_LEFT_UP 9
//#define TSEMOUSE_MIDDLE_UP 10
//Data Structure for Storing Mouse action
typedef struct _MOUSE_INFO
{
UINT32 Top;
UINT32 Left;
UINT32 ButtonStatus;
}MOUSE_INFO;
#if TSE_USE_AMI_EFI_KEYCODE_PROTOCOL
#include <Protocol/AmiKeyCode.h>
//Start EIP #23127 Item #8
//EIP 60128 Ctrl+Alt+F6 also working as Ctrl+F6 or Alt+F6
BOOLEAN CheckAdvShiftState (UINT32 AmiKeyShiftState, UINT32 CondShiftState);
#define TSE_CHECK_SHIFTSTATE CheckAdvShiftState
/*( (!(AmiKeyShiftSate &(~SHIFT_STATE_VALID)) && (!CondShiftState)) || \
(((AmiKeyShiftSate &(~SHIFT_STATE_VALID)) & CondShiftState) == (CondShiftState & (~SHIFT_STATE_VALID))) || \
((AmiKeyShiftSate == SHIFT_STATE_VALID) && (CondShiftState == SHIFT_STATE_VALID)) )*/
//End EIP #23127 Item #8
#else
#ifndef _AMI_EFI_KEY_DATA_
#define _AMI_EFI_KEY_DATA_
typedef struct {
EFI_INPUT_KEY Key;
} AMI_EFI_KEY_DATA;
#endif
#endif
VOID DrawQuietBootLogo(VOID);
BOOLEAN ProcessConInAvailability(VOID);
VOID ProcessEnterSetup(VOID);
VOID ProcessProceedToBoot(VOID);
VOID MinisetupDriverEntryHook(VOID);
VOID PostManagerHandShakeHook(VOID);
CONTROL_ACTION MapControlKeys(AMI_EFI_KEY_DATA key);
VOID CheckForKey( EFI_EVENT Event, VOID *Context );
VOID CheckForClick( EFI_EVENT Event, VOID *Context );
VOID BeforeLegacyBootLaunch(VOID);
VOID AfterLegacyBootLaunch(VOID);
VOID BeforeEfiBootLaunch(VOID);
VOID AfterEfiBootLaunch(VOID);
VOID SavedConfigChanges(VOID);
VOID LoadedConfigDefaults(VOID);
VOID TimeOutLoopHook(VOID);
VOID PasswordEncode( CHAR16 *Password, UINTN MaxSize);
EFI_STATUS SetControlColors(UINT8 *BGColor, UINT8 *FGColor, UINT8 *SecBGColor, UINT8 *SecFGColor,
UINT8 *SelBGColor, UINT8 *SelFGColor, UINT8 *NSelBGColor, UINT8 *NSelFGColor,
UINT8 *LabelBGColor, UINT8 *LabelFGColor,UINT8 *NSelLabelFGColor, UINT8 *EditBGColor, UINT8 *EditFGColor,
UINT8 *PopupFGColor, UINT8 *PopupBGColor);
VOID InvalidActionHook(VOID);
VOID LoadedUserDefaults(VOID);
VOID LoadedBuildDefaults(VOID);
VOID LoadedPreviousValues(VOID);
VOID SetupConfigModified(VOID);
VOID LoadSetupDefaults (VOID *defaults, UINTN data );
VOID PreSystemResetHook(VOID);
CONTROL_ACTION MapControlMouseAction(VOID *pMouseInfo);
VOID ProcessProceedToBootNow(VOID);
VOID ProcessConOutAvailable(VOID);
VOID ProcessUIInitHook(VOID);
VOID AfterInitPostScreen(VOID);
VOID SwitchToPostScreen(VOID);//EIP-111415 SwitchToPostScreenHook
#define MODIFIER_DUAL_KEYS 0x000000FF //For handling any oTf the two dual(ctrl, alt, shift and logo) keys pressed
#define RIGHT_LEFT_SHIFT_PRESSED 0x00000003
#define RIGHT_LEFT_CONTROL_PRESSED 0x0000000C
#define RIGHT_LEFT_ALT_PRESSED 0x00000030
#define RIGHT_LEFT_LOGO_PRESSED 0x000000C0
#define EFI_MOUSE_DRIVER_PROTOCOL_GUID \
{0xc7a7030c, 0xc3d8, 0x45ee, 0xbe, 0xd9, 0x5d, 0x9e, 0x76, 0x76, 0x29, 0x53}
typedef struct
{
EFI_GUID VariableGuid;
CHAR8 VariableName [50];
}VAR_DYNAMICPARSING_HANDLESUPPRESS;
#endif
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//** **//
//** (C)Copyright 2011, American Megatrends, Inc. **//
//** **//
//** All Rights Reserved. **//
//** **//
//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
//** **//
//** Phone (770)-246-8600 **//
//** **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
|