Lines Matching +full:4 +full:- +full:temp

1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* align.c - handle alignment exceptions for the Power PC.
5 * Copyright (c) 1998-1999 TiVo, Inc.
9 * Copyright (c) 2001-2002 PPC64 team, IBM Corp
10 * 64-bit and Power4 support
40 #define SE 2 /* sign-extend value, or FP ld/st as word */
56 { 4, LD }, /* 0 10 00: evlwhe[x] */
58 { 4, LD }, /* 0 10 10: evlwhou[x] */
59 { 4, LD+SE }, /* 0 10 11: evlwhos[x] */
60 { 4, LD+E4 }, /* 0 11 00: evlwwsplat[x] */
62 { 4, LD }, /* 0 11 10: evlwhsplat[x] */
73 { 4, ST }, /* 1 10 00: evstwhe[x] */
75 { 4, ST }, /* 1 10 10: evstwho[x] */
77 { 4, ST+E4 }, /* 1 11 00: evstwwe[x] */
79 { 4, ST+E4 }, /* 1 11 10: evstwwo[x] */
104 * Only Book-E has these instructions, and it does true little-endian,
113 u16 h[4]; in emulate_spe()
115 } data, temp; in emulate_spe() local
117 unsigned long *evr = &current->thread.evr[reg]; in emulate_spe()
124 addr = (unsigned char __user *)regs->dar; in emulate_spe()
145 data.w[1] = regs->gpr[reg]; in emulate_spe()
149 data.h[3] = regs->gpr[reg] >> 16; in emulate_spe()
153 data.h[3] = regs->gpr[reg] & 0xffff; in emulate_spe()
159 data.w[1] = regs->gpr[reg]; in emulate_spe()
162 return -EINVAL; in emulate_spe()
165 temp.ll = data.ll = 0; in emulate_spe()
169 return -EFAULT; in emulate_spe()
173 unsafe_get_user(temp.v[0], p++, Efault_read); in emulate_spe()
174 unsafe_get_user(temp.v[1], p++, Efault_read); in emulate_spe()
175 unsafe_get_user(temp.v[2], p++, Efault_read); in emulate_spe()
176 unsafe_get_user(temp.v[3], p++, Efault_read); in emulate_spe()
178 case 4: in emulate_spe()
179 unsafe_get_user(temp.v[4], p++, Efault_read); in emulate_spe()
180 unsafe_get_user(temp.v[5], p++, Efault_read); in emulate_spe()
183 unsafe_get_user(temp.v[6], p++, Efault_read); in emulate_spe()
184 unsafe_get_user(temp.v[7], p++, Efault_read); in emulate_spe()
192 data.ll = temp.ll; in emulate_spe()
195 data.h[0] = temp.h[3]; in emulate_spe()
196 data.h[2] = temp.h[3]; in emulate_spe()
200 data.h[1] = temp.h[3]; in emulate_spe()
201 data.h[3] = temp.h[3]; in emulate_spe()
204 data.h[0] = temp.h[2]; in emulate_spe()
205 data.h[2] = temp.h[3]; in emulate_spe()
209 data.h[1] = temp.h[2]; in emulate_spe()
210 data.h[3] = temp.h[3]; in emulate_spe()
213 data.w[0] = temp.w[1]; in emulate_spe()
214 data.w[1] = temp.w[1]; in emulate_spe()
217 data.h[0] = temp.h[2]; in emulate_spe()
218 data.h[1] = temp.h[2]; in emulate_spe()
219 data.h[2] = temp.h[3]; in emulate_spe()
220 data.h[3] = temp.h[3]; in emulate_spe()
223 return -EINVAL; in emulate_spe()
256 return -EFAULT; in emulate_spe()
265 case 4: in emulate_spe()
266 unsafe_put_user(data.v[4], p++, Efault_write); in emulate_spe()
276 regs->gpr[reg] = data.w[1]; in emulate_spe()
283 return -EFAULT; in emulate_spe()
287 return -EFAULT; in emulate_spe()
296 * Return -EFAULT if data address is bad
307 if (is_kernel_addr(regs->nip)) in fix_alignment()
308 r = copy_inst_from_kernel_nofault(&instr, (void *)regs->nip); in fix_alignment()
310 r = __get_user_instr(instr, (void __user *)regs->nip); in fix_alignment()
313 return -EFAULT; in fix_alignment()
314 if ((regs->msr & MSR_LE) != (MSR_KERNEL & MSR_LE)) { in fix_alignment()
315 /* We don't handle PPC little-endian any more... */ in fix_alignment()
317 return -EIO; in fix_alignment()
337 * when pasting to a co-processor. Furthermore, paste_last is the in fix_alignment()
341 return -EIO; in fix_alignment()
345 return -EINVAL; in fix_alignment()
350 return -EINVAL; in fix_alignment()
356 return -EIO; in fix_alignment()