inst.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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_TO_IFA(reg, clob) \
  67. mov cr.ifa = reg \
  68. CLOBBER(clob)
  69. #define MOV_TO_ITIR(pred, reg, clob) \
  70. (pred) mov cr.itir = reg \
  71. CLOBBER(clob)
  72. #define MOV_TO_IHA(pred, reg, clob) \
  73. (pred) mov cr.iha = reg \
  74. CLOBBER(clob)
  75. #define MOV_TO_IPSR(pred, reg, clob) \
  76. (pred) mov cr.ipsr = reg \
  77. CLOBBER(clob)
  78. #define MOV_TO_IFS(pred, reg, clob) \
  79. (pred) mov cr.ifs = reg \
  80. CLOBBER(clob)
  81. #define MOV_TO_IIP(reg, clob) \
  82. mov cr.iip = reg \
  83. CLOBBER(clob)
  84. #define MOV_TO_KR(kr, reg, clob0, clob1) \
  85. mov IA64_KR(kr) = reg \
  86. CLOBBER(clob0) \
  87. CLOBBER(clob1)
  88. #define ITC_I(pred, reg, clob) \
  89. (pred) itc.i reg \
  90. CLOBBER(clob)
  91. #define ITC_D(pred, reg, clob) \
  92. (pred) itc.d reg \
  93. CLOBBER(clob)
  94. #define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
  95. (pred_i) itc.i reg; \
  96. (pred_d) itc.d reg \
  97. CLOBBER(clob)
  98. #define THASH(pred, reg0, reg1, clob) \
  99. (pred) thash reg0 = reg1 \
  100. CLOBBER(clob)
  101. #define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1) \
  102. ssm psr.ic | PSR_DEFAULT_BITS \
  103. CLOBBER(clob0) \
  104. CLOBBER(clob1) \
  105. ;; \
  106. srlz.i /* guarantee that interruption collectin is on */ \
  107. ;;
  108. #define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1) \
  109. ssm psr.ic \
  110. CLOBBER(clob0) \
  111. CLOBBER(clob1) \
  112. ;; \
  113. srlz.d
  114. #define RSM_PSR_IC(clob) \
  115. rsm psr.ic \
  116. CLOBBER(clob)
  117. #define SSM_PSR_I(pred, pred_clob, clob) \
  118. (pred) ssm psr.i \
  119. CLOBBER(clob) \
  120. CLOBBER_PRED(pred_clob)
  121. #define RSM_PSR_I(pred, clob0, clob1) \
  122. (pred) rsm psr.i \
  123. CLOBBER(clob0) \
  124. CLOBBER(clob1)
  125. #define RSM_PSR_I_IC(clob0, clob1, clob2) \
  126. rsm psr.i | psr.ic \
  127. CLOBBER(clob0) \
  128. CLOBBER(clob1) \
  129. CLOBBER(clob2)
  130. #define RSM_PSR_DT \
  131. rsm psr.dt
  132. #define SSM_PSR_DT_AND_SRLZ_I \
  133. ssm psr.dt \
  134. ;; \
  135. srlz.i
  136. #define BSW_0(clob0, clob1, clob2) \
  137. bsw.0 \
  138. CLOBBER(clob0) \
  139. CLOBBER(clob1) \
  140. CLOBBER(clob2)
  141. #define BSW_1(clob0, clob1) \
  142. bsw.1 \
  143. CLOBBER(clob0) \
  144. CLOBBER(clob1)
  145. #define COVER \
  146. cover
  147. #define RFI \
  148. rfi