inst.h 4.1 KB

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