/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/ |
H A D | triagebot.toml | 67 trigger_files = ["kernel/src/filesystem"] 70 trigger_files = ["kernel/src/arch/x86_64"] 73 trigger_files = ["kernel/src/arch/riscv64"] 77 "kernel/src/driver", 78 "kernel/src/arch/x86_64/driver", 79 "kernel/src/arch/riscv64/driver", 83 trigger_files = ["kernel/src/virt", "kernel/src/arch/x86_64/kvm"] 89 "/kernel/src/debug/kprobe", 90 "/kernel/src/bpf", 110 [mentions."kernel/src/driver/base"] [all …]
|
H A D | README.md | 2 <img width="40%" src="docs/_static/dragonos-logo.svg" alt="dragonos-logo"></br> 5 <a href="https://dragonos.org"><img alt="官网" src="https://img.shields.io/badge/%E5%AE%98%E7%BD%91-D… 6 <a href="https://bbs.dragonos.org.cn"><img alt="bbs" src="https://img.shields.io/badge/BBS-bbs.drag…
|
/DragonOS/kernel/src/syscall/ |
H A D | user_access.rs | 38 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user() 39 verify_area(dest, src.len()).map_err(|_| SystemError::EFAULT)?; in copy_to_user() 43 p.copy_from_nonoverlapping(src.as_ptr(), src.len()); in copy_to_user() 44 return Ok(src.len()); in copy_to_user() 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() localVariable 53 dst.copy_from_slice(src); in copy_from_user() 241 fn convert_with_offset<T>(&self, src: &[u8], offset: usize) -> Result<&[T], SystemError> { in convert_with_offset() 242 if offset >= src.len() { in convert_with_offset() [all …]
|
/DragonOS/user/apps/user-manage/ |
H A D | Cargo.toml | 8 path = "src/cmd/useradd.rs" 12 path = "src/cmd/userdel.rs" 16 path = "src/cmd/usermod.rs" 20 path = "src/cmd/passwd.rs" 24 path = "src/cmd/groupadd.rs" 28 path = "src/cmd/groupdel.rs" 32 path = "src/cmd/groupmod.rs"
|
/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() 158 if dst < 0 || src >= 16 { in insn() 170 src: src as u8, in insn() 190 (AluBinary, Register(dst), Register(src), Nil) => insn(opc | ebpf::BPF_X, dst, src, 0, 0), in encode() 194 (LoadInd, Register(src), Integer(imm), Nil) => insn(opc, 0, src, 0, imm), 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() 200 (JumpConditional, Register(dst), Register(src), Integer(off)) => { in encode() 201 insn(opc | ebpf::BPF_X, dst, src, off, 0) in encode() 269 pub fn assemble(src: &str) -> Result<Vec<u8>, String> { in assemble() [all …]
|
H A D | cranelift.rs | 394 let src = self.insn_dst32(bcx, &insn); in translate_program() localVariable 396 let res = bcx.ins().iadd(src, imm); in translate_program() 408 let src = self.insn_dst32(bcx, &insn); in translate_program() localVariable 410 let res = bcx.ins().isub(src, imm); in translate_program() 422 let src = self.insn_dst32(bcx, &insn); in translate_program() localVariable 424 let res = bcx.ins().imul(src, imm); in translate_program() 440 let src = self.insn_dst32(bcx, &insn); in translate_program() localVariable 441 bcx.ins().udiv(src, imm) in translate_program() 462 let src = self.insn_dst32(bcx, &insn); in translate_program() localVariable 464 let res = bcx.ins().bor(src, imm); in translate_program() [all …]
|
H A D | disassembler.rs | 25 format!("{name} r{}, r{}", insn.dst, insn.src) in alu_reg_str() 54 format!("{name} r{}, [r{}+{:#x}]", insn.dst, insn.src, insn.off) in ld_reg_str() 59 insn.src, in ld_reg_str() 68 format!("{name} [r{}+{:#x}], r{}", insn.dst, insn.off, insn.src) in st_reg_str() 74 insn.src in st_reg_str() 86 format!("{name} r{}, {:#x}", insn.src, insn.imm) in ldind_str() 106 format!("{name} r{}, r{}, +{:#x}", insn.dst, insn.src, insn.off) in jmp_reg_str() 111 insn.src, in jmp_reg_str() 143 pub src: u8, field 752 src: insn.src, in to_insn_vec()
|
/DragonOS/docs/kernel/configuration/ |
H A D | config.md | 14 path = "src/init/" 20 path = "src/mm/" 35 **src/mm/d.config** 44 path = "src/mm/allocator/" 69 **src/mm/allocator/d.config** 82 **src/init/d.config**
|
/DragonOS/kernel/ |
H A D | .gitignore | 2 src/kernel 7 src/include/bindings/bindings.rs 9 src/include/bindings/bindings.h
|
H A D | Makefile | 19 $(MAKE) -C src all ARCH=$(ARCH) || (sh -c "echo 内核编译失败" && exit 1) 24 $(MAKE) -C src clean ARCH=$(ARCH) 39 …ly-2024-11-05 check --workspace $(CARGO_ZBUILD) --message-format=json --target ./src/$(TARGET_JSON) 41 …ly-2024-11-05 check --workspace $(CARGO_ZBUILD) --message-format=json --target ./src/$(TARGET_JSON)
|
H A D | rust-toolchain.toml | 3 components = ["rust-src", "clippy"]
|
/DragonOS/kernel/src/smp/ |
H A D | syscall.rs | 11 let src = unsafe { cpu_manager.possible_cpus().inner().as_bytes() }; in getaffinity() localVariable 12 set[0..src.len()].copy_from_slice(src); in getaffinity()
|
/DragonOS/docs/kernel/core_api/ |
H A D | kernel_api.md | 455 **src** 459 #### `long strnlen(const char *src, unsigned long maxlen)` 467 **src** 475 #### `long strnlen_user(const char *src, unsigned long maxlen)` 481   该函数会进行地址空间校验,要求src字符串必须来自用户空间。当源字符串来自内核空间时,将返回0. 485 **src** 493 #### `char *strncpy(char *dst, const char *src, long count)` 501 **src** 513 #### `char *strcpy(char *dst, const char *src)` argument 521 **src** [all …]
|
H A D | casting.md | 8   上述没有特殊标明的函数,都是在`kernel/src/libs/casting.rs`中实现的。 16 SystemError枚举类型使用了这种方式,您可以在`kernel/src/syscall/mod.rs`中找到它的用法。 44 …>`转换为`Arc<T>`的具体类型指针时,我们要为`U`这个trait实现`DowncastArc`trait。这个trait定义在`kernel/src/libs/casting.rs`中。它…
|
/DragonOS/kernel/src/arch/x86_64/include/asm/ |
H A D | asm.h | 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() 274 static inline uint64_t copy_from_user(void *dst, void *src, uint64_t size) in copy_from_user() argument 277 if (!verify_area((uint64_t)src, size)) in copy_from_user() 290 : "r"(size & 7), "0"(size >> 3), "1"(dst), "2"(src) in copy_from_user() 303 static inline uint64_t copy_to_user(void *dst, void *src, uint64_t size) in copy_to_user() argument 305 if (verify_area((uint64_t)src, size)) in copy_to_user() 321 memcpy(dst, src, size); in copy_to_user()
|
/DragonOS/kernel/crates/rbpf/tests/ |
H A D | disassembler.rs | 13 ($src:expr) => {{ 14 let src = $src; localVariable 15 let asm = assemble(src).expect("Can't assemble from string"); 23 assert_eq!(src, reasm);
|
/DragonOS/user/apps/test_ebpf/syscall_ebpf/syscall_ebpf-ebpf/ |
H A D | rust-toolchain.toml | 3 # The source code of rustc, provided by the rust-src component, is needed for 9 "rust-src",
|
/DragonOS/kernel/src/driver/video/fbdev/base/ |
H A D | mod.rs | 157 let mut src; in fast_imageblit() localVariable 163 src = offset; in fast_imageblit() 169 dst1.write(color_tab[(image.data[src] as usize >> 4) & bitmask]); in fast_imageblit() 170 dst1.write(color_tab[(image.data[src] as usize) & bitmask]); in fast_imageblit() 172 src += 1; in fast_imageblit() 179 dst1.write(color_tab[(image.data[src] as usize >> 6) & bitmask]); in fast_imageblit() 180 dst1.write(color_tab[(image.data[src] as usize >> 4) & bitmask]); in fast_imageblit() 181 dst1.write(color_tab[(image.data[src] as usize >> 2) & bitmask]); in fast_imageblit() 182 dst1.write(color_tab[(image.data[src] as usize) & bitmask]); in fast_imageblit() 183 src += 1; in fast_imageblit() [all …]
|
H A D | render_helper.rs | 12 src: Iter<'a, u8>, field 30 src: Iter<'a, u8>, in new() 45 src, in new() 55 ans.current = *ans.src.next().unwrap(); in new() 78 self.current = match self.src.next() { in move_mask()
|
/DragonOS/kernel/src/driver/video/fbdev/ |
H A D | vesafb.rs | 532 let src = in fb_copyarea() localVariable 544 let mut src = src.as_ptr::<u32>(); in fb_copyarea() localVariable 551 core::ptr::copy(src, dst, visiable_w as usize); in fb_copyarea() 552 src = src.add(line_offset); in fb_copyarea() 563 core::ptr::copy(src, tmp_ptr, visiable_w as usize); in fb_copyarea() 564 src = src.add(line_offset); in fb_copyarea() 579 let mut src = src.as_ptr::<u16>(); in fb_copyarea() localVariable 586 core::ptr::copy(src, dst, visiable_w as usize); in fb_copyarea() 587 src = src.add(line_offset); in fb_copyarea() 598 core::ptr::copy(src, tmp_ptr, visiable_w as usize); in fb_copyarea() [all …]
|
/DragonOS/kernel/src/filesystem/procfs/ |
H A D | kmsg.rs | 74 let src = &self.data[0..len]; in read_all() localVariable 75 buf[0..len].copy_from_slice(src); in read_all() 93 let src = &data_level[0..len]; in read_level() localVariable 94 buf[0..len].copy_from_slice(src); in read_level()
|
/DragonOS/docs/community/code_contribution/ |
H A D | conventional-commit.md | 10 …: 如无特殊说明,以子模块/系统/目录名作为范围,例如代码变动是发生在`kernel/src/driver/net`中的特性追加,那么应当命名为`feat(driver/net):`,如果是发生在…
|
/DragonOS/user/apps/test_ebpf/syscall_ebpf/syscall_ebpf-common/ |
H A D | Cargo.toml | 14 path = "src/lib.rs"
|