Fix issue with CodeSourcery gcc requiring assembly functions to have a .type define inorder to support interworking (calling from thumb(C code) to ARM code (hadn written assembly). We had to add a macro as the .type directive is not supported, or needed, by Xcode. All ARM .S files need to be updated.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11167 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		@@ -110,6 +110,20 @@ typedef INT32   INTN;
 | 
				
			|||||||
  /// Define this macro to unify the usage.
 | 
					  /// Define this macro to unify the usage.
 | 
				
			||||||
  ///
 | 
					  ///
 | 
				
			||||||
  #define ASM_GLOBAL .globl
 | 
					  #define ASM_GLOBAL .globl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  #if !defined(__APPLE__)
 | 
				
			||||||
 | 
					    ///
 | 
				
			||||||
 | 
					    /// ARM EABI defines that the linker should not manipulate call relocations
 | 
				
			||||||
 | 
					    /// (do bl/blx conversion) unless the target symbol has function type.
 | 
				
			||||||
 | 
					    /// CodeSourcery 2010.09 started requiring the .type to function properly
 | 
				
			||||||
 | 
					    ///
 | 
				
			||||||
 | 
					    #define INTERWORK_FUNC(func__)   .type ASM_PFX(func__), %function
 | 
				
			||||||
 | 
					  #else
 | 
				
			||||||
 | 
					    //
 | 
				
			||||||
 | 
					    // .type not supported by Apple Xcode tools 
 | 
				
			||||||
 | 
					    //
 | 
				
			||||||
 | 
					    #define INTERWORK_FUNC(func__)
 | 
				
			||||||
 | 
					  #endif
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
.text
 | 
					.text
 | 
				
			||||||
.p2align 2
 | 
					.p2align 2
 | 
				
			||||||
.globl ASM_PFX(CpuFlushTlb)
 | 
					.globl ASM_PFX(CpuFlushTlb)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(CpuFlushTlb)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#/**
 | 
					#/**
 | 
				
			||||||
#  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
 | 
					#  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
.text
 | 
					.text
 | 
				
			||||||
.p2align 2
 | 
					.p2align 2
 | 
				
			||||||
.globl ASM_PFX(CpuSleep)
 | 
					.globl ASM_PFX(CpuSleep)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(CpuSleep)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#/**
 | 
					#/**
 | 
				
			||||||
#  Places the CPU in a sleep state until an interrupt is received.
 | 
					#  Places the CPU in a sleep state until an interrupt is received.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
.text
 | 
					.text
 | 
				
			||||||
.p2align 2
 | 
					.p2align 2
 | 
				
			||||||
.globl ASM_PFX(CpuBreakpoint)
 | 
					.globl ASM_PFX(CpuBreakpoint)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(CpuBreakpoint)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#/**
 | 
					#/**
 | 
				
			||||||
#  Generates a breakpoint on the CPU.
 | 
					#  Generates a breakpoint on the CPU.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
.text
 | 
					.text
 | 
				
			||||||
.p2align 2
 | 
					.p2align 2
 | 
				
			||||||
.globl ASM_PFX(DisableInterrupts)
 | 
					.globl ASM_PFX(DisableInterrupts)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(DisableInterrupts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#/**
 | 
					#/**
 | 
				
			||||||
#  Disables CPU interrupts.
 | 
					#  Disables CPU interrupts.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
.text
 | 
					.text
 | 
				
			||||||
.p2align 2
 | 
					.p2align 2
 | 
				
			||||||
.globl ASM_PFX(EnableInterrupts)
 | 
					.globl ASM_PFX(EnableInterrupts)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(EnableInterrupts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#/**
 | 
					#/**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
.text
 | 
					.text
 | 
				
			||||||
.p2align 2
 | 
					.p2align 2
 | 
				
			||||||
.globl _GetInterruptState
 | 
					.globl ASM_PFX(GetInterruptState)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(GetInterruptState)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#/**
 | 
					#/**
 | 
				
			||||||
#  Retrieves the current CPU interrupt state.
 | 
					#  Retrieves the current CPU interrupt state.
 | 
				
			||||||
@@ -35,7 +36,7 @@
 | 
				
			|||||||
#  VOID
 | 
					#  VOID
 | 
				
			||||||
# );
 | 
					# );
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
_GetInterruptState:
 | 
					ASM_PFX(GetInterruptState):
 | 
				
			||||||
    mrs    R0, CPSR
 | 
					    mrs    R0, CPSR
 | 
				
			||||||
    tst    R0, #0x80  @Check if IRQ is enabled.
 | 
					    tst    R0, #0x80  @Check if IRQ is enabled.
 | 
				
			||||||
    moveq  R0, #1
 | 
					    moveq  R0, #1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,6 +20,8 @@
 | 
				
			|||||||
	.text
 | 
						.text
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathLShiftU64)
 | 
						.globl ASM_PFX(InternalMathLShiftU64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathLShiftU64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathLShiftU64):
 | 
					ASM_PFX(InternalMathLShiftU64):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6}
 | 
						stmfd	sp!, {r4, r5, r6}
 | 
				
			||||||
	mov	r6, r1
 | 
						mov	r6, r1
 | 
				
			||||||
@@ -37,6 +39,8 @@ ASM_PFX(InternalMathLShiftU64):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathRShiftU64)
 | 
						.globl ASM_PFX(InternalMathRShiftU64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathRShiftU64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathRShiftU64):
 | 
					ASM_PFX(InternalMathRShiftU64):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6}
 | 
						stmfd	sp!, {r4, r5, r6}
 | 
				
			||||||
	mov	r5, r0
 | 
						mov	r5, r0
 | 
				
			||||||
