8 #include <linux/string.h>
10 #include <asm/paravirt.h>
12 #include <asm/processor.h>
13 #include <asm/sections.h>
14 #include <asm/unistd.h>
30 get_imm64 (
u64 insn_addr)
32 u64 *
p = (
u64 *) (insn_addr & -16);
34 return ( (p[1] & 0x0800000000000000UL) << 4) |
35 ((p[1] & 0x00000000007fffffUL) << 40) |
36 ((p[0] & 0xffffc00000000000UL) >> 24) |
37 ((p[1] & 0x0000100000000000UL) >> 23) |
38 ((p[1] & 0x0003e00000000000UL) >> 29) |
39 ((p[1] & 0x07fc000000000000UL) >> 43) |
40 ((p[1] & 0x000007f000000000UL) >> 36);
47 u64 m0, m1,
v0,
v1, b0, b1, *
b = (
u64 *) (insn_addr & -16);
48 # define insn_mask ((1UL << 41) - 1)
52 shift = 5 + 41 * (insn_addr % 16);
54 m1 = mask << (shift - 64);
55 v1 = val << (shift - 64);
57 m0 = mask << shift; m1 = mask >> (64 - shift);
58 v0 = val << shift; v1 = val >> (64 - shift);
59 b[0] = (b0 & ~m0) | (v0 & m0);
61 b[1] = (b1 & ~m1) | (v1 & m1);
72 0x01fffefe000UL, ( ((val & 0x8000000000000000UL) >> 27)
73 | ((val & 0x0000000000200000UL) << 0)
74 | ((val & 0x00000000001f0000UL) << 6)
75 | ((val & 0x000000000000ff80UL) << 20)
76 | ((val & 0x000000000000007fUL) << 13) ));
77 ia64_patch(insn_addr + 1, 0x1ffffffffffUL, val >> 22);
88 0x011ffffe000UL, ( ((val & 0x0800000000000000UL) >> 23)
89 | ((val & 0x00000000000fffffUL) << 13) ));
90 ia64_patch(insn_addr + 1, 0x1fffffffffcUL, val >> 18);
103 s32 *offp = (
s32 *) start;
106 while (offp < (
s32 *)
end) {
107 ip = (
u64) offp + *offp;
126 s32 *offp = (
s32 *) start;
129 while (offp < (
s32 *)
end) {
130 ip = (
u64) offp + *offp;
132 b = (
u64 *)(ip & -16);
144 static int first_time = 1;
146 s32 *offp = (
s32 *) start;
159 while (offp < (
s32 *) end) {
160 wp = (
u64 *) ia64_imva((
char *) offp + *offp);
161 wp[0] = 0x0000000100000011
UL;
162 wp[1] = 0x0084006880000200
UL;
163 wp[2] = 0x0000000100000000
UL;
164 wp[3] = 0x0004000000000200
UL;
175 .fsyscall_table = (
unsigned long *)ia64_native_fsyscall_table,
192 patch_fsyscall_table (
unsigned long start,
unsigned long end)
195 s32 *offp = (
s32 *) start;
198 while (offp < (
s32 *)
end) {
199 ip = (
u64) ia64_imva((
char *) offp + *offp);
209 patch_brl_fsys_bubble_down (
unsigned long start,
unsigned long end)
212 s32 *offp = (
s32 *) start;
215 while (offp < (
s32 *)
end) {
216 ip = (
u64) offp + *offp;
218 (
u64) (fsys_bubble_down - (ip & -16)) / 16);
229 # define START(name) paravirt_get_gate_patchlist(PV_GATE_START_##name)
230 # define END(name) paravirt_get_gate_patchlist(PV_GATE_END_##name)
232 patch_fsyscall_table(
START(FSYSCALL),
END(FSYSCALL));
233 patch_brl_fsys_bubble_down(
START(BRL_FSYS_BUBBLE_DOWN),
END(BRL_FSYS_BUBBLE_DOWN));
245 mask = (0x3f
UL << 27) | (0x7f << 13);
246 imm = (((val >> 7) & 0x3f) << 27) | (val & 0x7f) << 13;
249 ip = (
u64) offp + *offp;