^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Name: acgcc.h - GCC specific defines, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef __ACGCC_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define __ACGCC_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Use compiler specific <stdarg.h> is a good practice for even when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #ifndef va_arg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #ifdef ACPI_USE_BUILTIN_STDARG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) typedef __builtin_va_list va_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define va_start(v, l) __builtin_va_start(v, l)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define va_end(v) __builtin_va_end(v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define va_arg(v, l) __builtin_va_arg(v, l)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define va_copy(d, s) __builtin_va_copy(d, s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <stdarg.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define ACPI_INLINE __inline__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) /* Function name is used for debug output. Non-ANSI, compiler-dependent */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define ACPI_GET_FUNCTION_NAME __func__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * This macro is used to tag functions as "printf-like" because
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * some compilers (like GCC) can catch printf format string problems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * Some compilers complain about unused variables. Sometimes we don't want to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * use all the variables (for example, _acpi_module_name). This allows us
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * to tell the compiler warning in a per-variable manner that a variable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * is unused.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define ACPI_UNUSED_VAR __attribute__ ((unused))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /* GCC supports __VA_ARGS__ in macros */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #define COMPILER_VA_MACRO 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /* GCC supports native multiply/shift on 32-bit platforms */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define ACPI_USE_NATIVE_MATH64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif /* __ACGCC_H__ */