@@ -54,6 +58,8 @@ ASM_PFX(InternalMathRShiftU64):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathARShiftU64)
 | 
						.globl ASM_PFX(InternalMathARShiftU64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathARShiftU64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathARShiftU64):
 | 
					ASM_PFX(InternalMathARShiftU64):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6}
 | 
						stmfd	sp!, {r4, r5, r6}
 | 
				
			||||||
	mov	r5, r0
 | 
						mov	r5, r0
 | 
				
			||||||
@@ -71,6 +77,8 @@ ASM_PFX(InternalMathARShiftU64):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathLRotU64)
 | 
						.globl ASM_PFX(InternalMathLRotU64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathLRotU64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathLRotU64):
 | 
					ASM_PFX(InternalMathLRotU64):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
						stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
				
			||||||
	add	r7, sp, #12
 | 
						add	r7, sp, #12
 | 
				
			||||||
@@ -96,6 +104,8 @@ ASM_PFX(InternalMathLRotU64):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathRRotU64)
 | 
						.globl ASM_PFX(InternalMathRRotU64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathRRotU64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathRRotU64):
 | 
					ASM_PFX(InternalMathRRotU64):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
						stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
				
			||||||
	add	r7, sp, #12
 | 
						add	r7, sp, #12
 | 
				
			||||||
@@ -120,6 +130,8 @@ ASM_PFX(InternalMathRRotU64):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathMultU64x32)
 | 
						.globl ASM_PFX(InternalMathMultU64x32)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathMultU64x32)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathMultU64x32):
 | 
					ASM_PFX(InternalMathMultU64x32):
 | 
				
			||||||
	stmfd	sp!, {r7, lr}
 | 
						stmfd	sp!, {r7, lr}
 | 
				
			||||||
	add	r7, sp, #0
 | 
						add	r7, sp, #0
 | 
				
			||||||
@@ -133,6 +145,8 @@ ASM_PFX(InternalMathMultU64x32):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathMultU64x64)
 | 
						.globl ASM_PFX(InternalMathMultU64x64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathMultU64x64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathMultU64x64):
 | 
					ASM_PFX(InternalMathMultU64x64):
 | 
				
			||||||
	stmfd	sp!, {r7, lr}
 | 
						stmfd	sp!, {r7, lr}
 | 
				
			||||||
	add	r7, sp, #0
 | 
						add	r7, sp, #0
 | 
				
			||||||
