inst.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. #define DO_SAVE_MIN IA64_NATIVE_DO_SAVE_MIN
  23. #ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
  24. # define PARAVIRT_POISON 0xdeadbeefbaadf00d
  25. # define CLOBBER(clob) \
  26. ;; \
  27. movl clob = PARAVIRT_POISON; \
  28. ;;
  29. #else
  30. # define CLOBBER(clob) /* nothing */
  31. #endif
  32. #define MOV_FROM_IFA(reg) \
  33. mov reg = cr.ifa
  34. #define MOV_FROM_ITIR(reg) \
  35. mov reg = cr.itir
  36. #define MOV_FROM_ISR(reg) \
  37. mov reg = cr.isr
  38. #define MOV_FROM_IHA(reg) \
  39. mov reg = cr.iha
  40. #define MOV_FROM_IPSR(pred, reg) \
  41. (pred) mov reg = cr.ipsr
  42. #define MOV_FROM_IIM(reg) \
  43. mov reg = cr.iim
  44. #define MOV_FROM_IIP(reg) \
  45. mov reg = cr.iip
  46. #define MOV_FROM_IVR(reg, clob) \
  47. mov reg = cr.ivr \
  48. CLOBBER(clob)
  49. #define MOV_FROM_PSR(pred, reg, clob) \
  50. (pred) mov reg = psr \
  51. CLOBBER(clob)
  52. #define MOV_TO_IFA(reg, clob) \
  53. mov cr.ifa = reg \
  54. CLOBBER(clob)
  55. #define MOV_TO_ITIR(pred, reg, clob) \
  56. (pred) mov cr.itir = reg \
  57. CLOBBER(clob)
  58. #define MOV_TO_IHA(pred, reg, clob) \
  59. (pred) mov cr.iha = reg \
  60. CLOBBER(clob)
  61. #define MOV_TO_IPSR(pred, reg, clob) \
  62. (pred) mov cr.ipsr = reg \
  63. CLOBBER(clob)
  64. #define MOV_TO_IFS(pred, reg, clob) \
  65. (pred) mov cr.ifs = reg \
  66. CLOBBER(clob)
  67. #define MOV_TO_IIP(reg, clob) \
  68. mov cr.iip = reg \
  69. CLOBBER(clob)
  70. #define MOV_TO_KR(kr, reg, clob0, clob1) \
  71. mov IA64_KR(kr) = reg \
  72. CLOBBER(clob0) \
  73. CLOBBER(clob1)
  74. #define ITC_I(pred, reg, clob) \
  75. (pred) itc.i reg \
  76. CLOBBER(clob)
  77. #define ITC_D(pred, reg, clob) \
  78. (pred) itc.d reg \
  79. CLOBBER(clob)
  80. #define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
  81. (pred_i) itc.i reg; \
  82. (pred_d) itc.d reg \
  83. CLOBBER(clob)
  84. #define THASH(pred, reg0, reg1, clob) \
  85. (pred) thash reg0 = reg1 \
  86. CLOBBER(clob)
  87. #define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1) \
  88. ssm psr.ic | PSR_DEFAULT_BITS \
  89. CLOBBER(clob0) \
  90. CLOBBER(clob1) \
  91. ;; \
  92. srlz.i /* guarantee that interruption collectin is on */ \
  93. ;;
  94. #define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1) \
  95. ssm psr.ic \
  96. CLOBBER(clob0) \
  97. CLOBBER(clob1) \
  98. ;; \
  99. srlz.d
  100. #define RSM_PSR_IC(clob) \
  101. rsm psr.ic \
  102. CLOBBER(clob)
  103. #define SSM_PSR_I(pred, pred_clob, clob) \
  104. (pred) ssm psr.i \
  105. CLOBBER(clob)
  106. #define RSM_PSR_I(pred, clob0, clob1) \
  107. (pred) rsm psr.i \
  108. CLOBBER(clob0) \
  109. CLOBBER(clob1)
  110. #define RSM_PSR_I_IC(clob0, clob1, clob2) \
  111. rsm psr.i | psr.ic \
  112. CLOBBER(clob0) \
  113. CLOBBER(clob1) \
  114. CLOBBER(clob2)
  115. #define RSM_PSR_DT \
  116. rsm psr.dt
  117. #define SSM_PSR_DT_AND_SRLZ_I \
  118. ssm psr.dt \
  119. ;; \
  120. srlz.i
  121. #define BSW_0(clob0, clob1, clob2) \
  122. bsw.0 \
  123. CLOBBER(clob0) \
  124. CLOBBER(clob1) \
  125. CLOBBER(clob2)
  126. #define BSW_1(clob0, clob1) \
  127. bsw.1 \
  128. CLOBBER(clob0) \
  129. CLOBBER(clob1)
  130. #define COVER \
  131. cover
  132. #define RFI \
  133. rfi