/DragonOS/kernel/crates/rbpf/src/ |
H A D | jit.rs | 150 fn basix_rex_would_set_bits(&self, w: u8, src: u8, dst: u8) -> bool { in basix_rex_would_set_bits() 151 w != 0 || (src & 0b1000) != 0 || (dst & 0b1000) != 0 in basix_rex_would_set_bits() 164 fn emit_basic_rex(&self, mem: &mut JitMemory, w: u8, src: u8, dst: u8) { in emit_basic_rex() 165 if self.basix_rex_would_set_bits(w, src, dst) { in emit_basic_rex() 170 self.emit_rex(mem, w, is_masked(src, 8), 0, is_masked(dst, 8)); in emit_basic_rex() 187 fn emit_alu32(&self, mem: &mut JitMemory, op: u8, src: u8, dst: u8) { in emit_alu32() 188 self.emit_basic_rex(mem, 0, src, dst); in emit_alu32() 190 self.emit_modrm_reg2reg(mem, src, dst); in emit_alu32() 194 fn emit_alu32_imm32(&self, mem: &mut JitMemory, op: u8, src: u8, dst: u8, imm: i32) { in emit_alu32_imm32() 195 self.emit_alu32(mem, op, src, dst); in emit_alu32_imm32() [all …]
|
H A D | assembler.rs | 154 fn insn(opc: u8, dst: i64, src: i64, off: i64, imm: i64) -> Result<Insn, String> { in insn() 155 if !(0..16).contains(&dst) { in insn() 158 if dst < 0 || src >= 16 { in insn() 169 dst: dst as u8, in insn() 190 (AluBinary, Register(dst), Register(src), Nil) => insn(opc | ebpf::BPF_X, dst, src, 0, 0), in encode() 191 (AluBinary, Register(dst), Integer(imm), Nil) => insn(opc | ebpf::BPF_K, dst, 0, 0, imm), in encode() 192 (AluUnary, Register(dst), Nil, Nil) => insn(opc, dst, 0, 0, 0), in encode() 195 (LoadReg, Register(dst), Memory(src, off), Nil) in encode() 196 | (StoreReg, Memory(dst, off), Register(src), Nil) => insn(opc, dst, src, off, 0), in encode() 197 (StoreImm, Memory(dst, off), Integer(imm), Nil) => insn(opc, dst, 0, off, imm), in encode() [all …]
|
H A D | disassembler.rs | 20 format!("{name} r{}, {:#x}", insn.dst, insn.imm) in alu_imm_str() 25 format!("{name} r{}, r{}", insn.dst, insn.src) in alu_reg_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() 44 insn.dst, in ld_st_imm_str() 54 format!("{name} r{}, [r{}+{:#x}]", insn.dst, insn.src, insn.off) in ld_reg_str() 58 insn.dst, in ld_reg_str() 68 format!("{name} [r{}+{:#x}], r{}", insn.dst, insn.off, insn.src) in st_reg_str() 72 insn.dst, in st_reg_str() 92 format!("{name} r{}, {:#x}, +{:#x}", insn.dst, insn.imm, insn.off) in jmp_imm_str() [all …]
|
H A D | insn_builder.rs | 17 self.get_insn().dst in get_dst() 36 fn set_dst(mut self, dst: u8) -> Self { in set_dst() 37 self.get_insn_mut().dst = dst; in set_dst() 186 dst: 0x00, in mov_internal() 201 dst: 0x00, in swap_bytes() 238 dst: 0x00, in load_internal() 264 dst: 0x00, in store_internal() 285 dst: 0x00, in jump_conditional() 299 dst: 0x00, in call() 313 dst: 0x00, in exit()
|
H A D | ebpf.rs | 447 pub dst: u8, field 479 self.src.wrapping_shl(4) | self.dst, 511 self.src.wrapping_shl(4) | self.dst, in to_vec() 567 dst: prog[INSN_SIZE * idx + 1] & 0x0f, in get_insn()
|
H A D | cranelift.rs | 794 bcx.def_var(self.registers[insn.dst as usize], imm); in translate_program() 799 bcx.def_var(self.registers[insn.dst as usize], src); in translate_program() 958 bcx.use_var(self.registers[insn.dst as usize]) in insn_dst() 961 let dst = self.insn_dst(bcx, insn); in insn_dst32() localVariable 962 bcx.ins().ireduce(I32, dst) in insn_dst32() 974 bcx.def_var(self.registers[insn.dst as usize], val); in set_dst()
|
H A D | verifier.rs | 104 match (insn.dst, store) { in check_registers()
|
H A D | interpreter.rs | 135 let _dst = insn.dst as usize; in execute_program()
|
/DragonOS/kernel/src/common/ |
H A D | compiler.h | 49 static __always_inline void __read_once_size(void *dst, const volatile void *src, int size) in __read_once_size() argument 54 *(__u8_alias_t *)dst = *(volatile __u8_alias_t *)src; in __read_once_size() 57 *(__u16_alias_t *)dst = *(volatile __u16_alias_t *)src; in __read_once_size() 60 *(__u32_alias_t *)dst = *(volatile __u32_alias_t *)src; in __read_once_size() 63 *(__u64_alias_t *)dst = *(volatile __u64_alias_t *)src; in __read_once_size() 67 __builtin_memcpy((void *)dst, (const void *)src, size); in __read_once_size() 80 static __always_inline void __write_once_size(volatile void *dst, void *src, int size) in __write_once_size() argument 85 *(volatile __u8_alias_t *)dst = *(__u8_alias_t *)src; in __write_once_size() 88 *(volatile __u16_alias_t *)dst = *(__u16_alias_t *)src; in __write_once_size() 91 *(volatile __u32_alias_t *)dst = *(__u32_alias_t *)src; in __write_once_size() [all …]
|
/DragonOS/kernel/src/arch/x86_64/include/asm/ |
H A D | asm.h | 142 void *memset(void *dst, unsigned char C, ul size) in memset() argument 161 : "a"(tmp), "q"(size), "0"(size / 8), "1"(dst) in memset() 163 return dst; in memset() 166 void *memset_c(void *dst, uint8_t c, size_t count) in memset_c() argument 168 uint8_t *xs = (uint8_t *)dst; in memset_c() 173 return dst; in memset_c() 184 static void *memcpy(void *dst, const void *src, long Num) in memcpy() argument 201 : "0"(Num / 8), "q"(Num), "1"(dst), "2"(src) in memcpy() 203 return dst; in memcpy() 274 static inline uint64_t copy_from_user(void *dst, void *src, uint64_t size) in copy_from_user() argument [all …]
|
/DragonOS/kernel/src/syscall/ |
H A D | user_access.rs | 48 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user() 49 verify_area(src, dst.len()).map_err(|_| SystemError::EFAULT)?; in copy_from_user() 51 let src: &[u8] = core::slice::from_raw_parts(src.data() as *const u8, dst.len()); in copy_from_user() 53 dst.copy_from_slice(src); in copy_from_user() 55 return Ok(dst.len()); in copy_from_user() 131 let dst = [0usize; 1]; in check_and_clone_cstr_array() localVariable 132 let mut dst = core::mem::transmute::<[usize; 1], [u8; size_of::<usize>()]>(dst); in check_and_clone_cstr_array() localVariable 133 copy_from_user(&mut dst, VirtAddr::new(addr as usize))?; in check_and_clone_cstr_array() 134 let dst = core::mem::transmute::<[u8; size_of::<usize>()], [usize; 1]>(dst); in check_and_clone_cstr_array() localVariable 135 str_ptr = dst[0] as *const u8; in check_and_clone_cstr_array() [all …]
|
/DragonOS/kernel/src/driver/video/fbdev/base/ |
H A D | render_helper.rs | 194 dst: VirtAddr, field 208 dst: VirtAddr, in new() 212 let limit = VirtAddr::new(frame_height * frame_width * byte_per_pixel) + dst; in new() 214 dst, in new() 231 let mut dst = self.dst; in write() localVariable 234 if self.dst.data() + self.current + self.start_offset + size > self.limit.data() { in write() 244 dst = dst.add(self.current + self.start_offset); in write() 248 *dst.as_ptr::<T>() = data; in write()
|
/DragonOS/docs/kernel/core_api/ |
H A D | kernel_api.md | 493 #### `char *strncpy(char *dst, const char *src, long count)` 497   拷贝长度为count个字节的字符串,返回dst字符串 505 **dst** 513 #### `char *strcpy(char *dst, const char *src)` 517   拷贝源字符串,返回dst字符串 525 **dst** 529 #### `long strncpy_from_user(char *dst, const char *src, unsigned long size)` 543 **dst** 657 #### `void *memcpy(void *dst, const void *src, uint64_t size)` 661   将内存从src处拷贝到dst处。 [all …]
|
/DragonOS/kernel/src/driver/video/fbdev/ |
H A D | vesafb.rs | 535 let dst = in fb_copyarea() localVariable 543 let mut dst = dst.as_ptr::<u32>(); in fb_copyarea() localVariable 551 core::ptr::copy(src, dst, visiable_w as usize); in fb_copyarea() 553 dst = dst.add(visiable_w as usize); in fb_copyarea() 570 core::ptr::copy(tmp_ptr, dst, visiable_w as usize); in fb_copyarea() 571 dst = dst.add(line_offset); in fb_copyarea() 578 let mut dst = dst.as_ptr::<u16>(); in fb_copyarea() localVariable 586 core::ptr::copy(src, dst, visiable_w as usize); in fb_copyarea() 588 dst = dst.add(visiable_w as usize); in fb_copyarea() 605 core::ptr::copy(tmp_ptr, dst, visiable_w as usize); in fb_copyarea() [all …]
|
/DragonOS/kernel/src/bpf/helper/ |
H A D | mod.rs | 90 fn raw_bpf_probe_read(dst: *mut c_void, size: u32, unsafe_ptr: *const c_void) -> i64 { in raw_bpf_probe_read() 93 dst as usize, in raw_bpf_probe_read() 97 let (dst, src) = unsafe { in raw_bpf_probe_read() 98 let dst = core::slice::from_raw_parts_mut(dst as *mut u8, size as usize); in raw_bpf_probe_read() localVariable 100 (dst, src) in raw_bpf_probe_read() 102 let res = bpf_probe_read(dst, src); in raw_bpf_probe_read() 112 pub fn bpf_probe_read(dst: &mut [u8], src: &[u8]) -> Result<()> { in bpf_probe_read() 113 log::info!("bpf_probe_read: len: {}", dst.len()); in bpf_probe_read() 114 dst.copy_from_slice(src); in bpf_probe_read()
|
/DragonOS/kernel/crates/rbpf/examples/ |
H A D | to_json.rs | 32 "dst" => format!("{:#x}", insn.dst), // => insn.dst, in to_json()
|
/DragonOS/kernel/src/driver/video/fbdev/base/fbcon/ |
H A D | mod.rs | 477 pub fn update_attr(&self, dst: &mut [u8], src: &[u8], vc_data: &VirtualConsoleData) { in update_attr() 498 dst[i] = c; in update_attr()
|
H A D | framebuffer_console.rs | 151 let mut dst = vec![0; src.len()]; in bit_put_string() localVariable 152 dst.copy_from_slice(src); in bit_put_string() 155 attr.update_attr(&mut dst, src, vc_data) in bit_put_string() 163 .copy_from_slice(&dst[dst_offset..dst_offset_next]); in bit_put_string()
|
/DragonOS/kernel/crates/rbpf/tests/ |
H A D | assembler.rs | 16 fn insn(opc: u8, dst: u8, src: u8, off: i16, imm: i32) -> ebpf::Insn { in insn() 19 dst, in insn()
|
/DragonOS/kernel/src/filesystem/fat/ |
H A D | entry.rs | 1070 pub fn copy_name_to_slice(&self, dst: &mut [u16]) -> Result<(), SystemError> { in copy_name_to_slice() 1071 if dst.len() != Self::LONG_NAME_STR_LEN { in copy_name_to_slice() 1074 dst[0..5].copy_from_slice(&self.name1); in copy_name_to_slice() 1075 dst[5..11].copy_from_slice(&self.name2); in copy_name_to_slice() 1076 dst[11..13].copy_from_slice(&self.name3); in copy_name_to_slice()
|
/DragonOS/kernel/src/driver/tty/tty_ldisc/ |
H A D | ntty.rs | 996 dst: &mut [u8], in canon_copy_from_read_buf() 1062 self.ntty_copy(&mut dst[*offset..], tail, &mut n)?; in canon_copy_from_read_buf() 1120 dst: &mut [u8], in copy_from_read_buf() 1133 self.ntty_copy(&mut dst[*offset..], tail, &mut n)?; in copy_from_read_buf()
|