1. Removed AsmSwitchStackAndBackingStore from BaseLib.h
2. Modified SwitchStack definition update to MWG 0.60e. 3. Added BaseLib/Ipf/InternalSwitchStack.c and removed BaseLib/Ipf/Non-existing.c 4. Updated any references of AsmSwitchStackAndBackingStore to SwichStack on IPF. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2499 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -499,7 +499,7 @@
|
||||
<Filename SupArchList="IPF">Ipf/CpuPause.s</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/CpuFlushTlb.s</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/GetInterruptState.s</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/Non-existing.c</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/InternalSwitchStack.c</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/FlushCacheRange.s</Filename>
|
||||
<Filename SupArchList="IPF">Ipf/ReadItc.s</Filename>
|
||||
|
||||
|
@@ -314,10 +314,16 @@ InternalMathDivRemS64x64 (
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
Transfers control to the function specified by EntryPoint using the new stack
|
||||
specified by NewStack and passing in the parameters specified by Context1 and
|
||||
Context2. Context1 and Context2 are optional and may be NULL. The function
|
||||
EntryPoint must never return.
|
||||
Transfers control to the function specified by EntryPoint using the
|
||||
new stack specified by NewStack and passing in the parameters specified
|
||||
by Context1 and Context2. Context1 and Context2 are optional and may
|
||||
be NULL. The function EntryPoint must never return.
|
||||
Marker will be ignored on IA-32, x64, and EBC.
|
||||
IPF CPUs expect one additional parameter of type VOID * that specifies
|
||||
the new backing store pointer.
|
||||
|
||||
If EntryPoint is NULL, then ASSERT().
|
||||
If NewStack is NULL, then ASSERT().
|
||||
|
||||
@param EntryPoint A pointer to function to call with the new stack.
|
||||
@param Context1 A pointer to the context to pass into the EntryPoint
|
||||
@@ -326,15 +332,17 @@ InternalMathDivRemS64x64 (
|
||||
function.
|
||||
@param NewStack A pointer to the new stack to use for the EntryPoint
|
||||
function.
|
||||
@param Marker VA_LIST marker for the variable argument list.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalSwitchStack (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1,
|
||||
IN VOID *Context2,
|
||||
IN VOID *NewStack
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack,
|
||||
IN VA_LIST Marker
|
||||
);
|
||||
|
||||
//
|
||||
@@ -656,9 +664,9 @@ InternalSyncDecrement (
|
||||
Performs an atomic compare exchange operation on a 32-bit unsigned integer.
|
||||
|
||||
Performs an atomic compare exchange operation on the 32-bit unsigned integer
|
||||
specified by Value. If Value is equal to CompareValue, then Value is set to
|
||||
specified by Value. If Value is equal to CompareValue, then Value is set to
|
||||
ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
|
||||
then Value is returned. The compare exchange operation must be performed using
|
||||
then Value is returned. The compare exchange operation must be performed using
|
||||
MP safe mechanisms.
|
||||
|
||||
@param Value A pointer to the 32-bit value for the compare exchange
|
||||
@@ -680,9 +688,9 @@ InternalSyncCompareExchange32 (
|
||||
/**
|
||||
Performs an atomic compare exchange operation on a 64-bit unsigned integer.
|
||||
|
||||
Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
|
||||
by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
|
||||
CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
|
||||
Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
|
||||
by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
|
||||
CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
|
||||
The compare exchange operation must be performed using MP safe mechanisms.
|
||||
|
||||
@param Value A pointer to the 64-bit value for the compare exchange
|
||||
@@ -721,7 +729,7 @@ BitFieldReadUint (
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that reads a bit field from Operand, performs a bitwise OR,
|
||||
Worker function that reads a bit field from Operand, performs a bitwise OR,
|
||||
and returns the result.
|
||||
|
||||
Performs a bitwise OR between the bit field specified by StartBit and EndBit
|
||||
@@ -745,7 +753,7 @@ BitFieldOrUint (
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that reads a bit field from Operand, performs a bitwise AND,
|
||||
Worker function that reads a bit field from Operand, performs a bitwise AND,
|
||||
and returns the result.
|
||||
|
||||
Performs a bitwise AND between the bit field specified by StartBit and EndBit
|
||||
@@ -784,6 +792,7 @@ InternalAssertJumpBuffer (
|
||||
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Restores the CPU context that was saved with SetJump().
|
||||
|
||||
@@ -802,4 +811,41 @@ InternalLongJump (
|
||||
IN UINTN Value
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// IPF specific functions
|
||||
//
|
||||
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
Transfers control to the function specified by EntryPoint using the new stack
|
||||
specified by NewStack and passing in the parameters specified by Context1 and
|
||||
Context2. Context1 and Context2 are optional and may be NULL. The function
|
||||
EntryPoint must never return.
|
||||
|
||||
If EntryPoint is NULL, then ASSERT().
|
||||
If NewStack is NULL, then ASSERT().
|
||||
|
||||
@param EntryPoint A pointer to function to call with the new stack.
|
||||
@param Context1 A pointer to the context to pass into the EntryPoint
|
||||
function.
|
||||
@param Context2 A pointer to the context to pass into the EntryPoint
|
||||
function.
|
||||
@param NewStack A pointer to the new stack to use for the EntryPoint
|
||||
function.
|
||||
@param NewBsp A pointer to the new memory location for RSE backing
|
||||
store.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
AsmSwitchStackAndBackingStore (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack,
|
||||
IN VOID *NewBsp
|
||||
);
|
||||
|
||||
#endif
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Switch Stack functions.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation<BR>
|
||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -17,10 +17,13 @@
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
Transfers control to the function specified by EntryPoint using the new stack
|
||||
specified by NewStack and passing in the parameters specified by Context1 and
|
||||
Context2. Context1 and Context2 are optional and may be NULL. The function
|
||||
EntryPoint must never return.
|
||||
Transfers control to the function specified by EntryPoint using the
|
||||
new stack specified by NewStack and passing in the parameters specified
|
||||
by Context1 and Context2. Context1 and Context2 are optional and may
|
||||
be NULL. The function EntryPoint must never return.
|
||||
Marker will be ignored on IA-32, x64, and EBC.
|
||||
IPF CPUs expect one additional parameter of type VOID * that specifies
|
||||
the new backing store pointer.
|
||||
|
||||
If EntryPoint is NULL, then ASSERT().
|
||||
If NewStack is NULL, then ASSERT().
|
||||
@@ -32,21 +35,30 @@
|
||||
function.
|
||||
@param NewStack A pointer to the new stack to use for the EntryPoint
|
||||
function.
|
||||
@param Marker VA_LIST marker for the variable argument list.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalSwitchStack (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack,
|
||||
IN VA_LIST Marker
|
||||
)
|
||||
|
||||
{
|
||||
//
|
||||
// This version of this function does not actually change the stack pointer
|
||||
// This is to support compilation of CPU types that do not support assemblers
|
||||
// such as EBC
|
||||
//
|
||||
|
||||
//
|
||||
// Stack should be aligned with CPU_STACK_ALIGNMENT
|
||||
//
|
||||
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
||||
|
||||
EntryPoint (Context1, Context2);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
SwitchStack() function for IA-32.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation<BR>
|
||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -17,10 +17,16 @@
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
Transfers control to the function specified by EntryPoint using the new stack
|
||||
specified by NewStack and passing in the parameters specified by Context1 and
|
||||
Context2. Context1 and Context2 are optional and may be NULL. The function
|
||||
EntryPoint must never return.
|
||||
Transfers control to the function specified by EntryPoint using the
|
||||
new stack specified by NewStack and passing in the parameters specified
|
||||
by Context1 and Context2. Context1 and Context2 are optional and may
|
||||
be NULL. The function EntryPoint must never return.
|
||||
Marker will be ignored on IA-32, x64, and EBC.
|
||||
IPF CPUs expect one additional parameter of type VOID * that specifies
|
||||
the new backing store pointer.
|
||||
|
||||
If EntryPoint is NULL, then ASSERT().
|
||||
If NewStack is NULL, then ASSERT().
|
||||
|
||||
@param EntryPoint A pointer to function to call with the new stack.
|
||||
@param Context1 A pointer to the context to pass into the EntryPoint
|
||||
@@ -29,19 +35,26 @@
|
||||
function.
|
||||
@param NewStack A pointer to the new stack to use for the EntryPoint
|
||||
function.
|
||||
@param Marker VA_LIST marker for the variable argument list.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalSwitchStack (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1,
|
||||
IN VOID *Context2,
|
||||
IN VOID *NewStack
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack,
|
||||
IN VA_LIST Marker
|
||||
)
|
||||
{
|
||||
BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
|
||||
|
||||
//
|
||||
// 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);
|
||||
|
68
MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c
Normal file
68
MdePkg/Library/BaseLib/Ipf/InternalSwitchStack.c
Normal file
@@ -0,0 +1,68 @@
|
||||
/** @file
|
||||
SwitchStack() function for IPF.
|
||||
|
||||
Copyright (c) 2007, Intel Corporation<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name: InternalSwitchStack.c
|
||||
|
||||
**/
|
||||
|
||||
#include <BaseLibInternals.h>
|
||||
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
Transfers control to the function specified by EntryPoint using the
|
||||
new stack specified by NewStack and passing in the parameters specified
|
||||
by Context1 and Context2. Context1 and Context2 are optional and may
|
||||
be NULL. The function EntryPoint must never return.
|
||||
Marker will be ignored on IA-32, x64, and EBC.
|
||||
IPF CPUs expect one additional parameter of type VOID * that specifies
|
||||
the new backing store pointer.
|
||||
|
||||
If EntryPoint is NULL, then ASSERT().
|
||||
If NewStack is NULL, then ASSERT().
|
||||
|
||||
@param EntryPoint A pointer to function to call with the new stack.
|
||||
@param Context1 A pointer to the context to pass into the EntryPoint
|
||||
function.
|
||||
@param Context2 A pointer to the context to pass into the EntryPoint
|
||||
function.
|
||||
@param NewStack A pointer to the new stack to use for the EntryPoint
|
||||
function.
|
||||
@param Marker VA_LIST marker for the variable argument list.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalSwitchStack (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack,
|
||||
IN VA_LIST Marker
|
||||
)
|
||||
|
||||
{
|
||||
VOID *NewBsp;
|
||||
|
||||
//
|
||||
// Get new backing store pointer from variable list
|
||||
//
|
||||
NewBsp = VA_ARG (Marker, VOID *);
|
||||
|
||||
//
|
||||
// Stack should be aligned with CPU_STACK_ALIGNMENT
|
||||
//
|
||||
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
||||
ASSERT (((UINTN)NewBsp & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
||||
|
||||
AsmSwitchStackAndBackingStore (EntryPoint, Context1, Context2, NewStack, NewBsp);
|
||||
}
|
@@ -1,53 +0,0 @@
|
||||
/** @file
|
||||
Non-existing BaseLib functions on Ipf
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name: Non-existing.c
|
||||
|
||||
**/
|
||||
|
||||
#include "../BaseLibInternals.h"
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
Transfers control to the function specified by EntryPoint using the new stack
|
||||
specified by NewStack and passing in the parameters specified by Context1 and
|
||||
Context2. Context1 and Context2 are optional and may be NULL. The function
|
||||
EntryPoint must never return.
|
||||
|
||||
If EntryPoint is NULL, then ASSERT().
|
||||
If NewStack is NULL, then ASSERT().
|
||||
|
||||
@param EntryPoint A pointer to function to call with the new stack.
|
||||
@param Context1 A pointer to the context to pass into the EntryPoint
|
||||
function.
|
||||
@param Context2 A pointer to the context to pass into the EntryPoint
|
||||
function.
|
||||
@param NewStack A pointer to the new stack to use for the EntryPoint
|
||||
function.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalSwitchStack (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack
|
||||
)
|
||||
{
|
||||
//
|
||||
// This version of this function does not actually change the stack pointer
|
||||
// This is to support compilation of CPU types that do not support assemblers
|
||||
// such as EBC
|
||||
//
|
||||
ASSERT (FALSE);
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Switch Stack functions.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation<BR>
|
||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -19,14 +19,17 @@
|
||||
/**
|
||||
Transfers control to a function starting with a new stack.
|
||||
|
||||
Transfers control to the function specified by EntryPoint using the new stack
|
||||
specified by NewStack and passing in the parameters specified by Context1 and
|
||||
Context2. Context1 and Context2 are optional and may be NULL. The function
|
||||
EntryPoint must never return.
|
||||
Transfers control to the function specified by EntryPoint using the
|
||||
new stack specified by NewStack and passing in the parameters specified
|
||||
by Context1 and Context2. Context1 and Context2 are optional and may
|
||||
be NULL. The function EntryPoint must never return. This function
|
||||
supports a variable number of arguments following the NewStack parameter.
|
||||
These additional arguments are ignored on IA-32, x64, and EBC.
|
||||
IPF CPUs expect one additional parameter of type VOID * that specifies
|
||||
the new backing store pointer.
|
||||
|
||||
If EntryPoint is NULL, then ASSERT().
|
||||
If NewStack is NULL, then ASSERT().
|
||||
For IPF CPUs, if NewStack is not aligned on a 16-byte boundary, then ASSERT().
|
||||
|
||||
@param EntryPoint A pointer to function to call with the new stack.
|
||||
@param Context1 A pointer to the context to pass into the EntryPoint
|
||||
@@ -41,16 +44,19 @@ VOID
|
||||
EFIAPI
|
||||
SwitchStack (
|
||||
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||
IN VOID *Context1,
|
||||
IN VOID *Context2,
|
||||
IN VOID *NewStack
|
||||
IN VOID *Context1, OPTIONAL
|
||||
IN VOID *Context2, OPTIONAL
|
||||
IN VOID *NewStack,
|
||||
...
|
||||
)
|
||||
{
|
||||
VA_LIST Marker;
|
||||
|
||||
ASSERT (EntryPoint != NULL && NewStack != NULL);
|
||||
|
||||
#ifdef MDE_CPU_IPF
|
||||
ASSERT (((UINTN)NewStack & 0xf) == 0);
|
||||
#endif
|
||||
VA_START (Marker, NewStack);
|
||||
|
||||
InternalSwitchStack (EntryPoint, Context1, Context2, NewStack);
|
||||
InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);
|
||||
|
||||
VA_END (Marker);
|
||||
}
|
||||
|
Reference in New Issue
Block a user