EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Public Member Functions | Data Fields | Static Public Attributes

DependencyExpression Class Reference

Convert dependency expression string into EFI internal representation. More...

Public Member Functions

def __init__
 Constructor.
def __str__
def __repr__
def GetExpressionTokenList
 Split the expression string into token list.
def GetPostfixNotation
 Convert token list into postfix notation.
def ValidateOpcode
 Validate the dependency expression.
def Optimize
 Simply optimize the dependency expression by removing duplicated operands.
def GetGuidValue
 Convert a GUID value in C structure format into its binary form.
def Generate
 Save the binary form of dependency expression in file.

Data Fields

 ModuleType
 Phase
 ExpressionString
 TokenList
 PostfixNotation
 OpcodeList
 ArchProtocols

Static Public Attributes

tuple ArchProtocols
dictionary OpcodePriority
dictionary Opcode
list SupportedOpcode = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "END", "SOR"]
list SupportedOperand = ["TRUE", "FALSE"]
list OpcodeWithSingleOperand = ['NOT', 'BEFORE', 'AFTER']
list OpcodeWithTwoOperand = ['AND', 'OR']
list NonEndingOpcode = ["AND", "OR", "NOT", 'SOR']
list ExclusiveOpcode = ["BEFORE", "AFTER"]
list AboveAllOpcode = ["SOR", "BEFORE", "AFTER"]
tuple TokenPattern = re.compile("(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")

Detailed Description

Convert dependency expression string into EFI internal representation.

DependencyExpression class is used to parse dependency expression string and convert it into its binary form.

Definition at line 52 of file GenDepex.py.


Constructor & Destructor Documentation

def __init__ (   self,
  Expression,
  ModuleType,
  Optimize = False 
)

Constructor.

Parameters:
ExpressionThe list or string of dependency expression
ModuleTypeThe type of the module using the dependency expression

Definition at line 128 of file GenDepex.py.


Member Function Documentation

def __repr__ (   self)

Definition at line 152 of file GenDepex.py.

def __str__ (   self)

Definition at line 149 of file GenDepex.py.

def Generate (   self,
  File = None 
)

Save the binary form of dependency expression in file.

Parameters:
FileThe path of file. If None is given, put the data on console
Return values:
TrueIf the file doesn't exist or file is changed
FalseIf file exists and is not changed.

Definition at line 331 of file GenDepex.py.

def GetExpressionTokenList (   self)

Split the expression string into token list.

Definition at line 162 of file GenDepex.py.

def GetGuidValue (   self,
  Guid 
)

Convert a GUID value in C structure format into its binary form.

Parameters:
GuidThe GUID value in C structure format
Return values:
arrayThe byte array representing the GUID value

Definition at line 317 of file GenDepex.py.

def GetPostfixNotation (   self)

Convert token list into postfix notation.

Definition at line 166 of file GenDepex.py.

def Optimize (   self)

Simply optimize the dependency expression by removing duplicated operands.

Definition at line 261 of file GenDepex.py.

def ValidateOpcode (   self)

Validate the dependency expression.

Definition at line 233 of file GenDepex.py.


Field Documentation

list AboveAllOpcode = ["SOR", "BEFORE", "AFTER"] [static]

Definition at line 116 of file GenDepex.py.

tuple ArchProtocols [static]
Initial value:
set([
                        '665e3ff6-46cc-11d4-9a38-0090273fc14d',     #   'gEfiBdsArchProtocolGuid'
                        '26baccb1-6f42-11d4-bce7-0080c73c8881',     #   'gEfiCpuArchProtocolGuid'
                        '26baccb2-6f42-11d4-bce7-0080c73c8881',     #   'gEfiMetronomeArchProtocolGuid'
                        '1da97072-bddc-4b30-99f1-72a0b56fff2a',     #   'gEfiMonotonicCounterArchProtocolGuid'
                        '27cfac87-46cc-11d4-9a38-0090273fc14d',     #   'gEfiRealTimeClockArchProtocolGuid'
                        '27cfac88-46cc-11d4-9a38-0090273fc14d',     #   'gEfiResetArchProtocolGuid'
                        'b7dfb4e1-052f-449f-87be-9818fc91b733',     #   'gEfiRuntimeArchProtocolGuid'
                        'a46423e3-4617-49f1-b9ff-d1bfa9115839',     #   'gEfiSecurityArchProtocolGuid'
                        '26baccb3-6f42-11d4-bce7-0080c73c8881',     #   'gEfiTimerArchProtocolGuid'
                        '6441f818-6362-4e44-b570-7dba31dd2453',     #   'gEfiVariableWriteArchProtocolGuid'
                        '1e5668e2-8481-11d4-bcf1-0080c73c8881',     #   'gEfiVariableArchProtocolGuid'
                        '665e3ff5-46cc-11d4-9a38-0090273fc14d'      #   'gEfiWatchdogTimerArchProtocolGuid'
                        ]
                    )

Definition at line 54 of file GenDepex.py.

Definition at line 261 of file GenDepex.py.

list ExclusiveOpcode = ["BEFORE", "AFTER"] [static]

Definition at line 114 of file GenDepex.py.

Definition at line 128 of file GenDepex.py.

Definition at line 128 of file GenDepex.py.

list NonEndingOpcode = ["AND", "OR", "NOT", 'SOR'] [static]

Definition at line 112 of file GenDepex.py.

dictionary Opcode [static]
Initial value:
{
        "PEI"   : {
            "PUSH"  :   0x02,
            "AND"   :   0x03,
            "OR"    :   0x04,
            "NOT"   :   0x05,
            "TRUE"  :   0x06,
            "FALSE" :   0x07,
            "END"   :   0x08
        },

        "DXE"   : {
            "BEFORE":   0x00,
            "AFTER" :   0x01,
            "PUSH"  :   0x02,
            "AND"   :   0x03,
            "OR"    :   0x04,
            "NOT"   :   0x05,
            "TRUE"  :   0x06,
            "FALSE" :   0x07,
            "END"   :   0x08,
            "SOR"   :   0x09
        }
    }

Definition at line 79 of file GenDepex.py.

Definition at line 128 of file GenDepex.py.

dictionary OpcodePriority [static]
Initial value:
{
        "AND"   :   1,
        "OR"    :   1,
        "NOT"   :   2,
        # "SOR"   :   9,
        # "BEFORE":   9,
        # "AFTER" :   9,
    }

Definition at line 70 of file GenDepex.py.

list OpcodeWithSingleOperand = ['NOT', 'BEFORE', 'AFTER'] [static]

Definition at line 108 of file GenDepex.py.

list OpcodeWithTwoOperand = ['AND', 'OR'] [static]

Definition at line 109 of file GenDepex.py.

Definition at line 128 of file GenDepex.py.

Definition at line 128 of file GenDepex.py.

list SupportedOpcode = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "END", "SOR"] [static]

Definition at line 105 of file GenDepex.py.

list SupportedOperand = ["TRUE", "FALSE"] [static]

Definition at line 106 of file GenDepex.py.

Definition at line 128 of file GenDepex.py.

tuple TokenPattern = re.compile("(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)") [static]

Definition at line 121 of file GenDepex.py.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines