]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/X64/ProcessorBind.h
redefine the ASM_PFX to let it can work on Apple/NetBSD and other Unix* platform.
[mirror_edk2.git] / MdePkg / Include / X64 / ProcessorBind.h
index ce198678514367291c7b7fdd149d73004ee0c50e..027d8d0f59fc56efb0e47646ce9d668ceb41a58e 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Processor or Compiler specific defines and types x64 (Intel(r) EM64T, AMD64).\r
+  Processor or Compiler specific defines and types x64 (Intel 64, AMD64).\r
 \r
   Copyright (c) 2006 - 2009, Intel Corporation<BR>                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
@@ -400,16 +400,23 @@ typedef INT64   INTN;
 // For symbol name in GNU assembly code, an extra "_" is necessary\r
 //\r
 #if defined(__GNUC__)\r
-  #if defined(linux)\r
-    #define ASM_PFX(name) name\r
-  #else\r
-    #define ASM_PFX(name) _##name\r
-  #endif  \r
-  #if defined(__APPLE__)\r
-    #define ASM_GLOBAL .globl\r
-  #else\r
-    #define ASM_GLOBAL .global\r
-  #endif \r
+  ///\r
+  /// Private worker functions for ASM_PFX()\r
+  ///\r
+  #define _CONCATENATE(a, b)  __CONCATENATE(a, b)\r
+  #define __CONCATENATE(a, b) a ## b\r
+\r
+  ///\r
+  /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix\r
+  /// on symbols in assembly language.\r
+  ///\r
+  #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)\r
+\r
+  ///\r
+  /// For GNU assembly code, .global or .globl can declare global symbols.\r
+  /// Define this macro to unify the usage.\r
+  ///\r
+  #define ASM_GLOBAL .globl\r
 #endif\r
 \r
 /**\r