/DragonOS/kernel/crates/rbpf/src/ |
H A D | interpreter.rs | 22 mbuff: &[u8], in check_mem() 23 mem: &[u8], in check_mem() 24 stack: &[u8], in check_mem() 51 mbuff: &[u8], in check_mem() 52 mem: &[u8], in check_mem() 53 stack: &[u8], in check_mem() 84 prog_: Option<&[u8]>, in execute_program() 85 mem: &[u8], in execute_program() 86 mbuff: &[u8], in execute_program() 145 let x = (mem.as_ptr() as u64 + (insn.imm as u32) as u64) as *const u8; in execute_program() constant [all …]
|
H A D | jit.rs | 74 fn map_register(r: u8) -> u8 { in map_register() 113 fn emit1(&self, mem: &mut JitMemory, data: u8) { in emit1() 129 fn emit_modrm(&self, mem: &mut JitMemory, modrm: u8, r: u8, m: u8) { in emit_modrm() 134 fn emit_modrm_reg2reg(&self, mem: &mut JitMemory, r: u8, m: u8) { in emit_modrm_reg2reg() 138 fn emit_modrm_and_displacement(&self, mem: &mut JitMemory, r: u8, m: u8, d: i32) { in emit_modrm_and_displacement() 150 fn basix_rex_would_set_bits(&self, w: u8, src: u8, dst: u8) -> bool { in basix_rex_would_set_bits() 154 fn emit_rex(&self, mem: &mut JitMemory, w: u8, r: u8, x: u8, b: u8) { in emit_rex() 164 fn emit_basic_rex(&self, mem: &mut JitMemory, w: u8, src: u8, dst: u8) { in emit_basic_rex() 174 fn emit_push(&self, mem: &mut JitMemory, r: u8) { in emit_push() 179 fn emit_pop(&self, mem: &mut JitMemory, r: u8) { in emit_pop() [all …]
|
/DragonOS/kernel/src/mm/allocator/ |
H A D | kernel_allocator.rs | 24 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8; in local_alloc() 25 unsafe fn local_alloc_zeroed(&self, layout: Layout) -> *mut u8; in local_alloc_zeroed() 26 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc() 32 unsafe fn alloc_in_buddy(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { in alloc_in_buddy() 54 pub(super) unsafe fn free_in_buddy(&self, ptr: *mut u8, layout: Layout) { in free_in_buddy() 65 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8 { in local_alloc() 79 unsafe fn local_alloc_zeroed(&self, layout: Layout) -> *mut u8 { in local_alloc_zeroed() 97 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout) { in local_dealloc() 108 unsafe fn alloc(&self, layout: Layout) -> *mut u8 { in alloc() 118 unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { in alloc_zeroed() [all …]
|
H A D | slab.rs | 33 pub(crate) unsafe fn allocate(&mut self, layout: Layout) -> *mut u8 { in allocate() 54 ptr: *mut u8, in deallocate() 91 unsafe fn free_slab_page(&self, base_addr: *mut u8, size: usize) { in free_slab_page()
|
/DragonOS/kernel/src/syscall/ |
H A D | mod.rs | 104 Self::put_string(args[0] as *const u8, args[1] as u32, args[2] as u32) in handle() constant 108 let path = args[0] as *const u8; in handle() constant 117 let oldname: *const u8 = args[0] as *const u8; in handle() constant 118 let newname: *const u8 = args[1] as *const u8; in handle() constant 131 let oldname: *const u8 = args[1] as *const u8; in handle() constant 133 let newname: *const u8 = args[3] as *const u8; in handle() constant 139 let oldname: *const u8 = args[1] as *const u8; in handle() constant 141 let newname: *const u8 = args[3] as *const u8; in handle() constant 148 let path = args[1] as *const u8; in handle() constant 175 UserBufferReader::new(buf_vaddr as *const u8, len, from_user)?; in handle() constant [all …]
|
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() 51 let src: &[u8] = core::slice::from_raw_parts(src.data() as *const u8, dst.len()); in copy_from_user() constant 76 user: *const u8, in check_and_clone_cstr() 128 let str_ptr: *const u8; in check_and_clone_cstr_array() constant 135 str_ptr = dst[0] as *const u8; in check_and_clone_cstr_array() constant 176 buffer: unsafe { core::slice::from_raw_parts(addr as *const u8, len) }, in new() constant 241 fn convert_with_offset<T>(&self, src: &[u8], offset: usize) -> Result<&[T], SystemError> { in convert_with_offset() 259 fn convert_one_with_offset<T>(&self, src: &[u8], offset: usize) -> Result<&T, SystemError> { in convert_one_with_offset() 328 fn convert_with_offset<T>(src: &mut [u8], offset: usize) -> Result<&mut [T], SystemError> { in convert_with_offset() 346 fn convert_one_with_offset<T>(src: &mut [u8], offset: usize) -> Result<&mut T, SystemError> { in convert_one_with_offset()
|
/DragonOS/kernel/src/bpf/map/ |
H A D | hash_map.rs | 41 fn lookup_elem(&mut self, key: &[u8]) -> Result<Option<&[u8]>> { in lookup_elem() 45 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem() 54 fn for_each_elem(&mut self, cb: BpfCallBackFn, ctx: *const u8, flags: u64) -> Result<u32> { in for_each_elem() 69 fn lookup_and_delete_elem(&mut self, key: &[u8], value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem() 79 fn get_next_key(&self, key: Option<&[u8]>, next_key: &mut [u8]) -> Result<()> { in get_next_key() 126 fn lookup_elem(&mut self, key: &[u8]) -> Result<Option<&[u8]>> { in lookup_elem() 129 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem() 135 fn for_each_elem(&mut self, cb: BpfCallBackFn, ctx: *const u8, flags: u64) -> Result<u32> { in for_each_elem() 138 fn lookup_and_delete_elem(&mut self, key: &[u8], value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem() 143 fn lookup_percpu_elem(&mut self, key: &[u8], cpu: u32) -> Result<Option<&[u8]>> { in lookup_percpu_elem() [all …]
|
H A D | lru.rs | 40 fn lookup_elem(&mut self, key: &[u8]) -> Result<Option<&[u8]>> { in lookup_elem() 44 fn update_elem(&mut self, key: &[u8], value: &[u8], _flags: u64) -> Result<()> { in update_elem() 52 fn for_each_elem(&mut self, cb: BpfCallBackFn, ctx: *const u8, flags: u64) -> Result<u32> { in for_each_elem() 67 fn lookup_and_delete_elem(&mut self, key: &[u8], value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem() 77 fn get_next_key(&self, key: Option<&[u8]>, next_key: &mut [u8]) -> Result<()> { in get_next_key() 124 fn lookup_elem(&mut self, key: &[u8]) -> Result<Option<&[u8]>> { in lookup_elem() 127 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem() 133 fn for_each_elem(&mut self, cb: BpfCallBackFn, ctx: *const u8, flags: u64) -> Result<u32> { in for_each_elem() 136 fn lookup_and_delete_elem(&mut self, key: &[u8], value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem() 141 fn lookup_percpu_elem(&mut self, key: &[u8], cpu: u32) -> Result<Option<&[u8]>> { in lookup_percpu_elem() [all …]
|
H A D | array_map.rs | 83 fn lookup_elem(&mut self, key: &[u8]) -> Result<Option<&[u8]>> { in lookup_elem() 94 fn update_elem(&mut self, key: &[u8], value: &[u8], _flags: u64) -> Result<()> { in update_elem() 113 fn for_each_elem(&mut self, cb: BpfCallBackFn, ctx: *const u8, flags: u64) -> Result<u32> { in for_each_elem() 131 fn lookup_and_delete_elem(&mut self, _key: &[u8], _value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem() 135 fn get_next_key(&self, key: Option<&[u8]>, next_key: &mut [u8]) -> Result<()> { in get_next_key() 156 fn first_value_ptr(&self) -> Result<*const u8> { in first_value_ptr() 190 fn lookup_elem(&mut self, key: &[u8]) -> Result<Option<&[u8]>> { in lookup_elem() 193 fn update_elem(&mut self, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in update_elem() 199 fn for_each_elem(&mut self, cb: BpfCallBackFn, ctx: *const u8, flags: u64) -> Result<u32> { in for_each_elem() 202 fn lookup_and_delete_elem(&mut self, _key: &[u8], _value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem() [all …]
|
H A D | mod.rs | 35 pub type BpfCallBackFn = fn(key: &[u8], value: &[u8], ctx: *const u8) -> i32; constant 41 fn lookup_elem(&mut self, _key: &[u8]) -> Result<Option<&[u8]>> { in lookup_elem() 47 fn update_elem(&mut self, _key: &[u8], _value: &[u8], _flags: u64) -> Result<()> { in update_elem() 60 fn for_each_elem(&mut self, _cb: BpfCallBackFn, _ctx: *const u8, _flags: u64) -> Result<u32> { in for_each_elem() 65 fn lookup_and_delete_elem(&mut self, _key: &[u8], _value: &mut [u8]) -> Result<()> { in lookup_and_delete_elem() 70 fn lookup_percpu_elem(&mut self, _key: &[u8], _cpu: u32) -> Result<Option<&[u8]>> { in lookup_percpu_elem() 76 fn get_next_key(&self, _key: Option<&[u8]>, _next_key: &mut [u8]) -> Result<()> { in get_next_key() 81 fn push_elem(&mut self, _value: &[u8], _flags: u64) -> Result<()> { in push_elem() 103 fn first_value_ptr(&self) -> Result<*const u8> { in first_value_ptr() 145 _buf: &mut [u8], in read_at() [all …]
|
/DragonOS/kernel/src/arch/x86_64/pci/ |
H A D | pci.rs | 23 fn read_config_early(bus: u8, slot: u8, func: u8, offset: u8) -> u8 { in read_config_early() 55 fn write_config(bus_device_function: &BusDeviceFunction, offset: u8, data: u32) { in write_config()
|
/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | entry.rs | 546 pub unsafe fn set_intr_gate(irq: u32, ist: u8, vaddr: VirtAddr) { in set_intr_gate() 553 pub unsafe fn set_trap_gate(irq: u32, ist: u8, vaddr: VirtAddr) { in set_trap_gate() 560 pub unsafe fn set_system_trap_gate(irq: u32, ist: u8, vaddr: VirtAddr) { in set_system_trap_gate() 577 unsafe fn set_gate(gate: &mut [u64], attr: u8, ist: u8, handler: VirtAddr) { in set_gate()
|
/DragonOS/kernel/src/bpf/helper/ |
H A D | mod.rs | 25 let key = core::slice::from_raw_parts(key as *const u8, key_size); in raw_map_lookup_elem() constant 36 pub fn map_lookup_elem(map: &Arc<BpfMap>, key: &[u8]) -> Result<Option<*const u8>> { in map_lookup_elem() 57 let data = core::slice::from_raw_parts(data as *const u8, size as usize); in raw_perf_event_output() constant 71 data: &[u8], in perf_event_output() 99 let src = core::slice::from_raw_parts(unsafe_ptr as *const u8, size as usize); in raw_bpf_probe_read() constant 112 pub fn bpf_probe_read(dst: &mut [u8], src: &[u8]) -> Result<()> { in bpf_probe_read() 128 let key = core::slice::from_raw_parts(key as *const u8, key_size); in raw_map_update_elem() constant 129 let value = core::slice::from_raw_parts(value as *const u8, value_size); in raw_map_update_elem() constant 138 pub fn map_update_elem(map: &Arc<BpfMap>, key: &[u8], value: &[u8], flags: u64) -> Result<()> { in map_update_elem() 150 let key = core::slice::from_raw_parts(key as *const u8, key_size); in raw_map_delete_elem() constant [all …]
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | virtio_impl.rs | 24 ) -> (virtio_drivers::PhysAddr, NonNull<u8>) { in dma_alloc() 56 vaddr: NonNull<u8>, in dma_dealloc() 86 unsafe fn mmio_phys_to_virt(paddr: virtio_drivers::PhysAddr, _size: usize) -> NonNull<u8> { in mmio_phys_to_virt() 93 buffer: NonNull<[u8]>, in share() 104 _buffer: NonNull<[u8]>, in unshare()
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | ioapic.rs | 155 unsafe fn write(&mut self, reg: u8, data: u32) { in write() 162 fn write_rte(&mut self, rte_index: u8, vector: u8, flags: RedirectionEntry, dest: u8) { in write_rte() 171 pub fn enable(&mut self, rte_index: u8) { in enable() 177 pub fn disable(&mut self, rte_index: u8) { in disable() 198 rte_index: u8, in install() 199 vector: u8, in install() 200 dest: u8, in install() 236 pub fn irq_vector(&mut self, irq: u8) -> u8 { in irq_vector() 242 pub fn set_irq_vector(&mut self, irq: u8, vector: u8) { in set_irq_vector() 254 pub fn id(&mut self) -> u8 { in id() [all …]
|
/DragonOS/kernel/src/driver/tty/tty_ldisc/ |
H A D | ntty.rs | 165 pub fn read_at(&self, i: usize) -> u8 { in read_at() 174 buf: &[u8], in receive_buf_common() 175 flags: Option<&[u8]>, in receive_buf_common() 238 buf: &[u8], in receive_buf() 239 flags: Option<&[u8]>, in receive_buf() 284 fn receive_buf_real_raw(&mut self, buf: &[u8], mut count: usize) { in receive_buf_real_raw() 301 fn receive_buf_raw(&mut self, buf: &[u8], flags: Option<&[u8]>, mut count: usize) { in receive_buf_raw() 341 buf: &[u8], in receive_buf_standard() 342 flags: Option<&[u8]>, in receive_buf_standard() 403 pub fn receive_special_char(&mut self, mut c: u8, tty: Arc<TtyCore>, lookahead_done: bool) { in receive_special_char() [all …]
|
H A D | mod.rs | 31 buf: &mut [u8], in read() 40 buf: &[u8], in write() 58 buf: &[u8], in receive_buf() 59 flags: Option<&[u8]>, in receive_buf() 67 buf: &[u8], in receive_buf2() 68 flags: Option<&[u8]>, in receive_buf2()
|
/DragonOS/kernel/src/driver/pci/ |
H A D | pci_irq.rs | 229 fn irq_enable(&self, enable: bool) -> Result<u8, PciError> { in irq_enable() 251 fn msix_enable(&self, enable: bool) -> Result<u8, PciError> { in msix_enable() 282 fn msi_enable(&self, enable: bool) -> Result<u8, PciError> { in msi_enable() 318 fn irq_install(&self, msg: PciIrqMsg) -> Result<u8, PciError> { in irq_install() 349 fn msi_install(&self, msg: PciIrqMsg) -> Result<u8, PciError> { in msi_install() 514 fn msix_install(&self, msg: PciIrqMsg) -> Result<u8, PciError> { in msix_install() 604 fn irq_uninstall(&mut self) -> Result<u8, PciError> { in irq_uninstall() 626 fn msi_uninstall(&self) -> Result<u8, PciError> { in msi_uninstall() 674 fn msix_uninstall(&self) -> Result<u8, PciError> { in msix_uninstall() 729 fn irq_mask(&mut self, irq_index: u16) -> Result<u8, PciError> { in irq_mask() [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | keyboard_parser.rs | 66 fn parse(&self, scancode: u8, scancode_status: &mut ScanCodeStatus) -> TypeOneFSMState { in parse() 89 fn handle_start(&self, scancode: u8, scancode_status: &mut ScanCodeStatus) -> TypeOneFSMState { in handle_start() 108 scancode: u8, in handle_pause_break() 128 fn handle_func0(&self, scancode: u8, scancode_status: &mut ScanCodeStatus) -> TypeOneFSMState { in handle_func0() 278 fn handle_type3(&self, scancode: u8, scancode_status: &mut ScanCodeStatus) -> TypeOneFSMState { in handle_type3() 353 fn to_ctrl(ch: u8, shift: bool) -> u8 { in to_ctrl() 369 fn emit(ch: u8) { in emit() 377 scancode: u8, in handle_prtsc_press() 402 scancode: u8, in handle_prtsc_release()
|
H A D | vec_cursor.rs | 36 pub fn get_mut(&mut self) -> &mut Vec<u8> { in get_mut() 41 pub fn get_ref(&self) -> &Vec<u8> { in get_ref() 46 pub fn read_u8(&mut self) -> Result<u8, SystemError> { in read_u8() 151 pub fn write_u8(&mut self, value: u8) -> Result<u8, SystemError> { in write_u8() 222 pub fn as_slice(&self) -> &[u8] { in as_slice() 227 pub fn as_mut_slice(&mut self) -> &mut [u8] { in as_mut_slice()
|
/DragonOS/kernel/src/filesystem/kernfs/ |
H A D | callback.rs | 20 buf: &mut [u8], in read() 27 buf: &[u8], in write() 68 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() 76 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() 93 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() 102 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write()
|
/DragonOS/kernel/src/filesystem/vfs/ |
H A D | syscall.rs | 485 path: *const u8, in open() 507 path: *const u8, in openat() 631 pub fn pread(fd: i32, buf: &mut [u8], len: usize, offset: usize) -> Result<usize, SystemError> { in pread() 653 pub fn pwrite(fd: i32, buf: &[u8], len: usize, offset: usize) -> Result<usize, SystemError> { in pwrite() 801 pub fn mkdir(path: *const u8, mode: usize) -> Result<usize, SystemError> { in mkdir() 814 pub fn mkdir_at(dirfd: i32, path: *const u8, mode: usize) -> Result<usize, SystemError> { in mkdir_at() 886 pub fn link(old: *const u8, new: *const u8) -> Result<usize, SystemError> { in link() 887 let get_path = |cstr: *const u8| -> Result<String, SystemError> { in link() constant 913 old: *const u8, in linkat() 915 new: *const u8, in linkat() [all …]
|
/DragonOS/kernel/src/bpf/prog/ |
H A D | mod.rs | 34 pub fn insns(&self) -> &[u8] { in insns() 38 pub fn insns_mut(&mut self) -> &mut [u8] { in insns_mut() 58 _buf: &mut [u8], in read_at() 68 _buf: &[u8], in write_at() 104 let file = Arc::from_raw(*ptr as *const u8 as *const BpfMap); in drop() constant
|
/DragonOS/kernel/src/filesystem/sysfs/ |
H A D | file.rs | 60 pub fn callback_read(&self, buf: &mut [u8], offset: usize) -> Result<usize, SystemError> { in callback_read() 83 pub fn callback_write(&self, buf: &[u8], offset: usize) -> Result<usize, SystemError> { in callback_write() 297 buf: &mut [u8], in read() 306 buf: &[u8], in write() 329 buf: &mut [u8], in read() 338 _buf: &[u8], in write() 361 _buf: &mut [u8], in read() 370 buf: &[u8], in write() 393 _buf: &mut [u8], in read() 402 _buf: &[u8], in write() [all …]
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | lib.rs | 65 fn allocate(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocationError>; in allocate() 70 ptr: NonNull<u8>, in deallocate() 90 unsafe fn free_slab_page(&self, _: *mut u8, _: usize) {} in free_slab_page()
|