TianoCore EDK2 master
Loading...
Searching...
No Matches
HiiExpression.c File Reference
#include "HiiInternal.h"

Go to the source code of this file.

Functions

EFI_STATUS GrowStack (IN OUT EFI_HII_VALUE **Stack, IN OUT EFI_HII_VALUE **StackPtr, IN OUT EFI_HII_VALUE **StackEnd)
 
EFI_STATUS PushStack (IN OUT EFI_HII_VALUE **Stack, IN OUT EFI_HII_VALUE **StackPtr, IN OUT EFI_HII_VALUE **StackEnd, IN EFI_HII_VALUE *Data)
 
EFI_STATUS PopStack (IN EFI_HII_VALUE *Stack, IN OUT EFI_HII_VALUE **StackPtr, OUT EFI_HII_VALUE *Data)
 
VOID ResetCurrentExpressionStack (VOID)
 
EFI_STATUS PushCurrentExpression (IN VOID *Pointer)
 
EFI_STATUS PopCurrentExpression (OUT VOID **Pointer)
 
VOID ResetMapExpressionListStack (VOID)
 
EFI_STATUS GrowConditionalStack (IN OUT HII_EXPRESSION ***Stack, IN OUT HII_EXPRESSION ***StackPtr, IN OUT HII_EXPRESSION ***StackEnd, IN UINTN MemberSize)
 
EFI_STATUS PushConditionalStack (IN OUT HII_EXPRESSION ***Stack, IN OUT HII_EXPRESSION ***StackPtr, IN OUT HII_EXPRESSION ***StackEnd, IN HII_EXPRESSION **Data)
 
EFI_STATUS PopConditionalStack (IN HII_EXPRESSION **Stack, IN OUT HII_EXPRESSION ***StackPtr, OUT HII_EXPRESSION **Data)
 
INTN GetConditionalExpressionCount (IN EXPRESS_LEVEL Level)
 
HII_EXPRESSION ** GetConditionalExpressionList (IN EXPRESS_LEVEL Level)
 
EFI_STATUS PushConditionalExpression (IN HII_EXPRESSION *Pointer, IN EXPRESS_LEVEL Level)
 
EFI_STATUS PopConditionalExpression (IN EXPRESS_LEVEL Level)
 
EFI_STATUS PushMapExpressionList (IN VOID *Pointer)
 
EFI_STATUS PopMapExpressionList (OUT VOID **Pointer)
 
VOID ResetScopeStack (VOID)
 
EFI_STATUS PushScope (IN UINT8 Operand)
 
EFI_STATUS PopScope (OUT UINT8 *Operand)
 
EFI_STATUS GrowDependencyStack (IN OUT HII_DEPENDENCY_EXPRESSION ***Stack, IN OUT HII_DEPENDENCY_EXPRESSION ***StackPtr, IN OUT HII_DEPENDENCY_EXPRESSION ***StackEnd)
 
EFI_STATUS PushDependencyStack (IN OUT HII_DEPENDENCY_EXPRESSION ***Stack, IN OUT HII_DEPENDENCY_EXPRESSION ***StackPtr, IN OUT HII_DEPENDENCY_EXPRESSION ***StackEnd, IN HII_DEPENDENCY_EXPRESSION **Data)
 
EFI_STATUS PopDependencyStack (IN HII_DEPENDENCY_EXPRESSION **Stack, IN OUT HII_DEPENDENCY_EXPRESSION ***StackPtr, OUT HII_DEPENDENCY_EXPRESSION **Data)
 
EFI_STATUS PushDependencyExpDes (IN HII_DEPENDENCY_EXPRESSION **Pointer)
 
EFI_STATUS PopDependencyExpDes (OUT HII_DEPENDENCY_EXPRESSION **Pointer)
 
EFI_STATUS GetHiiExpressionDependency (IN OUT HII_EXPRESSION *Expression)
 
