mirror of https://github.com/acidanthera/audk.git
Fix file headers
Move stack alignment check from CPU specific files into common SwitchStack() function and add VA_END() to SwitchStack(). Fix incorrect syntax for ASM_FUNCTION_REMOVE_IF_UNREFERENCED git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9193 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2bd1edf456
commit
7f22d35110
|
@ -3,7 +3,7 @@
|
||||||
# CpuBreakpoint() for ARM
|
# CpuBreakpoint() for ARM
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
# Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
# Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; CpuBreakpoint() for ARM
|
; CpuBreakpoint() for ARM
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
; Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
; Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; 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
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; CpuPause() for ARM
|
; CpuPause() for ARM
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
; Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
; Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; 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
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# DisableInterrupts() for ARM
|
# DisableInterrupts() for ARM
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
# Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
# Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; DisableInterrupts() for ARM
|
; DisableInterrupts() for ARM
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
; Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
; Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; 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
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# EnableInterrupts() for ARM
|
# EnableInterrupts() for ARM
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
# Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
# Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; EnableInterrupts() for ARM
|
; EnableInterrupts() for ARM
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
; Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
; Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; 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
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
GCC inline implementation of BaseLib processor specific functions.
|
GCC inline implementation of BaseLib processor specific functions.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# GetInterruptState() function for ARM
|
# GetInterruptState() function for ARM
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
# Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
# Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; GetInterruptState() function for ARM
|
; GetInterruptState() function for ARM
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
; Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
; Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; 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
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
SwitchStack() function for ARM.
|
SwitchStack() function for ARM.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -15,6 +15,16 @@
|
||||||
|
|
||||||
#include "BaseLibInternals.h"
|
#include "BaseLibInternals.h"
|
||||||
|
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
InternalSwitchStackAsm (
|
||||||
|
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
|
||||||
|
IN VOID *Context1, OPTIONAL
|
||||||
|
IN VOID *Context2, OPTIONAL
|
||||||
|
IN VOID *NewStack
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Transfers control to a function starting with a new stack.
|
Transfers control to a function starting with a new stack.
|
||||||
|
|
||||||
|
@ -50,10 +60,5 @@ InternalSwitchStack (
|
||||||
)
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// Stack should be aligned with CPU_STACK_ALIGNMENT
|
|
||||||
//
|
|
||||||
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
|
||||||
|
|
||||||
InternalSwitchStackAsm (EntryPoint, Context1, Context2, NewStack);
|
InternalSwitchStackAsm (EntryPoint, Context1, Context2, NewStack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
# Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
# Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
# Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -67,4 +67,4 @@ ASM_PFX(InternalLongJump):
|
||||||
mov r0, r1
|
mov r0, r1
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
ASM_FUNCTION_REMOVE_IF_UNREFERENCED()
|
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
; Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
; Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; 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
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
; Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
; Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
; Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; 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
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
volatile was added to work around optimization issues.
|
volatile was added to work around optimization issues.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
Copyright (c) 2006 - 2009, Intel Corporation<BR>
|
||||||
Portions Copyright (c) 2008-2009 Apple Inc.<BR>
|
Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Base Library implementation.
|
# Base Library implementation.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2009, Intel Corporation.<BR>
|
# Copyright (c) 2007 - 2009, Intel Corporation.<BR>
|
||||||
# Portions Copyright (c) 2008-2009 Apple Inc.<BR>
|
# Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -600,6 +600,7 @@
|
||||||
Arm/GccInline.c | GCC
|
Arm/GccInline.c | GCC
|
||||||
Arm/EnableInterrupts.S | GCC
|
Arm/EnableInterrupts.S | GCC
|
||||||
Arm/DisableInterrupts.S | GCC
|
Arm/DisableInterrupts.S | GCC
|
||||||
|
Arm/GetInterruptsState.S | GCC
|
||||||
Arm/SetJumpLongJump.S | GCC
|
Arm/SetJumpLongJump.S | GCC
|
||||||
Arm/CpuBreakpoint.S | GCC
|
Arm/CpuBreakpoint.S | GCC
|
||||||
|
|
||||||
|
|
|
@ -54,11 +54,5 @@ InternalSwitchStack (
|
||||||
// This is to support compilation of CPU types that do not support assemblers
|
// This is to support compilation of CPU types that do not support assemblers
|
||||||
// such as EBC
|
// such as EBC
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
|
||||||
// Stack should be aligned with CPU_STACK_ALIGNMENT
|
|
||||||
//
|
|
||||||
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
|
||||||
|
|
||||||
EntryPoint (Context1, Context2);
|
EntryPoint (Context1, Context2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
GCC inline implementation of BaseLib processor specific functions.
|
GCC inline implementation of BaseLib processor specific functions.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
|
@ -50,11 +50,6 @@ InternalSwitchStack (
|
||||||
{
|
{
|
||||||
BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
|
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.Eip = (UINTN)EntryPoint;
|
||||||
JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
|
JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
|
||||||
JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);
|
JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);
|
||||||
|
|
|
@ -57,9 +57,8 @@ InternalSwitchStack (
|
||||||
NewBsp = VA_ARG (Marker, VOID *);
|
NewBsp = VA_ARG (Marker, VOID *);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Stack should be aligned with CPU_STACK_ALIGNMENT
|
// New backing store pointer should be aligned with CPU_STACK_ALIGNMENT
|
||||||
//
|
//
|
||||||
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
|
||||||
ASSERT (((UINTN)NewBsp & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
ASSERT (((UINTN)NewBsp & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
||||||
|
|
||||||
AsmSwitchStackAndBackingStore (EntryPoint, Context1, Context2, NewStack, NewBsp);
|
AsmSwitchStackAndBackingStore (EntryPoint, Context1, Context2, NewStack, NewBsp);
|
||||||
|
|
|
@ -58,10 +58,17 @@ SwitchStack (
|
||||||
ASSERT (EntryPoint != NULL);
|
ASSERT (EntryPoint != NULL);
|
||||||
ASSERT (NewStack != NULL);
|
ASSERT (NewStack != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// New stack must be aligned with CPU_STACK_ALIGNMENT
|
||||||
|
//
|
||||||
|
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
|
||||||
|
|
||||||
VA_START (Marker, NewStack);
|
VA_START (Marker, NewStack);
|
||||||
|
|
||||||
InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);
|
InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);
|
||||||
|
|
||||||
|
VA_END (Marker);
|
||||||
|
|
||||||
//
|
//
|
||||||
// InternalSwitchStack () will never return
|
// InternalSwitchStack () will never return
|
||||||
//
|
//
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
GCC inline implementation of BaseLib processor specific functions.
|
GCC inline implementation of BaseLib processor specific functions.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
Portions copyright (c) 2008-2009 Apple Inc.<BR>
|
Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
Loading…
Reference in New Issue