Lines Matching full:instruction
79 * handle an instruction that does an unaligned memory access by emulating the
81 * - note that PC _may not_ point to the faulting instruction
82 * (if that instruction is in a branch delay slot)
85 static int handle_unaligned_ins(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_ins() argument
93 index = (instruction>>8)&15; /* 0x0F00 */ in handle_unaligned_ins()
96 index = (instruction>>4)&15; /* 0x00F0 */ in handle_unaligned_ins()
99 count = 1<<(instruction&3); in handle_unaligned_ins()
109 switch (instruction>>12) { in handle_unaligned_ins()
111 if (instruction & 8) { in handle_unaligned_ins()
143 dstu += (instruction&0x000F)<<2; in handle_unaligned_ins()
151 if (instruction & 4) in handle_unaligned_ins()
165 srcu += (instruction & 0x000F) << 2; in handle_unaligned_ins()
176 if (instruction & 4) in handle_unaligned_ins()
191 switch ((instruction&0xFF00)>>8) { in handle_unaligned_ins()
198 dstu += (instruction & 0x000F) << 1; in handle_unaligned_ins()
207 srcu += (instruction & 0x000F) << 1; in handle_unaligned_ins()
225 srcu += (instruction & 0x00FF) << 1; in handle_unaligned_ins()
242 srcu += (instruction & 0x00FF) << 2; in handle_unaligned_ins()
262 * emulate the instruction in the delay slot
263 * - fetches the instruction from PC+2
269 insn_size_t instruction; in handle_delayslot() local
273 if (copy_from_user(&instruction, addr, sizeof(instruction))) { in handle_delayslot()
274 /* the instruction-fetch faulted */ in handle_delayslot()
283 return handle_unaligned_ins(instruction, regs, ma); in handle_delayslot()
287 * handle an instruction that does an unaligned memory access
302 int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_access() argument
312 if (instruction_size(instruction) != 2) in handle_unaligned_access()
315 index = (instruction>>8)&15; /* 0x0F00 */ in handle_unaligned_access()
326 unaligned_fixups_notify(current, instruction, regs); in handle_unaligned_access()
332 switch (instruction&0xF000) { in handle_unaligned_access()
334 if (instruction==0x000B) { in handle_unaligned_access()
336 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
340 else if ((instruction&0x00FF)==0x0023) { in handle_unaligned_access()
342 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
346 else if ((instruction&0x00FF)==0x0003) { in handle_unaligned_access()
348 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
367 if ((instruction&0x00FF)==0x002B) { in handle_unaligned_access()
369 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
373 else if ((instruction&0x00FF)==0x000B) { in handle_unaligned_access()
375 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
394 switch (instruction&0x0F00) { in handle_unaligned_access()
403 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
410 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
417 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
424 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
434 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
436 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
440 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
443 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
452 /* handle non-delay-slot instruction */ in handle_unaligned_access()
454 ret = handle_unaligned_ins(instruction, regs, ma); in handle_unaligned_access()
456 regs->pc += instruction_size(instruction); in handle_unaligned_access()
462 * - instruction address error:
468 * Unfortuntaly we can't distinguish between instruction address error
477 insn_size_t instruction; in do_address_error() local
493 if (copy_from_user(&instruction, (insn_size_t *)(regs->pc & ~1), in do_address_error()
494 sizeof(instruction))) { in do_address_error()
501 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
510 regs->pc += instruction_size(instruction); in do_address_error()
522 tmp = handle_unaligned_access(instruction, regs, in do_address_error()
542 if (copy_from_user(&instruction, (void __user *)(regs->pc), in do_address_error()
543 sizeof(instruction))) { in do_address_error()
544 /* Argh. Fault on the instruction itself. in do_address_error()
551 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
553 handle_unaligned_access(instruction, regs, &user_mem_access, in do_address_error()
578 /* Check for any type of DSP or support instruction */ in is_dsp_inst()
628 /* Check if it's a DSP instruction */ in do_reserved_inst()
630 /* Enable DSP mode, and restart instruction. */ in do_reserved_inst()
642 die_if_no_fixup("reserved instruction", regs, error_code); in do_reserved_inst()
716 die_if_no_fixup("illegal slot instruction", regs, inst); in do_illegal_slot_inst()