git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11289
6f19259b-4bc3-4df7-8a09-
765794883524
/// CodeSourcery 2010.09 started requiring the .type to function properly\r
///\r
#define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function\r
/// CodeSourcery 2010.09 started requiring the .type to function properly\r
///\r
#define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function\r
+\r
+ #define GCC_ASM_EXPORT(func__) \\r
+ .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\\r
+ .type ASM_PFX(func__), %function \r
+\r
+ #define GCC_ASM_IMPORT(func__) \\r
+ .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)\r
+ \r
#else\r
//\r
// .type not supported by Apple Xcode tools \r
//\r
#else\r
//\r
// .type not supported by Apple Xcode tools \r
//\r
- #define INTERWORK_FUNC(func__)\r
+ #define INTERWORK_FUNC(func__) \r
+\r
+ #define GCC_ASM_EXPORT(func__) \\r
+ .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \\r
+ \r
+ #define GCC_ASM_IMPORT(name) \\r
+ .extern _CONCATENATE (__USER_LABEL_PREFIX__, name)\r
+\r
#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)\r
\r
#endif\r
#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)\r
\r
#endif\r
-.globl ASM_PFX(CpuFlushTlb)\r
-INTERWORK_FUNC(CpuFlushTlb)
+GCC_ASM_EXPORT(CpuFlushTlb)\r
\r
#/**\r
# Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
\r
#/**\r
# Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
-.globl ASM_PFX(CpuSleep)\r
-INTERWORK_FUNC(CpuSleep)
+GCC_ASM_EXPORT(CpuSleep)\r
\r
#/**\r
# Places the CPU in a sleep state until an interrupt is received.\r
\r
#/**\r
# Places the CPU in a sleep state until an interrupt is received.\r
-.globl ASM_PFX(CpuBreakpoint)\r
-INTERWORK_FUNC(CpuBreakpoint)
+GCC_ASM_EXPORT(CpuBreakpoint)\r
\r
#/**\r
# Generates a breakpoint on the CPU.\r
\r
#/**\r
# Generates a breakpoint on the CPU.\r
-.globl ASM_PFX(DisableInterrupts)\r
-INTERWORK_FUNC(DisableInterrupts)
+GCC_ASM_EXPORT(DisableInterrupts)\r
\r
#/**\r
# Disables CPU interrupts.\r
\r
#/**\r
# Disables CPU interrupts.\r
-.globl ASM_PFX(EnableInterrupts)\r
-INTERWORK_FUNC(EnableInterrupts)
+GCC_ASM_EXPORT(EnableInterrupts)\r
-.globl ASM_PFX(GetInterruptState)\r
-INTERWORK_FUNC(GetInterruptState)
+GCC_ASM_EXPORT (GetInterruptState)\r
\r
#/**\r
# Retrieves the current CPU interrupt state.\r
\r
#/**\r
# Retrieves the current CPU interrupt state.\r
- .globl ASM_PFX(InternalMathLShiftU64)
- INTERWORK_FUNC(InternalMathLShiftU64)
+ GCC_ASM_EXPORT(InternalMathLShiftU64)
ASM_PFX(InternalMathLShiftU64):
stmfd sp!, {r4, r5, r6}
ASM_PFX(InternalMathLShiftU64):
stmfd sp!, {r4, r5, r6}
- .globl ASM_PFX(InternalMathRShiftU64)
- INTERWORK_FUNC(InternalMathRShiftU64)
+ GCC_ASM_EXPORT(InternalMathRShiftU64)
ASM_PFX(InternalMathRShiftU64):
stmfd sp!, {r4, r5, r6}
ASM_PFX(InternalMathRShiftU64):
stmfd sp!, {r4, r5, r6}
- .globl ASM_PFX(InternalMathARShiftU64)
- INTERWORK_FUNC(InternalMathARShiftU64)
+ GCC_ASM_EXPORT(InternalMathARShiftU64)
ASM_PFX(InternalMathARShiftU64):
stmfd sp!, {r4, r5, r6}
ASM_PFX(InternalMathARShiftU64):
stmfd sp!, {r4, r5, r6}
- .globl ASM_PFX(InternalMathLRotU64)
- INTERWORK_FUNC(InternalMathLRotU64)
+ GCC_ASM_EXPORT(InternalMathLRotU64)
ASM_PFX(InternalMathLRotU64):
stmfd sp!, {r4, r5, r6, r7, lr}
ASM_PFX(InternalMathLRotU64):
stmfd sp!, {r4, r5, r6, r7, lr}
- .globl ASM_PFX(InternalMathRRotU64)
- INTERWORK_FUNC(InternalMathRRotU64)
+ GCC_ASM_EXPORT(InternalMathRRotU64)
ASM_PFX(InternalMathRRotU64):
stmfd sp!, {r4, r5, r6, r7, lr}
ASM_PFX(InternalMathRRotU64):
stmfd sp!, {r4, r5, r6, r7, lr}
ldmfd sp!, {r4, r5, r6, r7, pc}
.align 2
ldmfd sp!, {r4, r5, r6, r7, pc}
.align 2
- .globl ASM_PFX(InternalMathMultU64x32)
- INTERWORK_FUNC(InternalMathMultU64x32)
+ GCC_ASM_EXPORT(InternalMathMultU64x32)
ASM_PFX(InternalMathMultU64x32):
stmfd sp!, {r7, lr}
ASM_PFX(InternalMathMultU64x32):
stmfd sp!, {r7, lr}
ldmfd sp!, {r7, pc}
.align 2
ldmfd sp!, {r7, pc}
.align 2
- .globl ASM_PFX(InternalMathMultU64x64)
- INTERWORK_FUNC(InternalMathMultU64x64)
+ GCC_ASM_EXPORT(InternalMathMultU64x64)
ASM_PFX(InternalMathMultU64x64):
stmfd sp!, {r7, lr}
ASM_PFX(InternalMathMultU64x64):
stmfd sp!, {r7, lr}
ldmfd sp!, {r7, pc}
.align 2
ldmfd sp!, {r7, pc}
.align 2
- .globl ASM_PFX(InternalMathDivU64x32)
- INTERWORK_FUNC(InternalMathDivU64x32)
+ GCC_ASM_EXPORT(InternalMathDivU64x32)
ASM_PFX(InternalMathDivU64x32):
stmfd sp!, {r7, lr}
ASM_PFX(InternalMathDivU64x32):
stmfd sp!, {r7, lr}
- .globl ASM_PFX(InternalMathModU64x32)
- INTERWORK_FUNC(InternalMathModU64x32)
+ GCC_ASM_EXPORT(InternalMathModU64x32)
ASM_PFX(InternalMathModU64x32):
stmfd sp!, {r7, lr}
ASM_PFX(InternalMathModU64x32):
stmfd sp!, {r7, lr}
- .globl ASM_PFX(InternalMathDivRemU64x32)
- INTERWORK_FUNC(InternalMathDivRemU64x32)
+ GCC_ASM_EXPORT(InternalMathDivRemU64x32)
ASM_PFX(InternalMathDivRemU64x32):
stmfd sp!, {r4, r5, r6, r7, lr}
ASM_PFX(InternalMathDivRemU64x32):
stmfd sp!, {r4, r5, r6, r7, lr}
- .globl ASM_PFX(InternalMathDivRemU64x64)
- INTERWORK_FUNC(InternalMathDivRemU64x64)
+ GCC_ASM_EXPORT(InternalMathDivRemU64x64)
ASM_PFX(InternalMathDivRemU64x64):
stmfd sp!, {r4, r5, r6, r7, lr}
ASM_PFX(InternalMathDivRemU64x64):
stmfd sp!, {r4, r5, r6, r7, lr}
- .globl ASM_PFX(InternalMathDivRemS64x64)
- INTERWORK_FUNC(InternalMathDivRemS64x64)
+ GCC_ASM_EXPORT(InternalMathDivRemS64x64)
ASM_PFX(InternalMathDivRemS64x64):
stmfd sp!, {r4, r5, r6, r7, lr}
ASM_PFX(InternalMathDivRemS64x64):
stmfd sp!, {r4, r5, r6, r7, lr}
- .globl ASM_PFX(InternalMathSwapBytes64)
- INTERWORK_FUNC(InternalMathSwapBytes64)
+ GCC_ASM_EXPORT(InternalMathSwapBytes64)
ASM_PFX(InternalMathSwapBytes64):
@ args = 0, pretend = 0, frame = 0
ASM_PFX(InternalMathSwapBytes64):
@ args = 0, pretend = 0, frame = 0
-.globl ASM_PFX(SetJump)\r
-INTERWORK_FUNC(SetJump)
-\r
-.globl ASM_PFX(InternalLongJump)\r
-INTERWORK_FUNC(InternalLongJump)
+GCC_ASM_EXPORT(SetJump)\r
+GCC_ASM_EXPORT(InternalLongJump)\r
\r
#/**\r
# Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#\r
\r
#/**\r
# Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#\r