EXPRESS_RESULT EvaluateExpressionList (IN HII_EXPRESSION_LIST *ExpList, IN BOOLEAN Evaluate, IN HII_FORMSET *FormSet OPTIONAL, IN HII_FORM *Form OPTIONAL)
 

Variables

EFI_HII_VALUEmOpCodeScopeStack = NULL
 
EFI_HII_VALUEmOpCodeScopeStackEnd = NULL
 
EFI_HII_VALUEmOpCodeScopeStackPointer = NULL
 
HII_EXPRESSION ** mFormExpressionStack = NULL
 
HII_EXPRESSION ** mFormExpressionEnd = NULL
 
HII_EXPRESSION ** mFormExpressionPointer = NULL
 
HII_EXPRESSION ** mStatementExpressionStack = NULL
 
HII_EXPRESSION ** mStatementExpressionEnd = NULL
 
HII_EXPRESSION ** mStatementExpressionPointer = NULL
 
HII_EXPRESSION ** mOptionExpressionStack = NULL
 
HII_EXPRESSION ** mOptionExpressionEnd = NULL
 
HII_EXPRESSION ** mOptionExpressionPointer = NULL
 
EFI_HII_VALUEmCurrentExpressionStack = NULL
 
EFI_HII_VALUEmCurrentExpressionEnd = NULL
 
EFI_HII_VALUEmCurrentExpressionPointer = NULL
 
EFI_HII_VALUEmMapExpressionListStack = NULL
 
EFI_HII_VALUEmMapExpressionListEnd = NULL
 
EFI_HII_VALUEmMapExpressionListPointer = NULL
 
HII_DEPENDENCY_EXPRESSION ** mExpressionDependencyStack = NULL
 
HII_DEPENDENCY_EXPRESSION ** mExpressionDependencyEnd = NULL
 
HII_DEPENDENCY_EXPRESSION ** mExpressionDependencyPointer = NULL
 

Detailed Description

The implementation of HII expression.

Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HiiExpression.c.

Function Documentation

◆ EvaluateExpressionList()

EXPRESS_RESULT EvaluateExpressionList ( IN HII_EXPRESSION_LIST ExpList,
IN BOOLEAN  Evaluate,
IN HII_FORMSET *FormSet  OPTIONAL,
IN HII_FORM *Form  OPTIONAL 
)

Return the result of the expression list. Check the expression list and return the highest priority express result. Priority: DisableIf > SuppressIf > GrayOutIf > FALSE

Parameters
[in]ExpListThe input expression list.
[in]EvaluateWhether need to evaluate the expression first.
[in]FormSetFormSet associated with this expression.
[in]FormForm associated with this expression.
Return values
EXPRESS_RESULTReturn the higher priority express result. DisableIf > SuppressIf > GrayOutIf > FALSE

Definition at line 1380 of file HiiExpression.c.

◆ GetConditionalExpressionCount()

INTN GetConditionalExpressionCount ( IN EXPRESS_LEVEL  Level)

Get the expression list count.

Parameters
LevelWhich type this expression belong to. Form, statement or option?
Return values
>=0The expression count
-1Input parameter error.

Definition at line 432 of file HiiExpression.c.

◆ GetConditionalExpressionList()

HII_EXPRESSION ** GetConditionalExpressionList ( IN EXPRESS_LEVEL  Level)

Get the expression Buffer pointer.

Parameters
LevelWhich type this expression belong to. Form, statement or option?
Return values
Thestart pointer of the expression buffer or NULL.

Definition at line 459 of file HiiExpression.c.

◆ GetHiiExpressionDependency()

EFI_STATUS GetHiiExpressionDependency ( IN OUT HII_EXPRESSION Expression)

Retrieve dependencies within an expression. These dependencies can express how this expression will be evaluated.

Parameters
[in,out]ExpressionExpression to retrieve dependencies.
Return values
EFI_SUCCESSThe dependencies were successfully retrieved.
EFI_OUT_OF_RESOURCESThere is not enough system memory.

Definition at line 882 of file HiiExpression.c.

