unified.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * include/asm-arm/unified.h - Unified Assembler Syntax helper macros
  3. *
  4. * Copyright (C) 2008 ARM Limited
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef __ASM_UNIFIED_H
  20. #define __ASM_UNIFIED_H
  21. #if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
  22. .syntax unified
  23. #endif
  24. #ifdef CONFIG_THUMB2_KERNEL
  25. #if __GNUC__ < 4
  26. #error Thumb-2 kernel requires gcc >= 4
  27. #endif
  28. /* The CPSR bit describing the instruction set (Thumb) */
  29. #define PSR_ISETSTATE PSR_T_BIT
  30. #define ARM(x...)
  31. #define THUMB(x...) x
  32. #define W(instr) instr.w
  33. #define BSYM(sym) sym + 1
  34. #else /* !CONFIG_THUMB2_KERNEL */
  35. /* The CPSR bit describing the instruction set (ARM) */
  36. #define PSR_ISETSTATE 0
  37. #define ARM(x...) x
  38. #define THUMB(x...)
  39. #define W(instr) instr
  40. #define BSYM(sym) sym
  41. #endif /* CONFIG_THUMB2_KERNEL */
  42. #ifndef CONFIG_ARM_ASM_UNIFIED
  43. /*
  44. * If the unified assembly syntax isn't used (in ARM mode), these
  45. * macros expand to an empty string
  46. */
  47. #ifdef __ASSEMBLY__
  48. .macro it, cond
  49. .endm
  50. .macro itt, cond
  51. .endm
  52. .macro ite, cond
  53. .endm
  54. .macro ittt, cond
  55. .endm
  56. .macro itte, cond
  57. .endm
  58. .macro itet, cond
  59. .endm
  60. .macro itee, cond
  61. .endm
  62. .macro itttt, cond
  63. .endm
  64. .macro ittte, cond
  65. .endm
  66. .macro ittet, cond
  67. .endm
  68. .macro ittee, cond
  69. .endm
  70. .macro itett, cond
  71. .endm
  72. .macro itete, cond
  73. .endm
  74. .macro iteet, cond
  75. .endm
  76. .macro iteee, cond
  77. .endm
  78. #else /* !__ASSEMBLY__ */
  79. __asm__(
  80. " .macro it, cond\n"
  81. " .endm\n"
  82. " .macro itt, cond\n"
  83. " .endm\n"
  84. " .macro ite, cond\n"
  85. " .endm\n"
  86. " .macro ittt, cond\n"
  87. " .endm\n"
  88. " .macro itte, cond\n"
  89. " .endm\n"
  90. " .macro itet, cond\n"
  91. " .endm\n"
  92. " .macro itee, cond\n"
  93. " .endm\n"
  94. " .macro itttt, cond\n"
  95. " .endm\n"
  96. " .macro ittte, cond\n"
  97. " .endm\n"
  98. " .macro ittet, cond\n"
  99. " .endm\n"
  100. " .macro ittee, cond\n"
  101. " .endm\n"
  102. " .macro itett, cond\n"
  103. " .endm\n"
  104. " .macro itete, cond\n"
  105. " .endm\n"
  106. " .macro iteet, cond\n"
  107. " .endm\n"
  108. " .macro iteee, cond\n"
  109. " .endm\n");
  110. #endif /* __ASSEMBLY__ */
  111. #endif /* CONFIG_ARM_ASM_UNIFIED */
  112. #endif /* !__ASM_UNIFIED_H */