Home
last modified time | relevance | path

Searched refs:insn (Results 1 – 25 of 352) sorted by relevance

12345678910>>...15

/linux-3.4.99/arch/x86/lib/
Dinsn.c26 #define validate_next(t, insn, n) \ argument
27 ((insn)->next_byte + sizeof(t) + n - (insn)->kaddr <= MAX_INSN_SIZE)
29 #define __get_next(t, insn) \ argument
30 ({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })
32 #define __peek_nbyte_next(t, insn, n) \ argument
33 ({ t r = *(t*)((insn)->next_byte + n); r; })
35 #define get_next(t, insn) \ argument
36 ({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
38 #define peek_nbyte_next(t, insn, n) \ argument
39 ({ if (unlikely(!validate_next(t, insn, n))) goto err_out; __peek_nbyte_next(t, insn, n); })
[all …]
/linux-3.4.99/arch/x86/include/asm/
Dinsn.h36 struct insn { struct
99 extern void insn_init(struct insn *insn, const void *kaddr, int x86_64);
100 extern void insn_get_prefixes(struct insn *insn);
101 extern void insn_get_opcode(struct insn *insn);
102 extern void insn_get_modrm(struct insn *insn);
103 extern void insn_get_sib(struct insn *insn);
104 extern void insn_get_displacement(struct insn *insn);
105 extern void insn_get_immediate(struct insn *insn);
106 extern void insn_get_length(struct insn *insn);
109 static inline void insn_get_attribute(struct insn *insn) in insn_get_attribute() argument
[all …]
/linux-3.4.99/arch/powerpc/xmon/
Dspu.h91 #define SIGNED_EXTRACT(insn,size,pos) (((int)((insn) << (32-size-pos))) >> (32-size)) argument
92 #define UNSIGNED_EXTRACT(insn,size,pos) (((insn) >> pos) & ((1 << size)-1)) argument
94 #define DECODE_INSN_RT(insn) (insn & 0x7f) argument
95 #define DECODE_INSN_RA(insn) ((insn >> 7) & 0x7f) argument
96 #define DECODE_INSN_RB(insn) ((insn >> 14) & 0x7f) argument
97 #define DECODE_INSN_RC(insn) ((insn >> 21) & 0x7f) argument
99 #define DECODE_INSN_I10(insn) SIGNED_EXTRACT(insn,10,14) argument
100 #define DECODE_INSN_U10(insn) UNSIGNED_EXTRACT(insn,10,14) argument
103 #define DECODE_INSN_I16(insn) SIGNED_EXTRACT(insn,16,7) argument
104 #define DECODE_INSN_U16(insn) UNSIGNED_EXTRACT(insn,16,7) argument
[all …]
Dspu-dis.c55 get_index_for_opcode (unsigned int insn) in get_index_for_opcode() argument
58 unsigned int opcode = insn >> (32-11); in get_index_for_opcode()
94 print_insn_spu (unsigned long insn, unsigned long memaddr) in print_insn_spu() argument
101 index = get_index_for_opcode (insn); in print_insn_spu()
105 printf(".long 0x%x", insn); in print_insn_spu()
117 int fb = (insn >> (32-18)) & 0x7f; in print_insn_spu()
138 DECODE_INSN_RT (insn)); in print_insn_spu()
142 DECODE_INSN_RA (insn)); in print_insn_spu()
146 DECODE_INSN_RB (insn)); in print_insn_spu()
150 DECODE_INSN_RC (insn)); in print_insn_spu()
[all …]
/linux-3.4.99/arch/m32r/kernel/
Dalign.c38 #define REG1(insn) (((insn) & 0x0f00) >> 8) argument
39 #define REG2(insn) ((insn) & 0x000f) argument
81 static int emu_addi(unsigned short insn, struct pt_regs *regs) in emu_addi() argument
83 char imm = (char)(insn & 0xff); in emu_addi()
84 int dest = REG1(insn); in emu_addi()
94 static int emu_ldi(unsigned short insn, struct pt_regs *regs) in emu_ldi() argument
96 char imm = (char)(insn & 0xff); in emu_ldi()
98 set_reg(regs, REG1(insn), (int)imm); in emu_ldi()
103 static int emu_add(unsigned short insn, struct pt_regs *regs) in emu_add() argument
105 int dest = REG1(insn); in emu_add()
[all …]
Dptrace.c255 compute_next_pc_for_16bit_insn(unsigned long insn, unsigned long pc, in compute_next_pc_for_16bit_insn() argument
264 if (insn & 0x00008000) in compute_next_pc_for_16bit_insn()
267 insn &= 0x7fff; /* right slot */ in compute_next_pc_for_16bit_insn()
269 insn >>= 16; /* left slot */ in compute_next_pc_for_16bit_insn()
271 op = (insn >> 12) & 0xf; in compute_next_pc_for_16bit_insn()
272 op2 = (insn >> 8) & 0xf; in compute_next_pc_for_16bit_insn()
273 op3 = (insn >> 4) & 0xf; in compute_next_pc_for_16bit_insn()
280 disp = (long)(insn << 24) >> 22; in compute_next_pc_for_16bit_insn()
288 disp = (long)(insn << 24) >> 22; in compute_next_pc_for_16bit_insn()
295 disp = (long)(insn << 24) >> 22; in compute_next_pc_for_16bit_insn()
[all …]
/linux-3.4.99/arch/mips/kernel/
Dbranch.c32 union mips_instruction insn) in __compute_return_epc_for_insn() argument
38 switch (insn.i_format.opcode) { in __compute_return_epc_for_insn()
43 switch (insn.r_format.func) { in __compute_return_epc_for_insn()
45 regs->regs[insn.r_format.rd] = epc + 8; in __compute_return_epc_for_insn()
48 regs->cp0_epc = regs->regs[insn.r_format.rs]; in __compute_return_epc_for_insn()
59 switch (insn.i_format.rt) { in __compute_return_epc_for_insn()
62 if ((long)regs->regs[insn.i_format.rs] < 0) { in __compute_return_epc_for_insn()
63 epc = epc + 4 + (insn.i_format.simmediate << 2); in __compute_return_epc_for_insn()
64 if (insn.i_format.rt == bltzl_op) in __compute_return_epc_for_insn()
73 if ((long)regs->regs[insn.i_format.rs] >= 0) { in __compute_return_epc_for_insn()
[all …]
/linux-3.4.99/arch/sparc/kernel/
Dunaligned_32.c28 static inline enum direction decode_direction(unsigned int insn) in decode_direction() argument
30 unsigned long tmp = (insn >> 21) & 1; in decode_direction()
35 if(((insn>>19)&0x3f) == 15) in decode_direction()
43 static inline int decode_access_size(unsigned int insn) in decode_access_size() argument
45 insn = (insn >> 19) & 3; in decode_access_size()
47 if(!insn) in decode_access_size()
49 else if(insn == 3) in decode_access_size()
51 else if(insn == 2) in decode_access_size()
54 printk("Impossible unaligned trap. insn=%08x\n", insn); in decode_access_size()
61 static inline int decode_signedness(unsigned int insn) in decode_signedness() argument
[all …]
Dvisemul.c288 static void edge(struct pt_regs *regs, unsigned int insn, unsigned int opf) in edge() argument
293 maybe_flush_windows(RS1(insn), RS2(insn), RD(insn), 0); in edge()
294 orig_rs1 = rs1 = fetch_reg(RS1(insn), regs); in edge()
295 orig_rs2 = rs2 = fetch_reg(RS2(insn), regs); in edge()
344 store_reg(regs, rd_val, RD(insn)); in edge()
366 static void array(struct pt_regs *regs, unsigned int insn, unsigned int opf) in array() argument
371 maybe_flush_windows(RS1(insn), RS2(insn), RD(insn), 0); in array()
372 rs1 = fetch_reg(RS1(insn), regs); in array()
373 rs2 = fetch_reg(RS2(insn), regs); in array()
397 store_reg(regs, rd_val, RD(insn)); in array()
[all …]
Dunaligned_64.c37 static inline enum direction decode_direction(unsigned int insn) in decode_direction() argument
39 unsigned long tmp = (insn >> 21) & 1; in decode_direction()
44 switch ((insn>>19)&0xf) { in decode_direction()
54 static inline int decode_access_size(struct pt_regs *regs, unsigned int insn) in decode_access_size() argument
58 tmp = ((insn >> 19) & 0xf); in decode_access_size()
69 printk("Impossible unaligned trap. insn=%08x\n", insn); in decode_access_size()
82 static inline int decode_asi(unsigned int insn, struct pt_regs *regs) in decode_asi() argument
84 if (insn & 0x800000) { in decode_asi()
85 if (insn & 0x2000) in decode_asi()
88 return (unsigned char)(insn >> 5); /* imm_asi */ in decode_asi()
[all …]
/linux-3.4.99/arch/arm/kernel/
Dkprobes-thumb.c44 kprobe_opcode_t insn = p->opcode; in t32_simulate_table_branch() local
46 int rn = (insn >> 16) & 0xf; in t32_simulate_table_branch()
47 int rm = insn & 0xf; in t32_simulate_table_branch()
53 if (insn & 0x10) /* TBH */ in t32_simulate_table_branch()
64 kprobe_opcode_t insn = p->opcode; in t32_simulate_mrs() local
65 int rd = (insn >> 8) & 0xf; in t32_simulate_mrs()
73 kprobe_opcode_t insn = p->opcode; in t32_simulate_cond_branch() local
76 long offset = insn & 0x7ff; /* imm11 */ in t32_simulate_cond_branch()
77 offset += (insn & 0x003f0000) >> 5; /* imm6 */ in t32_simulate_cond_branch()
78 offset += (insn & 0x00002000) << 4; /* J1 */ in t32_simulate_cond_branch()
[all …]
Dkprobes-common.c187 kprobe_opcode_t insn = p->opcode; in simulate_ldm1stm1() local
188 int rn = (insn >> 16) & 0xf; in simulate_ldm1stm1()
189 int lbit = insn & (1 << 20); in simulate_ldm1stm1()
190 int wbit = insn & (1 << 21); in simulate_ldm1stm1()
191 int ubit = insn & (1 << 23); in simulate_ldm1stm1()
192 int pbit = insn & (1 << 24); in simulate_ldm1stm1()
198 reg_bit_vector = insn & 0xffff; in simulate_ldm1stm1()
208 reg_bit_vector = insn & 0xffff; in simulate_ldm1stm1()
280 kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi) in kprobe_decode_ldmstm() argument
283 unsigned reglist = insn & 0xffff; in kprobe_decode_ldmstm()
[all …]
Dpatch.c13 unsigned int insn; member
16 void __kprobes __patch_text(void *addr, unsigned int insn) in __patch_text() argument
21 if (thumb2 && __opcode_is_thumb16(insn)) { in __patch_text()
22 *(u16 *)addr = __opcode_to_mem_thumb16(insn); in __patch_text()
25 u16 first = __opcode_thumb32_first(insn); in __patch_text()
26 u16 second = __opcode_thumb32_second(insn); in __patch_text()
35 insn = __opcode_to_mem_thumb32(insn); in __patch_text()
37 insn = __opcode_to_mem_arm(insn); in __patch_text()
39 *(u32 *)addr = insn; in __patch_text()
51 __patch_text(patch->addr, patch->insn); in patch_text_stop_machine()
[all …]
Dkprobes-arm.c69 #define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25) argument
110 kprobe_opcode_t insn = p->opcode; in simulate_bbl() local
112 int disp = branch_displacement(insn); in simulate_bbl()
114 if (insn & (1 << 24)) in simulate_bbl()
122 kprobe_opcode_t insn = p->opcode; in simulate_blx1() local
124 int disp = branch_displacement(insn); in simulate_blx1()
127 regs->ARM_pc = iaddr + 8 + disp + ((insn >> 23) & 0x2); in simulate_blx1()
133 kprobe_opcode_t insn = p->opcode; in simulate_blx2bx() local
134 int rm = insn & 0xf; in simulate_blx2bx()
137 if (insn & (1 << 5)) in simulate_blx2bx()
[all …]
Dunwind.c70 const unsigned long *insn; /* pointer to the current instructions word */ member
226 ret = (*ctrl->insn >> (ctrl->byte * 8)) & 0xff; in unwind_get_byte()
229 ctrl->insn++; in unwind_get_byte()
243 unsigned long insn = unwind_get_byte(ctrl); in unwind_exec_insn() local
245 pr_debug("%s: insn = %08lx\n", __func__, insn); in unwind_exec_insn()
247 if ((insn & 0xc0) == 0x00) in unwind_exec_insn()
248 ctrl->vrs[SP] += ((insn & 0x3f) << 2) + 4; in unwind_exec_insn()
249 else if ((insn & 0xc0) == 0x40) in unwind_exec_insn()
250 ctrl->vrs[SP] -= ((insn & 0x3f) << 2) + 4; in unwind_exec_insn()
251 else if ((insn & 0xf0) == 0x80) { in unwind_exec_insn()
[all …]
/linux-3.4.99/drivers/staging/comedi/kcomedilib/
Dkcomedilib_main.c83 static int comedi_do_insn(struct comedi_device *dev, struct comedi_insn *insn) in comedi_do_insn() argument
89 if (insn->subdev >= dev->n_subdevices) { in comedi_do_insn()
93 s = dev->subdevices + insn->subdev; in comedi_do_insn()
96 printk(KERN_ERR "%d not useable subdevice\n", insn->subdev); in comedi_do_insn()
103 ret = comedi_check_chanlist(s, 1, &insn->chanspec); in comedi_do_insn()
116 switch (insn->insn) { in comedi_do_insn()
118 ret = s->insn_bits(dev, s, insn, insn->data); in comedi_do_insn()
122 ret = s->insn_config(dev, s, insn, insn->data); in comedi_do_insn()
138 struct comedi_insn insn; in comedi_dio_config() local
140 memset(&insn, 0, sizeof(insn)); in comedi_dio_config()
[all …]
/linux-3.4.99/arch/powerpc/math-emu/
Dmath.c219 u32 insn = 0; in do_mathemu() local
227 if (get_user(insn, (u32 *)pc)) in do_mathemu()
231 switch (insn >> 26) { in do_mathemu()
233 idx = (insn >> 16) & 0x1f; in do_mathemu()
234 sdisp = (insn & 0xffff); in do_mathemu()
235 op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f); in do_mathemu()
240 idx = (insn >> 16) & 0x1f; in do_mathemu()
241 sdisp = (insn & 0xffff); in do_mathemu()
242 op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f); in do_mathemu()
248 idx = (insn >> 16) & 0x1f; in do_mathemu()
[all …]
/linux-3.4.99/arch/x86/tools/
Dinsn_sanity.c80 static void dump_insn(FILE *fp, struct insn *insn) in dump_insn() argument
83 dump_field(fp, "prefixes", "\t", &insn->prefixes); in dump_insn()
84 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix); in dump_insn()
85 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix); in dump_insn()
86 dump_field(fp, "opcode", "\t", &insn->opcode); in dump_insn()
87 dump_field(fp, "modrm", "\t", &insn->modrm); in dump_insn()
88 dump_field(fp, "sib", "\t", &insn->sib); in dump_insn()
89 dump_field(fp, "displacement", "\t", &insn->displacement); in dump_insn()
90 dump_field(fp, "immediate1", "\t", &insn->immediate1); in dump_insn()
91 dump_field(fp, "immediate2", "\t", &insn->immediate2); in dump_insn()
[all …]
Dtest_get_len.c70 static void dump_insn(FILE *fp, struct insn *insn) in dump_insn() argument
73 dump_field(fp, "prefixes", "\t", &insn->prefixes); in dump_insn()
74 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix); in dump_insn()
75 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix); in dump_insn()
76 dump_field(fp, "opcode", "\t", &insn->opcode); in dump_insn()
77 dump_field(fp, "modrm", "\t", &insn->modrm); in dump_insn()
78 dump_field(fp, "sib", "\t", &insn->sib); in dump_insn()
79 dump_field(fp, "displacement", "\t", &insn->displacement); in dump_insn()
80 dump_field(fp, "immediate1", "\t", &insn->immediate1); in dump_insn()
81 dump_field(fp, "immediate2", "\t", &insn->immediate2); in dump_insn()
[all …]
/linux-3.4.99/arch/sparc/mm/
Dbtfixup.c76 unsigned insn; in btfixup() local
141 insn = *addr; in btfixup()
144 insn = *(unsigned int *)q[1]; in btfixup()
145 if (!insn || insn == 1) in btfixup()
146 insn = *addr; in btfixup()
157 if ((insn & 0xc1c00000) == 0x01000000) { /* SETHI */ in btfixup()
158 *addr = (insn & 0xffc00000) | (p[1] >> 10); break; in btfixup()
159 } else if ((insn & 0xc1f82000) == 0x80102000) { /* OR X, %LO(i), Y */ in btfixup()
160 *addr = (insn & 0xffffe000) | (p[1] & 0x3ff); break; in btfixup()
161 } else if ((insn & 0xc0000000) != 0x40000000) { /* !CALL */ in btfixup()
[all …]
Dfault_64.c97 u32 insn = 0; in get_user_insn() local
123 : "=r" (insn) in get_user_insn()
130 return insn; in get_user_insn()
157 unsigned int insn, int fault_code) in do_fault_siginfo() argument
168 addr = compute_effective_address(regs, insn, 0); in do_fault_siginfo()
181 static unsigned int get_fault_insn(struct pt_regs *regs, unsigned int insn) in get_fault_insn() argument
183 if (!insn) { in get_fault_insn()
187 insn = *(unsigned int *) regs->tpc; in get_fault_insn()
189 insn = get_user_insn(regs->tpc); in get_fault_insn()
192 return insn; in get_fault_insn()
[all …]
/linux-3.4.99/drivers/staging/comedi/drivers/addi-data/
Dhwdrv_apci3xxx.c108 struct comedi_insn *insn, in i_APCI3XXX_AnalogInputConfigOperatingMode() argument
111 int i_ReturnValue = insn->n; in i_APCI3XXX_AnalogInputConfigOperatingMode()
121 if (insn->n == 4) { in i_APCI3XXX_AnalogInputConfigOperatingMode()
297 struct comedi_insn *insn, in i_APCI3XXX_InsnConfigAnalogInput() argument
300 int i_ReturnValue = insn->n; in i_APCI3XXX_InsnConfigAnalogInput()
306 if (insn->n >= 1) { in i_APCI3XXX_InsnConfigAnalogInput()
311 s, insn, data); in i_APCI3XXX_InsnConfigAnalogInput()
358 struct comedi_insn *insn, in i_APCI3XXX_InsnReadAnalogInput() argument
361 int i_ReturnValue = insn->n; in i_APCI3XXX_InsnReadAnalogInput()
362 unsigned char b_Configuration = (unsigned char) CR_RANGE(insn->chanspec); in i_APCI3XXX_InsnReadAnalogInput()
[all …]
/linux-3.4.99/drivers/staging/comedi/drivers/
Ds526.c270 struct comedi_subdevice *s, struct comedi_insn *insn,
274 struct comedi_insn *insn, unsigned int *data);
276 struct comedi_subdevice *s, struct comedi_insn *insn,
280 struct comedi_insn *insn, unsigned int *data);
282 struct comedi_insn *insn, unsigned int *data);
284 struct comedi_insn *insn, unsigned int *data);
286 struct comedi_insn *insn, unsigned int *data);
289 struct comedi_insn *insn, unsigned int *data);
292 struct comedi_insn *insn, unsigned int *data);
515 struct comedi_subdevice *s, struct comedi_insn *insn, in s526_gpct_rinsn() argument
[all …]
/linux-3.4.99/arch/x86/kernel/
Dkprobes.c120 } __attribute__((packed)) *insn; in __synthesize_relative_insn() local
122 insn = (struct __arch_relative_insn *)from; in __synthesize_relative_insn()
123 insn->raddr = (s32)((long)(to) - ((long)(from) + 5)); in __synthesize_relative_insn()
124 insn->op = op; in __synthesize_relative_insn()
142 static kprobe_opcode_t *__kprobes skip_prefixes(kprobe_opcode_t *insn) in skip_prefixes() argument
146 attr = inat_get_opcode_attribute((insn_byte_t)*insn); in skip_prefixes()
148 insn++; in skip_prefixes()
149 attr = inat_get_opcode_attribute((insn_byte_t)*insn); in skip_prefixes()
153 insn++; in skip_prefixes()
155 return insn; in skip_prefixes()
[all …]
Dkprobes-opt.c195 static int __kprobes insn_is_indirect_jump(struct insn *insn) in insn_is_indirect_jump() argument
197 return ((insn->opcode.bytes[0] == 0xff && in insn_is_indirect_jump()
198 (X86_MODRM_REG(insn->modrm.value) & 6) == 4) || /* Jump */ in insn_is_indirect_jump()
199 insn->opcode.bytes[0] == 0xea); /* Segment based jump */ in insn_is_indirect_jump()
203 static int insn_jump_into_range(struct insn *insn, unsigned long start, int len) in insn_jump_into_range() argument
207 switch (insn->opcode.bytes[0]) { in insn_jump_into_range()
216 if ((insn->opcode.bytes[1] & 0xf0) == 0x80) /* jcc near */ in insn_jump_into_range()
220 if ((insn->opcode.bytes[0] & 0xf0) == 0x70) /* jcc short */ in insn_jump_into_range()
224 target = (unsigned long)insn->next_byte + insn->immediate.value; in insn_jump_into_range()
233 struct insn insn; in can_optimize() local
[all …]

12345678910>>...15