1 /* 2 * Routines to access hardware 3 * 4 * Copyright (c) 2013 Realtek Semiconductor Corp. 5 * 6 * This module is a confidential and proprietary property of RealTek and 7 * possession or use of this module requires written permission of RealTek. 8 */ 9 10 #ifndef _VA_LIST_H_ 11 #define _VA_LIST_H_ 12 13 #include "platform_autoconf.h" 14 #include "basic_types.h" 15 16 #ifndef va_arg //this part is adapted from linux (Linux/include/acpi/platform/acenv.h) 17 18 typedef s32 acpi_native_int;//this definition is in (Linux/include/acpi/actypes.h) 19 20 #ifndef _VALIST 21 #define _VALIST 22 typedef char *va_list; 23 #endif /* _VALIST */ 24 25 /* Storage alignment properties */ 26 #define _AUPBND (sizeof (acpi_native_int) - 1) 27 #define _ADNBND (sizeof (acpi_native_int) - 1) 28 29 /* Variable argument list macro definitions */ 30 #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 31 #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) 32 #define va_end(ap) (ap = (va_list) NULL) 33 #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) 34 35 #endif /* va_arg */ 36 37 #endif //_VA_LIST_H_ 38