inst.h 4.0 KB

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