◆ GrowConditionalStack()

EFI_STATUS GrowConditionalStack ( IN OUT HII_EXPRESSION ***  Stack,
IN OUT HII_EXPRESSION ***  StackPtr,
IN OUT HII_EXPRESSION ***  StackEnd,
IN UINTN  MemberSize 
)

Grow size of the stack.

This is an internal function.

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
StackEndOn input: old stack end; On output: new stack end
MemberSizeThe stack member size.
Return values
EFI_SUCCESSGrow stack success.
EFI_OUT_OF_RESOURCESNo enough memory for stack space.

Definition at line 298 of file HiiExpression.c.

◆ GrowDependencyStack()

EFI_STATUS GrowDependencyStack ( IN OUT HII_DEPENDENCY_EXPRESSION ***  Stack,
IN OUT HII_DEPENDENCY_EXPRESSION ***  StackPtr,
IN OUT HII_DEPENDENCY_EXPRESSION ***  StackEnd 
)

Grow size of the stack for Expression Dependencies.

This is an internal function.

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
StackEndOn input: old stack end; On output: new stack end
Return values
EFI_SUCCESSGrow Dependency stack success.
EFI_OUT_OF_RESOURCESNo enough memory for stack space.

Definition at line 705 of file HiiExpression.c.

◆ GrowStack()

EFI_STATUS GrowStack ( IN OUT EFI_HII_VALUE **  Stack,
IN OUT EFI_HII_VALUE **  StackPtr,
IN OUT EFI_HII_VALUE **  StackEnd 
)

Grow size of the stack.

This is an internal function.

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
StackEndOn input: old stack end; On output: new stack end
Return values
EFI_SUCCESSGrow stack success.
EFI_OUT_OF_RESOURCESNo enough memory for stack space.

Definition at line 71 of file HiiExpression.c.

◆ PopConditionalExpression()

EFI_STATUS PopConditionalExpression ( IN EXPRESS_LEVEL  Level)

Pop the expression options from the Stack

Parameters
LevelWhich type this expression belong to. Form, statement or option?
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 532 of file HiiExpression.c.

◆ PopConditionalStack()

EFI_STATUS PopConditionalStack ( IN HII_EXPRESSION **  Stack,
IN OUT HII_EXPRESSION ***  StackPtr,
OUT HII_EXPRESSION **  Data 
)

Pop an element from the stack.

Parameters
StackOn input: old stack
StackPtrOn input: old stack pointer; On output: new stack pointer
DataData to pop.
Return values
EFI_SUCCESSThe value was popped onto the stack.
EFI_ACCESS_DENIEDThe pop operation underflowed the stack

Definition at line 400 of file HiiExpression.c.

◆ PopCurrentExpression()

EFI_STATUS PopCurrentExpression ( OUT VOID **  Pointer)

Pop current expression from the Stack

Parameters
PointerPointer to current expression to be pop.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 252 of file HiiExpression.c.

◆ PopDependencyExpDes()

EFI_STATUS PopDependencyExpDes ( OUT HII_DEPENDENCY_EXPRESSION **  Pointer)

Pop the list of Expression Dependencies from the Stack

Parameters
PointerPointer to the list of map expression to be pop.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 860 of file HiiExpression.c.

◆ PopDependencyStack()

EFI_STATUS PopDependencyStack ( IN HII_DEPENDENCY_EXPRESSION **  Stack,
IN OUT HII_DEPENDENCY_EXPRESSION ***  StackPtr,
OUT HII_DEPENDENCY_EXPRESSION **  Data 
)

Pop the Expression Dependency options from the Stack

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
DataData to push.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 807 of file HiiExpression.c.

◆ PopMapExpressionList()

EFI_STATUS PopMapExpressionList ( OUT VOID **  Pointer)

Pop the list of map expression from the Stack

Parameters
PointerPointer to the list of map expression to be pop.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 603 of file HiiExpression.c.

◆ PopScope()

