Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 116670
Collapse All | Expand All

(-)file_not_specified_in_diff (-6 / +13 lines)
Line  Link Here
 [IA64] Fix 2.6 kernel for the new ia64 assembler
 [IA64] Fix 2.6 kernel for the new ia64 assembler
1
 
1
 
2
 The new ia64 assembler uses slot 1 for the offset of a long (2-slot)
2
 The new ia64 assembler uses slot 1 for the offset of a long (2-slot)
3
 instruction and the old assembler uses slot 2. The 2.6 kernel assumes
3
 instruction and the old assembler uses slot 2. The 2.6 kernel assumes
4
 slot 2 and won't boot when the new assembler is used:
4
 slot 2 and won't boot when the new assembler is used:
5
 
5
 
6
 http://sources.redhat.com/bugzilla/show_bug.cgi?id=1433
6
 http://sources.redhat.com/bugzilla/show_bug.cgi?id=1433
7
 
7
 
8
 This patch will work with either slot 1 or 2.
8
 This patch will work with either slot 1 or 2.
9
 
9
 
10
 Patch provided by H.J. Lu
10
 Patch provided by H.J. Lu
11
 
11
 
12
 Signed-off-by: Tony Luck <tony.luck@intel.com>
12
 Signed-off-by: Tony Luck <tony.luck@intel.com>
13
--
13
++ b/arch/ia64/kernel/patch.c
14
-- a/arch/ia64/kernel/patch.c
Lines 64-85 ia64_patch (u64 insn_addr, u64 mask, u64 Link Here
64
void
64
void
65
ia64_patch_imm64 (u64 insn_addr, u64 val)
65
ia64_patch_imm64 (u64 insn_addr, u64 val)
66
{
66
{
67
	ia64_patch(insn_addr,
67
	/* The assembler may generate offset pointing to either slot 1
68
	   or slot 2 for a long (2-slot) instruction, occupying slots 1
69
	   and 2.  */
70
  	insn_addr &= -16UL;
71
	ia64_patch(insn_addr + 2,
68
		   0x01fffefe000UL, (  ((val & 0x8000000000000000UL) >> 27) /* bit 63 -> 36 */
72
		   0x01fffefe000UL, (  ((val & 0x8000000000000000UL) >> 27) /* bit 63 -> 36 */
69
				     | ((val & 0x0000000000200000UL) <<  0) /* bit 21 -> 21 */
73
				     | ((val & 0x0000000000200000UL) <<  0) /* bit 21 -> 21 */
70
				     | ((val & 0x00000000001f0000UL) <<  6) /* bit 16 -> 22 */
74
				     | ((val & 0x00000000001f0000UL) <<  6) /* bit 16 -> 22 */
71
				     | ((val & 0x000000000000ff80UL) << 20) /* bit  7 -> 27 */
75
				     | ((val & 0x000000000000ff80UL) << 20) /* bit  7 -> 27 */
72
				     | ((val & 0x000000000000007fUL) << 13) /* bit  0 -> 13 */));
76
				     | ((val & 0x000000000000007fUL) << 13) /* bit  0 -> 13 */));
73
	ia64_patch(insn_addr - 1, 0x1ffffffffffUL, val >> 22);
77
	ia64_patch(insn_addr + 1, 0x1ffffffffffUL, val >> 22);
74
}
78
}
75
79
76
void
80
void
77
ia64_patch_imm60 (u64 insn_addr, u64 val)
81
ia64_patch_imm60 (u64 insn_addr, u64 val)
78
{
82
{
79
	ia64_patch(insn_addr,
83
	/* The assembler may generate offset pointing to either slot 1
84
	   or slot 2 for a long (2-slot) instruction, occupying slots 1
85
	   and 2.  */
86
  	insn_addr &= -16UL;
87
	ia64_patch(insn_addr + 2,
80
		   0x011ffffe000UL, (  ((val & 0x0800000000000000UL) >> 23) /* bit 59 -> 36 */
88
		   0x011ffffe000UL, (  ((val & 0x0800000000000000UL) >> 23) /* bit 59 -> 36 */
81
				     | ((val & 0x00000000000fffffUL) << 13) /* bit  0 -> 13 */));
89
				     | ((val & 0x00000000000fffffUL) << 13) /* bit  0 -> 13 */));
82
	ia64_patch(insn_addr - 1, 0x1fffffffffcUL, val >> 18);
90
	ia64_patch(insn_addr + 1, 0x1fffffffffcUL, val >> 18);
83
}
91
}
84
92
85
/*
93
/*

Return to bug 116670