include: replace linux/module.h with "struct module" wherever possible
[linux-2.6/next.git] / arch / ia64 / include / asm / paravirt_patch.h
blob128ff5db6e67e62e264df76ecde8c925bd2bb59f
1 /******************************************************************************
2 * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
3 * VA Linux Systems Japan K.K.
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.
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.
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
21 #ifndef __ASM_PARAVIRT_PATCH_H
22 #define __ASM_PARAVIRT_PATCH_H
24 #ifdef __ASSEMBLY__
26 .section .paravirt_branches, "a"
27 .previous
28 #define PARAVIRT_PATCH_SITE_BR(type) \
29 { \
30 [1:] ; \
31 br.cond.sptk.many 2f ; \
32 nop.b 0 ; \
33 nop.b 0;; ; \
34 } ; \
35 2: \
36 .xdata8 ".paravirt_branches", 1b, type
38 #else
40 #include <linux/stringify.h>
41 #include <asm/intrinsics.h>
43 /* for binary patch */
44 struct paravirt_patch_site_bundle {
45 void *sbundle;
46 void *ebundle;
47 unsigned long type;
50 /* label means the beginning of new bundle */
51 #define paravirt_alt_bundle(instr, privop) \
52 "\t998:\n" \
53 "\t" instr "\n" \
54 "\t999:\n" \
55 "\t.pushsection .paravirt_bundles, \"a\"\n" \
56 "\t.popsection\n" \
57 "\t.xdata8 \".paravirt_bundles\", 998b, 999b, " \
58 __stringify(privop) "\n"
61 struct paravirt_patch_bundle_elem {
62 const void *sbundle;
63 const void *ebundle;
64 unsigned long type;
68 struct paravirt_patch_site_inst {
69 unsigned long stag;
70 unsigned long etag;
71 unsigned long type;
74 #define paravirt_alt_inst(instr, privop) \
75 "\t[998:]\n" \
76 "\t" instr "\n" \
77 "\t[999:]\n" \
78 "\t.pushsection .paravirt_insts, \"a\"\n" \
79 "\t.popsection\n" \
80 "\t.xdata8 \".paravirt_insts\", 998b, 999b, " \
81 __stringify(privop) "\n"
83 struct paravirt_patch_site_branch {
84 unsigned long tag;
85 unsigned long type;
88 struct paravirt_patch_branch_target {
89 const void *entry;
90 unsigned long type;
93 void
94 __paravirt_patch_apply_branch(
95 unsigned long tag, unsigned long type,
96 const struct paravirt_patch_branch_target *entries,
97 unsigned int nr_entries);
99 void
100 paravirt_patch_reloc_br(unsigned long tag, const void *target);
102 void
103 paravirt_patch_reloc_brl(unsigned long tag, const void *target);
106 #if defined(ASM_SUPPORTED) && defined(CONFIG_PARAVIRT)
107 unsigned long
108 ia64_native_patch_bundle(void *sbundle, void *ebundle, unsigned long type);
110 unsigned long
111 __paravirt_patch_apply_bundle(void *sbundle, void *ebundle, unsigned long type,
112 const struct paravirt_patch_bundle_elem *elems,
113 unsigned long nelems,
114 const struct paravirt_patch_bundle_elem **found);
116 void
117 paravirt_patch_apply_bundle(const struct paravirt_patch_site_bundle *start,
118 const struct paravirt_patch_site_bundle *end);
120 void
121 paravirt_patch_apply_inst(const struct paravirt_patch_site_inst *start,
122 const struct paravirt_patch_site_inst *end);
124 void paravirt_patch_apply(void);
125 #else
126 #define paravirt_patch_apply_bundle(start, end) do { } while (0)
127 #define paravirt_patch_apply_inst(start, end) do { } while (0)
128 #define paravirt_patch_apply() do { } while (0)
129 #endif
131 #endif /* !__ASSEMBLEY__ */
133 #endif /* __ASM_PARAVIRT_PATCH_H */
136 * Local variables:
137 * mode: C
138 * c-set-style: "linux"
139 * c-basic-offset: 8
140 * tab-width: 8
141 * indent-tabs-mode: t
142 * End: