From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- Core/EM/AMITSE/Inc/HiiLib.h | 127 ++++++++++ Core/EM/AMITSE/Inc/HookAnchor.h | 252 +++++++++++++++++++ Core/EM/AMITSE/Inc/LogoLib.h | 241 ++++++++++++++++++ Core/EM/AMITSE/Inc/PwdLib.h | 148 +++++++++++ Core/EM/AMITSE/Inc/TseCommon.h | 147 +++++++++++ Core/EM/AMITSE/Inc/TseElinks.h | 159 ++++++++++++ Core/EM/AMITSE/Inc/boot.h | 537 ++++++++++++++++++++++++++++++++++++++++ Core/EM/AMITSE/Inc/mem.h | 100 ++++++++ Core/EM/AMITSE/Inc/setupdata.h | 421 +++++++++++++++++++++++++++++++ Core/EM/AMITSE/Inc/variable.h | 251 +++++++++++++++++++ 10 files changed, 2383 insertions(+) create mode 100644 Core/EM/AMITSE/Inc/HiiLib.h create mode 100644 Core/EM/AMITSE/Inc/HookAnchor.h create mode 100644 Core/EM/AMITSE/Inc/LogoLib.h create mode 100644 Core/EM/AMITSE/Inc/PwdLib.h create mode 100644 Core/EM/AMITSE/Inc/TseCommon.h create mode 100644 Core/EM/AMITSE/Inc/TseElinks.h create mode 100644 Core/EM/AMITSE/Inc/boot.h create mode 100644 Core/EM/AMITSE/Inc/mem.h create mode 100644 Core/EM/AMITSE/Inc/setupdata.h create mode 100644 Core/EM/AMITSE/Inc/variable.h (limited to 'Core/EM/AMITSE/Inc') diff --git a/Core/EM/AMITSE/Inc/HiiLib.h b/Core/EM/AMITSE/Inc/HiiLib.h new file mode 100644 index 0000000..a0bc7ba --- /dev/null +++ b/Core/EM/AMITSE/Inc/HiiLib.h @@ -0,0 +1,127 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2010, 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/Inc/HiiLib.h $ +// +// $Author: Arunsb $ +// +// $Revision: 6 $ +// +// $Date: 10/18/12 5:31a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/HiiLib.h $ +// +// 6 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 11 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 5 9/20/10 6:46p Madhans +// [TAG] EIP44542 +// [Category] BUILD ISSUE FIX +// [Symptom] Build issues with TSE label (INT)4.6.2_TSE_2_10_1207_TEST +// when IdeSecurity and FastBoot modules added to the project +// [RootCause] - +// [Solution] Build issues resolved +// [Files] CommonHelper.c, Tsecommon.h, Hiilib.h, Boot.h, minisetup.h, +// bbs.c, special.c, Bds.c TseLitehelp +// +// 4 6/17/10 2:17p Madhans +// Refer Changelog.log. +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 7 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 6 1/09/10 2:29a Mallikarjunanv +// Updated TSE2.01 Release sources with coding standards +// +// 5 10/28/09 5:34p Madhans +// +// 4 8/13/09 7:33a Mallikarjunanv +// changed after moving the hii ralated function to uefi module from +// binary module +// +// 3 7/20/09 11:54a Mallikarjunanv +// added external variable gHiiProtocol to use in tse binary +// +// 2 6/24/09 6:33p Madhans +// Coding Standards. +// +// 1 6/09/09 9:53a Madhans +// TSE 2.00.1201 +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:50p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 10:24p Madhans +// Tse 2.0 Code complete Checkin. +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: hiilib.h +// +// Description: Hii related functions +// +//---------------------------------------------------------------------------- +// + +#ifndef _HIILIB_H_ +#define _HIILIB_H_ + +EFI_STATUS HiiInitializeProtocol( VOID ); +CHAR16 *HiiGetString( VOID* handle, UINT16 token ); +UINT16 HiiAddString( VOID* handle, CHAR16 *string ); +UINTN TestPrintLength ( IN CHAR16 *String ); + +extern VOID * gHiiHandle; + +#ifndef INVALID_HANDLE +#define INVALID_HANDLE ((VOID*)(UINTN)-1) +#endif + +#ifndef INVALID_TOKEN +#define INVALID_TOKEN ((UINT16)-1) +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/HookAnchor.h b/Core/EM/AMITSE/Inc/HookAnchor.h new file mode 100644 index 0000000..106d722 --- /dev/null +++ b/Core/EM/AMITSE/Inc/HookAnchor.h @@ -0,0 +1,252 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (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/Inc/HookAnchor.h $ +// +// $Author: Premkumara $ +// +// $Revision: 10 $ +// +// $Date: 3/06/13 12:20a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/HookAnchor.h $ +// +// 10 3/06/13 12:20a 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 +// +// 9 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 11 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 8 11/20/11 6:33a 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. +// +// 7 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 +// +// 6 9/16/10 8:39p Madhans +// Updated for TSE 2.10. Refer changelog.log for more deatils. +// +// 5 6/04/10 12:12p Blaines +// Created new AMITSE hook, hook33 +// +// 4 4/16/10 5:11p Madhans +// Changes for Tse 2.02. Please see Changelog.log for more details. +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 5 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 4 2/04/10 11:08p Madhans +// MapControlMouseAction hook added +// +// 3 9/15/09 9:03a Sudhirv +// added two hooks one for LoadSetupDefaults and the other for +// PreSystemReset +// +// 2 6/24/09 6:33p Madhans +// Coding Standards. +// +// 1 6/09/09 9:53a Madhans +// TSE 2.00.1201 +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:50p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 10:24p Madhans +// Tse 2.0 Code complete Checkin. +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: hookanchor.h +// +// Description: TSE hook functions +// +//---------------------------------------------------------------------------- +// + +#ifndef _HOOKANCHOR_H_ +#define _HOOKANCHOR_H_ + +#if TSE_USE_AMI_EFI_KEYCODE_PROTOCOL +#include +#else +#ifndef _AMI_EFI_KEY_DATA_ +#define _AMI_EFI_KEY_DATA_ +typedef struct { + EFI_INPUT_KEY Key; +} AMI_EFI_KEY_DATA; +#endif +#endif + +VOID DrawQuietBootLogoHook(VOID); +BOOLEAN ProcessConInAvailabilityHook(VOID); +VOID ProcessEnterSetupHook(VOID); +VOID ProcessProceedToBootHook(VOID); +VOID MinisetupDriverEntryHookHook(VOID); +VOID PostManagerHandShakeHookHook(VOID); +CONTROL_ACTION MapControlKeysHook(AMI_EFI_KEY_DATA key); +VOID CheckForKeyHook( EFI_EVENT Event, VOID *Context ); +VOID CheckForClickHook( EFI_EVENT Event, VOID *Context );//EIP 62763 : Utilize the Improvements done from mouse driver in AMITSE +VOID BeforeLegacyBootLaunchHook(VOID); +VOID AfterLegacyBootLaunchHook(VOID); +VOID BeforeEfiBootLaunchHook(VOID); +VOID AfterEfiBootLaunchHook(VOID); +VOID SavedConfigChangesHook(VOID); +VOID LoadedConfigDefaultsHook(VOID); +VOID TimeOutLoopHookHook(VOID); +EFI_STATUS OemKey1HookHook ( BOOT_FLOW *bootFlowPtr ); +EFI_STATUS OemKey2HookHook ( BOOT_FLOW *bootFlowPtr ); +EFI_STATUS OemKey3HookHook ( BOOT_FLOW *bootFlowPtr ); +EFI_STATUS OemKey4HookHook ( BOOT_FLOW *bootFlowPtr ); +VOID PasswordEncodeHook( CHAR16 *Password, UINTN MaxSize); +EFI_STATUS SetControlColorsHook(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 InvalidActionHookHook(VOID); +VOID LoadedUserDefaultsHook(VOID); +VOID LoadedBuildDefaultsHook(VOID); +VOID LoadedPreviousValuesHook(VOID); +VOID SetupConfigModifiedHook(VOID); +VOID DrawPopupMenuHook(); +VOID BbsBootHook(); +VOID LoadSetupDefaultsHook( NVRAM_VARIABLE *defaults, UINTN data ); +VOID PreSystemResetHookHook(VOID); +CONTROL_ACTION MapControlMouseActionHook(VOID *pMouseInfo); +VOID ProcessProceedToBootNowHook(VOID); +VOID ProcessConOutAvailableHook(VOID); +VOID ProcessUIInitHookHook(VOID); +VOID AfterInitPostScreenHook(VOID); +VOID SwitchToPostScreenHook(VOID);//EIP-111415 SwitchToPostScreenHook + +VOID LastTSEHook(VOID); + +typedef VOID (TSE_HOOK) (VOID); +typedef BOOLEAN (TSE_HOOK_T1) (); +typedef CONTROL_ACTION (TSE_HOOK_T2) (AMI_EFI_KEY_DATA key); +typedef VOID (TSE_HOOK_T3) (EFI_EVENT Event, VOID *Context); +typedef EFI_STATUS (TSE_HOOK_T4) (BOOT_FLOW *bootFlowPtr); +typedef VOID (TSE_HOOK_T5) (CHAR16 *Password, UINTN MaxSize); +typedef EFI_STATUS (TSE_HOOK_T6) (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); +typedef CONTROL_ACTION (TSE_HOOK_T7) (VOID *MouseInfo); + +extern TSE_HOOK * AMITSE_HookList []; + +extern UINTN gHookBase; + +#define HOOKID0 (gHookBase) +#define HOOKID1 (gHookBase+1) +#define HOOKID2 (gHookBase+2) +#define HOOKID3 (gHookBase+3) +#define HOOKID4 (gHookBase+4) +#define HOOKID5 (gHookBase+5) +#define HOOKID6 (gHookBase+6) +#define HOOKID7 (gHookBase+7) +#define HOOKID8 (gHookBase+8) +#define HOOKID9 (gHookBase+9) +#define HOOKID10 (gHookBase+10) +#define HOOKID11 (gHookBase+11) +#define HOOKID12 (gHookBase+12) +#define HOOKID13 (gHookBase+13) +#define HOOKID14 (gHookBase+14) +#define HOOKID15 (gHookBase+15) +#define HOOKID16 (gHookBase+16) +#define HOOKID17 (gHookBase+17) +#define HOOKID18 (gHookBase+18) +#define HOOKID19 (gHookBase+19) +#define HOOKID20 (gHookBase+20) +#define HOOKID21 (gHookBase+21) +#define HOOKID22 (gHookBase+22) +#define HOOKID23 (gHookBase+23) +#define HOOKID24 (gHookBase+24) +#define HOOKID25 (gHookBase+25) +#define HOOKID26 (gHookBase+26) +#define HOOKID27 (gHookBase+27) +#define HOOKID28 (gHookBase+28) +#define HOOKID29 (gHookBase+29) +#define HOOKID30 (gHookBase+30) +#define HOOKID31 (gHookBase+31) +#define HOOKID32 (gHookBase+32) +#define HOOKID33 (gHookBase+33) +#define HOOKID34 (gHookBase+34) +#define HOOKID35 (gHookBase+35) +#define HOOKID36 (gHookBase+36) +#define HOOKID37 (gHookBase+37)//EIP-SwitchToPostScreenHook + + +#endif /* _HOOKANCHOR_H_ */ + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/LogoLib.h b/Core/EM/AMITSE/Inc/LogoLib.h new file mode 100644 index 0000000..7707268 --- /dev/null +++ b/Core/EM/AMITSE/Inc/LogoLib.h @@ -0,0 +1,241 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 1985-2012, 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/Inc/LogoLib.h $ +// +// $Author: Arunsb $ +// +// $Revision: 10 $ +// +// $Date: 10/18/12 5:31a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/LogoLib.h $ +// +// 10 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 8 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 9 2/02/12 12:40a Premkumara +// [TAG] EIP75136 +// [Category] New Feature +// [Description] Generic support for logos in RomHoles +// [Files] CommomHelper.c, AMITSE.sdl, AMITSE.mak, LogoLib.h +// +// 8 1/31/12 1:18p Premkumara +// [TAG] EIP75136 +// [Category] New Feature +// [Description] Generic support for logos in RomHoles +// [Files] CommomHelper.c, AMITSE.sdl, AMITSE.mak, LogoLib.h, +// Postmgmt.c, AMILogo.h +// +// 7 9/29/11 7:00p Blaines +// [TAG] - EIP 66860 +// [Category]- Function Request +// [Synopsis]- AmiPostManager interface for text entry. +// [Files] - LogoLib.h, AMIPostMgr.h, protocol.c, protocol.h, +// TseAdvanced.c, TseLitehelper.c, TseUefiHii.h, Uefi21Wapper.c +// +// 6 6/22/11 9:17a Premkumara +// [TAG] EIP60048 +// [Category] Improvement +// [Description] TSE should Change the System Resolution according to +// the Quite Logo Size +// [Files] CommonHelper.c, AMITSE.sdl, Logo.c, LogoLib.h +// +// 5 6/13/11 12:29p Rajashakerg +// [TAG] EIP60910 +// [Category] New Feature +// [Description] PNG image support in TSE. +// [Files] LogoLib.h, AMITSE.sdl, CommonHelper.c, logo.c, png.c, png.h, +// pnguncmp.c, TseAdvanced.cif +// +// 4 4/16/10 5:11p Madhans +// Changes for Tse 2.02. Please see Changelog.log for more details. +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 5 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 4 2/04/10 12:01p Blaines +// EIP-28005 +// +// Added PostManagerSetAttribute to support display of text in color. +// Added support for handling string characters --- \n, \r. +// +// 3 8/13/09 12:09p Blaines +// Move Image support to binary module +// +// 2 6/24/09 6:33p Madhans +// Coding Standards. +// +// 1 6/09/09 9:53a Madhans +// TSE 2.00.1201 +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:50p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 10:24p Madhans +// Tse 2.0 Code complete Checkin. +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: logolib.h +// +// Description: logo related header +// +//---------------------------------------------------------------------------- +// + +#ifndef _LOGOLIB_H_ +#define _LOGOLIB_H_ + +//OEM_POST Logo GUID. Don't change the GUID. ChangeLogo expects this GUID. +#define AMI_OEM_LOGO_GUID \ + { 0x294b1cef, 0x9beb, 0x42d5, 0x99, 0x71, 0x0c, 0x89, 0x63, 0xcd, 0xaf, 0x02} + +typedef enum { + BMP_Logo, + GIF_Logo, + JPEG_Logo, + PCX_Logo, + PNG_Logo, + OEM_Format_LOGO, + Unsupported_Logo +} LOGO_TYPE; + +EFI_STATUS SetScreenResolution(UINTN ResX, UINTN ResY); +EFI_STATUS GetScreenResolution(UINTN *ResX, UINTN *ResY); +EFI_STATUS GOPSetScreenResolution(UINTN *Width, UINTN *Height); +EFI_STATUS GOPSetScreenResolutionHook(UINTN *Width, UINTN *Height, UINT32 Index); + +EFI_STATUS +GetGraphicsBitMapFromFV ( +IN EFI_GUID *FileNameGuid, +IN OUT VOID **Image, +IN OUT UINTN *ImageSize +); + +EFI_STATUS +DrawImage( +IN UINT8 *ImageData, +IN UINTN ImageSize, +IN CO_ORD_ATTRIBUTE Attribute, +IN INTN CoOrdX, +IN INTN CoOrdY, +IN BOOLEAN AdjustScreenResolution, +OUT UINTN *Width, +OUT UINTN *Height +); + +EFI_STATUS PostManagerDisplayPostMessage( CHAR16 *message ); +EFI_STATUS PostManagerDisplayPostMessageEx( CHAR16 *message, UINTN Attribute ); +EFI_STATUS PostManagerSwitchToPostScreen( VOID ); + +EFI_STATUS +PostManagerDisplayMsgBox( + IN CHAR16 *MsgBoxTitle, + IN CHAR16 *Message, + IN UINT8 MsgBoxType, + OUT UINT8 *MsgBoxSel +); + +EFI_STATUS +PostManagerDisplayTextBox( + IN VOID *HiiHandle, + IN UINT16 TitleToken, + IN TEXT_INPUT_TEMPLATE *InputData, + IN UINT16 ItemCount, + IN DISPLAY_TEXT_KEY_VALIDATE DisplayTextKeyValidate +); + +EFI_STATUS +PostManagerDisplayProgress( +IN UINT8 ProgressBoxState, +IN CHAR16 *Title, +IN CHAR16 *Message, +IN CHAR16 *Legend, +IN UINTN Percent, // 0 - 100 +IN OUT VOID **Handle, //Out HANDLE. Valid Handle for update and close +OUT AMI_POST_MGR_KEY *OutKey //Out Key +); + +EFI_STATUS +PostManagerDisplayMsgBoxEx( + IN CHAR16 *Title, + IN CHAR16 *Message, + IN CHAR16 *Legend, + IN MSGBOX_EX_CATAGORY MsgBoxExCatagory, + IN UINT8 MsgBoxType, + IN UINT16 *OptionPtrTokens, // Valid only with MSGBOX_TYPE_CUSTOM + IN UINT16 OptionCount, // Valid only with MSGBOX_TYPE_CUSTOM + IN AMI_POST_MGR_KEY *HotKeyList, // NULL - AnyKeyPress closes + IN UINT16 HotKeyListCount, + OUT UINT8 *MsgBoxSel, + OUT AMI_POST_MGR_KEY *OutKey +); + +EFI_STATUS +PostManagerDisplayQuietBootMessage( + CHAR16 *Message, + INTN CoOrdX, + INTN CoOrdY, + CO_ORD_ATTRIBUTE Attribute, + EFI_UGA_PIXEL Foreground, + EFI_UGA_PIXEL Background +); + +EFI_STATUS PostManagerDisplayInfoBox( CHAR16 *InfoBoxTitle, + CHAR16 *InfoString, + UINTN Timeout, + EFI_EVENT *Event + ); + +EFI_STATUS PostManagerSetCursorPosition(UINTN X, UINTN Y); +EFI_STATUS PostManagerGetCursorPosition(UINTN *pX, UINTN *pY); +EFI_STATUS PostManagerSetAttribute(UINT8 ATTRIB); +VOID CleanUpLogo( VOID ); + +VOID InitPostScreen( VOID ); + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/PwdLib.h b/Core/EM/AMITSE/Inc/PwdLib.h new file mode 100644 index 0000000..a229378 --- /dev/null +++ b/Core/EM/AMITSE/Inc/PwdLib.h @@ -0,0 +1,148 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2010, 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/Inc/PwdLib.h $ +// +// $Author: Arunsb $ +// +// $Revision: 4 $ +// +// $Date: 10/18/12 5:31a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/PwdLib.h $ +// +// 4 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 5 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 3 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 2 10/28/09 5:34p Madhans +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:50p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 10:24p Madhans +// Tse 2.0 Code complete Checkin. +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: pwdlib.h +// +// Description: password handling realted header +// +//---------------------------------------------------------------------------- +// + +#ifndef _PWDLIB_H_ +#define _PWDLIB_H_ + +#define AMI_PASSWORD_NONE 0 +#define AMI_PASSWORD_USER 1 +#define AMI_PASSWORD_ADMIN 2 +#define AMI_PASSWORD_ANY 3 + +UINT32 +CheckSystemPassword( +IN OUT UINT32 EmptyPasswordType, +IN UINTN *NoOfRetries, +IN OUT UINTN *TimeOut +); + +BOOLEAN CheckSystemPasswordPolicy(UINT32 PasswordInstalled); + +UINT32 PasswordCheckInstalled( VOID ); +VOID SetPasswordType( UINT32 PasswordType ); + +extern UINT32 gPasswordType; //Provides what is the current access level + +// Internal Helper functions +// Used for HDD Security module. +VOID _DrawPasswordWindow(UINT16 PromptToken, UINTN PasswordLength, UINTN *CurrXPos, UINTN *CurrYPos); + +VOID _ReportInBox( + UINTN PasswordLength, + UINT16 BoxToken, + UINTN CurrXPos, + UINTN CurrYPos, + BOOLEAN bWaitForReturn + ); +EFI_STATUS _GetPassword( + CHAR16 *PasswordEntered, + UINTN PasswordLength, + UINTN CurrXPos, + UINTN CurrYPos, + UINTN *TimeOut + ); + +// Expected from IDE sec module. +extern UINT16 IDEPasswordGetName(UINT16 Index); +extern EFI_STATUS IDEPasswordAuthenticate( + CHAR16 *Password, + VOID* Ptr, + BOOLEAN bCheckUser +); +extern BOOLEAN IDEPasswordUpdate( + UINT32 Index, + CHAR16 *Password, + BOOLEAN bCheckUser +); +extern VOID* IDEPasswordGetDataPtr( UINTN Index); +extern BOOLEAN IDEPasswordGetLocked( + UINTN Index +); +extern VOID IDEPasswordCheck(); +extern VOID IDEPasswordFreezeDevices(); +extern VOID UnlockHDD(VOID); +extern VOID SetHDDPassword(VOID); +extern VOID IDEUpdateConfig( + VOID *TempideSecConfig, + UINTN value +); + + + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/TseCommon.h b/Core/EM/AMITSE/Inc/TseCommon.h new file mode 100644 index 0000000..62e6030 --- /dev/null +++ b/Core/EM/AMITSE/Inc/TseCommon.h @@ -0,0 +1,147 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (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/Inc/TseCommon.h $ +// +// $Author: Arunsb $ +// +// $Revision: 6 $ +// +// $Date: 10/18/12 5:31a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/TseCommon.h $ +// +// 6 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 7 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 5 11/20/11 6:38a 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. +// +// 4 9/20/10 6:46p Madhans +// [TAG] EIP44542 +// [Category] BUILD ISSUE FIX +// [Symptom] Build issues with TSE label (INT)4.6.2_TSE_2_10_1207_TEST +// when IdeSecurity and FastBoot modules added to the project +// [RootCause] - +// [Solution] Build issues resolved +// [Files] CommonHelper.c, Tsecommon.h, Hiilib.h, Boot.h, minisetup.h, +// bbs.c, special.c, Bds.c TseLitehelp +// +// 3 9/16/10 8:39p Madhans +// Updated for TSE 2.10. Refer changelog.log for more deatils. +// +// 2 8/04/10 12:11a Mallikarjunanv +// EIP-29951 : Device Path Name support updates +// +// 1 2/19/10 12:58p Madhans +// Uploaded for TSE 2.01. Refer Changelog.log for File change history. +// +// 2 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 1 10/28/09 5:32p Madhans +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: TseCommon.h +// +// Description: Tse Common Helper header file +// +//---------------------------------------------------------------------------- +// + +#ifndef _TSECOMMON_H_ +#define _TSECOMMON_H_ + +#include "HiiLib.h" +#include "Mem.h" +#include "Variable.h" +#include "PwdLib.h" + +EFI_STATUS +EfiLibReportStatusCode ( + IN EFI_STATUS_CODE_TYPE Type, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID *CallerId OPTIONAL, + IN EFI_STATUS_CODE_DATA *Data OPTIONAL + ); + +VOID * +EfiLibAllocateZeroPool ( + IN UINTN AllocationSize + ); + +extern INTN +EfiCompareMem ( + IN VOID *MemOne, + IN VOID *MemTwo, + IN UINTN Len + ); + +UINTN +SPrint ( + OUT CHAR16 *Buffer, + IN UINTN BufferSize, + IN CONST CHAR16 *Format, + ... + ); + +EFI_STATUS ShowPostMsgBox(IN CHAR16 *MsgBoxTitle,IN CHAR16 *Message,IN UINT8 MsgBoxType, UINT8 *pSelection); + +VOID CheckForKeyHook( EFI_EVENT Event, VOID *Context ); +VOID CheckForClickHook( EFI_EVENT Event, VOID *Context ); +VOID ClearScreen( UINT8 Attrib ); +VOID *SaveScreen( VOID ); + +extern EFI_BOOT_SERVICES *gBS; +extern EFI_SYSTEM_TABLE *gST; +extern EFI_GUID gEfiDevicePathProtocolGuid; + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/TseElinks.h b/Core/EM/AMITSE/Inc/TseElinks.h new file mode 100644 index 0000000..f64cbcd --- /dev/null +++ b/Core/EM/AMITSE/Inc/TseElinks.h @@ -0,0 +1,159 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2013, 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/Inc/TseElinks.h $ +// +// $Author: Premkumara $ +// +// $Revision: 6 $ +// +// $Date: 3/25/13 8:41a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/TseElinks.h $ +// +// 6 3/25/13 8:41a Premkumara +// [TAG] EIP116315 +// [Category] Improvement +// [Description] Display control prompt string for password control. +// (for String on CHAP secret popup) +// [Files] - AMITSE.sdl +// - CommonHelper.c +// - FakeToken.c +// - AmiTSEStr.uni +// - TseLite\PopupPassword.c +// - uefi2.1\UefiWapper21.c +// - uefi2.0\UefiWapper20.c +// - uefi2.0\HiiCallback.c +// - uefi2.0\hii.h +// - uefi2.0\hii.c +// +// 5 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 5 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 4 5/28/12 6:21a Rajashakerg +// [TAG] EIP80873 +// [Category] Improvement +// [Description] TSE Load/Save defaults without Messaaagebox. +// [Files] TseElinks.h, Tseadvanced.c +// +// 3 11/13/11 12:22p Arunsb +// [TAG] EIP70421 +// [Category] New Feature +// [Description] Support for driver order in TSE +// [Files] AMITSE.SDL, CommonHelper.c, setup.ini, uefisetup.ini, +// boot.c, +// minisetup.h, bbs.c, special.c, special.h, tseadvanced.c, +// addbootoption.c, +// callback.c, minisetupext.c, minisetupext.h, popupsel.c, popupsel.h, +// TseLitehelper.c, variable.c, Uefi21Wapper.c, AMIVfr.h, boot.h, +// TseElink.h, variable.h, +// setup.h, Boot.vfr and Setup.uni +// +// 2 12/29/10 5:11a Mallikarjunanv +// [TAG] EIP41615 +// [Category] New Feature +// [Description] Added the file browser support for the Add boot option +// reated controls +// +// [Files] AmiVfr.h, AmiTse.sdl, AmiTseStr.uni, CommonHelper.c, +// Faketokens.c, TseElinks.h, EdkHelper.h, minisetup.h, TseAdvanced.c, +// AddBootOption.c +// +// 1 2/19/10 12:58p Madhans +// Uploaded for TSE 2.01. Refer Changelog.log for File change history. +// +// 2 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 1 7/30/09 7:32a Mallikarjunanv +// New header file to handle the Elinks related inforamtion +// +// 1 7/30/09 7:27a Mallikarjunanv +// New file to handle Elink related definitions +// +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: TseElinks.h +// +// Description: Header file for Elink related customizations +// +//---------------------------------------------------------------------------- +// + +#ifndef _TSEELINKS_H_ +#define _TSEELINKS_H_ + +#define END_OF_EXIT_PAGE_OPTION_LIST 0xFF + +///Default fucntions to handle Exit page options... +VOID HandleSaveAndExit(VOID); +VOID HandleExitApplication(VOID); +VOID HandleSaveAndReset(VOID); +VOID HandleResetSys(VOID); +VOID HandleSaveWithoutExit(VOID); +VOID HandleLoadPreviousValues(VOID); +VOID HandleLoadOptimalDefaults(VOID); +VOID HandleSaveUserDefaults(VOID); +VOID HandleRestoreUserDefaults(VOID); +VOID HandleBootAddBootOption(VOID); +VOID HandleLaunchFileSystem(VOID); //EIP_41615 related to file browser support in AddBootOption +VOID HandleLaunchFileSystemDriver (VOID); +VOID HandleDriverAddDriverOption (VOID); +VOID SaveUserDefaultsSilently(VOID); +VOID LoadUserDefaultsSilently(VOID); + +typedef VOID (*OPTION_CALLBACK)(VOID); + +typedef struct _EXIT_PAGE_OPTIONS +{ + UINT8 OptIdx; + OPTION_CALLBACK ExitPageCallBack; +} +EXIT_PAGE_OPTIONS; + +typedef struct +{ + EFI_GUID FormsetGuid; + UINT32 QuestionID; + BOOLEAN EncodingFlag; +}PASSWORD_ENOCDE_LIST_TEMPLATE; + +#endif /* _TSEELINKS_H_ */ + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/boot.h b/Core/EM/AMITSE/Inc/boot.h new file mode 100644 index 0000000..3172a07 --- /dev/null +++ b/Core/EM/AMITSE/Inc/boot.h @@ -0,0 +1,537 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (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/Inc/boot.h $ +// +// $Author: Arunsb $ +// +// $Revision: 12 $ +// +// $Date: 10/18/12 5:31a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/boot.h $ +// +// 12 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 8 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 10 9/21/12 9:41a Premkumara +// [TAG] EIP 97704 +// [Category] Improvement +// [Description] Support BootFFFF variable +// [Files] Boot.h, Boot.c, Special.c +// +// 9 5/29/12 2:55a Arunsb +// [TAG] EIP91109 +// [Category] Improvement +// [Description] Sync the Aptio IV source for AptioV +// [Files] boot.h +// +// 8 11/13/11 12:21p Arunsb +// [TAG] EIP70421 +// [Category] New Feature +// [Description] Support for driver order in TSE +// [Files] AMITSE.SDL, CommonHelper.c, setup.ini, uefisetup.ini, +// boot.c, +// minisetup.h, bbs.c, special.c, special.h, tseadvanced.c, +// addbootoption.c, +// callback.c, minisetupext.c, minisetupext.h, popupsel.c, popupsel.h, +// TseLitehelper.c, variable.c, Uefi21Wapper.c, AMIVfr.h, boot.h, +// TseElink.h, variable.h, +// setup.h, Boot.vfr and Setup.uni +// +// 7 6/20/11 11:38a Rajashakerg +// [TAG] EIP59417 +// [Category] New Feature +// [Description] Spport LOAD_OPTION_HIDDEN option in TSE +// [Files] boot.h, AMITSE.sdl, CommonHelper.c, bbs.c, boot.c, +// minisetup.h, special.c, callback.c +// +// 6 3/15/11 5:11a Rajashakerg +// [TAG] EIP51671 +// [Category] New Feature +// [Description] Boot overide menu devices are not disable +// [Files] boot.c, minisetup.h, special.c, minisetupext.c, AMITSE.sdl, +// boot.h, CommonHelper.c +// +// 5 9/20/10 6:46p Madhans +// [TAG] EIP44542 +// [Category] BUILD ISSUE FIX +// [Symptom] Build issues with TSE label (INT)4.6.2_TSE_2_10_1207_TEST +// when IdeSecurity and FastBoot modules added to the project +// [RootCause] - +// [Solution] Build issues resolved +// [Files] CommonHelper.c, Tsecommon.h, Hiilib.h, Boot.h, minisetup.h, +// bbs.c, special.c, Bds.c TseLitehelp +// +// 4 3/26/10 5:26p Madhans +// EIP 35562: Support To create Boot option in Capital letters. +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 4 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 3 1/09/10 2:29a Mallikarjunanv +// Updated TSE2.01 Release sources with coding standards +// +// 2 6/24/09 6:33p Madhans +// Coding Standards. +// +// 1 6/09/09 9:53a Madhans +// TSE 2.00.1201 +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:50p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 10:24p Madhans +// Tse 2.0 Code complete Checkin. +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: boot.h +// +// Description: UEFI Boot related header +// +//---------------------------------------------------------------------------- +// + +#ifndef _BOOT_H_ +#define _BOOT_H_ + +#if !TSE_USE_EDK_LIBRARY +//EIP:39334 - START +#if TSE_CSM_SUPPORT +#include +#else //If CSM support is not available, then TSE need the following info to build. + +#define EFI_LEGACY_BIOS_PROTOCOL_GUID \ + { 0xdb9a1e3d, 0x45cb, 0x4abb, 0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d} + +GUID_VARIABLE_DECLARATION(gEfiLegacyBiosProtocolGuid,EFI_LEGACY_BIOS_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include + +typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL; + +// +//---------------------------------------------------------------------------- +// Name: HDD_INFO +// +// Fields: +// Status UINT16 Status of IDE device. See Notes for details. +// Bus UINT32 PCI bus of IDE controller. +// Device UINT32 PCI device of IDE controller. +// Function UINT32 PCI function of IDE controller. +// CommandBaseAddress UINT16 Command ports base address. +// ControlBaseAddress UINT16 Control ports base address. +// BusMasterAddress UINT16 Bus master address. +// IdentifyDrive ATAPI_IDENTIFY Data that identifies the drive data. +// +// Notes: +// The values for the Status field are the following: +// HDD_PRIMARY 0x01 +// HDD_SECONDARY 0x02 +// HDD_MASTER_ATAPI 0x04 +// HDD_SLAVE_ATAPI 0x08 +// HDD_MASTER_IDE 0x20 +// HDD_SLAVE_IDE 0x40 +// HDD_SATA_PATA 0x80 +// There is one HDD_INFO structure per IDE controller. The IdentifyDrive is +// one per drive. Index 0 is master and index 1 is slave. +//---------------------------------------------------------------------------- +// + +typedef struct _ATAPI_IDENTIFY { + UINT16 Raw[256]; +} ATAPI_IDENTIFY; + +//************************************************* +// IDE device status values +//************************************************* + +#define HDD_PRIMARY 0x01 +#define HDD_SECONDARY 0x02 +#define HDD_MASTER_ATAPI 0x04 +#define HDD_SLAVE_ATAPI 0x08 +#define HDD_MASTER_IDE 0x20 +#define HDD_SLAVE_IDE 0x40 +#define HDD_SATA_PATA 0x80 + +typedef struct _HDD_INFO { + UINT16 Status; + UINT32 Bus; + UINT32 Device; + UINT32 Function; + UINT16 CommandBaseAddress; + UINT16 ControlBaseAddress; + UINT16 BusMasterAddress; + UINT8 HddIrq; + ATAPI_IDENTIFY IdentifyDrive[2]; +} HDD_INFO; + + +//**************************************************** +// BBS related definitions +//**************************************************** + +// +// BootPriority values +// +#define BBS_DO_NOT_BOOT_FROM 0xFFFC +#define BBS_LOWEST_PRIORITY 0xFFFD +#define BBS_UNPRIORITIZED_ENTRY 0xFFFE +#define BBS_IGNORE_ENTRY 0xFFFF +// +// Following is a description of the above fields. +// +// BBS_DO_NOT_BOOT_FROM - Removes a device from the boot list but still +// allows it to be enumerated as a valid device +// under MS-DOS*. +// BBS_LOWEST_PRIORITY - Forces the device to be the last boot device. +// BBS_UNPRIORITIZED_ENTRY - Value that is placed in the BBS_TABLE.BootPriority +// field before priority has been assigned but that +// indicates it is valid entry. Other values indicate +// the priority, with 0x0000 being the highest priority. +// BBS_IGNORE_ENTRY - When placed in the BBS_TABLE.BootPriority field, +// indicates that the entry is to be skipped. +// + +// +//---------------------------------------------------------------------------- +// Name: BBS_STATUS_FLAGS +// +// Fields: +// OldPosition UINT16:4 Prior priority. +// Reserved1 UINT16:4 Reserved for future use. +// Enabled UINT16:1 If 0, ignore this entry. +// Failed UINT16:1 0-Not known if boot failure occurred; 1-Boot attempt failed. +// MediaPresent UINT16:2 State of media present, see notes. +// Reserved2 UINT16:4 Reserved for future use. +// +// Notes: +// MediaPresent field details: +// 00 = No bootable media is present in the device. +// 01 = Unknown if a bootable media present. +// 10 = Media is present and appears bootable. +// 11 = Reserved. +//---------------------------------------------------------------------------- +// + +typedef struct { + UINT16 OldPosition : 4; + UINT16 Reserved1 : 4; + UINT16 Enabled : 1; + UINT16 Failed : 1; + UINT16 MediaPresent: 2; + UINT16 Reserved2 : 4; +} BBS_STATUS_FLAGS; + + + +//**************************************************** +// DeviceType values +//**************************************************** +#define BBS_FLOPPY 0x01 +#define BBS_HARDDISK 0x02 +#define BBS_CDROM 0x03 +#define BBS_PCMCIA 0x04 +#define BBS_USB 0x05 +#define BBS_EMBED_NETWORK 0x06 +#define BBS_BEV_DEVICE 0x80 +#define BBS_UNKNOWN 0xff + + + +// +//---------------------------------------------------------------------------- +// Name: BBS_TABLE +// +// Fields: +// BootPriority UINT16 The boot priority for this boot device. +// Bus UINT32 The PCI bus for this boot device. +// Device UINT32 The PCI device for this boot device. +// Function UINT32 The PCI function for the boot device. +// Class UINT8 The PCI class for this boot device.. +// SubClass UINT8 The PCI Subclass for this boot device. +// MfgString UINT32 Segment:offset address of an ASCIIZ description. +// DeviceType UINT16 BBS device type. +// StatusFlags BBS_STATUS_FLAGS Status of this boot device. +// BootHandler UINT32 Segment:Offset address of boot loader for IPL devices. +// DescString UINT32 Segment:offset address of an ASCIIZ description string. +// InitPerReserved UINT32 Reserved. +// AdditionalIrq??Handler UINT32 See notes for details. +// AssignedDriveNumber UINT8 The drive number(0x80 -0x8?) assigned by the 16-bit code. +// IBV1 UINT32 IBV specific field. +// IBV2 UINT32 IBV specific field. +// +// Notes: +// The use of AdditionalIrq??Handler fields is IBV dependent. They can be +// used to flag that an OpROM has hooked the specified IRQ. The OpROM +// may be BBS compliant as some SCSI BBS-compliant OpROMs also hook IRQ +// vectors in order to run their BIOS Setup. +//---------------------------------------------------------------------------- +// + +typedef struct _BBS_TABLE { + UINT16 BootPriority; + UINT32 Bus; + UINT32 Device; + UINT32 Function; + UINT8 Class; + UINT8 SubClass; + UINT16 MfgStringOffset; + UINT16 MfgStringSegment; + UINT16 DeviceType; + BBS_STATUS_FLAGS StatusFlags; + UINT16 BootHandlerOffset; + UINT16 BootHandlerSegment; + UINT16 DescStringOffset; + UINT16 DescStringSegment; + UINT32 InitPerReserved; + UINT32 AdditionalIrq13Handler; + UINT32 AdditionalIrq18Handler; + UINT32 AdditionalIrq19Handler; + UINT32 AdditionalIrq40Handler; + UINT8 AssignedDriveNumber; + UINT32 AdditionalIrq41Handler; + UINT32 AdditionalIrq46Handler; + UINT32 IBV1; + UINT32 IBV2; +} BBS_TABLE; + +// +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_BOOT +// +// Description: Boots a traditional OS +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// BootOption The EFI device path from BootXXXX variable. +// LoadOptionSize Size of LoadOption. +// LoadOption The load option from BootXXXX variable. +// +// Output: +// EFI_DEVICE_ERROR Failed to boot from any boot device and +// memory is uncorrupted. +// +// Notes: This function normally never returns. It will either boot the OS +// or reset the system if memory has been "corrupted" by loading a +// boot sector and passing control to it. +//---------------------------------------------------------------------------- +// + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_BOOT) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN BBS_BBS_DEVICE_PATH *BootOption, + IN UINT32 LoadOptionsSize, + IN VOID *LoadOptions + ); + +// +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_GET_BBS_INFO +// +// Description: Presents BBS information to external agents. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// HddCount Number of HDD_INFO structures. +// HddInfo Onboard IDE controller information. +// BbsCount Number of BBS_TABLE structures. +// BbsTable BBS entry. +// +// Output: EFI_SUCCESS +//---------------------------------------------------------------------------- +// + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + OUT UINT16 *HddCount, + OUT struct _HDD_INFO **HddInfo, + OUT UINT16 *BbsCount, + IN OUT struct _BBS_TABLE **BbsTable + ); + +// +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PROTOCOL +// +// Description: Abstracts the traditional BIOS from the rest of EFI. The +// LegacyBoot() member function allows the BDS to support booting +// a traditional OS. EFI thunks drivers that make EFI bindings for +// BIOS INT services use all the other member functions. +//---------------------------------------------------------------------------- +// + +typedef struct _EFI_LEGACY_BIOS_PROTOCOL { + EFI_LEGACY_BIOS_BOOT LegacyBoot; + EFI_LEGACY_BIOS_GET_BBS_INFO GetBbsInfo; +} EFI_LEGACY_BIOS_PROTOCOL; + +#endif //#ifndef GUID_VARIABLE_DEFINITION +#endif //#if !TSE_CSM_SUPPORT +#endif +//EIP:39334 - END + + +#define MAX_BOOT_OPTIONS 0xFFFF + +#ifndef LOAD_OPTION_ACTIVE +#define LOAD_OPTION_ACTIVE 0x00000001 +#endif +//EIP:59417 - Checking for LOAD_OPTION_HIDDEN attribute declearaton +#define LOAD_OPTION_HIDDEN 0x00000008 + +#ifndef LOAD_OPTION_FORCE_RECONNECT +#define LOAD_OPTION_FORCE_RECONNECT 0x00000002 +#endif +//EIP-97704 changed macro to global variable +//#define DISABLED_BOOT_OPTION 0xFFFF +//#define DISABLED_DRIVER_OPTION 0xFFFF +extern UINT16 DISABLED_BOOT_OPTION; +extern UINT16 DISABLED_DRIVER_OPTION; + +#define BOOT_ORDER_OPTION 0 +#define DRIVER_ORDER_OPTION 1 + +typedef struct _BOOT_OPTION +{ + UINT32 Active; + UINT16 PathLength; + CHAR16 Name[1]; +} +BOOT_OPTION; + +typedef struct _BBS_ORDER_LIST BBS_ORDER_LIST; + +typedef struct _BOOT_DATA +{ + UINT16 Option; + UINT32 Active; + CHAR16 *Name; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + VOID *LoadOptions; + UINTN LoadOptionSize; + BOOLEAN bNewOption; + UINTN LegacyEntryOffset; + UINT16 LegacyDevCount; + BBS_ORDER_LIST *OrderList; +} +BOOT_DATA; + +typedef struct _LANGUAGE_DATA +{ +//#if SETUP_SUPPORT_PLATFORM_LANG_VAR + CHAR8 *LangCode; + CHAR16 *Unicode; +//#else +// CHAR8 LangCode[4]; +// CHAR16 Unicode[4]; +//#endif + CHAR16 *LangString; + UINT16 Token; +} +LANGUAGE_DATA; + +//#if SETUP_SUPPORT_ADD_BOOT_OPTION +typedef struct _FS_DATA +{ + CHAR16 *FsId; + EFI_DEVICE_PATH_PROTOCOL *FsPath; +} +FS_DATA; +//#endif + +//exported variables +extern UINTN gBootOptionCount; +extern CHAR16 gBootFileName[]; +extern BOOLEAN gShowAllBbsDev,gPopupMenuShowAllBbsDev; +extern BOOLEAN gSetupHideDisableBootOptions,gPopupMenuHideDisableBootOptions;// EIP:51671 extern decleration of the global varibales to use in soruces. +extern BOOLEAN gLoadOptionHidden; //EIP:59417 - extern decleration of the global varibales to use in soruces. +extern CHAR16 gBootFormarSpecifier[]; + +extern UINT16 *gBBSDisabled; +//#if SETUP_SUPPORT_ADD_BOOT_OPTION +extern UINTN gFsCount; +extern FS_DATA *gFsList; +//#endif + +//exported functions +EFI_STATUS BootGetBootOptions( VOID ); +EFI_STATUS BootLaunchBootOption(UINT16 u16Option, UINT16 *pOrder, UINTN u16OrderCount); +BOOT_DATA *BootGetBootData( UINT16 Option ); +CHAR16 *BootGetOptionName( BOOT_DATA *bootData); + +CHAR16 *BootGetBootNowName( UINT16 value, BOOLEAN ShowAllBBSDev, BOOLEAN TseBootNowInBootOrde); + +VOID BootGetLanguages( VOID ); +//EFI_STATUS BootLaunchBootNow( UINT16 Index ); +EFI_STATUS BootLaunchBootNow( UINT16 index, BOOLEAN ShowAllBbsDev ); +EFI_STATUS BootLaunchGuid( EFI_GUID *guid ); +EFI_STATUS BootLaunchFilename( CHAR16 *fileName ); +//#if SETUP_SUPPORT_ADD_BOOT_OPTION +VOID BootAddBootOption( VOID ); +VOID BootDelBootOption( UINT16 index ); +VOID DiscardAddDelBootOptions(VOID); +VOID SaveAddDelBootOptions(VOID); + +//EIP70421 & 70422 Support for driver order starts +extern UINTN gDriverOptionCount; +extern CHAR16 gDriverFormarSpecifier []; +BOOT_DATA *DriverGetDriverData (UINT16); +CHAR16 *DriverGetOptionName (BOOT_DATA *); +VOID DriverDelDriverOption (UINT16); +VOID DriverAddDriverOption (); +VOID DiscardAddDelDriverOptions (VOID); +VOID SaveAddDelDriverOptions (VOID); +//EIP70421 & 70422 Support for driver order ends +//#endif + +#endif /* _BOOT_H_ */ + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/mem.h b/Core/EM/AMITSE/Inc/mem.h new file mode 100644 index 0000000..f4b93d9 --- /dev/null +++ b/Core/EM/AMITSE/Inc/mem.h @@ -0,0 +1,100 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (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/Inc/mem.h $ +// +// $Author: Arunsb $ +// +// $Revision: 5 $ +// +// $Date: 10/18/12 5:31a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/mem.h $ +// +// 5 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 5 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 4 11/10/11 12:46a Arunsb +// [TAG] EIP67735 +// [Category] Improvement +// [Description] Zeroing password buffers before freeing +// [Files] mem.c, mem.h, popupedit.c, popuppassword.c and tseadvanced.c +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 3 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 2 6/24/09 6:12p Madhans +// Made TSE_USE_EDK_LIBRARY=OFF to not to refer EDK module. +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:50p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 10:24p Madhans +// Tse 2.0 Code complete Checkin. +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: mem.h +// +// Description: memory utility functions +// +//---------------------------------------------------------------------------- +// + +#ifndef _MEM_H_ +#define _MEM_H_ + +VOID MemFreePointer (VOID **ptr); +VOID StringZeroFreeMemory (VOID **ptr); +VOID MemCopy( VOID *dest, VOID *src, UINTN size ); +VOID MemSet( VOID *buffer, UINTN size, UINT8 value ); +#if !TSE_USE_EDK_LIBRARY +INTN MemCmp( VOID *dest, VOID *src, UINTN size ); +#endif +VOID *MemReallocateZeroPool( VOID *oldBuffer, UINTN oldSize, UINTN newSize ); +VOID MemFillUINT16Buffer( VOID *buffer, UINTN bufferSize, UINT16 value ); + +#endif /* _MEM_H_ */ + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/setupdata.h b/Core/EM/AMITSE/Inc/setupdata.h new file mode 100644 index 0000000..b92052f --- /dev/null +++ b/Core/EM/AMITSE/Inc/setupdata.h @@ -0,0 +1,421 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2013, 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/Inc/setupdata.h $ +// +// $Author: Arunsb $ +// +// $Revision: 10 $ +// +// $Date: 4/02/13 8:01a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/setupdata.h $ +// +// 10 4/02/13 8:01a Arunsb +// [TAG] EIP113919 +// [Category] Improvement +// [Description] Provide support for EFI_IFR_WRITE, EFI_IFR_READ, +// EFI_IFR_GET, EFI_IFR_SET and EFI_IFR_MAP_OP. +// [Files] Setupdata.h, ctrlcond.c, expression.c, hii.c and parse.c +// +// 9 3/25/13 8:08a Premkumara +// [TAG] EIP105468 +// [Category] New Feature +// [Description] Support for EFI_IFR_REFRESH_ID opcode for Offline +// Parsing +// [Files] Parse.c, Hii.c, Setupdata.h +// +// 8 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 9 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 7 1/20/12 12:46a Rajashakerg +// [TAG] EIP80426 +// [Category] Improvement +// [Description] When restoring settings, avoid accessing the varstore +// for text controls +// [Files] uefi21wapper.c, Setupdata.h. +// +// 6 6/23/11 3:38p Rajashakerg +// [TAG] EIP55762, 58925, 59971 +// [Category] New Feature +// [Description] Support REF2,REF3 and REF4 in AMITSE +// Support direct form navigation path +// Improper layout of controls in the root page when Dynamic pages are +// added using the Legacy Setup Style +// [Files] setupdata.h, CommonHelper.c, AMITSE.sdl, Legacy\Legacy.c, +// Legacy\style.h, Legacy\style.h, frame.c, minisetupext.c, +// minisetupext.h, numeric.c, page.c Popupstring.c, Hii.c, +// Uefi21Wrapper.c, Parse.c Hii.c +// +// 5 4/29/11 4:28p Arunsb +// For 2.13 public patch release IFR RefX feature is omitted +// +// 3 2/10/11 12:31p Blaines +// [TAG] - EIP 53146 +// [Category]- New Feature +// [Description] -Add the support to Move the Dynamic IFR Pages under +// subpages. It should be customizable to move around. +// +// 2 6/17/10 2:17p Madhans +// Refer Changelog.log. +// +// 1 2/19/10 12:58p Madhans +// Uploaded for TSE 2.01. Refer Changelog.log for File change history. +// +// 4 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 3 2/18/10 7:56p Madhans +// AMI Special Var Attribute +// +// 2 1/09/10 2:34a Mallikarjunanv +// Updated TSE2.01 Release sources with coding standards +// +// 1 10/28/09 5:32p Madhans +// +// 3 6/16/09 2:16p Presannar +// Added File Headers for Header Files +// +// 2 6/12/09 7:44p Presannar +// Initial implementation of coding standards for AMITSE2.0 +// +// 1 6/04/09 8:05p Madhans +// +// 1 4/28/09 11:06p Madhans +// Tse 2.0 Code complete Checkin. +// +// 4 4/28/09 9:40p Madhans +// Tse 2.0 Code complete Checkin. +// +// 3 3/31/09 4:12p Madhans +// +// 2 1/30/09 6:06p Madhans +// Function headers added. +// +// 1 12/18/08 7:59p Madhans +// Intial version of TSE Lite sources +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: setupdata.h +// +// Description: Header file for setup data +// +//---------------------------------------------------------------------------- +// + +#ifndef _SETUPDATA_H_ +#define _SETUPDATA_H_ + + + +// forward declarations +typedef struct _SETUP_PKG SETUP_PKG; +typedef struct _SCREEN_INFO SCREEN_INFO; +typedef struct _PAGE_LIST PAGE_LIST; +typedef struct _PAGE_INFO PAGE_INFO; +typedef struct _PAGE_FLAGS PAGE_FLAGS; +typedef struct _CONTROL_LIST CONTROL_LIST; +typedef struct _CONTROL_INFO CONTROL_INFO; +typedef struct _CONTROL_FLAGS CONTROL_FLAGS; +typedef struct _VARIABLE_LIST VARIABLE_LIST; +typedef struct _VARIABLE_INFO VARIABLE_INFO; +typedef struct _HPK_INFO HPK_INFO; +typedef struct _GUID_LIST GUID_LIST; +typedef struct _GUID_FLAGS GUID_FLAGS; +typedef struct _GUID_INFO GUID_INFO; +typedef struct _PAGE_ID_LIST PAGE_ID_LIST; +typedef struct _PAGE_ID_INFO PAGE_ID_INFO; + +#define VARIABLE_NAME_LENGTH 40 +// Control types +#define CONTROL_TYPE_NULL 0x0000 +#define CONTROL_TYPE_SUBMENU 0x0001 +#define CONTROL_TYPE_LABEL 0x0002 +#define CONTROL_TYPE_TEXT 0x0003 +#define CONTROL_TYPE_DATE 0x0004 +#define CONTROL_TYPE_TIME 0x0005 +#define CONTROL_TYPE_POPUPSEL 0x0006 +#define CONTROL_TYPE_MEMO 0x0008 +#define CONTROL_TYPE_MSGBOX 0x0009 +#define CONTROL_TYPE_CHECKBOX 0x000A +#define CONTROL_TYPE_NUMERIC 0x000B +#define CONTROL_TYPE_EDIT 0x000C +#define CONTROL_TYPE_PASSWORD 0x000D +#define CONTROL_TYPE_MENU 0x000E +#define CONTROL_TYPE_ORDERED_LIST 0x000F +#define CONTROL_TYPE_POPUPEDIT 0x0010 +#define CONTROL_TYPE_VARSTORE_SELECT 0x0011 +#define CONTROL_TYPE_VARSTORE_SELECT_PAIR 0x0012 +#define CONTROL_TYPE_POPUP_STRING 0x0013 +#define CONTROL_TYPE_VARSTORE 0x0014 +#define INCONSISTENT_IF 0x0015 + +// UEFI 2.1 Defines +#define NO_SUBMIT_IF 0x0016 +#define DISABLE_IF 0x0017 +#define CONTROL_TYPE_VARSTORE_NAME_VALUE 0x0018 +#define CONTROL_TYPE_VARSTORE_EFI 0x0019 +#define CONTROL_TYPE_VARSTORE_DEVICE 0x001A +#define CONTROL_TYPE_ACTION 0x001B +#define CONTROL_TYPE_RESET 0x001C +#define CONTROL_TYPE_RULE 0x001D +#define CONTROL_TYPE_REF2 0x001E // EIP 80426:When restoring settings, avoid accessing the varstore for text controls + +// Used in Edit.c +#ifndef IFR_PASSWORD_OP +#define IFR_PASSWORD_OP 0x08 +#endif + +#pragma warning( disable : 4201 ) + +#pragma pack(8) +struct _SETUP_PKG +{ + CHAR8 PackageSignature[4]; //'$SPF' Signature to identify the package file + UINT16 StructureRevision; //0x0100 Revision of this structure + UINT32 PackageVersion; //0x00000100 Version number of the structure data + UINT8 Reserved[6]; //0 Reserved for future expansion + EFI_GUID PackageGuid; //Varies EFI_GUID for the entire setup package + UINT32 PackageVariable; //0x00000001 ID of the default GUID-Name variable store for this package + UINT32 PackageScreen; //Varies Offset to start of SCREEN_INFO structure + UINT32 PackagePageList; //Varies Offset to start of PAGE_LIST structure + UINT32 PackageControlOffset; //Varies Offset to start of controls + UINT32 PackageVariableList; //Varies Offset to start of VARIABLE_LIST structure + UINT32 PackageHpkData; //Varies Offset to source HPK info that we need + UINT32 PackageGuidList; //Varies List of OEM GUIDs requiring application launch + UINT32 PackagePageIdList; //Varies Offset to list of Page ID triplets guid class subclass + UINT32 PackageIfrData; //Varies IFR data that is used to build our 'static' pages +}; + +struct _SCREEN_INFO //Structure containing global information used by all pages +{ + union { + /*EFI_HII_HANDLE*/VOID * MainHandle; //Varies HII Handle to the formset that contains the global screen info + UINT8 res[8]; + }; + UINT16 MainTitle; //Varies Token for title string + UINT16 MainCopyright; //Varies Token for copyright string + UINT16 MainHelpTitle; //Varies Token for help 'window' title + UINT16 MainMenuCount; //Varies Number of entries in main menu (0 = no main menu) + UINT16 MainNavCount; //Varies Number of nav help strings on the page + //UINT16 MenuEntries[]; //Varies Tokens for menu strings + //UINT16 MainNavToken[]; //Varies Tokens for all navigational help strings +}; + +struct _PAGE_LIST //This is the listing of all the pages in setup +{ + UINT32 PageCount; //Varies Number of pages in Setup + UINT32 PageList[1]; //Varies Offsets to each of the page structures +}; + +struct _PAGE_FLAGS //Structure containing the attributes global to a page +{ + UINT32 PageVisible : 1; //TRUE Controls whether or not this page is visible + UINT32 PageHelpVisible : 1; //TRUE Controls whether or not help is visible on this page + UINT32 PageDisableHotKeys : 1; //FALSE Controls whether globals hot keys are enabled for this page + UINT32 PageRefresh : 1; //TRUE Controls whether the page is refreshable + UINT32 PageModal : 1; //TRUE Controls whether the page is Modal + UINT32 PageDynamic : 1; //TRUE Controls whether the page is Dynamic + UINT32 PageStdMap : 1; // set 0 if Form map is not found otherwise set 1 + UINT32 Reserved : 25; //0 Reserved for future use +}; + +struct _CONTROL_LIST //Structure containing the offsets of all the control data +{ + UINT32 ControlCount; //Varies Number of controls in this list + UINT32 ControlList[1]; //Varies Offsets to each of the control structures +}; + +struct _PAGE_INFO //Structure containing the layout of the page +{ + union { + /*EFI_HII_HANDLE*/VOID * PageHandle; //Varies HII Handle to the formset that contains this control + UINT8 res[8]; + }; + UINT16 PageIdIndex; //varies Index in to PageIdList triplets + UINT16 PageFormID; //Varies Form ID within the formset for this page + UINT16 PageTitle; //Varies Allows a page to override the main title bar + UINT16 PageSubTitle; //Varies Token for the subtitle string for this page + UINT16 PageID; //Varies unique ID for this page + UINT16 PageParentID; //Varies Identify this page's parent page + PAGE_FLAGS PageFlags; //3 Various attributes for a specific page + UINT32 PageVariable; //Varies Overrides the variable ID for this page (0 = use default) + CONTROL_LIST PageControls; //Varies Listing of controls for this page +}; + + +struct _CONTROL_FLAGS //Structure containing the attributes for a specific control +{ + UINT32 ControlVisible : 1; //TRUE Whether or not a control is shown to the user +#define CONTROL_ACCESS_DEFAULT 0 //Do not override VFR +#define CONTROL_ACCESS_EXT_USER 1 //Admin - Editable; User - Editable; +#define CONTROL_ACCESS_USER 2 //Admin - Editable; User - Visible but not editable; +#define CONTROL_ACCESS_ADMIN 3 //Admin - Editable; User - Invisible; + UINT32 ControlAccess : 2; //0 User access to control + UINT32 ControlReset : 1; //FALSE Whether or not changing a value requires a system reset + UINT32 ControlReadOnly : 1; //FALSE Weather or not the control is read only. + UINT32 ControlInteractive : 1; //FALSE Weather the Control is interactive or not + UINT32 ControlEvaluateDefault : 1; // FALSE If set Default is obtained by expression evaluation + UINT32 Reserved1 : 1; //0 Reserved for future use + UINT32 ControlRefresh : 8; //0 Refresh timer (in 0.1s intervals) (0 = refresh disabled) + UINT32 RefreshID : 1; //TRUE or FALSE to denote RefreshID status + UINT32 ControlRWEvaluate : 1; // set 0 if read/write expression is not found otherwise set 1 + UINT32 Reserved2 : 14; //0 Reserved for future use +}; + +struct _CONTROL_INFO //Structure containing control data +{ + union { + /*EFI_HII_HANDLE*/VOID * ControlHandle; //Varies HII Handle to the formset that contains this control + UINT8 res[8]; + }; + UINT32 ControlVariable; //Varies Overrides the variable ID for this control (0 = use default) + union + { + UINT32 ControlConditionalVariable[2]; //Varies Overrides the condition variable ID for this control (0 = use default) + struct + { + UINT16 ControlKey; // Varies Variable unique identifier same as QuestionID in UEFI2.1 + UINT16 DevicePathId; // Device Path as specified by VarStoreDevicePath nested within the scope of this question. + UINT8 DefaultStoreCount; // Constant No of Defaults (n) values other than Optimal and Failsafe for that control. +//EIP# 55762 + UINT8 Reserved[1]; // Reserved space for use in future. + UINT16 DestQuestionID; // This is for EFI_IFR_REFX support +//EIP# 55762 + }; + }; + UINT16 ControlType; //Varies Type of the control on the page + UINT16 ControlPageID; //Varies Page ID that contains this control + UINT16 ControlDestPageID; //FFFFh Only needed for controls of type CONTROL_TYPE_SUBMENU + CONTROL_FLAGS ControlFlags; //1 Various attributes for a specific control + UINT16 ControlHelp; //Varies Token for help string for this control + UINT16 ControlLabel; //Varies One-based label number that this control is 'linked to' + UINT16 ControlIndex; //Varies Zero-based control number from the label, not formset + UINT16 ControlLabelCount; //Varies number of opcodes associated with this control's label + union { + VOID * ControlPtr; //Varies Pointer to control data in HII + UINT64 res1; + }; + union { + VOID * ControlConditionalPtr; //Varies Pointer to control condition data in HII + UINT64 res2; + }; + UINT16 ControlDataLength; //Varies Length of HII data for control + UINT16 ControlDataWidth; //Varies Width of data (in bytes) for this control + UINT16 QuestionId; //Varies Offset for data of this control in the Variable + //UINT8 ControlFailsafeValue; //Varies Used when user selects load failsafe value + //UINT8 ControlOptimalValue; //Varies Used when user selects load optimal value +}; + +struct _VARIABLE_LIST +{ + UINT32 VariableCount; //Varies Number of GUID-Name pairs in this list + UINT32 VariableList[1]; //Varies Offsets to each of the variable structures +}; + +struct _VARIABLE_INFO //Structure containing GUID-Name pairs for variable access +{ + EFI_GUID VariableGuid; //Varies EFI_GUID for the NVRAM variable store for this data + CHAR16 VariableName[VARIABLE_NAME_LENGTH]; //Varies Variable store name + UINT32 VariableAttributes; //Varies Attributes of the variable + UINT32 VariableID; //Varies unique variable number, 0x0FFFF for our own variables. +#define VARIABLE_ATTRIBUTE_VARSTORE 0x0000 // Buffer varstore accessed via Config. Access protocol exposed by the driver. +#define VARIABLE_ATTRIBUTE_EFI_VARSTORE 0x1000 // EFI Variable, GetVeriable and SetVariable Can be used. +#define VARIABLE_ATTRIBUTE_NAMEVALUE 0x2000 // Namevalue varstore accessed via Config. Access protocol exposed by the driver. +#define AMI_SPECIAL_NO_DEFAULTS 0x00000001 +#define AMI_SPECIAL_VARIABLE_NO_SET 0x00000002 +#define AMI_SPECIAL_VARIABLE_NO_GET 0x00000004 + UINT32 ExtendedAttibutes; //Varies Extended Attributes to identify type of Variable. + UINT16 VariableNameId; //Varies Id for the Variable Name + UINT8 Reserved[2]; // Reserved space for use in future. + union + { + /*EFI_HII_HANDLE*/VOID* VariableHandle; //Varies HII Handle to the formset that contains this VarStore + UINT64 res; + }; + UINT16 VariableSize; //Varies The size of Buffer Varstore +}; + +struct _HPK_INFO +{ + UINT32 Length; + UINT16 Class; + UINT16 SubClass; +}; + +struct _GUID_LIST +{ + UINT32 GuidCount; //Varies Number of GUID-Name pairs in this list + UINT32 GuidList[1]; //Varies Offsets to each of the variable structures +}; + +struct _GUID_FLAGS +{ + UINT32 GuidLaunchCallback : 1; + UINT32 GuidLaunchGuid : 1; + UINT32 GuidLaunchFilename : 1; + UINT32 GuidLaunchCallbackUpdateTemplate : 1; + UINT32 Reserved : 28; +}; + +struct _GUID_INFO +{ + EFI_GUID GuidValue; + CHAR16 GuidName[VARIABLE_NAME_LENGTH]; + GUID_FLAGS GuidFlags; + UINT32 GuidKey; +}; + +struct _PAGE_ID_LIST +{ + UINT32 PageIdCount; //Varies Number of guid class subclass triplets + UINT32 PageIdList[1]; //Varies Offsets to each of the PageId structures +}; + +struct _PAGE_ID_INFO //Structure containing page id triplets guid class and subclass +{ + EFI_GUID PageGuid; //Varies EFI_GUID for the pages + UINT16 PageClass; //Varies Class for the pages + UINT16 PageSubClass; //Varies SubClass for the pages +}; + +#pragma pack() + +#endif /* _SETUPDATA_H_ */ + + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Core/EM/AMITSE/Inc/variable.h b/Core/EM/AMITSE/Inc/variable.h new file mode 100644 index 0000000..18a8a08 --- /dev/null +++ b/Core/EM/AMITSE/Inc/variable.h @@ -0,0 +1,251 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (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/Inc/variable.h $ +// +// $Author: Arunsb $ +// +// $Revision: 13 $ +// +// $Date: 5/03/14 6:37p $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Inc/variable.h $ +// +// 13 5/03/14 6:37p Arunsb +// [TAG] EIP130198 +// [Category] Improvement +// [Description] Increase the variable ID range from 25 to 54 +// [Files] Variable.h, Setup.ini, UefiSetup.ini +// +// 12 2/11/14 7:37p Arunsb +// Changes reverted for 2.16.1243 label +// +// 11 8/19/13 2:49a Premkumara +// [TAG] EIP130198 +// [Category] Improvement +// [Description] Increase the variable ID range from 25 to 54 +// [Files] Variable.h, Setup.ini, UefiSetup.ini +// +// 10 10/18/12 5:31a Arunsb +// Updated for 2.16.1235 QA submission +// +// 6 10/10/12 12:23p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 9 1/30/12 1:33a Arunsb +// [TAG] EIP74676 +// [Category] Improvement +// [Description] Setup.ini and Upfisetup.ini to reserve 3~5 variable and +// GUID for porting purpose +// [Files] Amivfr.h, special.h, variable.h, Uefisetup.ini and setup.ini +// +// 8 12/05/11 5:46a Rajashakerg +// [TAG] EIP76381 +// [Category] Improvement +// [Description] Performance: Improving variable data load and usage +// [Files] callback.c, minisetupext.c, variable.c, variable.h, +// minisetup.h, Hii.c, FormBrowser2.c +// +// 7 11/23/11 5:08a Rajashakerg +// [TAG] EIP75473 +// [Category] Improvement +// [Description] System Time is not updated every second +// [Files] variable.h, variable.c, FormBrowser2.c, TseUefiHii.h, +// Uefi21Wapper.c, hii.h, uefi20Wapper.c +// +// 6 11/13/11 12:23p Arunsb +// [TAG] EIP70421 +// [Category] New Feature +// [Description] Support for driver order in TSE +// [Files] AMITSE.SDL, CommonHelper.c, setup.ini, uefisetup.ini, +// boot.c, +// minisetup.h, bbs.c, special.c, special.h, tseadvanced.c, +// addbootoption.c, +// callback.c, minisetupext.c, minisetupext.h, popupsel.c, popupsel.h, +// TseLitehelper.c, variable.c, Uefi21Wapper.c, AMIVfr.h, boot.h, +// TseElink.h, variable.h, +// setup.h, Boot.vfr and Setup.uni +// +// 5 7/19/11 3:06p Arunsb +// [TAG] EIP57661 +// [Category] New Feature +// [Description] Drv health related variable declarations added to +// update the cache. +// [Files] notify.c, Uefi21Wapper.c and variable.h +// +// 4 7/19/11 10:47a Blaines +// [TAG] - EIP 63262 +// [Category]- Defect +// [Symptom]- Setup page display problem on rose city. +// When SETUP_GROUP_DYNAMIC_PAGES is enabled and Network Stack is enabled, +// the "iSCSI" menu is listed as a dynamic page in advanced menu but only +// 3 of 4 "Port Configuration" pages shows up. The TSE dynamic page count +// is incorrect. +// +// [Solution]- In the functions (RTIfrProcessRunTimeForms, +// HandleNewIFRPack, HandleRemoveIFRPack, HandleAddIFRPack), make sure the +// nvram cache is updated by calling +// VarUpdateVariable(VARIABLE_ID_DYNAMIC_PAGE_COUNT) when updating +// "DynamicPageCount" variable name. +// . +// [Files] - Hii.c, Minisetup.h, Variable.h +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 4 2/19/10 7:59a Mallikarjunanv +// updated the year in copyright message +// +// 3 1/09/10 2:31a Mallikarjunanv +// Updated TSE2.01 Release sources with coding standards +// +// 2 10/28/09 5:34p Madhans +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:50p Madhans +// Tse 2.0 Code complete Checkin. +// +// 1 4/28/09 10:24p Madhans +// Tse 2.0 Code complete Checkin. +// +// +//*****************************************************************// +//*****************************************************************// +// +//---------------------------------------------------------------------------- +// +// Name: variable.h +// +// Description: Variable handling header +// +//---------------------------------------------------------------------------- +// + +#ifndef _VARIABLE_H_ +#define _VARIABLE_H_ + +typedef struct _NVRAM_VARIABLE +{ + UINT8 *Buffer; + UINTN Size; +} +NVRAM_VARIABLE; + +#define VAR_ZERO_OFFSET 0 + +#define VAR_COMMAND_GET_VALUE 0 +#define VAR_COMMAND_SET_VALUE 1 + +#define VAR_COMMAND_GET_NVRAM 0 +#define VAR_COMMAND_SET_NVRAM 1 + +// Variable IDs +#define VARIABLE_ID_SETUP 0 +#define VARIABLE_ID_LANGUAGE 1 +#define VARIABLE_ID_BOOT_TIMEOUT 2 +#define VARIABLE_ID_USER_DEFAULTS 3 +#define VARIABLE_ID_ERROR_MANAGER 4 +#define VARIABLE_ID_AMITSESETUP 5 +#define VARIABLE_ID_IDE_SECURITY 6 +#define VARIABLE_ID_BOOT_ORDER 7 +#define VARIABLE_ID_BBS_ORDER 8 +#define VARIABLE_ID_DEL_BOOT_OPTION 9 +#define VARIABLE_ID_ADD_BOOT_OPTION 10 +#define VARIABLE_ID_BOOT_MANAGER 11 +#define VARIABLE_ID_BOOT_NOW 12 +#define VARIABLE_ID_LEGACY_DEV_INFO 13 +#define VARIABLE_ID_AMI_CALLBACK 14 +#define VARIABLE_ID_LEGACY_GROUP_INFO 15 +#define VARIABLE_ID_OEM_TSE_VAR 17 +#define VARIABLE_ID_DYNAMIC_PAGE_COUNT 18 +#define VARIABLE_ID_DRV_HLTH_ENB 19 +#define VARIABLE_ID_DRV_HLTH_COUNT 20 +#define VARIABLE_ID_DRIVER_MANAGER 22 //EIP70421 & 70422 Support for driver order +#define VARIABLE_ID_DRIVER_ORDER 23 +#define VARIABLE_ID_ADD_DRIVER_OPTION 24 +#define VARIABLE_ID_DEL_DRIVER_OPTION 25 +#define VARIABLE_ID_PORT_OEM1 26 //EIP74676 variables for porting purpose +#define VARIABLE_ID_PORT_OEM2 27 +#define VARIABLE_ID_PORT_OEM3 28 +#define VARIABLE_ID_PORT_OEM4 29 +#define VARIABLE_ID_PORT_OEM5 30 +#define VARIABLE_ID_PORT_OEM6 31 +#define VARIABLE_ID_PORT_OEM7 32 +#define VARIABLE_ID_PORT_OEM8 33 +#define VARIABLE_ID_PORT_OEM9 34 +#define VARIABLE_ID_PORT_OEM10 35 +#define VARIABLE_ID_PORT_OEM11 36 +#define VARIABLE_ID_PORT_OEM12 37 +#define VARIABLE_ID_PORT_OEM13 38 +#define VARIABLE_ID_PORT_OEM14 39 +#define VARIABLE_ID_PORT_OEM15 40 +#define VARIABLE_ID_PORT_OEM16 41 +#define VARIABLE_ID_PORT_OEM17 42 +#define VARIABLE_ID_PORT_OEM18 43 +#define VARIABLE_ID_PORT_OEM19 44 +#define VARIABLE_ID_PORT_OEM20 45 +#define VARIABLE_ID_PORT_OEM21 46 +#define VARIABLE_ID_PORT_OEM22 47 +#define VARIABLE_ID_PORT_OEM23 48 +#define VARIABLE_ID_PORT_OEM24 49 +#define VARIABLE_ID_PORT_OEM25 50 +#define VARIABLE_ID_PORT_OEM26 51 +#define VARIABLE_ID_PORT_OEM27 52 +#define VARIABLE_ID_PORT_OEM28 53 +#define VARIABLE_ID_PORT_OEM29 54 + +//EIP 76381 : Performance Improving of variable data load and usage +EFI_STATUS GetNvramVariableList(NVRAM_VARIABLE **RetNvramVarList); +VOID CleanTempNvramVariableList(); +EFI_STATUS CopyNvramVariableList(NVRAM_VARIABLE *SrcVarList, NVRAM_VARIABLE **DestVarList); + +EFI_STATUS VarLoadVariables( VOID **list, NVRAM_VARIABLE *defaultList ); +EFI_STATUS VarBuildDefaults( VOID ); +VOID *VarGetNvramName( CHAR16 *name, EFI_GUID *guid, UINT32 *attributes, UINTN *size ); +EFI_STATUS VarSetNvramName( CHAR16 *name, EFI_GUID *guid, UINT32 attributes, VOID *buffer, UINTN size ); +VOID *VarGetNvram( UINT32 variable, UINTN *size ); +VOID *VarGetNvramQuestionValue(UINT32 variable, UINTN Offset, UINTN Size); +EFI_STATUS VarSetNvram( UINT32 variable, VOID *buffer, UINTN size ); +EFI_STATUS VarGetDefaults( UINT32 variable, UINT32 offset, UINTN size, VOID *buffer ); +EFI_STATUS VarGetValue( UINT32 variable, UINT32 offset, UINTN size, VOID *buffer ); +EFI_STATUS VarSetValue( UINT32 variable, UINT32 offset, UINTN size, VOID *buffer ); +VOID VarUpdateVariable(UINT32 variable); +VOID VarUpdateDefaults(UINT32 variable); +VOID *VarGetVariable( UINT32 variable, UINTN *size ); + +EFI_STATUS _VarGetData( UINT32 variable, UINT32 offset, UINTN size, VOID *buffer, BOOLEAN useDefaults ); +EFI_STATUS _VarGetSetValue( UINTN command, NVRAM_VARIABLE *list, UINT32 variable, UINT32 offset, UINTN size, VOID *buffer ); + +#endif /* _VARIABLE_H_ */ + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** -- cgit v1.2.3