Modified PeiServicesTablePointerLib.h to match the Spec, and sync the c files with it.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6991 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gikidy 2008-12-11 06:29:24 +00:00
parent 64d2df940c
commit 4b8157f93c
4 changed files with 58 additions and 18 deletions

View File

@ -16,10 +16,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define __PEI_SERVICES_TABLE_POINTER_LIB_H__ #define __PEI_SERVICES_TABLE_POINTER_LIB_H__
/** /**
The function returns the pointer to PEI services. Retrieves the cached value of the PEI Services Table pointer.
The function returns the pointer to PEI services. Returns the cached value of the PEI Services Table pointer in a CPU specific manner
It will ASSERT() if the pointer to PEI services is NULL. as specified in the CPU binding section of the Platform Initialization Pre-EFI
Initialization Core Interface Specification.
If the cached PEI Services Table pointer is NULL, then ASSERT().
@return The pointer to PeiServices. @return The pointer to PeiServices.
@ -31,8 +34,13 @@ GetPeiServicesTablePointer (
); );
/** /**
The function set the pointer of PEI services immediately preceding the IDT table Caches a pointer PEI Services Table.
according to PI specification.
Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
Pre-EFI Initialization Core Interface Specification.
If PeiServicesTablePointer is NULL, then ASSERT().
@param PeiServicesTablePointer The address of PeiServices pointer. @param PeiServicesTablePointer The address of PeiServices pointer.
**/ **/

View File

@ -22,8 +22,13 @@
CONST EFI_PEI_SERVICES **gPeiServices; CONST EFI_PEI_SERVICES **gPeiServices;
/** /**
The function set the pointer of PEI services immediately preceding the IDT table Caches a pointer PEI Services Table.
according to PI specification.
Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
Pre-EFI Initialization Core Interface Specification.
If PeiServicesTablePointer is NULL, then ASSERT().
@param PeiServicesTablePointer The address of PeiServices pointer. @param PeiServicesTablePointer The address of PeiServices pointer.
**/ **/
@ -33,16 +38,20 @@ SetPeiServicesTablePointer (
IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
) )
{ {
ASSERT (PeiServicesTablePointer != NULL);
gPeiServices = PeiServicesTablePointer; gPeiServices = PeiServicesTablePointer;
} }
/** /**
The function returns the pointer to PEI services. Retrieves the cached value of the PEI Services Table pointer.
The function returns the pointer to PEI services. Returns the cached value of the PEI Services Table pointer in a CPU specific manner
It will ASSERT() if the pointer to PEI services is NULL. as specified in the CPU binding section of the Platform Initialization Pre-EFI
Initialization Core Interface Specification.
If the cached PEI Services Table pointer is NULL, then ASSERT().
@retval The pointer to PeiServices. @return The pointer to PeiServices.
**/ **/
CONST EFI_PEI_SERVICES ** CONST EFI_PEI_SERVICES **

View File

@ -22,12 +22,15 @@
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
/** /**
The function returns the pointer to PEI services. Retrieves the cached value of the PEI Services Table pointer.
The function returns the pointer to PEI services. Returns the cached value of the PEI Services Table pointer in a CPU specific manner
It will ASSERT() if the pointer to PEI services is NULL. as specified in the CPU binding section of the Platform Initialization Pre-EFI
Initialization Core Interface Specification.
If the cached PEI Services Table pointer is NULL, then ASSERT().
@retval The pointer to PeiServices. @return The pointer to PeiServices.
**/ **/
CONST EFI_PEI_SERVICES ** CONST EFI_PEI_SERVICES **
@ -46,9 +49,16 @@ GetPeiServicesTablePointer (
} }
/** /**
Caches a pointer PEI Services Table.
Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
Pre-EFI Initialization Core Interface Specification.
The function set the pointer of PEI services immediately preceding the IDT table The function set the pointer of PEI services immediately preceding the IDT table
according to PI specification. according to PI specification.
If PeiServicesTablePointer is NULL, then ASSERT().
@param PeiServicesTablePointer The address of PeiServices pointer. @param PeiServicesTablePointer The address of PeiServices pointer.
**/ **/
VOID VOID
@ -59,6 +69,7 @@ SetPeiServicesTablePointer (
{ {
IA32_DESCRIPTOR Idtr; IA32_DESCRIPTOR Idtr;
ASSERT (PeiServicesTablePointer != NULL);
AsmReadIdtr (&Idtr); AsmReadIdtr (&Idtr);
(*(UINTN*)(Idtr.Base - sizeof (UINTN))) = (UINTN)PeiServicesTablePointer; (*(UINTN*)(Idtr.Base - sizeof (UINTN))) = (UINTN)PeiServicesTablePointer;
} }

View File

@ -18,10 +18,13 @@
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
/** /**
The function returns the pointer to PEI services. Retrieves the cached value of the PEI Services Table pointer.
The function returns the pointer to PEI services. Returns the cached value of the PEI Services Table pointer in a CPU specific manner
It will ASSERT() if the pointer to PEI services is NULL. as specified in the CPU binding section of the Platform Initialization Pre-EFI
Initialization Core Interface Specification.
If the cached PEI Services Table pointer is NULL, then ASSERT().
@return The pointer to PeiServices. @return The pointer to PeiServices.
@ -39,10 +42,18 @@ GetPeiServicesTablePointer (
return PeiServices; return PeiServices;
} }
/** /**
Caches a pointer PEI Services Table.
Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
Pre-EFI Initialization Core Interface Specification.
The function set the pointer of PEI services in KR7 register The function set the pointer of PEI services in KR7 register
according to PI specification. according to PI specification.
If PeiServicesTablePointer is NULL, then ASSERT().
@param PeiServicesTablePointer The address of PeiServices pointer. @param PeiServicesTablePointer The address of PeiServices pointer.
**/ **/
VOID VOID
@ -51,6 +62,7 @@ SetPeiServicesTablePointer (
IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
) )
{ {
ASSERT (PeiServicesTablePointer != NULL);
AsmWriteKr7 ((UINT64)(UINTN)PeiServicesTablePointer); AsmWriteKr7 ((UINT64)(UINTN)PeiServicesTablePointer);
} }