Home
last modified time | relevance | path

Searched refs:imm (Results 1 – 12 of 12) sorted by relevance

/DragonOS/kernel/crates/rbpf/src/
H A Dinterpreter.rs145 let x = (mem.as_ptr() as u64 + (insn.imm as u32) as u64) as *const u8; in execute_program()
152 let x = (mem.as_ptr() as u64 + (insn.imm as u32) as u64) as *const u16; in execute_program()
159 let x = (mem.as_ptr() as u64 + (insn.imm as u32) as u64) as *const u32; in execute_program()
165 log::info!("executing LD_ABS_DW, set reg[{}] to {:#x}", _dst, insn.imm); in execute_program()
167 let x = (mem.as_ptr() as u64 + (insn.imm as u32) as u64) as *const u64; in execute_program()
175 (mem.as_ptr() as u64 + reg[_src] + (insn.imm as u32) as u64) as *const u8; in execute_program()
183 (mem.as_ptr() as u64 + reg[_src] + (insn.imm as u32) as u64) as *const u16; in execute_program()
191 (mem.as_ptr() as u64 + reg[_src] + (insn.imm as u32) as u64) as *const u32; in execute_program()
199 (mem.as_ptr() as u64 + reg[_src] + (insn.imm as u32) as u64) as *const u64; in execute_program()
213 reg[_dst] = ((insn.imm as u32) as u64) + ((next_insn.imm as u64) << 32); in execute_program()
[all …]
H A Djit.rs194 fn emit_alu32_imm32(&self, mem: &mut JitMemory, op: u8, src: u8, dst: u8, imm: i32) { in emit_alu32_imm32()
196 self.emit4(mem, imm as u32); in emit_alu32_imm32()
200 fn emit_alu32_imm8(&self, mem: &mut JitMemory, op: u8, src: u8, dst: u8, imm: i8) { in emit_alu32_imm8()
202 self.emit1(mem, imm as u8); in emit_alu32_imm8()
215 fn emit_alu64_imm32(&self, mem: &mut JitMemory, op: u8, src: u8, dst: u8, imm: i32) { in emit_alu64_imm32()
217 self.emit4(mem, imm as u32); in emit_alu64_imm32()
221 fn emit_alu64_imm8(&self, mem: &mut JitMemory, op: u8, src: u8, dst: u8, imm: i8) { in emit_alu64_imm8()
223 self.emit1(mem, imm as u8); in emit_alu64_imm8()
231 fn emit_cmp_imm32(&self, mem: &mut JitMemory, dst: u8, imm: i32) { in emit_cmp_imm32()
232 self.emit_alu64_imm32(mem, 0x81, 7, dst, imm); in emit_cmp_imm32()
[all …]
H A Dassembler.rs154 fn insn(opc: u8, dst: i64, src: i64, off: i64, imm: i64) -> Result<Insn, String> { in insn()
164 if !(-2147483648..2147483648).contains(&imm) { in insn()
172 imm: imm as i32, in insn()
191 (AluBinary, Register(dst), Integer(imm), Nil) => insn(opc | ebpf::BPF_K, dst, 0, 0, imm), in encode()
193 (LoadAbs, Integer(imm), Nil, Nil) => insn(opc, 0, 0, 0, imm), in encode()
194 (LoadInd, Register(src), Integer(imm), Nil) => insn(opc, 0, src, 0, imm), in encode()
197 (StoreImm, Memory(dst, off), Integer(imm), Nil) => insn(opc, dst, 0, off, imm), in encode()
203 (JumpConditional, Register(dst), Integer(imm), Integer(off)) => { in encode()
204 insn(opc | ebpf::BPF_K, dst, 0, off, imm) in encode()
206 (Call, Integer(imm), Nil, Nil) => insn(opc, 0, 0, 0, imm), in encode()
[all …]
H A Dcranelift.rs294 .iconst(self.isa.pointer_type(), insn.imm as u32 as i64); in translate_program()
321 let imm = (((insn.imm as u32) as u64) + ((next_insn.imm as u64) << 32)) as i64; in translate_program() localVariable
322 let iconst = bcx.ins().iconst(I64, imm); in translate_program()
395 let imm = self.insn_imm32(bcx, &insn); in translate_program() localVariable
396 let res = bcx.ins().iadd(src, imm); in translate_program()
409 let imm = self.insn_imm32(bcx, &insn); in translate_program() localVariable
410 let res = bcx.ins().isub(src, imm); in translate_program()
423 let imm = self.insn_imm32(bcx, &insn); in translate_program() localVariable
424 let res = bcx.ins().imul(src, imm); in translate_program()
436 let res = if insn.imm == 0 { in translate_program()
[all …]
H A Ddisassembler.rs20 format!("{name} r{}, {:#x}", insn.dst, insn.imm) in alu_imm_str()
30 match insn.imm { in byteswap_str()
34 format!("{name}{} r{}", insn.imm, insn.dst) in byteswap_str()
40 format!("{name} [r{}+{:#x}], {:#x}", insn.dst, insn.off, insn.imm) in ld_st_imm_str()
46 insn.imm in ld_st_imm_str()
81 format!("{name} {:#x}", insn.imm) in ldabs_str()
86 format!("{name} r{}, {:#x}", insn.src, insn.imm) in ldind_str()
92 format!("{name} r{}, {:#x}, +{:#x}", insn.dst, insn.imm, insn.off) in jmp_imm_str()
97 insn.imm, in jmp_imm_str()
148 pub imm: i64, field
[all …]
H A Debpf.rs453 pub imm: i32, field
482 (self.imm & 0xff) as u8,
483 (self.imm & 0xff_00).wrapping_shr(8) as u8,
484 (self.imm as u32 & 0xff_00_00).wrapping_shr(16) as u8,
485 (self.imm as u32 & 0xff_00_00_00).wrapping_shr(24) as u8,
514 (self.imm & 0xff) as u8, in to_vec()
515 (self.imm & 0xff_00).wrapping_shr(8) as u8, in to_vec()
516 (self.imm as u32 & 0xff_00_00).wrapping_shr(16) as u8, in to_vec()
517 (self.imm as u32 & 0xff_00_00_00).wrapping_shr(24) as u8, in to_vec()
570 imm: LittleEndian::read_i32(&prog[(INSN_SIZE * idx + 4)..]), in get_insn()
H A Dinsn_builder.rs32 self.get_insn().imm in get_imm()
54 fn set_imm(mut self, imm: i32) -> Self { in set_imm()
55 self.get_insn_mut().imm = imm; in set_imm()
189 imm: 0x00_00_00_00, in mov_internal()
204 imm: 0x00_00_00_00, in swap_bytes()
241 imm: 0x00_00_00_00, in load_internal()
267 imm: 0x00_00_00_00, in store_internal()
288 imm: 0x00_00_00_00, in jump_conditional()
302 imm: 0x00_00_00_00, in call()
316 imm: 0x00_00_00_00, in exit()
H A Dverifier.rs57 match insn.imm { in check_imm_endian()
/DragonOS/kernel/src/bpf/prog/
H A Dverifier.rs50 let map_fd = insn.imm as usize; in relocation()
67 let offset = next_insn.imm as usize; in relocation()
104 insn.imm = ptr as i32; in relocation()
105 next_insn.imm = (ptr >> 32) as i32; in relocation()
/DragonOS/kernel/crates/rbpf/examples/
H A Dto_json.rs42 "imm" => format!("{:#x}", insn.imm as i32), // => insn.imm, in to_json()
/DragonOS/kernel/crates/rbpf/tests/
H A Dassembler.rs16 fn insn(opc: u8, dst: u8, src: u8, off: i16, imm: i32) -> ebpf::Insn { in insn()
22 imm, in insn()
/DragonOS/kernel/src/include/bindings/
H A Dlinux_bpf.rs195 pub imm: __s32, field