]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Dependency/dependency.c
Fix function comment to follows doxygen format.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Dependency / dependency.c
index c817a3d1717ad722aa145496f44dffc565c860b1..8146c19ca369f373f847840bcf9d7825d6b9eceb 100644 (file)
@@ -1,4 +1,9 @@
-/*++\r
+/** @file\r
+  PEI Dispatcher Dependency Evaluator\r
+\r
+  This routine evaluates a dependency expression (DEPENDENCY_EXPRESSION) to determine\r
+  if a driver can be scheduled for execution.  The criteria for\r
+  schedulability is that the dependency expression is satisfied.\r
 \r
 Copyright (c) 2006, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
@@ -9,47 +14,30 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-Module Name:\r
-\r
-  dependency.c\r
-\r
-Abstract:\r
-\r
-  PEI Dispatcher Dependency Evaluator\r
-\r
-  This routine evaluates a dependency expression (DEPENDENCY_EXPRESSION) to determine\r
-  if a driver can be scheduled for execution.  The criteria for\r
-  schedulability is that the dependency expression is satisfied.\r
-  \r
---*/\r
+**/\r
 \r
 #include <PeiMain.h>\r
 #include "dependency.h"\r
 \r
-STATIC\r
-BOOLEAN\r
-IsPpiInstalled (\r
-  IN EFI_PEI_SERVICES  **PeiServices,\r
-  IN EVAL_STACK_ENTRY  *Stack\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   This routine determines if a PPI has been installed.\r
   The truth value of a GUID is determined by if the PPI has\r
   been published and can be queried from the PPI database.\r
 \r
-Arguments:\r
-  PeiServices - The PEI core services table.\r
-  Stack       - Reference to EVAL_STACK_ENTRY that contains PPI GUID to check\r
 \r
-Returns:\r
+  @param PeiServices     The PEI core services table.\r
+  @param Stack           Reference to EVAL_STACK_ENTRY that contains PPI GUID to check\r
 \r
-  True if the PPI is already installed.\r
-  False if the PPI has yet to be installed.\r
+  @retval TRUE  if the PPI is already installed.\r
+  @retval FALSE if the PPI has yet to be installed.\r
 \r
---*/\r
+**/\r
+BOOLEAN\r
+IsPpiInstalled (\r
+  IN EFI_PEI_SERVICES  **PeiServices,\r
+  IN EVAL_STACK_ENTRY  *Stack\r
+  )\r
 {\r
   VOID        *PeiInstance;\r
   EFI_STATUS  Status;\r
@@ -86,16 +74,7 @@ Returns:
   return TRUE;\r
 }\r
 \r
-\r
-EFI_STATUS\r
-PeimDispatchReadiness (\r
-  IN EFI_PEI_SERVICES   **PeiServices,\r
-  IN VOID               *DependencyExpression,\r
-  OUT BOOLEAN           *Runnable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   This is the POSTFIX version of the dependency evaluator.  When a\r
   PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on\r
@@ -104,33 +83,28 @@ Routine Description:
   some time savings as not all PPIs must be checked for certain\r
   operation types (AND, OR).\r
 \r
-Arguments:\r
-\r
-  PeiServices               - Calling context.\r
 \r
-  DependencyExpression      - Pointer to a dependency expression.  The Grammar adheres to \r
-                              the BNF described above and is stored in postfix notation.\r
-  Runnable                  - is True if the driver can be scheduled and False if the driver \r
-                              cannot be scheduled.  This is the value that the schedulers \r
-                              should use for deciding the state of the driver.\r
+  @param PeiServices            Calling context.\r
+  @param DependencyExpression   Pointer to a dependency expression.  The Grammar adheres to\r
+                                the BNF described above and is stored in postfix notation.\r
 \r
-Returns:\r
+  @retval TRUE      if it is a well-formed Grammar\r
+  @retval FALSE     if the dependency expression overflows the evaluation stack\r
+                    if the dependency expression underflows the evaluation stack\r
+                    if the dependency expression is not a well-formed Grammar.\r
 \r
-  Status = EFI_SUCCESS            if it is a well-formed Grammar\r
-           EFI_INVALID_PARAMETER  if the dependency expression overflows\r
-                                  the evaluation stack\r
-           EFI_INVALID_PARAMETER  if the dependency expression underflows\r
-                                  the evaluation stack\r
-           EFI_INVALID_PARAMETER  if the dependency expression is not a\r
-                                  well-formed Grammar.\r
---*/\r
+**/\r
+BOOLEAN\r
+PeimDispatchReadiness (\r
+  IN EFI_PEI_SERVICES   **PeiServices,\r
+  IN VOID               *DependencyExpression\r
+  )\r
 {\r
   DEPENDENCY_EXPRESSION_OPERAND  *Iterator;\r
   EVAL_STACK_ENTRY               *StackPtr;\r
   EVAL_STACK_ENTRY               EvalStack[MAX_GRAMMAR_SIZE];\r
 \r
   Iterator  = DependencyExpression;\r
-  *Runnable = FALSE;\r
 \r
   StackPtr = &EvalStack[0];\r
 \r
@@ -149,7 +123,7 @@ Returns:
         // EvalStack on the push\r
         //\r
         if (StackPtr > &EvalStack[MAX_GRAMMAR_SIZE-1]) {\r
-          return EFI_INVALID_PARAMETER;\r
+          return FALSE;\r
         }\r
 \r
         //\r
@@ -170,7 +144,7 @@ Returns:
         // did two POPs.\r
         //\r
         if (StackPtr < &EvalStack[2]) {\r
-          return EFI_INVALID_PARAMETER;\r
+          return FALSE;\r
         }\r
 \r
         //\r
@@ -208,10 +182,9 @@ Returns:
         // an error in the dependency grammar, so return EFI_INVALID_PARAMETER.\r
         //\r
         if (StackPtr != &EvalStack[0]) {\r
-          return EFI_INVALID_PARAMETER;\r
+          return FALSE;\r
         }\r
-        *Runnable = IsPpiInstalled (PeiServices, StackPtr);\r
-        return EFI_SUCCESS;\r
+        return IsPpiInstalled (PeiServices, StackPtr);\r
         break;\r
 \r
       case (EFI_DEP_NOT):    \r
@@ -222,7 +195,7 @@ Returns:
         // did a POP.\r
         //\r
         if (StackPtr < &EvalStack[1]) {\r
-          return EFI_INVALID_PARAMETER;\r
+          return FALSE;\r
         }\r
         (StackPtr-1)->Result = (BOOLEAN) !IsPpiInstalled (PeiServices, (StackPtr-1));\r
         (StackPtr-1)->Operator = NULL;\r
@@ -235,7 +208,7 @@ Returns:
         // EvalStack on the push\r
         //\r
         if (StackPtr > &EvalStack[MAX_GRAMMAR_SIZE-1]) {\r
-          return EFI_INVALID_PARAMETER;\r
+          return FALSE;\r
         }\r
         //\r
         // Iterator has increased by 1 after we retrieve the operand, so here we \r
@@ -255,7 +228,7 @@ Returns:
         //\r
         // The grammar should never arrive here\r
         //\r
-        return EFI_INVALID_PARAMETER;\r
+        return FALSE;\r
         break;\r
     }\r
   }\r