OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
ControlMsrE2.h File Reference
#include <Uefi.h>
#include <PiDxe.h>
#include <Library/PcdLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcStringLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/MemoryAllocationLib.h>
#include <Uefi/UefiInternalFormRepresentation.h>
#include <Library/UefiHiiServicesLib.h>
#include <Library/HiiLib.h>
#include <Protocol/HiiFont.h>
#include <Protocol/HiiImage.h>
#include <Protocol/HiiImageEx.h>
#include <Protocol/HiiImageDecoder.h>
#include <Protocol/HiiString.h>
#include <Protocol/HiiDatabase.h>
#include <Protocol/HiiConfigRouting.h>
#include <Protocol/HiiConfigAccess.h>
#include <Protocol/HiiConfigKeyword.h>
#include <Guid/HiiPlatformSetupFormset.h>

Go to the source code of this file.

Data Structures

struct  ONE_OF_CONTEXT_
 

Macros

#define CHAR_ESC   0x1B
 
#define DONT_STOP_AT   0xFFFF
 
#define PADD(x, y)
 
#define BUFFER_LENGTH   128
 

Typedefs

typedef struct ONE_OF_CONTEXT_ ONE_OF_CONTEXT
 
typedef VOID OP_CODE_HANDLER(IN EFI_IFR_OP_HEADER *IfrHeader, IN OUT BOOLEAN *Stop OPTIONAL, IN VOID *Context)
 

Enumerations

enum  { ARG_VERIFY = 0 , ARG_LOCK = 1 , ARG_UNLOCK = 2 , ARG_INTERACTIVE = 8 }
 

Functions

EFI_STATUS EFIAPI VerifyMSRE2 (VOID)
 
BOOLEAN ReadYN (VOID)
 
CHAR16 ReadAnyKey (VOID)
 
EFI_STATUS InterpretArguments (VOID)
 
VOID ModifySearchString (IN OUT EFI_STRING *SearchString)
 
EFI_HII_PACKAGE_LIST_HEADER * HiiExportPackageLists (IN EFI_HII_HANDLE Handle)
 
VOID HandleIfrOption (IN EFI_IFR_OP_HEADER *IfrHeader, IN OUT BOOLEAN *Stop OPTIONAL, IN OUT VOID *Context)
 
VOID HandleIfrVariable (IN OUT ONE_OF_CONTEXT *Context)
 
EFI_IFR_OP_HEADER * IterateOpCode (IN EFI_IFR_OP_HEADER *Header, IN UINT8 OpCode, IN OUT BOOLEAN *Stop OPTIONAL, IN VOID *Context, IN OP_CODE_HANDLER Handler)
 

Variables

UINTN mArgumentFlags
 

Detailed Description

Control CFGLock BIOS Option

Copyright (c) 2020, Brumbaer. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file ControlMsrE2.h.

Macro Definition Documentation

◆ BUFFER_LENGTH

#define BUFFER_LENGTH   128

Definition at line 112 of file ControlMsrE2.h.

◆ CHAR_ESC

#define CHAR_ESC   0x1B

Definition at line 49 of file ControlMsrE2.h.

◆ DONT_STOP_AT

#define DONT_STOP_AT   0xFFFF

Definition at line 50 of file ControlMsrE2.h.

◆ PADD

#define PADD ( x,
y )
Value:
(VOID *)(((CHAR8 *) x) + y)
UINT16 y
Definition BmfFile.h:84
UINT16 x
Definition BmfFile.h:83

Definition at line 110 of file ControlMsrE2.h.

Typedef Documentation

◆ ONE_OF_CONTEXT

Parameters to search in a Form for IfrHeaders which contain a Description and to return the VarStore

Parameters
SearchTextText that must be part of the options description
EfiHandleHandle of the list the Form is part of
ListHeaderPointer to the contents of the handle
PkgHeaderPointer to the current package in the list
FirstIfrHeaderPointer to first IfrHeader in Package
IfrVarStorePointer to IfrHeader of corresponding varstore in same list
IfrOneOfPointer to IfrHeader of BIOS Option
StopAtFind a certain BIOS Option
CountRunning number of suitable BIOS Options

◆ OP_CODE_HANDLER

