TianoCore EDK2 master
Loading...
Searching...
No Matches
Dependency.c File Reference
#include "PiSmmCore.h"

Go to the source code of this file.

Macros

#define EFI_DEP_REPLACE_TRUE   0xff
 
#define DEPEX_STACK_SIZE_INCREMENT   0x1000
 

Functions

EFI_STATUS GrowDepexStack (VOID)
 
EFI_STATUS PushBool (IN BOOLEAN Value)
 
EFI_STATUS PopBool (OUT BOOLEAN *Value)
 
BOOLEAN SmmIsSchedulable (IN EFI_SMM_DRIVER_ENTRY *DriverEntry)
 

Variables

BOOLEAN * mDepexEvaluationStack = NULL
 
BOOLEAN * mDepexEvaluationStackEnd = NULL
 
BOOLEAN * mDepexEvaluationStackPointer = NULL
 

Detailed Description

SMM Driver Dispatcher Dependency Evaluator

This routine evaluates a dependency expression (DEPENDENCY_EXPRESSION) to determine if a driver can be scheduled for execution. The criteria for schedulability is that the dependency expression is satisfied.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Dependency.c.

Macro Definition Documentation

◆ DEPEX_STACK_SIZE_INCREMENT

#define DEPEX_STACK_SIZE_INCREMENT   0x1000

Define the initial size of the dependency expression evaluation stack

Definition at line 28 of file Dependency.c.

◆ EFI_DEP_REPLACE_TRUE

#define EFI_DEP_REPLACE_TRUE   0xff

EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependency expression to save time. A EFI_DEP_PUSH is evaluated one an replaced with EFI_DEP_REPLACE_TRUE. If PI spec's Vol 2 Driver Execution Environment Core Interface use 0xff as new DEPEX opcode. EFI_DEP_REPLACE_TRUE should be defined to a new value that is not conflicting with PI spec.

Definition at line 23 of file Dependency.c.

Function Documentation

◆ GrowDepexStack()

EFI_STATUS GrowDepexStack ( VOID  )

Grow size of the Depex stack

Return values
EFI_SUCCESSStack successfully growed.
EFI_OUT_OF_RESOURCESThere is not enough system memory to grow the stack.

Definition at line 45 of file Dependency.c.

◆ PopBool()

EFI_STATUS PopBool ( OUT BOOLEAN *  Value)

Pop an element from the Boolean stack.

Parameters
ValueBOOLEAN to pop.
Return values
EFI_SUCCESSThe value was popped onto the stack.
EFI_ACCESS_DENIEDThe pop operation underflowed the stack.

Definition at line 136 of file Dependency.c.

◆ PushBool()

EFI_STATUS PushBool ( IN BOOLEAN  Value)

Push an element onto the Boolean Stack.

Parameters
ValueBOOLEAN 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 98 of file Dependency.c.

◆ SmmIsSchedulable()

BOOLEAN SmmIsSchedulable ( IN EFI_SMM_DRIVER_ENTRY *  DriverEntry)

This is the POSTFIX version of the dependency evaluator. This code does not need to handle Before or After, as it is not valid to call this routine in this case. POSTFIX means all the math is done on top of the stack.

Parameters
DriverEntryDriverEntry element to update.
Return values
TRUEIf driver is ready to run.
FALSEIf driver is not ready to run or some fatal error was found.

Definition at line 168 of file Dependency.c.

Variable Documentation

◆ mDepexEvaluationStack

BOOLEAN* mDepexEvaluationStack = NULL

Definition at line 33 of file Dependency.c.

◆ mDepexEvaluationStackEnd

BOOLEAN* mDepexEvaluationStackEnd = NULL

Definition at line 34 of file Dependency.c.

◆ mDepexEvaluationStackPointer

BOOLEAN* mDepexEvaluationStackPointer = NULL

Definition at line 35 of file Dependency.c.