paravirtentry.S 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /******************************************************************************
  2. * linux/arch/ia64/xen/paravirtentry.S
  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. #include <linux/init.h>
  23. #include <asm/asmmacro.h>
  24. #include <asm/asm-offsets.h>
  25. #include <asm/paravirt_privop.h>
  26. #include <asm/paravirt_patch.h>
  27. #include "entry.h"
  28. #define DATA8(sym, init_value) \
  29. .pushsection .data..read_mostly ; \
  30. .align 8 ; \
  31. .global sym ; \
  32. sym: ; \
  33. data8 init_value ; \
  34. .popsection
  35. #define BRANCH(targ, reg, breg, type) \
  36. PARAVIRT_PATCH_SITE_BR(PARAVIRT_PATCH_TYPE_BR_ ## type) ; \
  37. ;; \
  38. movl reg=targ ; \
  39. ;; \
  40. ld8 reg=[reg] ; \
  41. ;; \
  42. mov breg=reg ; \
  43. br.cond.sptk.many breg
  44. #define BRANCH_PROC(sym, reg, breg, type) \
  45. DATA8(paravirt_ ## sym ## _targ, ia64_native_ ## sym) ; \
  46. GLOBAL_ENTRY(paravirt_ ## sym) ; \
  47. BRANCH(paravirt_ ## sym ## _targ, reg, breg, type) ; \
  48. END(paravirt_ ## sym)
  49. #define BRANCH_PROC_UNWINFO(sym, reg, breg, type) \
  50. DATA8(paravirt_ ## sym ## _targ, ia64_native_ ## sym) ; \
  51. GLOBAL_ENTRY(paravirt_ ## sym) ; \
  52. PT_REGS_UNWIND_INFO(0) ; \
  53. BRANCH(paravirt_ ## sym ## _targ, reg, breg, type) ; \
  54. END(paravirt_ ## sym)
  55. BRANCH_PROC(switch_to, r22, b7, SWITCH_TO)
  56. BRANCH_PROC_UNWINFO(leave_syscall, r22, b7, LEAVE_SYSCALL)
  57. BRANCH_PROC(work_processed_syscall, r2, b7, WORK_PROCESSED_SYSCALL)
  58. BRANCH_PROC_UNWINFO(leave_kernel, r22, b7, LEAVE_KERNEL)
  59. #ifdef CONFIG_MODULES
  60. #define __INIT_OR_MODULE .text
  61. #define __INITDATA_OR_MODULE .data
  62. #else
  63. #define __INIT_OR_MODULE __INIT
  64. #define __INITDATA_OR_MODULE __INITDATA
  65. #endif /* CONFIG_MODULES */
  66. __INIT_OR_MODULE
  67. GLOBAL_ENTRY(paravirt_fc_i)
  68. fc.i r32
  69. br.ret.sptk.many rp
  70. END(paravirt_fc_i)
  71. __FINIT
  72. __INIT_OR_MODULE
  73. .align 32
  74. GLOBAL_ENTRY(paravirt_nop_b_inst_bundle)
  75. {
  76. nop.b 0
  77. nop.b 0
  78. nop.b 0
  79. }
  80. END(paravirt_nop_b_inst_bundle)
  81. __FINIT
  82. /* NOTE: nop.[mfi] has same format */
  83. __INIT_OR_MODULE
  84. GLOBAL_ENTRY(paravirt_nop_mfi_inst_bundle)
  85. {
  86. nop.m 0
  87. nop.f 0
  88. nop.i 0
  89. }
  90. END(paravirt_nop_mfi_inst_bundle)
  91. __FINIT
  92. __INIT_OR_MODULE
  93. GLOBAL_ENTRY(paravirt_nop_bundle)
  94. paravirt_nop_bundle_start:
  95. {
  96. nop 0
  97. nop 0
  98. nop 0
  99. }
  100. paravirt_nop_bundle_end:
  101. END(paravirt_nop_bundle)
  102. __FINIT
  103. __INITDATA_OR_MODULE
  104. .align 8
  105. .global paravirt_nop_bundle_size
  106. paravirt_nop_bundle_size:
  107. data8 paravirt_nop_bundle_end - paravirt_nop_bundle_start