EFI_STATUS PopScope ( OUT UINT8 *  Operand)

Pop an Operand from the Stack

Parameters
OperandOperand to pop.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 672 of file HiiExpression.c.

◆ PopStack()

EFI_STATUS PopStack ( IN EFI_HII_VALUE Stack,
IN OUT EFI_HII_VALUE **  StackPtr,
OUT EFI_HII_VALUE Data 
)

Pop an element from the stack.

Parameters
StackOn input: old stack
StackPtrOn input: old stack pointer; On output: new stack pointer
DataData to pop.
Return values
EFI_SUCCESSThe value was popped onto the stack.
EFI_ACCESS_DENIEDThe pop operation underflowed the stack

Definition at line 179 of file HiiExpression.c.

◆ PushConditionalExpression()

EFI_STATUS PushConditionalExpression ( IN HII_EXPRESSION Pointer,
IN EXPRESS_LEVEL  Level 
)

Push the expression options onto the Stack.

Parameters
PointerPointer to the current expression.
LevelWhich type this expression belong to. Form, statement or option?
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 488 of file HiiExpression.c.

◆ PushConditionalStack()

EFI_STATUS PushConditionalStack ( IN OUT HII_EXPRESSION ***  Stack,
IN OUT HII_EXPRESSION ***  StackPtr,
IN OUT HII_EXPRESSION ***  StackEnd,
IN HII_EXPRESSION **  Data 
)

Push an element onto the Stack.

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
StackEndOn input: old stack end; On output: new stack end
DataData to push.
Return values
EFI_SUCCESSPush stack success.

Definition at line 357 of file HiiExpression.c.

◆ PushCurrentExpression()

EFI_STATUS PushCurrentExpression ( IN VOID *  Pointer)

Push current expression onto the Stack

Parameters
PointerPointer to current expression.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 225 of file HiiExpression.c.

◆ PushDependencyExpDes()

EFI_STATUS PushDependencyExpDes ( IN HII_DEPENDENCY_EXPRESSION **  Pointer)

Push the list of Expression Dependencies onto the Stack

Parameters
PointerPointer to the list of map expression to be pushed.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 838 of file HiiExpression.c.

◆ PushDependencyStack()

EFI_STATUS PushDependencyStack ( IN OUT HII_DEPENDENCY_EXPRESSION ***  Stack,
IN OUT HII_DEPENDENCY_EXPRESSION ***  StackPtr,
IN OUT HII_DEPENDENCY_EXPRESSION ***  StackEnd,
IN HII_DEPENDENCY_EXPRESSION **  Data 
)

Push an element onto the Stack for Expression Dependencies.

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
StackEndOn input: old stack end; On output: new stack end
DataData to push.
Return values
EFI_SUCCESSPush stack success.

Definition at line 763 of file HiiExpression.c.

◆ PushMapExpressionList()

EFI_STATUS PushMapExpressionList ( IN VOID *  Pointer)

Push the list of map expression onto the Stack

Parameters
PointerPointer to the list of map expression to be pushed.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 576 of file HiiExpression.c.

◆ PushScope()

EFI_STATUS PushScope ( IN UINT8  Operand)

Push an Operand onto the Stack

Parameters
OperandOperand to push.
Return values
EFI_SUCCESSThe value was pushed onto the stack.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 644 of file HiiExpression.c.

◆ PushStack()

EFI_STATUS PushStack ( IN OUT EFI_HII_VALUE **  Stack,
IN OUT EFI_HII_VALUE **  StackPtr,
IN OUT EFI_HII_VALUE **  StackEnd,
IN EFI_HII_VALUE Data 
)

Push an element onto the Boolean Stack.

Parameters
StackOn input: old stack; On output: new stack
StackPtrOn input: old stack pointer; On output: new stack pointer
StackEndOn input: old stack end; On output: new stack end
DataData to push.
Return values
EFI_SUCCESSPush stack success.

Definition at line 129 of file HiiExpression.c.

◆ ResetCurrentExpressionStack()