@@ -145,6 +159,8 @@ ASM_PFX(InternalMathMultU64x64):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathDivU64x32)
 | 
						.globl ASM_PFX(InternalMathDivU64x32)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathDivU64x32)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathDivU64x32):
 | 
					ASM_PFX(InternalMathDivU64x32):
 | 
				
			||||||
	stmfd	sp!, {r7, lr}
 | 
						stmfd	sp!, {r7, lr}
 | 
				
			||||||
	add	r7, sp, #0
 | 
						add	r7, sp, #0
 | 
				
			||||||
@@ -155,6 +171,8 @@ ASM_PFX(InternalMathDivU64x32):
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathModU64x32)
 | 
						.globl ASM_PFX(InternalMathModU64x32)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathModU64x32)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathModU64x32):
 | 
					ASM_PFX(InternalMathModU64x32):
 | 
				
			||||||
	stmfd	sp!, {r7, lr}
 | 
						stmfd	sp!, {r7, lr}
 | 
				
			||||||
	add	r7, sp, #0
 | 
						add	r7, sp, #0
 | 
				
			||||||
@@ -165,6 +183,8 @@ ASM_PFX(InternalMathModU64x32):
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathDivRemU64x32)
 | 
						.globl ASM_PFX(InternalMathDivRemU64x32)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathDivRemU64x32)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathDivRemU64x32):
 | 
					ASM_PFX(InternalMathDivRemU64x32):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
						stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
				
			||||||
	add	r7, sp, #12
 | 
						add	r7, sp, #12
 | 
				
			||||||
@@ -192,6 +212,8 @@ L22:
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathDivRemU64x64)
 | 
						.globl ASM_PFX(InternalMathDivRemU64x64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathDivRemU64x64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathDivRemU64x64):
 | 
					ASM_PFX(InternalMathDivRemU64x64):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
						stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
				
			||||||
	add	r7, sp, #12
 | 
						add	r7, sp, #12
 | 
				
			||||||
@@ -217,6 +239,8 @@ L26:
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathDivRemS64x64)
 | 
						.globl ASM_PFX(InternalMathDivRemS64x64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathDivRemS64x64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathDivRemS64x64):
 | 
					ASM_PFX(InternalMathDivRemS64x64):
 | 
				
			||||||
	stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
						stmfd	sp!, {r4, r5, r6, r7, lr}
 | 
				
			||||||
	add	r7, sp, #12
 | 
						add	r7, sp, #12
 | 
				
			||||||
@@ -242,6 +266,8 @@ L30:
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	.align 2
 | 
						.align 2
 | 
				
			||||||
	.globl ASM_PFX(InternalMathSwapBytes64)
 | 
						.globl ASM_PFX(InternalMathSwapBytes64)
 | 
				
			||||||
 | 
						INTERWORK_FUNC(InternalMathSwapBytes64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ASM_PFX(InternalMathSwapBytes64):
 | 
					ASM_PFX(InternalMathSwapBytes64):
 | 
				
			||||||
	@ args = 0, pretend = 0, frame = 0
 | 
						@ args = 0, pretend = 0, frame = 0
 | 
				
			||||||
	@ frame_needed = 1, uses_anonymous_args = 0
 | 
						@ frame_needed = 1, uses_anonymous_args = 0
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,10 @@
 | 
				
			|||||||
.p2align 2
 | 
					.p2align 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.globl ASM_PFX(SetJump)
 | 
					.globl ASM_PFX(SetJump)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(SetJump)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.globl ASM_PFX(InternalLongJump)
 | 
					.globl ASM_PFX(InternalLongJump)
 | 
				
			||||||
 | 
					INTERWORK_FUNC(InternalLongJump)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#/**
 | 
					#/**
 | 
				
			||||||
#  Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#
 | 
					#  Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user