compiler.h 527 B

123456789101112131415161718192021
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2019 Arm Limited
  4. * Original author: Dave Martin <[email protected]>
  5. */
  6. #ifndef COMPILER_H
  7. #define COMPILER_H
  8. #define __always_unused __attribute__((__unused__))
  9. #define __noreturn __attribute__((__noreturn__))
  10. #define __unreachable() __builtin_unreachable()
  11. /* curse(e) has value e, but the compiler cannot assume so */
  12. #define curse(e) ({ \
  13. __typeof__(e) __curse_e = (e); \
  14. asm ("" : "+r" (__curse_e)); \
  15. __curse_e; \
  16. })
  17. #endif /* ! COMPILER_H */