ia64/xen-unstable

changeset 9320:d18f8fd07fa2

[IA64] remove linux/patch.c

Removed, was unused.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Tue Mar 21 09:18:28 2006 -0700 (2006-03-21)
parents 263901a2a995
children 212eb6a2d8cd
files xen/arch/ia64/linux/patch.c
line diff
     1.1 --- a/xen/arch/ia64/linux/patch.c	Tue Mar 21 09:13:07 2006 -0700
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,189 +0,0 @@
     1.4 -/*
     1.5 - * Instruction-patching support.
     1.6 - *
     1.7 - * Copyright (C) 2003 Hewlett-Packard Co
     1.8 - *	David Mosberger-Tang <davidm@hpl.hp.com>
     1.9 - */
    1.10 -#include <linux/init.h>
    1.11 -#include <linux/string.h>
    1.12 -
    1.13 -#include <asm/patch.h>
    1.14 -#include <asm/processor.h>
    1.15 -#include <asm/sections.h>
    1.16 -#include <asm/system.h>
    1.17 -#include <asm/unistd.h>
    1.18 -
    1.19 -/*
    1.20 - * This was adapted from code written by Tony Luck:
    1.21 - *
    1.22 - * The 64-bit value in a "movl reg=value" is scattered between the two words of the bundle
    1.23 - * like this:
    1.24 - *
    1.25 - * 6  6         5         4         3         2         1
    1.26 - * 3210987654321098765432109876543210987654321098765432109876543210
    1.27 - * ABBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCDEEEEEFFFFFFFFFGGGGGGG
    1.28 - *
    1.29 - * CCCCCCCCCCCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    1.30 - * xxxxAFFFFFFFFFEEEEEDxGGGGGGGxxxxxxxxxxxxxBBBBBBBBBBBBBBBBBBBBBBB
    1.31 - */
    1.32 -static u64
    1.33 -get_imm64 (u64 insn_addr)
    1.34 -{
    1.35 -	u64 *p = (u64 *) (insn_addr & -16);	/* mask out slot number */
    1.36 -
    1.37 -	return ( (p[1] & 0x0800000000000000UL) << 4)  | /*A*/
    1.38 -		((p[1] & 0x00000000007fffffUL) << 40) | /*B*/
    1.39 -		((p[0] & 0xffffc00000000000UL) >> 24) | /*C*/
    1.40 -		((p[1] & 0x0000100000000000UL) >> 23) | /*D*/
    1.41 -		((p[1] & 0x0003e00000000000UL) >> 29) | /*E*/
    1.42 -		((p[1] & 0x07fc000000000000UL) >> 43) | /*F*/
    1.43 -		((p[1] & 0x000007f000000000UL) >> 36);  /*G*/
    1.44 -}
    1.45 -
    1.46 -/* Patch instruction with "val" where "mask" has 1 bits. */
    1.47 -void
    1.48 -ia64_patch (u64 insn_addr, u64 mask, u64 val)
    1.49 -{
    1.50 -	u64 m0, m1, v0, v1, b0, b1, *b = (u64 *) (insn_addr & -16);
    1.51 -#	define insn_mask ((1UL << 41) - 1)
    1.52 -	unsigned long shift;
    1.53 -
    1.54 -	b0 = b[0]; b1 = b[1];
    1.55 -	shift = 5 + 41 * (insn_addr % 16); /* 5 bits of template, then 3 x 41-bit instructions */
    1.56 -	if (shift >= 64) {
    1.57 -		m1 = mask << (shift - 64);
    1.58 -		v1 = val << (shift - 64);
    1.59 -	} else {
    1.60 -		m0 = mask << shift; m1 = mask >> (64 - shift);
    1.61 -		v0 = val  << shift; v1 = val >> (64 - shift);
    1.62 -		b[0] = (b0 & ~m0) | (v0 & m0);
    1.63 -	}
    1.64 -	b[1] = (b1 & ~m1) | (v1 & m1);
    1.65 -}
    1.66 -
    1.67 -void
    1.68 -ia64_patch_imm64 (u64 insn_addr, u64 val)
    1.69 -{
    1.70 -	ia64_patch(insn_addr,
    1.71 -		   0x01fffefe000UL, (  ((val & 0x8000000000000000UL) >> 27) /* bit 63 -> 36 */
    1.72 -				     | ((val & 0x0000000000200000UL) <<  0) /* bit 21 -> 21 */
    1.73 -				     | ((val & 0x00000000001f0000UL) <<  6) /* bit 16 -> 22 */
    1.74 -				     | ((val & 0x000000000000ff80UL) << 20) /* bit  7 -> 27 */
    1.75 -				     | ((val & 0x000000000000007fUL) << 13) /* bit  0 -> 13 */));
    1.76 -	ia64_patch(insn_addr - 1, 0x1ffffffffffUL, val >> 22);
    1.77 -}
    1.78 -
    1.79 -void
    1.80 -ia64_patch_imm60 (u64 insn_addr, u64 val)
    1.81 -{
    1.82 -	ia64_patch(insn_addr,
    1.83 -		   0x011ffffe000UL, (  ((val & 0x0800000000000000UL) >> 23) /* bit 59 -> 36 */
    1.84 -				     | ((val & 0x00000000000fffffUL) << 13) /* bit  0 -> 13 */));
    1.85 -	ia64_patch(insn_addr - 1, 0x1fffffffffcUL, val >> 18);
    1.86 -}
    1.87 -
    1.88 -/*
    1.89 - * We need sometimes to load the physical address of a kernel
    1.90 - * object.  Often we can convert the virtual address to physical
    1.91 - * at execution time, but sometimes (either for performance reasons
    1.92 - * or during error recovery) we cannot to this.  Patch the marked
    1.93 - * bundles to load the physical address.
    1.94 - */
    1.95 -void __init
    1.96 -ia64_patch_vtop (unsigned long start, unsigned long end)
    1.97 -{
    1.98 -	s32 *offp = (s32 *) start;
    1.99 -	u64 ip;
   1.100 -
   1.101 -	while (offp < (s32 *) end) {
   1.102 -		ip = (u64) offp + *offp;
   1.103 -
   1.104 -		/* replace virtual address with corresponding physical address: */
   1.105 -		ia64_patch_imm64(ip, ia64_tpa(get_imm64(ip)));
   1.106 -		ia64_fc((void *) ip);
   1.107 -		++offp;
   1.108 -	}
   1.109 -	ia64_sync_i();
   1.110 -	ia64_srlz_i();
   1.111 -}
   1.112 -
   1.113 -void
   1.114 -ia64_patch_mckinley_e9 (unsigned long start, unsigned long end)
   1.115 -{
   1.116 -	static int first_time = 1;
   1.117 -	int need_workaround;
   1.118 -	s32 *offp = (s32 *) start;
   1.119 -	u64 *wp;
   1.120 -
   1.121 -	need_workaround = (local_cpu_data->family == 0x1f && local_cpu_data->model == 0);
   1.122 -
   1.123 -	if (first_time) {
   1.124 -		first_time = 0;
   1.125 -		if (need_workaround)
   1.126 -			printk(KERN_INFO "Leaving McKinley Errata 9 workaround enabled\n");
   1.127 -		else
   1.128 -			printk(KERN_INFO "McKinley Errata 9 workaround not needed; "
   1.129 -			       "disabling it\n");
   1.130 -	}
   1.131 -	if (need_workaround)
   1.132 -		return;
   1.133 -
   1.134 -	while (offp < (s32 *) end) {
   1.135 -		wp = (u64 *) ia64_imva((char *) offp + *offp);
   1.136 -		wp[0] = 0x0000000100000000UL; /* nop.m 0; nop.i 0; nop.i 0 */
   1.137 -		wp[1] = 0x0004000000000200UL;
   1.138 -		wp[2] = 0x0000000100000011UL; /* nop.m 0; nop.i 0; br.ret.sptk.many b6 */
   1.139 -		wp[3] = 0x0084006880000200UL;
   1.140 -		ia64_fc(wp); ia64_fc(wp + 2);
   1.141 -		++offp;
   1.142 -	}
   1.143 -	ia64_sync_i();
   1.144 -	ia64_srlz_i();
   1.145 -}
   1.146 -
   1.147 -static void
   1.148 -patch_fsyscall_table (unsigned long start, unsigned long end)
   1.149 -{
   1.150 -	extern unsigned long fsyscall_table[NR_syscalls];
   1.151 -	s32 *offp = (s32 *) start;
   1.152 -	u64 ip;
   1.153 -
   1.154 -	while (offp < (s32 *) end) {
   1.155 -		ip = (u64) ia64_imva((char *) offp + *offp);
   1.156 -		ia64_patch_imm64(ip, (u64) fsyscall_table);
   1.157 -		ia64_fc((void *) ip);
   1.158 -		++offp;
   1.159 -	}
   1.160 -	ia64_sync_i();
   1.161 -	ia64_srlz_i();
   1.162 -}
   1.163 -
   1.164 -static void
   1.165 -patch_brl_fsys_bubble_down (unsigned long start, unsigned long end)
   1.166 -{
   1.167 -	extern char fsys_bubble_down[];
   1.168 -	s32 *offp = (s32 *) start;
   1.169 -	u64 ip;
   1.170 -
   1.171 -	while (offp < (s32 *) end) {
   1.172 -		ip = (u64) offp + *offp;
   1.173 -		ia64_patch_imm60((u64) ia64_imva((void *) ip),
   1.174 -				 (u64) (fsys_bubble_down - (ip & -16)) / 16);
   1.175 -		ia64_fc((void *) ip);
   1.176 -		++offp;
   1.177 -	}
   1.178 -	ia64_sync_i();
   1.179 -	ia64_srlz_i();
   1.180 -}
   1.181 -
   1.182 -void
   1.183 -ia64_patch_gate (void)
   1.184 -{
   1.185 -#	define START(name)	((unsigned long) __start_gate_##name##_patchlist)
   1.186 -#	define END(name)	((unsigned long)__end_gate_##name##_patchlist)
   1.187 -
   1.188 -	patch_fsyscall_table(START(fsyscall), END(fsyscall));
   1.189 -	patch_brl_fsys_bubble_down(START(brl_fsys_bubble_down), END(brl_fsys_bubble_down));
   1.190 -	ia64_patch_vtop(START(vtop), END(vtop));
   1.191 -	ia64_patch_mckinley_e9(START(mckinley_e9), END(mckinley_e9));
   1.192 -}