VOID ResetCurrentExpressionStack ( VOID  )

Reset stack pointer to begin of the stack.

Definition at line 205 of file HiiExpression.c.

◆ ResetMapExpressionListStack()

VOID ResetMapExpressionListStack ( VOID  )

Reset stack pointer to begin of the stack.

Definition at line 275 of file HiiExpression.c.

◆ ResetScopeStack()

VOID ResetScopeStack ( VOID  )

Reset stack pointer to begin of the stack.

Definition at line 626 of file HiiExpression.c.

Variable Documentation

◆ mCurrentExpressionEnd

EFI_HII_VALUE* mCurrentExpressionEnd = NULL

Definition at line 39 of file HiiExpression.c.

◆ mCurrentExpressionPointer

EFI_HII_VALUE* mCurrentExpressionPointer = NULL

Definition at line 40 of file HiiExpression.c.

◆ mCurrentExpressionStack

EFI_HII_VALUE* mCurrentExpressionStack = NULL

Definition at line 38 of file HiiExpression.c.

◆ mExpressionDependencyEnd

HII_DEPENDENCY_EXPRESSION** mExpressionDependencyEnd = NULL

Definition at line 53 of file HiiExpression.c.

◆ mExpressionDependencyPointer

HII_DEPENDENCY_EXPRESSION** mExpressionDependencyPointer = NULL

Definition at line 54 of file HiiExpression.c.

◆ mExpressionDependencyStack

HII_DEPENDENCY_EXPRESSION** mExpressionDependencyStack = NULL

Definition at line 52 of file HiiExpression.c.

◆ mFormExpressionEnd

HII_EXPRESSION** mFormExpressionEnd = NULL

Definition at line 24 of file HiiExpression.c.

◆ mFormExpressionPointer

HII_EXPRESSION** mFormExpressionPointer = NULL

Definition at line 25 of file HiiExpression.c.

◆ mFormExpressionStack

HII_EXPRESSION** mFormExpressionStack = NULL

Definition at line 23 of file HiiExpression.c.

◆ mMapExpressionListEnd

EFI_HII_VALUE* mMapExpressionListEnd = NULL

Definition at line 46 of file HiiExpression.c.

◆ mMapExpressionListPointer

EFI_HII_VALUE* mMapExpressionListPointer = NULL

Definition at line 47 of file HiiExpression.c.

◆ mMapExpressionListStack

EFI_HII_VALUE* mMapExpressionListStack = NULL

Definition at line 45 of file HiiExpression.c.

◆ mOpCodeScopeStack

EFI_HII_VALUE* mOpCodeScopeStack = NULL

Definition at line 16 of file HiiExpression.c.

◆ mOpCodeScopeStackEnd

EFI_HII_VALUE* mOpCodeScopeStackEnd = NULL

Definition at line 17 of file HiiExpression.c.

◆ mOpCodeScopeStackPointer

EFI_HII_VALUE* mOpCodeScopeStackPointer = NULL

Definition at line 18 of file HiiExpression.c.

◆ mOptionExpressionEnd

HII_EXPRESSION** mOptionExpressionEnd = NULL

Definition at line 32 of file HiiExpression.c.

◆ mOptionExpressionPointer

HII_EXPRESSION** mOptionExpressionPointer = NULL

Definition at line 33 of file HiiExpression.c.

◆ mOptionExpressionStack

HII_EXPRESSION** mOptionExpressionStack = NULL

Definition at line 31 of file HiiExpression.c.

◆ mStatementExpressionEnd

HII_EXPRESSION** mStatementExpressionEnd = NULL

Definition at line 28 of file HiiExpression.c.

◆ mStatementExpressionPointer

HII_EXPRESSION** mStatementExpressionPointer = NULL

Definition at line 29 of file HiiExpression.c.

◆ mStatementExpressionStack

HII_EXPRESSION** mStatementExpressionStack = NULL

Definition at line 27 of file HiiExpression.c.