diff options
author | Pete Batard <pete@akeo.ie> | 2018-02-23 17:50:02 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-03-19 17:05:42 +0800 |
commit | c41100f05f6549d7d95b04aa8213392738af3b69 (patch) | |
tree | 714a98b7ee3149b1321b5232c9715a3596e8b2c0 /MdePkg | |
parent | da351bdbe2076e06ecde95c9f563784c8d53af46 (diff) | |
download | edk2-c41100f05f6549d7d95b04aa8213392738af3b69.tar.gz edk2-c41100f05f6549d7d95b04aa8213392738af3b69.tar.bz2 edk2-c41100f05f6549d7d95b04aa8213392738af3b69.zip |
MdePkg/Include: Add VA list support for VS2017/ARM64
We need to explicitly call the built-in __va_start() for ARM64, otherwise
the variable parameters are not properly enqueued for the next function
calls.
Also do the same for ARM, as as it doesn't harm us.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Include/Base.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index a94182f088..4f7bd4449c 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -668,16 +668,15 @@ struct _LIST_ENTRY { #define VA_COPY(Dest, Start) __va_copy (Dest, Start)
-#elif defined(_M_ARM)
+#elif defined(_M_ARM) || defined(_M_ARM64)
//
// MSFT ARM variable argument list support.
-// Same as the generic macros below, except for VA_ARG that needs extra adjustment.
//
typedef char* VA_LIST;
-#define VA_START(Marker, Parameter) (Marker = (VA_LIST) ((UINTN) & (Parameter) + _INT_SIZE_OF(Parameter)))
-#define VA_ARG(Marker, TYPE) (*(TYPE *) ((Marker += _INT_SIZE_OF(TYPE) + ((-(INTN)Marker) & (sizeof(TYPE) - 1))) - _INT_SIZE_OF (TYPE)))
+#define VA_START(Marker, Parameter) __va_start (&Marker, &Parameter, _INT_SIZE_OF (Parameter), __alignof(Parameter), &Parameter)
+#define VA_ARG(Marker, TYPE) (*(TYPE *) ((Marker += _INT_SIZE_OF (TYPE) + ((-(INTN)Marker) & (sizeof(TYPE) - 1))) - _INT_SIZE_OF (TYPE)))
#define VA_END(Marker) (Marker = (VA_LIST) 0)
#define VA_COPY(Dest, Start) ((void)((Dest) = (Start)))
|