inst.h 4.5 KB

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