]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enable nest for suppressif/grayoutif/diableif for form/question/option.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 31 Jan 2012 07:17:42 +0000 (07:17 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 31 Jan 2012 07:17:42 +0000 (07:17 +0000)
Signed-off-by: ydong10
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12972 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c
MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
MdeModulePkg/Universal/SetupBrowserDxe/Ui.h

index 1420f91828075e0f8bf4788dcca270624e1f73be..37dd6a0f61d48e99db8afa289ff9a5648bb60687 100644 (file)
@@ -34,6 +34,19 @@ EFI_HII_VALUE *mMapExpressionListStack = NULL;
 EFI_HII_VALUE *mMapExpressionListEnd = NULL;\r
 EFI_HII_VALUE *mMapExpressionListPointer = NULL;\r
 \r
+FORM_EXPRESSION   **mFormExpressionStack = NULL;\r
+FORM_EXPRESSION   **mFormExpressionEnd = NULL;\r
+FORM_EXPRESSION   **mFormExpressionPointer = NULL;\r
+\r
+FORM_EXPRESSION   **mStatementExpressionStack = NULL;\r
+FORM_EXPRESSION   **mStatementExpressionEnd = NULL;\r
+FORM_EXPRESSION   **mStatementExpressionPointer = NULL;\r
+\r
+FORM_EXPRESSION   **mOptionExpressionStack = NULL;\r
+FORM_EXPRESSION   **mOptionExpressionEnd = NULL;\r
+FORM_EXPRESSION   **mOptionExpressionPointer = NULL;\r
+\r
+\r
 //\r
 // Unicode collation protocol interface\r
 //\r
@@ -194,7 +207,10 @@ ResetCurrentExpressionStack (
   VOID\r
   )\r
 {\r
-  mCurrentExpressionPointer = mCurrentExpressionStack;\r
+  mCurrentExpressionPointer   = mCurrentExpressionStack;\r
+  mFormExpressionPointer      = mFormExpressionStack;\r
+  mStatementExpressionPointer = mStatementExpressionStack;\r
+  mOptionExpressionPointer    = mOptionExpressionStack;  \r
 }\r
 \r
 \r
@@ -267,6 +283,294 @@ ResetMapExpressionListStack (
 }\r
 \r
 \r
+/**\r
+  Grow size of the stack.\r
+\r
+  This is an internal function.\r
+\r
+  @param  Stack                  On input: old stack; On output: new stack\r
+  @param  StackPtr               On input: old stack pointer; On output: new stack\r
+                                 pointer\r
+  @param  StackEnd               On input: old stack end; On output: new stack end\r
+  @param  MemberSize             The stack member size.\r
+  \r
+  @retval EFI_SUCCESS            Grow stack success.\r
+  @retval EFI_OUT_OF_RESOURCES   No enough memory for stack space.\r
+\r
+**/\r
+EFI_STATUS\r
+GrowConditionalStack (\r
+  IN OUT FORM_EXPRESSION   ***Stack,\r
+  IN OUT FORM_EXPRESSION   ***StackPtr,\r
+  IN OUT FORM_EXPRESSION   ***StackEnd,\r
+  IN     UINTN             MemberSize\r
+  )\r
+{\r
+  UINTN             Size;\r
+  FORM_EXPRESSION   **NewStack;\r
+\r
+  Size = EXPRESSION_STACK_SIZE_INCREMENT;\r
+  if (*StackPtr != NULL) {\r
+    Size = Size + (*StackEnd - *Stack);\r
+  }\r
+\r
+  NewStack = AllocatePool (Size * MemberSize);\r
+  if (NewStack == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  if (*StackPtr != NULL) {\r
+    //\r
+    // Copy from Old Stack to the New Stack\r
+    //\r
+    CopyMem (\r
+      NewStack,\r
+      *Stack,\r
+      (*StackEnd - *Stack) * MemberSize\r
+      );\r
+\r
+    //\r
+    // Free The Old Stack\r
+    //\r
+    FreePool (*Stack);\r
+  }\r
+\r
+  //\r
+  // Make the Stack pointer point to the old data in the new stack\r
+  //\r
+  *StackPtr = NewStack + (*StackPtr - *Stack);\r
+  *Stack    = NewStack;\r
+  *StackEnd = NewStack + Size;\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Push an element onto the Stack.\r
+\r
+  @param  Stack                  On input: old stack; On output: new stack\r
+  @param  StackPtr               On input: old stack pointer; On output: new stack\r
+                                 pointer\r
+  @param  StackEnd               On input: old stack end; On output: new stack end\r
+  @param  Data                   Data to push.\r
+\r
+  @retval EFI_SUCCESS            Push stack success.\r
+\r
+**/\r
+EFI_STATUS\r
+PushConditionalStack (\r
+  IN OUT FORM_EXPRESSION   ***Stack,\r
+  IN OUT FORM_EXPRESSION   ***StackPtr,\r
+  IN OUT FORM_EXPRESSION   ***StackEnd,\r
+  IN     FORM_EXPRESSION   **Data\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  //\r
+  // Check for a stack overflow condition\r
+  //\r
+  if (*StackPtr >= *StackEnd) {\r
+    //\r
+    // Grow the stack\r
+    //\r
+    Status = GrowConditionalStack (Stack, StackPtr, StackEnd, sizeof (FORM_EXPRESSION *));\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+  }\r
+\r
+  //\r
+  // Push the item onto the stack\r
+  //\r
+  CopyMem (*StackPtr, Data, sizeof (FORM_EXPRESSION *)); \r
+  *StackPtr = *StackPtr + 1;\r
+\r
+  return EFI_SUCCESS;\r
+\r
+}\r
+\r
+/**\r
+  Pop an element from the stack.\r
+\r
+  @param  Stack                  On input: old stack\r
+  @param  StackPtr               On input: old stack pointer; On output: new stack pointer\r
+  @param  Data                   Data to pop.\r
+\r
+  @retval EFI_SUCCESS            The value was popped onto the stack.\r
+  @retval EFI_ACCESS_DENIED      The pop operation underflowed the stack\r
+\r
+**/\r
+EFI_STATUS\r
+PopConditionalStack (\r
+  IN     FORM_EXPRESSION   **Stack,\r
+  IN OUT FORM_EXPRESSION   ***StackPtr,\r
+  OUT    FORM_EXPRESSION   **Data\r
+  )\r
+{\r
+  //\r
+  // Check for a stack underflow condition\r
+  //\r
+  if (*StackPtr == Stack) {\r
+    return EFI_ACCESS_DENIED;\r
+  }\r
+\r
+  //\r
+  // Pop the item off the stack\r
+  //\r
+  *StackPtr = *StackPtr - 1;\r
+  CopyMem (Data, *StackPtr, sizeof (FORM_EXPRESSION  *));\r
+  return EFI_SUCCESS;\r
+\r
+}\r
+\r
+/**\r
+  Get the expression list count.\r
+  \r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval >=0                    The expression count\r
+  @retval -1                     Input parameter error.\r
+\r
+**/\r
+INTN \r
+GetConditionalExpressionCount (\r
+  IN EXPRESS_LEVEL       Level\r
+  )\r
+{\r
+  switch (Level) {\r
+    case ExpressForm:\r
+      return mFormExpressionPointer - mFormExpressionStack;\r
+    case ExpressStatement:\r
+      return mStatementExpressionPointer - mStatementExpressionStack;\r
+    case ExpressOption:\r
+      return mOptionExpressionPointer - mOptionExpressionStack;\r
+    default:\r
+      ASSERT (FALSE);\r
+      return -1;\r
+  } \r
+}\r
+\r
+/**\r
+  Get the expression Buffer pointer.\r
+  \r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval  The start pointer of the expression buffer or NULL.\r
+\r
+**/\r
+FORM_EXPRESSION **\r
+GetConditionalExpressionList (\r
+  IN EXPRESS_LEVEL       Level\r
+  )\r
+{\r
+  switch (Level) {\r
+    case ExpressForm:\r
+      return mFormExpressionStack;\r
+    case ExpressStatement:\r
+      return mStatementExpressionStack;\r
+    case ExpressOption:\r
+      return mOptionExpressionStack;\r
+    default:\r
+      ASSERT (FALSE);\r
+      return NULL;\r
+  } \r
+}\r
+\r
+\r
+/**\r
+  Push the expression options onto the Stack.\r
+\r
+  @param  Pointer                Pointer to the current expression.\r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval EFI_SUCCESS            The value was pushed onto the stack.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to grow the stack.\r
+\r
+**/\r
+EFI_STATUS\r
+PushConditionalExpression (\r
+  IN FORM_EXPRESSION   *Pointer,\r
+  IN EXPRESS_LEVEL     Level\r
+  )\r
+{\r
+  switch (Level) {\r
+    case ExpressForm:\r
+      return PushConditionalStack (\r
+        &mFormExpressionStack,\r
+        &mFormExpressionPointer,\r
+        &mFormExpressionEnd,\r
+        &Pointer\r
+        );\r
+    case ExpressStatement:\r
+      return PushConditionalStack (\r
+        &mStatementExpressionStack,\r
+        &mStatementExpressionPointer,\r
+        &mStatementExpressionEnd,\r
+        &Pointer\r
+        );\r
+    case ExpressOption:\r
+      return PushConditionalStack (\r
+        &mOptionExpressionStack,\r
+        &mOptionExpressionPointer,\r
+        &mOptionExpressionEnd,\r
+        &Pointer\r
+        );\r
+    default:\r
+      ASSERT (FALSE);\r
+      return EFI_INVALID_PARAMETER;\r
+  }\r
+}\r
+\r
+/**\r
+  Pop the expression options from the Stack\r
+\r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval EFI_SUCCESS            The value was pushed onto the stack.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to grow the stack.\r
+\r
+**/\r
+EFI_STATUS\r
+PopConditionalExpression (\r
+  IN  EXPRESS_LEVEL      Level\r
+  )\r
+{\r
+  FORM_EXPRESSION   *Pointer;\r
+\r
+  switch (Level) {\r
+    case ExpressForm:\r
+      return PopConditionalStack (\r
+        mFormExpressionStack,\r
+        &mFormExpressionPointer,\r
+        &Pointer\r
+      );\r
+\r
+    case ExpressStatement:\r
+      return PopConditionalStack (\r
+        mStatementExpressionStack,\r
+        &mStatementExpressionPointer,\r
+        &Pointer\r
+      );\r
+\r
+    case ExpressOption:\r
+      return PopConditionalStack (\r
+        mOptionExpressionStack,\r
+        &mOptionExpressionPointer,\r
+        &Pointer\r
+      );\r
+\r
+    default:\r
+      ASSERT (FALSE);\r
+      return EFI_INVALID_PARAMETER;\r
+  }\r
+}\r
+\r
+\r
 /**\r
   Push the list of map expression onto the Stack\r
 \r
@@ -2868,3 +3172,80 @@ Done:
 \r
   return Status;\r
 }\r
+\r
+/**\r
+  Return the result of the expression list. Check the expression list and \r
+  return the highest priority express result.  \r
+  Priority: DisableIf > SuppressIf > GrayOutIf > FALSE\r
+\r
+  @param  ExpList             The input expression list.\r
+  @param  Evaluate            Whether need to evaluate the expression first.\r
+  @param  FormSet             FormSet associated with this expression.\r
+  @param  Form                Form associated with this expression.  \r
+\r
+  @retval EXPRESS_RESULT      Return the higher priority express result. \r
+                              DisableIf > SuppressIf > GrayOutIf > FALSE\r
+\r
+**/\r
+EXPRESS_RESULT \r
+EvaluateExpressionList (\r
+  IN FORM_EXPRESSION_LIST *ExpList,\r
+  IN BOOLEAN              Evaluate,\r
+  IN FORM_BROWSER_FORMSET *FormSet, OPTIONAL\r
+  IN FORM_BROWSER_FORM    *Form OPTIONAL\r
+  )\r
+{\r
+  UINTN              Index;\r
+  EXPRESS_RESULT     ReturnVal;\r
+  EXPRESS_RESULT     CompareOne;\r
+  EFI_STATUS         Status;\r
+\r
+  if (ExpList == NULL) {\r
+    return ExpressFalse;\r
+  }\r
+\r
+  ASSERT(ExpList->Signature == FORM_EXPRESSION_LIST_SIGNATURE);\r
+  Index     = 0;\r
+\r
+  //\r
+  // Check whether need to evaluate the expression first.\r
+  //\r
+  if (Evaluate) {  \r
+    while (ExpList->Count > Index) {\r
+      Status = EvaluateExpression (FormSet, Form, ExpList->Expression[Index++]);\r
+      if (EFI_ERROR (Status)) {\r
+        return ExpressFalse;\r
+      }\r
+    }\r
+  }\r
+\r
+  //\r
+  // Run the list of expressions.\r
+  //\r
+  ReturnVal = ExpressFalse;\r
+  for (Index = 0; Index < ExpList->Count; Index++) {\r
+    if (ExpList->Expression[Index]->Result.Type == EFI_IFR_TYPE_BOOLEAN &&\r
+        ExpList->Expression[Index]->Result.Value.b) {\r
+      switch (ExpList->Expression[Index]->Type) {\r
+        case EFI_HII_EXPRESSION_SUPPRESS_IF:\r
+          CompareOne = ExpressSuppress;\r
+          break;\r
+\r
+        case EFI_HII_EXPRESSION_GRAY_OUT_IF:\r
+          CompareOne = ExpressGrayOut;\r
+          break;\r
+\r
+        case EFI_HII_EXPRESSION_DISABLE_IF:\r
+          CompareOne = ExpressDisable;\r
+          break;\r
+\r
+        default:\r
+          return ExpressFalse; \r
+      }\r
+\r
+      ReturnVal = ReturnVal < CompareOne ? CompareOne : ReturnVal;\r
+    }\r
+  }\r
+  \r
+  return ReturnVal;\r
+}\r
index a2befcb6613782b708d7724e95e97e11a203714e..2cd666fc707180a3c73f5660479939451ddaeef8 100644 (file)
@@ -18,13 +18,6 @@ UINT16           mStatementIndex;
 UINT16           mExpressionOpCodeIndex;\r
 \r
 BOOLEAN          mInScopeSubtitle;\r
-BOOLEAN          mInScopeSuppress;\r
-BOOLEAN          mInScopeGrayOut;\r
-BOOLEAN          mInScopeDisable;\r
-FORM_EXPRESSION  *mSuppressExpression;\r
-FORM_EXPRESSION  *mGrayOutExpression;\r
-FORM_EXPRESSION  *mDisableExpression;\r
-\r
 /**\r
   Initialize Statement header members.\r
 \r
@@ -44,6 +37,7 @@ CreateStatement (
 {\r
   FORM_BROWSER_STATEMENT    *Statement;\r
   EFI_IFR_STATEMENT_HEADER  *StatementHdr;\r
+  INTN                      ConditionalExprCount; \r
 \r
   if (Form == NULL) {\r
     //\r
@@ -68,17 +62,18 @@ CreateStatement (
   CopyMem (&Statement->Prompt, &StatementHdr->Prompt, sizeof (EFI_STRING_ID));\r
   CopyMem (&Statement->Help, &StatementHdr->Help, sizeof (EFI_STRING_ID));\r
 \r
-  if (mInScopeSuppress) {\r
-    Statement->SuppressExpression = mSuppressExpression;\r
-  }\r
-\r
-  if (mInScopeGrayOut) {\r
-    Statement->GrayOutExpression = mGrayOutExpression;\r
-  }\r
-\r
-\r
-  if (mInScopeDisable) {\r
-    Statement->DisableExpression = mDisableExpression;\r
+  ConditionalExprCount = GetConditionalExpressionCount(ExpressStatement);\r
+  if (ConditionalExprCount > 0) {\r
+    //\r
+    // Form is inside of suppressif\r
+    //\r
+    \r
+    Statement->Expression = (FORM_EXPRESSION_LIST *) AllocatePool( \r
+                                             (UINTN) (sizeof(FORM_EXPRESSION_LIST) + ((ConditionalExprCount -1) * sizeof(FORM_EXPRESSION *))));\r
+    ASSERT (Statement->Expression != NULL);\r
+    Statement->Expression->Count     = (UINTN) ConditionalExprCount;\r
+    Statement->Expression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;\r
+    CopyMem (Statement->Expression->Expression, GetConditionalExpressionList(ExpressStatement), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));\r
   }\r
 \r
   Statement->InSubtitle = mInScopeSubtitle;\r
@@ -629,6 +624,9 @@ DestroyStatement (
   while (!IsListEmpty (&Statement->OptionListHead)) {\r
     Link = GetFirstNode (&Statement->OptionListHead);\r
     Option = QUESTION_OPTION_FROM_LINK (Link);\r
+    if (Option->SuppressExpression != NULL) {\r
+      FreePool (Option->SuppressExpression);\r
+    }\r
     RemoveEntryList (&Option->Link);\r
 \r
     FreePool (Option);\r
@@ -656,6 +654,10 @@ DestroyStatement (
     DestroyExpression (Expression);\r
   }\r
 \r
+  if (Statement->Expression != NULL) {\r
+    FreePool (Statement->Expression);\r
+  }\r
+\r
   if (Statement->VariableName != NULL) {\r
     FreePool (Statement->VariableName);\r
   }\r
@@ -723,6 +725,10 @@ DestroyForm (
     FreePool (ConfigInfo);\r
   }\r
 \r
+  if (Form->SuppressExpression != NULL) {\r
+    FreePool (Form->SuppressExpression);\r
+  }\r
+\r
   //\r
   // Free this Form\r
   //\r
@@ -931,10 +937,6 @@ ParseOpCodes (
   EFI_IMAGE_ID            *ImageId;\r
   BOOLEAN                 SuppressForQuestion;\r
   BOOLEAN                 SuppressForOption;\r
-  BOOLEAN                 InScopeOptionSuppress;\r
-  FORM_EXPRESSION         *OptionSuppressExpression;\r
-  BOOLEAN                 InScopeFormSuppress;\r
-  FORM_EXPRESSION         *FormSuppressExpression;\r
   UINT16                  DepthOfDisable;\r
   BOOLEAN                 OpCodeDisabled;\r
   BOOLEAN                 SingleOpCodeExpression;\r
@@ -946,15 +948,13 @@ ParseOpCodes (
   FORMSET_STORAGE         *VarStorage;\r
   LIST_ENTRY              *MapExpressionList;\r
   EFI_VARSTORE_ID         TempVarstoreId;\r
+  BOOLEAN                 InScopeDisable;\r
+  INTN                    ConditionalExprCount;\r
 \r
   mInScopeSubtitle         = FALSE;\r
   SuppressForQuestion      = FALSE;\r
   SuppressForOption        = FALSE;\r
-  InScopeFormSuppress      = FALSE;\r
-  mInScopeSuppress         = FALSE;\r
-  InScopeOptionSuppress    = FALSE;\r
-  mInScopeGrayOut          = FALSE;\r
-  mInScopeDisable          = FALSE;\r
+  InScopeDisable           = FALSE;\r
   DepthOfDisable           = 0;\r
   OpCodeDisabled           = FALSE;\r
   SingleOpCodeExpression   = FALSE;\r
@@ -962,8 +962,6 @@ ParseOpCodes (
   CurrentExpression        = NULL;\r
   CurrentDefault           = NULL;\r
   CurrentOption            = NULL;\r
-  OptionSuppressExpression = NULL;\r
-  FormSuppressExpression   = NULL;\r
   ImageId                  = NULL;\r
   MapMethod                = NULL;\r
   MapScopeDepth            = 0;\r
@@ -971,6 +969,7 @@ ParseOpCodes (
   VarStorage               = NULL;\r
   MapExpressionList        = NULL;\r
   TempVarstoreId           = 0;\r
+  ConditionalExprCount     = 0;\r
 \r
   //\r
   // Get the number of Statements and Expressions\r
@@ -1032,7 +1031,7 @@ ParseOpCodes (
 \r
         if (ScopeOpCode == EFI_IFR_DISABLE_IF_OP) {\r
           if (DepthOfDisable == 0) {\r
-            mInScopeDisable = FALSE;\r
+            InScopeDisable = FALSE;\r
             OpCodeDisabled = FALSE;\r
           } else {\r
             DepthOfDisable--;\r
@@ -1288,7 +1287,7 @@ ParseOpCodes (
         //\r
         SingleOpCodeExpression = FALSE;\r
 \r
-        if (mInScopeDisable && CurrentForm == NULL) {\r
+        if (InScopeDisable && CurrentForm == NULL) {\r
           //\r
           // This is DisableIf expression for Form, it should be a constant expression\r
           //\r
@@ -1351,11 +1350,17 @@ ParseOpCodes (
       CopyMem (&CurrentForm->FormId,    &((EFI_IFR_FORM *) OpCodeData)->FormId,    sizeof (UINT16));\r
       CopyMem (&CurrentForm->FormTitle, &((EFI_IFR_FORM *) OpCodeData)->FormTitle, sizeof (EFI_STRING_ID));\r
 \r
-      if (InScopeFormSuppress) {\r
+      ConditionalExprCount = GetConditionalExpressionCount(ExpressForm);\r
+      if ( ConditionalExprCount > 0) {\r
         //\r
         // Form is inside of suppressif\r
         //\r
-        CurrentForm->SuppressExpression = FormSuppressExpression;\r
+        CurrentForm->SuppressExpression = (FORM_EXPRESSION_LIST *) AllocatePool( \r
+                                                 (UINTN) (sizeof(FORM_EXPRESSION_LIST) + ((ConditionalExprCount -1) * sizeof(FORM_EXPRESSION *))));\r
+        ASSERT (CurrentForm->SuppressExpression != NULL);\r
+        CurrentForm->SuppressExpression->Count     = (UINTN) ConditionalExprCount;\r
+        CurrentForm->SuppressExpression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;\r
+        CopyMem (CurrentForm->SuppressExpression->Expression, GetConditionalExpressionList(ExpressForm), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));\r
       }\r
 \r
       if (Scope != 0) {\r
@@ -1410,11 +1415,17 @@ ParseOpCodes (
         CopyMem (&CurrentForm->FormTitle, &MapMethod->MethodTitle, sizeof (EFI_STRING_ID));\r
       }\r
 \r
-      if (InScopeFormSuppress) {\r
+      ConditionalExprCount = GetConditionalExpressionCount(ExpressForm);\r
+      if ( ConditionalExprCount > 0) {\r
         //\r
         // Form is inside of suppressif\r
         //\r
-        CurrentForm->SuppressExpression = FormSuppressExpression;\r
+        CurrentForm->SuppressExpression = (FORM_EXPRESSION_LIST *) AllocatePool( \r
+                                                 (UINTN) (sizeof(FORM_EXPRESSION_LIST) + ((ConditionalExprCount -1) * sizeof(FORM_EXPRESSION *))));\r
+        ASSERT (CurrentForm->SuppressExpression != NULL);\r
+        CurrentForm->SuppressExpression->Count     = (UINTN) ConditionalExprCount;\r
+        CurrentForm->SuppressExpression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;\r
+        CopyMem (CurrentForm->SuppressExpression->Expression, GetConditionalExpressionList(ExpressForm), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));\r
       }\r
 \r
       if (Scope != 0) {\r
@@ -1799,8 +1810,17 @@ ParseOpCodes (
       CopyMem (&CurrentOption->Value.Value, &((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Value, sizeof (EFI_IFR_TYPE_VALUE));\r
       ExtendValueToU64 (&CurrentOption->Value);\r
 \r
-      if (InScopeOptionSuppress) {\r
-        CurrentOption->SuppressExpression = OptionSuppressExpression;\r
+      ConditionalExprCount = GetConditionalExpressionCount(ExpressOption);\r
+      if ( ConditionalExprCount > 0) {\r
+        //\r
+        // Form is inside of suppressif\r
+        //\r
+        CurrentOption->SuppressExpression = (FORM_EXPRESSION_LIST *) AllocatePool( \r
+                                                 (UINTN) (sizeof(FORM_EXPRESSION_LIST) + ((ConditionalExprCount -1) * sizeof(FORM_EXPRESSION *))));\r
+        ASSERT (CurrentOption->SuppressExpression != NULL);\r
+        CurrentOption->SuppressExpression->Count     = (UINTN) ConditionalExprCount;\r
+        CurrentOption->SuppressExpression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;\r
+        CopyMem (CurrentOption->SuppressExpression->Expression, GetConditionalExpressionList(ExpressOption), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));\r
       }\r
 \r
       //\r
@@ -1892,14 +1912,11 @@ ParseOpCodes (
       }\r
 \r
       if (SuppressForOption) {\r
-        InScopeOptionSuppress = TRUE;\r
-        OptionSuppressExpression = CurrentExpression;\r
+        PushConditionalExpression(CurrentExpression, ExpressOption);       \r
       } else if (SuppressForQuestion) {\r
-        mInScopeSuppress = TRUE;\r
-        mSuppressExpression = CurrentExpression;\r
+        PushConditionalExpression(CurrentExpression, ExpressStatement);  \r
       } else {\r
-        InScopeFormSuppress = TRUE;\r
-        FormSuppressExpression = CurrentExpression;\r
+        PushConditionalExpression(CurrentExpression, ExpressForm);  \r
       }\r
 \r
       //\r
@@ -1918,9 +1935,7 @@ ParseOpCodes (
       CurrentExpression = CreateExpression (CurrentForm);\r
       CurrentExpression->Type = EFI_HII_EXPRESSION_GRAY_OUT_IF;\r
       InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);\r
-\r
-      mInScopeGrayOut = TRUE;\r
-      mGrayOutExpression = CurrentExpression;\r
+      PushConditionalExpression(CurrentExpression, ExpressStatement);\r
 \r
       //\r
       // Take a look at next OpCode to see whether current expression consists\r
@@ -1947,12 +1962,11 @@ ParseOpCodes (
         // This is DisableIf for Question, enqueue it to Form expression list\r
         //\r
         InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);\r
+        PushConditionalExpression(CurrentExpression, ExpressStatement);\r
       }\r
 \r
-      mDisableExpression = CurrentExpression;\r
-      mInScopeDisable    = TRUE;\r
-      OpCodeDisabled     = FALSE;\r
-\r
+      OpCodeDisabled  = FALSE;\r
+      InScopeDisable  = TRUE;\r
       //\r
       // Take a look at next OpCode to see whether current expression consists\r
       // of single OpCode\r
@@ -2235,20 +2249,23 @@ ParseOpCodes (
 \r
       case EFI_IFR_SUPPRESS_IF_OP:\r
         if (SuppressForOption) {\r
-          InScopeOptionSuppress = FALSE;\r
+          PopConditionalExpression(ExpressOption);      \r
         } else if (SuppressForQuestion) {\r
-          mInScopeSuppress = FALSE;\r
+          PopConditionalExpression(ExpressStatement);\r
         } else {\r
-          InScopeFormSuppress = FALSE;\r
+          PopConditionalExpression(ExpressForm);\r
         }\r
         break;\r
 \r
       case EFI_IFR_GRAY_OUT_IF_OP:\r
-        mInScopeGrayOut = FALSE;\r
+        PopConditionalExpression(ExpressStatement);\r
         break;\r
 \r
       case EFI_IFR_DISABLE_IF_OP:\r
-        mInScopeDisable = FALSE;\r
+        if (CurrentForm != NULL) {\r
+          PopConditionalExpression(ExpressStatement);\r
+        }\r
+        InScopeDisable = FALSE;\r
         OpCodeDisabled = FALSE;\r
         break;\r
 \r
@@ -2280,7 +2297,7 @@ ParseOpCodes (
 \r
       default:\r
         if (IsExpressionOpCode (ScopeOpCode)) {\r
-          if (mInScopeDisable && CurrentForm == NULL) {\r
+          if (InScopeDisable && CurrentForm == NULL) {\r
             //\r
             // This is DisableIf expression for Form, it should be a constant expression\r
             //\r
index 2522d16deb1b1c6d434d34020baeb7a833809f55..c9da7a311ad01e456bd75046e29ed0a904c176a0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Implementation for handling user input from the User Interfaces.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1005,7 +1005,7 @@ GetSelectionInputPopUp (
     RemoveEntryList (&OneOfOption->Link);\r
 \r
     if ((OneOfOption->SuppressExpression != NULL) &&\r
-        (OneOfOption->SuppressExpression->Result.Value.b)) {\r
+        EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) != ExpressFalse) {\r
       //\r
       // This option is suppressed, insert to tail\r
       //\r
index 2ba2165971308580387c3842b0013c5e3fa201db..28ed0348ed2761b99bd50f6d947c29d80f0662b3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Utility functions for UI presentation.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -468,7 +468,6 @@ DisplayForm (
   CHAR16                 *StringPtr;\r
   UINT16                 MenuItemCount;\r
   EFI_HII_HANDLE         Handle;\r
-  BOOLEAN                Suppress;\r
   EFI_SCREEN_DESCRIPTOR  LocalScreen;\r
   UINT16                 Width;\r
   UINTN                  ArrayEntry;\r
@@ -521,17 +520,7 @@ DisplayForm (
   while (!IsNull (&Selection->Form->StatementListHead, Link)) {\r
     Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r
 \r
-    if (Statement->SuppressExpression != NULL) {\r
-      Suppress = Statement->SuppressExpression->Result.Value.b;\r
-    } else {\r
-      Suppress = FALSE;\r
-    }\r
-\r
-    if (Statement->DisableExpression != NULL) {\r
-      Suppress = (BOOLEAN) (Suppress || Statement->DisableExpression->Result.Value.b);\r
-    }\r
-\r
-    if (!Suppress) {\r
+    if (EvaluateExpressionList(Statement->Expression, FALSE, NULL, NULL) <= ExpressGrayOut) {\r
       StringPtr = GetToken (Statement->Prompt, Handle);\r
       ASSERT (StringPtr != NULL);\r
 \r
@@ -1220,11 +1209,8 @@ ProcessCallBackFunction (
     //\r
     // Check whether Statement is disabled.\r
     //\r
-    if (Statement->DisableExpression != NULL) {\r
-      Status = EvaluateExpression (Selection->FormSet, Selection->Form, Statement->DisableExpression);\r
-      if (!EFI_ERROR (Status) && \r
-          (Statement->DisableExpression->Result.Type == EFI_IFR_TYPE_BOOLEAN) && \r
-          (Statement->DisableExpression->Result.Value.b)) {\r
+    if (Statement->Expression != NULL) {\r
+      if (EvaluateExpressionList(Statement->Expression, TRUE, Selection->FormSet, Selection->Form) == ExpressDisable) {\r
         continue;\r
       }\r
     }\r
@@ -1424,13 +1410,7 @@ SetupBrowser (
     // Check Form is suppressed.\r
     //\r
     if (Selection->Form->SuppressExpression != NULL) {\r
-      Status = EvaluateExpression (Selection->FormSet, Selection->Form, Selection->Form->SuppressExpression);\r
-      if (EFI_ERROR (Status) || (Selection->Form->SuppressExpression->Result.Type != EFI_IFR_TYPE_BOOLEAN)) {\r
-        Status = EFI_INVALID_PARAMETER;\r
-        goto Done;\r
-      }\r
-\r
-      if (Selection->Form->SuppressExpression->Result.Value.b) {\r
+      if (EvaluateExpressionList(Selection->Form->SuppressExpression, TRUE, Selection->FormSet, Selection->Form) == ExpressSuppress) {\r
         //\r
         // Form is suppressed. \r
         //\r
index 1ce139cbb0d25a0beef2c9a95d943f4f8137e40f..81d328014507143eaf5ad02aaa7323e0ebfad05e 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for handling the User Interface option processing.\r
 \r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -491,7 +491,7 @@ ProcessOptions (
 \r
         Suppress = FALSE;\r
         if ((OneOfOption->SuppressExpression != NULL) &&\r
-            (OneOfOption->SuppressExpression->Result.Value.b)) {\r
+            (EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressSuppress)) {\r
           //\r
           // This option is suppressed\r
           //\r
@@ -548,7 +548,7 @@ ProcessOptions (
           Option = QUESTION_OPTION_FROM_LINK (Link);\r
 \r
           if ((Option->SuppressExpression == NULL) ||\r
-              !Option->SuppressExpression->Result.Value.b) {\r
+              (EvaluateExpressionList(Option->SuppressExpression, FALSE, NULL, NULL) == ExpressFalse)) {\r
             CopyMem (QuestionValue, &Option->Value, sizeof (EFI_HII_VALUE));\r
             SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
             UpdateStatusBar (Selection, NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);\r
@@ -564,7 +564,7 @@ ProcessOptions (
       }\r
 \r
       if ((OneOfOption->SuppressExpression != NULL) &&\r
-          (OneOfOption->SuppressExpression->Result.Value.b)) {\r
+          ((EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressSuppress))) {\r
         //\r
         // This option is suppressed\r
         //\r
@@ -583,7 +583,7 @@ ProcessOptions (
           OneOfOption = QUESTION_OPTION_FROM_LINK (Link);\r
 \r
           if ((OneOfOption->SuppressExpression == NULL) ||\r
-              !OneOfOption->SuppressExpression->Result.Value.b) {\r
+              (EvaluateExpressionList(OneOfOption->SuppressExpression, FALSE, NULL, NULL) == ExpressFalse)) {\r
             Suppress = FALSE;\r
             CopyMem (QuestionValue, &OneOfOption->Value, sizeof (EFI_HII_VALUE));\r
             SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);\r
index 6b169cd0a1f3b882ed1d22c55e2cc5fb80e5f26f..b1eb88f4db240d81a098e89294291f1889e6f785 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Entry and initialization module for the browser.\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -3016,9 +3016,8 @@ ExtractDefault (
       //\r
       // If Question is disabled, don't reset it to default\r
       //\r
-      if (Question->DisableExpression != NULL) {\r
-        Status = EvaluateExpression (FormSet, Form, Question->DisableExpression);\r
-        if (!EFI_ERROR (Status) && Question->DisableExpression->Result.Value.b) {\r
+      if (Question->Expression != NULL) {\r
+        if (EvaluateExpressionList(Question->Expression, TRUE, FormSet, Form) == ExpressDisable) {\r
           continue;\r
         }\r
       }\r
index 214102c2131c9c2fb11734b29502cc2c4a903ff9..6a5ddf1f2b06250ce74a77b48fd555f6cff72559 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private MACRO, structure and function definitions for Setup Browser module.\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -299,6 +299,14 @@ typedef struct {
 \r
 #define FORM_EXPRESSION_FROM_LINK(a)  CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r
 \r
+#define FORM_EXPRESSION_LIST_SIGNATURE  SIGNATURE_32 ('F', 'E', 'X', 'R')\r
+\r
+typedef struct {\r
+    UINTN               Signature;\r
+    UINTN               Count;\r
+    FORM_EXPRESSION    *Expression[1];   // Array[Count] of expressions\r
+} FORM_EXPRESSION_LIST;\r
+\r
 #define QUESTION_DEFAULT_SIGNATURE  SIGNATURE_32 ('Q', 'D', 'F', 'T')\r
 \r
 typedef struct {\r
@@ -316,19 +324,33 @@ typedef struct {
 #define QUESTION_OPTION_SIGNATURE  SIGNATURE_32 ('Q', 'O', 'P', 'T')\r
 \r
 typedef struct {\r
-  UINTN               Signature;\r
-  LIST_ENTRY          Link;\r
+  UINTN                Signature;\r
+  LIST_ENTRY           Link;\r
 \r
-  EFI_STRING_ID       Text;\r
-  UINT8               Flags;\r
-  EFI_HII_VALUE       Value;\r
-  EFI_IMAGE_ID        ImageId;\r
+  EFI_STRING_ID        Text;\r
+  UINT8                Flags;\r
+  EFI_HII_VALUE        Value;\r
+  EFI_IMAGE_ID         ImageId;\r
 \r
-  FORM_EXPRESSION     *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
+  FORM_EXPRESSION_LIST *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
 } QUESTION_OPTION;\r
 \r
 #define QUESTION_OPTION_FROM_LINK(a)  CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r
 \r
+typedef enum {\r
+  ExpressFalse = 0,\r
+  ExpressGrayOut,  \r
+  ExpressSuppress,\r
+  ExpressDisable\r
+} EXPRESS_RESULT;\r
+\r
+typedef enum {\r
+  ExpressNone = 0,\r
+  ExpressForm,  \r
+  ExpressStatement,\r
+  ExpressOption\r
+} EXPRESS_LEVEL;\r
+\r
 #define FORM_BROWSER_STATEMENT_SIGNATURE  SIGNATURE_32 ('F', 'S', 'T', 'A')\r
 \r
 typedef struct {\r
@@ -390,9 +412,7 @@ typedef struct {
 \r
   LIST_ENTRY            InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
   LIST_ENTRY            NoSubmitListHead;    // nested nosubmit expression list (FORM_EXPRESSION)\r
-  FORM_EXPRESSION       *GrayOutExpression;  // nesting inside of GrayOutIf\r
-  FORM_EXPRESSION       *SuppressExpression; // nesting inside of SuppressIf\r
-  FORM_EXPRESSION       *DisableExpression;  // nesting inside of DisableIf\r
+  FORM_EXPRESSION_LIST  *Expression;         // nesting inside of GrayOutIf/DisableIf/SuppressIf\r
 \r
   FORM_EXPRESSION       *ReadExpression;     // nested EFI_IFR_READ, provide this question value by read expression.\r
   FORM_EXPRESSION       *WriteExpression;    // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.\r
@@ -417,24 +437,24 @@ typedef struct {
 #define STANDARD_MAP_FORM_TYPE 0x01\r
 \r
 typedef struct {\r
-  UINTN             Signature;\r
-  LIST_ENTRY        Link;\r
+  UINTN                Signature;\r
+  LIST_ENTRY           Link;\r
 \r
-  UINT16            FormId;               // FormId of normal form or formmap form.\r
-  EFI_STRING_ID     FormTitle;            // FormTile of normal form, or FormMapMethod title of formmap form.\r
-  UINT16            FormType;             // Specific form type for the different form.\r
+  UINT16               FormId;               // FormId of normal form or formmap form.\r
+  EFI_STRING_ID        FormTitle;            // FormTile of normal form, or FormMapMethod title of formmap form.\r
+  UINT16               FormType;             // Specific form type for the different form.\r
 \r
-  EFI_IMAGE_ID      ImageId;\r
+  EFI_IMAGE_ID         ImageId;\r
 \r
-  BOOLEAN           ModalForm;            // Whether this is a modal form.\r
-  BOOLEAN           Locked;               // Whether this form is locked.\r
+  BOOLEAN              ModalForm;            // Whether this is a modal form.\r
+  BOOLEAN              Locked;               // Whether this form is locked.\r
 \r
-  BOOLEAN           NvUpdateRequired;     // Whether this form has NV update request.\r
+  BOOLEAN              NvUpdateRequired;     // Whether this form has NV update request.\r
 \r
-  LIST_ENTRY        ExpressionListHead;   // List of Expressions (FORM_EXPRESSION)\r
-  LIST_ENTRY        StatementListHead;    // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
-  LIST_ENTRY        ConfigRequestHead;    // List of configreques for all storage.\r
-  FORM_EXPRESSION   *SuppressExpression;  // nesting inside of SuppressIf\r
+  LIST_ENTRY           ExpressionListHead;   // List of Expressions (FORM_EXPRESSION)\r
+  LIST_ENTRY           StatementListHead;    // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
+  LIST_ENTRY           ConfigRequestHead;    // List of configreques for all storage.\r
+  FORM_EXPRESSION_LIST *SuppressExpression;  // nesting inside of SuppressIf\r
 } FORM_BROWSER_FORM;\r
 \r
 #define FORM_BROWSER_FORM_FROM_LINK(a)  CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r
index 01909e46491897bb5318b3b9cd3bacae72092ea7..7c6a032f8b8b967eef08a7385bf6d8354c6e6c05 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Utility functions for User Interface functions.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -731,8 +731,10 @@ UiAddMenuOption (
     }\r
     MenuOption->Sequence = Index;\r
 \r
-    if (Statement->GrayOutExpression != NULL) {\r
-      MenuOption->GrayOut = Statement->GrayOutExpression->Result.Value.b;\r
+    if (EvaluateExpressionList(Statement->Expression, FALSE, NULL, NULL) == ExpressGrayOut ) {\r
+      MenuOption->GrayOut = TRUE;\r
+    } else {\r
+      MenuOption->GrayOut = FALSE;\r
     }\r
 \r
     //\r
@@ -1999,12 +2001,7 @@ ProcessGotoOpCode (
     RefForm = IdToForm (Selection->FormSet, Statement->HiiValue.Value.ref.FormId);\r
 \r
     if ((RefForm != NULL) && (RefForm->SuppressExpression != NULL)) {\r
-      Status = EvaluateExpression (Selection->FormSet, RefForm, RefForm->SuppressExpression);\r
-      if (EFI_ERROR (Status)) {\r
-        return Status;\r
-      }\r
-\r
-      if (RefForm->SuppressExpression->Result.Value.b) {\r
+      if (EvaluateExpressionList(RefForm->SuppressExpression, TRUE, Selection->FormSet, RefForm) != ExpressFalse) {\r
         //\r
         // Form is suppressed. \r
         //\r
index 92783182f935218f72da5b58a338233ac7e3c677..fb84aabfe899459345af0029e21b79b4d78e00a3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private structure, MACRO and function definitions for User Interface related functionalities.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -741,6 +741,67 @@ ResetScopeStack (
   VOID\r
   );\r
 \r
+/**\r
+  Push the expression options onto the Stack.\r
+\r
+  @param  Pointer                Pointer to the current expression.\r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval EFI_SUCCESS            The value was pushed onto the stack.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to grow the stack.\r
+\r
+**/\r
+EFI_STATUS\r
+PushConditionalExpression (\r
+  IN FORM_EXPRESSION     *Pointer,\r
+  IN EXPRESS_LEVEL               Level\r
+  );\r
+\r
+/**\r
+  Pop the expression options from the Stack\r
+\r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval EFI_SUCCESS            The value was pushed onto the stack.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough system memory to grow the stack.\r
+\r
+**/\r
+EFI_STATUS\r
+PopConditionalExpression (\r
+  IN  EXPRESS_LEVEL      Level\r
+  );\r
+  \r
+/**\r
+  Get the expression Buffer pointer.\r
+  \r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval  The start pointer of the expression buffer or NULL.\r
+\r
+**/\r
+FORM_EXPRESSION **\r
+GetConditionalExpressionList (\r
+  IN EXPRESS_LEVEL       Level\r
+  );\r
+\r
+/**\r
+  Get the expression list count.\r
+  \r
+  @param  Level                  Which type this expression belong to. Form, \r
+                                 statement or option?\r
+\r
+  @retval >=0                    The expression count\r
+  @retval -1                     Input parameter error.\r
+\r
+**/\r
+INTN \r
+GetConditionalExpressionCount (\r
+  IN EXPRESS_LEVEL       Level\r
+  );\r
+\r
 /**\r
   Push an Operand onto the Stack\r
 \r
@@ -935,4 +996,28 @@ EvaluateExpression (
   IN OUT FORM_EXPRESSION   *Expression\r
   );\r
 \r
+/**\r
+  Return the result of the expression list. Check the expression list and \r
+  return the highest priority express result.  \r
+  Priority: DisableIf > SuppressIf > GrayOutIf > FALSE\r
+\r
+  @param  ExpList             The input expression list.\r
+  @param  Evaluate            Whether need to evaluate the expression first.\r
+  @param  FormSet             FormSet associated with this expression. Only \r
+                              needed when Evaluate is TRUE\r
+  @param  Form                Form associated with this expression. Only \r
+                              needed when Evaluate is TRUE \r
+\r
+  @retval EXPRESS_RESULT      Return the higher priority express result. \r
+                              DisableIf > SuppressIf > GrayOutIf > FALSE\r
+\r
+**/\r
+EXPRESS_RESULT \r
+EvaluateExpressionList (\r
+  IN FORM_EXPRESSION_LIST *ExpList,\r
+  IN BOOLEAN              Evaluate,\r
+  IN FORM_BROWSER_FORMSET *FormSet, OPTIONAL\r
+  IN FORM_BROWSER_FORM    *Form OPTIONAL\r
+  );\r
+\r
 #endif // _UI_H\r