PI Enable:

1) The entry point of PeiCore has been changed to EFI_PEI_CORE_ENTRY_POINT defined in PI. 
2) Nt32, Tiger and lakeport platform's SecCore has been updated.
3) Autogen tools also has been updated.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3804 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2
2007-09-12 09:52:37 +00:00
parent 2303536ca1
commit 5aae0aa7d8
12 changed files with 296 additions and 46 deletions

View File

@@ -31,7 +31,7 @@ TransferOldDataToNewDataRange (
EFI_STATUS
PeiDispatcher (
IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
IN PEI_CORE_INSTANCE *PrivateData,
IN PEI_CORE_DISPATCH_DATA *DispatchData
)
@@ -44,7 +44,9 @@ Routine Description:
Arguments:
PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR
SecCoreData - Points to a data structure containing information about the PEI core's operating
environment, such as the size and location of temporary RAM, the stack location and
the BFV location.
PrivateData - Pointer to the private data passed in from caller
DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.
@@ -214,7 +216,8 @@ Returns:
PeiSwitchStacks (
(SWITCH_STACK_ENTRY_POINT)(UINTN)TempPtr.Raw,
PeiStartupDescriptor,
(VOID*) SecCoreData,
NULL,
(VOID*)PrivateDataInMem,
TopOfStack,
(VOID*)(UINTN)PrivateData->StackBase
@@ -360,7 +363,7 @@ VOID
InitializeDispatcherData (
IN EFI_PEI_SERVICES **PeiServices,
IN PEI_CORE_INSTANCE *OldCoreData,
IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData
)
/*++
@@ -373,7 +376,9 @@ Arguments:
PeiServices - The PEI core services table.
OldCoreData - Pointer to old core data (before switching stack).
NULL if being run in non-permament memory mode.
PeiStartupDescriptor - Information and services provided by SEC phase.
SecCoreData - Points to a data structure containing information about the PEI core's operating
environment, such as the size and location of temporary RAM, the stack location and
the BFV location.
Returns:
@@ -386,8 +391,8 @@ Returns:
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
if (OldCoreData == NULL) {
PrivateData->DispatchData.CurrentFvAddress = (EFI_FIRMWARE_VOLUME_HEADER *) PeiStartupDescriptor->BootFirmwareVolume;
PrivateData->DispatchData.BootFvAddress = (EFI_FIRMWARE_VOLUME_HEADER *) PeiStartupDescriptor->BootFirmwareVolume;
PrivateData->DispatchData.CurrentFvAddress = (EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase;
PrivateData->DispatchData.BootFvAddress = (EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase;
} else {
//

View File

@@ -47,9 +47,33 @@ PeiSwitchStacks (
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
IN VOID *Context1, OPTIONAL
IN VOID *Context2, OPTIONAL
IN VOID *Context3, OPTIONAL
IN VOID *NewStack,
IN VOID *NewBsp
)
{
SwitchStack (EntryPoint, Context1, Context2, NewStack);
BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
ASSERT (EntryPoint != NULL);
ASSERT (NewStack != NULL);
//
// Stack should be aligned with CPU_STACK_ALIGNMENT
//
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
JumpBuffer.Eip = (UINTN)EntryPoint;
JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2) + sizeof(Context3);
((VOID**)JumpBuffer.Esp)[1] = Context1;
((VOID**)JumpBuffer.Esp)[2] = Context2;
((VOID**)JumpBuffer.Esp)[3] = Context3;
LongJump (&JumpBuffer, (UINTN)-1);
//
// InternalSwitchStack () will never return
//
ASSERT (FALSE);
}