Lines Matching full:instruction

97  * handle an instruction that does an unaligned memory access by emulating the
99 * - note that PC _may not_ point to the faulting instruction
100 * (if that instruction is in a branch delay slot)
103 static int handle_unaligned_ins(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_ins() argument
111 index = (instruction>>8)&15; /* 0x0F00 */ in handle_unaligned_ins()
114 index = (instruction>>4)&15; /* 0x00F0 */ in handle_unaligned_ins()
117 count = 1<<(instruction&3); in handle_unaligned_ins()
127 switch (instruction>>12) { in handle_unaligned_ins()
129 if (instruction & 8) { in handle_unaligned_ins()
161 dstu += (instruction&0x000F)<<2; in handle_unaligned_ins()
169 if (instruction & 4) in handle_unaligned_ins()
183 srcu += (instruction & 0x000F) << 2; in handle_unaligned_ins()
194 if (instruction & 4) in handle_unaligned_ins()
209 switch ((instruction&0xFF00)>>8) { in handle_unaligned_ins()
216 dstu += (instruction & 0x000F) << 1; in handle_unaligned_ins()
225 srcu += (instruction & 0x000F) << 1; in handle_unaligned_ins()
243 srcu += (instruction & 0x00FF) << 1; in handle_unaligned_ins()
260 srcu += (instruction & 0x00FF) << 2; in handle_unaligned_ins()
280 * emulate the instruction in the delay slot
281 * - fetches the instruction from PC+2
287 insn_size_t instruction; in handle_delayslot() local
291 if (copy_from_user(&instruction, addr, sizeof(instruction))) { in handle_delayslot()
292 /* the instruction-fetch faulted */ in handle_delayslot()
301 return handle_unaligned_ins(instruction, regs, ma); in handle_delayslot()
305 * handle an instruction that does an unaligned memory access
320 int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_access() argument
330 if (instruction_size(instruction) != 2) in handle_unaligned_access()
333 index = (instruction>>8)&15; /* 0x0F00 */ in handle_unaligned_access()
344 unaligned_fixups_notify(current, instruction, regs); in handle_unaligned_access()
350 switch (instruction&0xF000) { in handle_unaligned_access()
352 if (instruction==0x000B) { in handle_unaligned_access()
354 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
358 else if ((instruction&0x00FF)==0x0023) { in handle_unaligned_access()
360 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
364 else if ((instruction&0x00FF)==0x0003) { in handle_unaligned_access()
366 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
385 if ((instruction&0x00FF)==0x002B) { in handle_unaligned_access()
387 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
391 else if ((instruction&0x00FF)==0x000B) { in handle_unaligned_access()
393 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
412 switch (instruction&0x0F00) { in handle_unaligned_access()
421 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
428 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
435 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
442 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
452 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
454 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
458 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
461 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
470 /* handle non-delay-slot instruction */ in handle_unaligned_access()
472 ret = handle_unaligned_ins(instruction, regs, ma); in handle_unaligned_access()
474 regs->pc += instruction_size(instruction); in handle_unaligned_access()
480 * - instruction address error:
486 * Unfortuntaly we can't distinguish between instruction address error
494 insn_size_t instruction; in do_address_error() local
509 if (copy_from_user(&instruction, (insn_size_t __user *)(regs->pc & ~1), in do_address_error()
510 sizeof(instruction))) { in do_address_error()
515 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
524 regs->pc += instruction_size(instruction); in do_address_error()
535 tmp = handle_unaligned_access(instruction, regs, in do_address_error()
553 if (copy_from_kernel_nofault(&instruction, (void *)(regs->pc), in do_address_error()
554 sizeof(instruction))) { in do_address_error()
555 /* Argh. Fault on the instruction itself. in do_address_error()
561 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
563 handle_unaligned_access(instruction, regs, &kernel_mem_access, in do_address_error()
587 /* Check for any type of DSP or support instruction */ in is_dsp_inst()
637 /* Check if it's a DSP instruction */ in do_reserved_inst()
639 /* Enable DSP mode, and restart instruction. */ in do_reserved_inst()
651 die_if_no_fixup("reserved instruction", regs, error_code); in do_reserved_inst()
725 die_if_no_fixup("illegal slot instruction", regs, inst); in do_illegal_slot_inst()