paravirt_patchlist.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /******************************************************************************
  2. * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
  3. * VA Linux Systems Japan K.K.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. */
  20. #include <linux/bug.h>
  21. #include <asm/paravirt.h>
  22. #define DECLARE(name) \
  23. extern unsigned long \
  24. __ia64_native_start_gate_##name##_patchlist[]; \
  25. extern unsigned long \
  26. __ia64_native_end_gate_##name##_patchlist[]
  27. DECLARE(fsyscall);
  28. DECLARE(brl_fsys_bubble_down);
  29. DECLARE(vtop);
  30. DECLARE(mckinley_e9);
  31. extern unsigned long __start_gate_section[];
  32. #define ASSIGN(name) \
  33. .start_##name##_patchlist = \
  34. (unsigned long)__ia64_native_start_gate_##name##_patchlist, \
  35. .end_##name##_patchlist = \
  36. (unsigned long)__ia64_native_end_gate_##name##_patchlist
  37. struct pv_patchdata pv_patchdata __initdata = {
  38. ASSIGN(fsyscall),
  39. ASSIGN(brl_fsys_bubble_down),
  40. ASSIGN(vtop),
  41. ASSIGN(mckinley_e9),
  42. .gate_section = (void*)__start_gate_section,
  43. };
  44. unsigned long __init
  45. paravirt_get_gate_patchlist(enum pv_gate_patchlist type)
  46. {
  47. #define CASE(NAME, name) \
  48. case PV_GATE_START_##NAME: \
  49. return pv_patchdata.start_##name##_patchlist; \
  50. case PV_GATE_END_##NAME: \
  51. return pv_patchdata.end_##name##_patchlist; \
  52. switch (type) {
  53. CASE(FSYSCALL, fsyscall);
  54. CASE(BRL_FSYS_BUBBLE_DOWN, brl_fsys_bubble_down);
  55. CASE(VTOP, vtop);
  56. CASE(MCKINLEY_E9, mckinley_e9);
  57. default:
  58. BUG();
  59. break;
  60. }
  61. return 0;
  62. }
  63. void * __init
  64. paravirt_get_gate_section(void)
  65. {
  66. return pv_patchdata.gate_section;
  67. }