Lines Matching refs:p
59 uint16_t *p = *ptr; in st_nm32_p() local
61 stw_p(p, insn >> 16); in st_nm32_p()
62 p++; in st_nm32_p()
63 stw_p(p, insn >> 0); in st_nm32_p()
64 p++; in st_nm32_p()
66 *ptr = p; in st_nm32_p()
75 uint32_t *p = *ptr; in bl_gen_nop() local
77 stl_p(p, 0); in bl_gen_nop()
78 p++; in bl_gen_nop()
79 *ptr = p; in bl_gen_nop()
87 uint32_t *p = *ptr; in bl_gen_r_type() local
97 stl_p(p, insn); in bl_gen_r_type()
98 p++; in bl_gen_r_type()
100 *ptr = p; in bl_gen_r_type()
106 uint32_t *p = *ptr; in bl_gen_i_type() local
114 stl_p(p, insn); in bl_gen_i_type()
115 p++; in bl_gen_i_type()
117 *ptr = p; in bl_gen_i_type()
121 static void bl_gen_dsll(void **p, bl_reg rd, bl_reg rt, uint8_t sa) in bl_gen_dsll() argument
124 bl_gen_r_type(p, 0, 0, rt, rd, sa, 0x38); in bl_gen_dsll()
130 static void bl_gen_jalr(void **p, bl_reg rs) in bl_gen_jalr() argument
139 st_nm32_p(p, insn); in bl_gen_jalr()
141 bl_gen_r_type(p, 0, rs, 0, BL_REG_RA, 0, 0x09); in bl_gen_jalr()
159 static void bl_gen_lui(void **p, bl_reg rt, uint16_t imm) in bl_gen_lui() argument
162 bl_gen_i_type(p, 0x0f, 0, rt, imm); in bl_gen_lui()
178 static void bl_gen_ori(void **p, bl_reg rt, bl_reg rs, uint16_t imm) in bl_gen_ori() argument
180 bl_gen_i_type(p, 0x0d, rs, rt, imm); in bl_gen_ori()
197 static void bl_gen_sw(void **p, bl_reg rt, uint8_t base, uint16_t offset) in bl_gen_sw() argument
200 bl_gen_sw_nm(p, rt, base, offset); in bl_gen_sw()
202 bl_gen_i_type(p, 0x2b, base, rt, offset); in bl_gen_sw()
206 static void bl_gen_sd(void **p, bl_reg rt, uint8_t base, uint16_t offset) in bl_gen_sd() argument
209 bl_gen_i_type(p, 0x3f, base, rt, offset); in bl_gen_sd()
216 static void bl_gen_li(void **p, bl_reg rt, uint32_t imm) in bl_gen_li() argument
219 bl_gen_lui_nm(p, rt, extract32(imm, 12, 20)); in bl_gen_li()
220 bl_gen_ori_nm(p, rt, rt, extract32(imm, 0, 12)); in bl_gen_li()
222 bl_gen_lui(p, rt, extract32(imm, 16, 16)); in bl_gen_li()
223 bl_gen_ori(p, rt, rt, extract32(imm, 0, 16)); in bl_gen_li()
227 static void bl_gen_dli(void **p, bl_reg rt, uint64_t imm) in bl_gen_dli() argument
229 bl_gen_li(p, rt, extract64(imm, 32, 32)); in bl_gen_dli()
230 bl_gen_dsll(p, rt, rt, 16); in bl_gen_dli()
231 bl_gen_ori(p, rt, rt, extract64(imm, 16, 16)); in bl_gen_dli()
232 bl_gen_dsll(p, rt, rt, 16); in bl_gen_dli()
233 bl_gen_ori(p, rt, rt, extract64(imm, 0, 16)); in bl_gen_dli()
236 static void bl_gen_load_ulong(void **p, bl_reg rt, target_ulong imm) in bl_gen_load_ulong() argument
239 bl_gen_dli(p, rt, imm); /* 64bit */ in bl_gen_load_ulong()
241 bl_gen_li(p, rt, imm); /* 32bit */ in bl_gen_load_ulong()
246 void bl_gen_jump_to(void **p, target_ulong jump_addr) in bl_gen_jump_to() argument
248 bl_gen_load_ulong(p, BL_REG_T9, jump_addr); in bl_gen_jump_to()
249 bl_gen_jalr(p, BL_REG_T9); in bl_gen_jump_to()
250 bl_gen_nop(p); /* delay slot */ in bl_gen_jump_to()
253 void bl_gen_jump_kernel(void **p, in bl_gen_jump_kernel() argument
262 bl_gen_load_ulong(p, BL_REG_SP, sp); in bl_gen_jump_kernel()
265 bl_gen_load_ulong(p, BL_REG_A0, a0); in bl_gen_jump_kernel()
268 bl_gen_load_ulong(p, BL_REG_A1, a1); in bl_gen_jump_kernel()
271 bl_gen_load_ulong(p, BL_REG_A2, a2); in bl_gen_jump_kernel()
274 bl_gen_load_ulong(p, BL_REG_A3, a3); in bl_gen_jump_kernel()
277 bl_gen_jump_to(p, kernel_addr); in bl_gen_jump_kernel()
280 void bl_gen_write_ulong(void **p, target_ulong addr, target_ulong val) in bl_gen_write_ulong() argument
282 bl_gen_load_ulong(p, BL_REG_K0, val); in bl_gen_write_ulong()
283 bl_gen_load_ulong(p, BL_REG_K1, addr); in bl_gen_write_ulong()
285 bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0); in bl_gen_write_ulong()
287 bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0); in bl_gen_write_ulong()
291 void bl_gen_write_u32(void **p, target_ulong addr, uint32_t val) in bl_gen_write_u32() argument
293 bl_gen_li(p, BL_REG_K0, val); in bl_gen_write_u32()
294 bl_gen_load_ulong(p, BL_REG_K1, addr); in bl_gen_write_u32()
295 bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0); in bl_gen_write_u32()
298 void bl_gen_write_u64(void **p, target_ulong addr, uint64_t val) in bl_gen_write_u64() argument
300 bl_gen_dli(p, BL_REG_K0, val); in bl_gen_write_u64()
301 bl_gen_load_ulong(p, BL_REG_K1, addr); in bl_gen_write_u64()
302 bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0); in bl_gen_write_u64()