Lines Matching refs:ppc_inst
21 static int __patch_instruction(struct ppc_inst *exec_addr, struct ppc_inst instr,
22 struct ppc_inst *patch_addr)
38 int raw_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr)
146 static int do_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr)
149 struct ppc_inst *patch_addr = NULL;
170 patch_addr = (struct ppc_inst *)(text_poke_addr + (kaddr & ~PAGE_MASK));
185 static int do_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr)
192 int patch_instruction(struct ppc_inst *addr, struct ppc_inst instr)
203 int patch_branch(struct ppc_inst *addr, unsigned long target, int flags)
205 struct ppc_inst instr;
242 bool is_conditional_branch(struct ppc_inst instr)
260 int create_branch(struct ppc_inst *instr,
261 const struct ppc_inst *addr,
266 *instr = ppc_inst(0);
276 *instr = ppc_inst(0x48000000 | (flags & 0x3) | (offset & 0x03FFFFFC));
281 int create_cond_branch(struct ppc_inst *instr, const struct ppc_inst *addr,
295 *instr = ppc_inst(0x40000000 | (flags & 0x3FF0003) | (offset & 0xFFFC));
300 static unsigned int branch_opcode(struct ppc_inst instr)
305 static int instr_is_branch_iform(struct ppc_inst instr)
310 static int instr_is_branch_bform(struct ppc_inst instr)
315 int instr_is_relative_branch(struct ppc_inst instr)
323 int instr_is_relative_link_branch(struct ppc_inst instr)
328 static unsigned long branch_iform_target(const struct ppc_inst *instr)
344 static unsigned long branch_bform_target(const struct ppc_inst *instr)
360 unsigned long branch_target(const struct ppc_inst *instr)
370 int instr_is_branch_to_addr(const struct ppc_inst *instr, unsigned long addr)
379 int translate_branch(struct ppc_inst *instr, const struct ppc_inst *dest,
380 const struct ppc_inst *src)
407 patch_branch((struct ppc_inst *)(ibase + (exc / 4) + 1), addr, 0);
424 struct ppc_inst instr;
430 check(instr_is_branch_iform(ppc_inst(0x48000000)));
432 check(instr_is_branch_iform(ppc_inst(0x4bffffff)));
434 check(!instr_is_branch_iform(ppc_inst(0xcbffffff)));
436 check(!instr_is_branch_iform(ppc_inst(0x7bffffff)));
439 check(instr_is_branch_iform(ppc_inst(0x48000001)));
441 check(instr_is_branch_iform(ppc_inst(0x4bfffffd)));
443 check(instr_is_branch_iform(ppc_inst(0x4bff00fd)));
445 check(!instr_is_branch_iform(ppc_inst(0x7bfffffd)));
448 instr = ppc_inst(0x48000103);
451 instr = ppc_inst(0x480420ff);
454 instr = ppc_inst(0x49fffffc);
457 instr = ppc_inst(0x4bfffffc);
460 instr = ppc_inst(0x4a000000);
494 check(ppc_inst_equal(instr, ppc_inst(0x48000000)));
499 struct ppc_inst *iptr;
501 struct ppc_inst instr;
504 iptr = (struct ppc_inst *)ppc_function_entry(test_trampoline);
515 struct ppc_inst *iptr, instr;
522 check(instr_is_branch_bform(ppc_inst(0x40000000)));
524 check(instr_is_branch_bform(ppc_inst(0x43ffffff)));
526 check(!instr_is_branch_bform(ppc_inst(0xc3ffffff)));
528 check(!instr_is_branch_bform(ppc_inst(0x7bffffff)));
531 instr = ppc_inst(0x43ff0103);
534 instr = ppc_inst(0x43ff20ff);
537 instr = ppc_inst(0x43ff7ffc);
540 instr = ppc_inst(0x43fffffc);
543 instr = ppc_inst(0x43ff8000);
580 check(ppc_inst_equal(instr, ppc_inst(0x43FF0000)));
587 struct ppc_inst instr;
614 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x4a000000)));
625 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x49fffffc)));
671 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x43ff8000)));
683 check(ppc_inst_equal(ppc_inst_read(q), ppc_inst(0x43ff7ffc)));
718 __patch_instruction((struct ppc_inst *)code_patching_test1,
720 (struct ppc_inst *)code_patching_test1);