inst.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /******************************************************************************
  2. * include/asm-ia64/native/inst.h
  3. *
  4. * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
  5. * VA Linux Systems Japan K.K.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. */
  22. #ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
  23. # define PARAVIRT_POISON 0xdeadbeefbaadf00d
  24. # define CLOBBER(clob) \
  25. ;; \
  26. movl clob = PARAVIRT_POISON; \
  27. ;;
  28. #else
  29. # define CLOBBER(clob) /* nothing */
  30. #endif
  31. #define MOV_FROM_IFA(reg) \
  32. mov reg = cr.ifa
  33. #define MOV_FROM_ITIR(reg) \
  34. mov reg = cr.itir
  35. #define MOV_FROM_ISR(reg) \
  36. mov reg = cr.isr
  37. #define MOV_FROM_IHA(reg) \
  38. mov reg = cr.iha
  39. #define MOV_FROM_IPSR(pred, reg) \
  40. (pred) mov reg = cr.ipsr
  41. #define MOV_FROM_IIM(reg) \
  42. mov reg = cr.iim
  43. #define MOV_FROM_IIP(reg) \
  44. mov reg = cr.iip
  45. #define MOV_FROM_IVR(reg, clob) \
  46. mov reg = cr.ivr \
  47. CLOBBER(clob)
  48. #define MOV_FROM_PSR(pred, reg, clob) \
  49. (pred) mov reg = psr \
  50. CLOBBER(clob)
  51. #define MOV_TO_IFA(reg, clob) \
  52. mov cr.ifa = reg \
  53. CLOBBER(clob)
  54. #define MOV_TO_ITIR(pred, reg, clob) \
  55. (pred) mov cr.itir = reg \
  56. CLOBBER(clob)
  57. #define MOV_TO_IHA(pred, reg, clob) \
  58. (pred) mov cr.iha = reg \
  59. CLOBBER(clob)
  60. #define MOV_TO_IPSR(pred, reg, clob) \
  61. (pred) mov cr.ipsr = reg \
  62. CLOBBER(clob)
  63. #define MOV_TO_IFS(pred, reg, clob) \
  64. (pred) mov cr.ifs = reg \
  65. CLOBBER(clob)
  66. #define MOV_TO_IIP(reg, clob) \
  67. mov cr.iip = reg \
  68. CLOBBER(clob)
  69. #define MOV_TO_KR(kr, reg, clob0, clob1) \
  70. mov IA64_KR(kr) = reg \
  71. CLOBBER(clob0) \
  72. CLOBBER(clob1)
  73. #define ITC_I(pred, reg, clob) \
  74. (pred) itc.i reg \
  75. CLOBBER(clob)
  76. #define ITC_D(pred, reg, clob) \
  77. (pred) itc.d reg \
  78. CLOBBER(clob)
  79. #define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
  80. (pred_i) itc.i reg; \
  81. (pred_d) itc.d reg \
  82. CLOBBER(clob)
  83. #define THASH(pred, reg0, reg1, clob) \
  84. (pred) thash reg0 = reg1 \
  85. CLOBBER(clob)
  86. #define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1) \
  87. ssm psr.ic | PSR_DEFAULT_BITS \
  88. CLOBBER(clob0) \
  89. CLOBBER(clob1) \
  90. ;; \
  91. srlz.i /* guarantee that interruption collectin is on */ \
  92. ;;
  93. #define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1) \
  94. ssm psr.ic \
  95. CLOBBER(clob0) \
  96. CLOBBER(clob1) \
  97. ;; \
  98. srlz.d
  99. #define RSM_PSR_IC(clob) \
  100. rsm psr.ic \
  101. CLOBBER(clob)
  102. #define SSM_PSR_I(pred, pred_clob, clob) \
  103. (pred) ssm psr.i \
  104. CLOBBER(clob)
  105. #define RSM_PSR_I(pred, clob0, clob1) \
  106. (pred) rsm psr.i \
  107. CLOBBER(clob0) \
  108. CLOBBER(clob1)
  109. #define RSM_PSR_I_IC(clob0, clob1, clob2) \
  110. rsm psr.i | psr.ic \
  111. CLOBBER(clob0) \
  112. CLOBBER(clob1) \
  113. CLOBBER(clob2)
  114. #define RSM_PSR_DT \
  115. rsm psr.dt
  116. #define SSM_PSR_DT_AND_SRLZ_I \
  117. ssm psr.dt \
  118. ;; \
  119. srlz.i
  120. #define BSW_0(clob0, clob1, clob2) \
  121. bsw.0 \
  122. CLOBBER(clob0) \
  123. CLOBBER(clob1) \
  124. CLOBBER(clob2)
  125. #define BSW_1(clob0, clob1) \
  126. bsw.1 \
  127. CLOBBER(clob0) \
  128. CLOBBER(clob1)
  129. #define COVER \
  130. cover
  131. #define RFI \
  132. rfi