diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-14 09:39:55 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-08-14 09:39:55 +0000 |
commit | d4cf6b6c976d07af769ad3bfeeccbcf833e72c32 (patch) | |
tree | 50363cf01e9f9a145c03cc8a5c9c585194cb6945 /MdePkg | |
parent | 02c9c47027d60266568936e1ebb3cf1395caaebd (diff) | |
download | edk2-d4cf6b6c976d07af769ad3bfeeccbcf833e72c32.zip edk2-d4cf6b6c976d07af769ad3bfeeccbcf833e72c32.tar.gz edk2-d4cf6b6c976d07af769ad3bfeeccbcf833e72c32.tar.bz2 |
redefine the ASM_PFX to let it can work on Apple/NetBSD and other Unix* platform.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9073 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Include/Ia32/ProcessorBind.h | 17 | ||||
-rw-r--r-- | MdePkg/Include/X64/ProcessorBind.h | 17 |
2 files changed, 24 insertions, 10 deletions
diff --git a/MdePkg/Include/Ia32/ProcessorBind.h b/MdePkg/Include/Ia32/ProcessorBind.h index 4f24c67..a356726 100644 --- a/MdePkg/Include/Ia32/ProcessorBind.h +++ b/MdePkg/Include/Ia32/ProcessorBind.h @@ -336,11 +336,18 @@ typedef INT32 INTN; // For symbol name in GNU assembly code, an extra "_" is necessary
//
#if defined(__GNUC__)
- #if defined(linux)
- #define ASM_PFX(name) name
- #else
- #define ASM_PFX(name) _##name
- #endif
+ ///
+ /// Private worker functions for ASM_PFX()
+ ///
+ #define _CONCATENATE(a, b) __CONCATENATE(a, b)
+ #define __CONCATENATE(a, b) a ## b
+
+ ///
+ /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
+ /// on symbols in assembly language.
+ ///
+ #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)
+
///
/// For GNU assembly code, .global or .globl can declare global symbols.
/// Define this macro to unify the usage.
diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/ProcessorBind.h index 363a2dc..027d8d0 100644 --- a/MdePkg/Include/X64/ProcessorBind.h +++ b/MdePkg/Include/X64/ProcessorBind.h @@ -400,11 +400,18 @@ typedef INT64 INTN; // For symbol name in GNU assembly code, an extra "_" is necessary
//
#if defined(__GNUC__)
- #if defined(linux)
- #define ASM_PFX(name) name
- #else
- #define ASM_PFX(name) _##name
- #endif
+ ///
+ /// Private worker functions for ASM_PFX()
+ ///
+ #define _CONCATENATE(a, b) __CONCATENATE(a, b)
+ #define __CONCATENATE(a, b) a ## b
+
+ ///
+ /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
+ /// on symbols in assembly language.
+ ///
+ #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)
+
///
/// For GNU assembly code, .global or .globl can declare global symbols.
/// Define this macro to unify the usage.
|