Lines Matching full:instruction

96  * handle an instruction that does an unaligned memory access by emulating the
98 * - note that PC _may not_ point to the faulting instruction
99 * (if that instruction is in a branch delay slot)
102 static int handle_unaligned_ins(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_ins() argument
110 index = (instruction>>8)&15; /* 0x0F00 */ in handle_unaligned_ins()
113 index = (instruction>>4)&15; /* 0x00F0 */ in handle_unaligned_ins()
116 count = 1<<(instruction&3); in handle_unaligned_ins()
126 switch (instruction>>12) { in handle_unaligned_ins()
128 if (instruction & 8) { in handle_unaligned_ins()
160 dstu += (instruction&0x000F)<<2; in handle_unaligned_ins()
168 if (instruction & 4) in handle_unaligned_ins()
182 srcu += (instruction & 0x000F) << 2; in handle_unaligned_ins()
193 if (instruction & 4) in handle_unaligned_ins()
208 switch ((instruction&0xFF00)>>8) { in handle_unaligned_ins()
215 dstu += (instruction & 0x000F) << 1; in handle_unaligned_ins()
224 srcu += (instruction & 0x000F) << 1; in handle_unaligned_ins()
242 srcu += (instruction & 0x00FF) << 1; in handle_unaligned_ins()
259 srcu += (instruction & 0x00FF) << 2; in handle_unaligned_ins()
279 * emulate the instruction in the delay slot
280 * - fetches the instruction from PC+2
286 insn_size_t instruction; in handle_delayslot() local
290 if (copy_from_user(&instruction, addr, sizeof(instruction))) { in handle_delayslot()
291 /* the instruction-fetch faulted */ in handle_delayslot()
300 return handle_unaligned_ins(instruction, regs, ma); in handle_delayslot()
304 * handle an instruction that does an unaligned memory access
319 int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_access() argument
329 if (instruction_size(instruction) != 2) in handle_unaligned_access()
332 index = (instruction>>8)&15; /* 0x0F00 */ in handle_unaligned_access()
343 unaligned_fixups_notify(current, instruction, regs); in handle_unaligned_access()
349 switch (instruction&0xF000) { in handle_unaligned_access()
351 if (instruction==0x000B) { in handle_unaligned_access()
353 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
357 else if ((instruction&0x00FF)==0x0023) { in handle_unaligned_access()
359 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
363 else if ((instruction&0x00FF)==0x0003) { in handle_unaligned_access()
365 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
384 if ((instruction&0x00FF)==0x002B) { in handle_unaligned_access()
386 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
390 else if ((instruction&0x00FF)==0x000B) { in handle_unaligned_access()
392 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
411 switch (instruction&0x0F00) { in handle_unaligned_access()
420 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
427 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
434 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
441 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
451 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
453 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
457 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
460 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
469 /* handle non-delay-slot instruction */ in handle_unaligned_access()
471 ret = handle_unaligned_ins(instruction, regs, ma); in handle_unaligned_access()
473 regs->pc += instruction_size(instruction); in handle_unaligned_access()
479 * - instruction address error:
485 * Unfortuntaly we can't distinguish between instruction address error
493 insn_size_t instruction; in do_address_error() local
508 if (copy_from_user(&instruction, (insn_size_t __user *)(regs->pc & ~1), in do_address_error()
509 sizeof(instruction))) { in do_address_error()
514 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
523 regs->pc += instruction_size(instruction); in do_address_error()
534 tmp = handle_unaligned_access(instruction, regs, in do_address_error()
552 if (copy_from_kernel_nofault(&instruction, (void *)(regs->pc), in do_address_error()
553 sizeof(instruction))) { in do_address_error()
554 /* Argh. Fault on the instruction itself. in do_address_error()
560 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
562 handle_unaligned_access(instruction, regs, &kernel_mem_access, in do_address_error()
586 /* Check for any type of DSP or support instruction */ in is_dsp_inst()
636 /* Check if it's a DSP instruction */ in do_reserved_inst()
638 /* Enable DSP mode, and restart instruction. */ in do_reserved_inst()
650 die_if_no_fixup("reserved instruction", regs, error_code); in do_reserved_inst()
724 die_if_no_fixup("illegal slot instruction", regs, inst); in do_illegal_slot_inst()