// }\r
//\r
\r
+/**\r
+ Return the size of argument that has been aligned to sizeof (UINTN).\r
+\r
+ @param n The parameter size is to be aligned.\r
+\r
+ @return The aligned size\r
+**/\r
+#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))\r
+\r
#if defined(__GNUC__)\r
//\r
// Use GCC built-in macros for variable argument lists.\r
#define VA_END(Marker) __builtin_va_end (Marker)\r
\r
#else\r
-/**\r
- Return the size of argument that has been aligned to sizeof (UINTN).\r
-\r
- @param n The parameter size to be aligned.\r
-\r
- @return The aligned size\r
-**/\r
-#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))\r
-\r
///\r
/// Pointer to the start of a variable argument list. Same as CHAR8 *.\r
///\r
\r
#endif\r
\r
+///\r
+/// Pointer to the start of a variable argument list stored in a memory buffer. Same as UINT8 *.\r
+///\r
+typedef UINTN *BASE_LIST;\r
+\r
+/**\r
+ Returns an argument of a specified type from a variable argument list and updates \r
+ the pointer to the variable argument list to point to the next argument. \r
+\r
+ This function returns an argument of the type specified by TYPE from the beginning \r
+ of the variable argument list specified by Marker. Marker is then updated to point \r
+ to the next argument in the variable argument list. The method for computing the \r
+ pointer to the next argument in the argument list is CPU specific following the EFIAPI ABI.\r
+\r
+ @param Marker Pointer to the beginning of a variable argument list.\r
+ @param TYPE The type of argument to retrieve from the beginning \r
+ of the variable argument list.\r
+ \r
+ @return An argument of the type specified by TYPE.\r
+\r
+**/\r
+#define BASE_ARG(Marker, TYPE) (*(TYPE *)((UINT8 *)(Marker = (BASE_LIST)((UINT8 *)Marker + _INT_SIZE_OF (TYPE))) - _INT_SIZE_OF (TYPE)))\r
+\r
/**\r
Macro that returns the byte offset of a field in a data structure. \r
\r
#define GLOBAL_REMOVE_IF_UNREFERENCED\r
#endif\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
+\r
///\r
/// A pointer to a function in IPF points to a plabel.\r
///\r
#define ASM_PFX(name) name\r
#else\r
#define ASM_PFX(name) _##name\r
- #endif \r
+ #endif\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