typedef VOID OP_CODE_HANDLER(IN EFI_IFR_OP_HEADER *IfrHeader, IN OUT BOOLEAN *Stop OPTIONAL, IN VOID *Context)

Callback - What to do, when a IfrHeader with a defined OP_CODE is found

Parameters
[in]IfrHeaderCurrent IfrHeader under scrutiny
[in,out]StopPointer to Stop flag. If TRUE no further search for opcodes. Can be NULL.
[in]ContextPointer to Handler specific data

Definition at line 94 of file ControlMsrE2.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Commandline Arguments

Enumerator
ARG_VERIFY 
ARG_LOCK 
ARG_UNLOCK 
ARG_INTERACTIVE 

Definition at line 103 of file ControlMsrE2.h.

Function Documentation

◆ HandleIfrOption()

VOID HandleIfrOption ( IN EFI_IFR_OP_HEADER * IfrHeader,
IN OUT BOOLEAN *Stop OPTIONAL,
IN OUT VOID * Context )

Callback to Handle EFI_IFR_ONE_OF_OP

Parameters
[in]IfrHeaderCurrent IfrHeader under scrutiny
[in,out]StopPointer to Stop flag. If TRUE no further search for opcodes. Can be NULL.
[in]ContextPointer to Handler specific data

< Skip identical Options

Definition at line 136 of file ControlMsrE2Hii.c.

◆ HandleIfrVariable()

VOID HandleIfrVariable ( IN OUT ONE_OF_CONTEXT * Context)

Displaying and Changing value of BIOS Option. Including UI

Parameters
[in]ContextPointer to Handler specific data

Definition at line 264 of file ControlMsrE2Hii.c.

◆ HiiExportPackageLists()

EFI_HII_PACKAGE_LIST_HEADER * HiiExportPackageLists ( IN EFI_HII_HANDLE Handle)

Copies Package Lists to Memory

Parameters
[in]HandleAn EFI_HII_HANDLE that corresponds to the desired package list in the HIIdatabase.

Definition at line 23 of file ControlMsrE2Hii.c.

◆ InterpretArguments()

EFI_STATUS InterpretArguments ( VOID )

Parse commandline arguments

Return values
EFI_SUCCESSSuccess
EFI_OUT_OF_RESOURCESCould not allocate memory
EFI_INVALID_PARAMETERMore than 1 parameter provided

Definition at line 145 of file ControlMsrE2UI.c.

◆ IterateOpCode()

EFI_IFR_OP_HEADER * IterateOpCode ( IN EFI_IFR_OP_HEADER * Header,
IN UINT8 OpCode,
IN OUT BOOLEAN *Stop OPTIONAL,
IN VOID * Context,
IN OP_CODE_HANDLER Handler )

Call Handler for each occurence of opCode, starting to search at header. Called recursively

Parameters
[in]HeaderCurrent Header under scrutiny
[in]OpCodeType for OpCode
[in,out]StopPointer to Stop flag. If TRUE no further search for opcodes. Can be NULL.
[in]ContextPointer to Handler specific data
[in]HandlerHandler for data

Definition at line 60 of file ControlMsrE2Hii.c.

◆ ModifySearchString()

VOID ModifySearchString ( IN OUT EFI_STRING * SearchString)

Displays SearchString and allows to change it

Parameters
[in,out]SearchStringCurrent configuration string

Definition at line 223 of file ControlMsrE2UI.c.

◆ ReadAnyKey()

CHAR16 ReadAnyKey ( VOID )

Wait for any key press

Return values
OtherUnicode for pressed key

Definition at line 118 of file ControlMsrE2UI.c.

◆ ReadYN()

BOOLEAN ReadYN ( VOID )

Wait for Keypress of Y or N. Ignores case.

Return values
TRUEKeypress is Y
FALSEKeypress is N

Definition at line 129 of file ControlMsrE2UI.c.

◆ VerifyMSRE2()

EFI_STATUS EFIAPI VerifyMSRE2 ( VOID )

Check MsrE2 Status - original VerifyMSRE2

Return values
EFI_SUCCESSSuccess
OtherFail to verify MSR 0xE2 status

Definition at line 61 of file VerifyMsrE2.c.

Variable Documentation

◆ mArgumentFlags

UINTN mArgumentFlags
extern

Definition at line 17 of file ControlMsrE2UI.c.