/DragonOS/kernel/src/arch/x86_64/ |
H A D | kprobe.rs | 16 pub r15: ::core::ffi::c_ulong, 17 pub r14: ::core::ffi::c_ulong, 18 pub r13: ::core::ffi::c_ulong, 19 pub r12: ::core::ffi::c_ulong, 20 pub rbp: ::core::ffi::c_ulong, 21 pub rbx: ::core::ffi::c_ulong, 22 pub r11: ::core::ffi::c_ulong, 23 pub r10: ::core::ffi::c_ulong, 24 pub r9: ::core::ffi::c_ulong, 25 pub r8: ::core::ffi::c_ulong, [all …]
|
/DragonOS/kernel/src/driver/tty/pty/ |
H A D | unix98pty.rs | 53 to.core().port().unwrap().receive_buf(buf, &[], nr) in write() 68 let mut ctrl = to.core().contorl_info_irqsave(); in flush_buffer() 71 to.core().read_wq().wakeup_all(); in flush_buffer() 77 let core = tty.core(); in ioctl() localVariable 78 if core.driver().tty_driver_sub_type() != TtyDriverSubType::PtyMaster { in ioctl() 84 return PtyCommon::pty_set_lock(core, VirtAddr::new(arg)); in ioctl() 87 return PtyCommon::pty_get_lock(core, VirtAddr::new(arg)); in ioctl() 90 return PtyCommon::pty_set_packet_mode(core, VirtAddr::new(arg)); in ioctl() 93 return PtyCommon::pty_get_packet_mode(core, VirtAddr::new(arg)); in ioctl() 97 UserBufferWriter::new(arg as *mut u32, core::mem::size_of::<u32>(), true)?; in ioctl() [all …]
|
H A D | mod.rs | 100 let core = tty.core(); in pty_common_install() localVariable 102 let other_tty = TtyCore::new(other_driver.clone(), core.index()); in pty_common_install() 108 let o_core = other_tty.core(); in pty_common_install() 111 core.init_termios(); in pty_common_install() 118 .insert(core.index(), other_tty.clone()); in pty_common_install() 119 driver.ttys().insert(core.index(), tty.clone()); in pty_common_install() 121 *core.termios_write() = driver.init_termios(); in pty_common_install() 125 core.set_link(Arc::downgrade(&other_tty)); in pty_common_install() 133 core.add_count(); in pty_common_install() 137 PTS_DRIVER.ttys().insert(core.index(), other_tty); in pty_common_install() [all …]
|
/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | mod.rs | 7 use core::any::Any; 8 use core::{ 110 pub r15: ::core::ffi::c_ulong, 111 pub r14: ::core::ffi::c_ulong, 112 pub r13: ::core::ffi::c_ulong, 113 pub r12: ::core::ffi::c_ulong, 114 pub r11: ::core::ffi::c_ulong, 115 pub r10: ::core::ffi::c_ulong, 116 pub r9: ::core::ffi::c_ulong, 117 pub r8: ::core::ffi::c_ulong, [all …]
|
/DragonOS/kernel/crates/bitmap/src/ |
H A D | alloc_bitmap.rs | 1 use core::ops::BitAnd; 11 core: BitMapCore<usize>, field 20 core: BitMapCore::new(), in new() 34 return self.core.get(self.elements, &self.data, index); in get() 39 return self.core.set(self.elements, &mut self.data, index, value); in set() 49 self.data.len() * core::mem::size_of::<usize>() in size() 54 self.core.first_index(&self.data) in first_index() 59 self.core.first_false_index(self.elements, &self.data) in first_false_index() 64 self.core.last_index(self.elements, &self.data) in last_index() 69 self.core.last_false_index(self.elements, &self.data) in last_false_index() [all …]
|
H A D | static_bitmap.rs | 1 use core::mem::size_of; 14 core: BitMapCore<usize>, field 34 core: BitMapCore::new(), in new() 45 return self.core.get(N, &self.data, index); in get() 50 return self.core.set(N, &mut self.data, index, value); in set() 65 self.core.first_index(&self.data) in first_index() 70 self.core.first_false_index(N, &self.data) in first_false_index() 75 self.core.last_index(N, &self.data) in last_index() 80 self.core.last_false_index(N, &self.data) in last_false_index() 85 self.core.next_index(N, &self.data, index) in next_index() [all …]
|
/DragonOS/kernel/src/include/bindings/ |
H A D | linux_bpf.rs | 85 pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]); 89 __IncompleteArrayField(::core::marker::PhantomData, []) in new() 101 ::core::slice::from_raw_parts(self.as_ptr(), len) in as_slice() 105 ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) in as_mut_slice() 108 impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> { 109 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { in fmt() 181 pub type __u8 = ::core::ffi::c_uchar; 182 pub type __s16 = ::core::ffi::c_short; 183 pub type __u16 = ::core::ffi::c_ushort; 184 pub type __s32 = ::core::ffi::c_int; [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | align.rs | 4 use core::{alloc::GlobalAlloc, fmt::Debug, ptr::Unique}; 23 const LAYOUT: core::alloc::Layout = { 31 let layout = core::alloc::Layout::from_size_align( 32 core::mem::size_of::<T>(), 33 max(ALIGN, core::mem::align_of::<T>()), 71 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt() 75 core::any::type_name::<T>(), in fmt() 76 core::mem::align_of::<T>(), in fmt() 78 core::mem::size_of::<T>() in fmt() 87 core::ptr::drop_in_place(self.inner.as_ptr()); in drop() [all …]
|
H A D | volatile.rs | 3 unsafe { core::ptr::read_volatile(core::ptr::addr_of!($data)) } 9 unsafe { core::ptr::write_volatile(core::ptr::addr_of_mut!($data), $value) } 21 true => core::ptr::read_volatile(core::ptr::addr_of!($data)) | $val, 22 false => core::ptr::read_volatile(core::ptr::addr_of!($data)) & (!$val), 150 crate::libs::volatile::VolatileReadable::vread(core::ptr::addr_of!( 172 core::ptr::addr_of_mut!((*$nonnull.as_ptr()).$field),
|
H A D | int_like.rs | 77 pub fn load(&self, order: ::core::sync::atomic::Ordering) -> $new_type_name { 81 pub fn store(&self, val: $new_type_name, order: ::core::sync::atomic::Ordering) { 88 order: ::core::sync::atomic::Ordering, 97 success: ::core::sync::atomic::Ordering, 98 failure: ::core::sync::atomic::Ordering, 99 ) -> ::core::result::Result<$new_type_name, $new_type_name> { 113 success: ::core::sync::atomic::Ordering, 114 failure: ::core::sync::atomic::Ordering, 115 ) -> ::core::result::Result<$new_type_name, $new_type_name> { 130 order: ::core::sync::atomic::Ordering, [all …]
|
H A D | lazy_init.rs | 19 use core::cell::UnsafeCell; 20 use core::fmt::Debug; 21 use core::mem::MaybeUninit; 22 use core::ops::{Deref, DerefMut}; 23 use core::sync::atomic::{AtomicBool, Ordering}; 137 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { in fmt()
|
H A D | lock_free_flags.rs | 1 use core::{cell::UnsafeCell, fmt::Debug}; 46 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt()
|
/DragonOS/kernel/src/driver/tty/ |
H A D | tty_core.rs | 1 use core::{ 39 core: TtyCoreData, field 46 if self.core.driver().tty_driver_sub_type() == TtyDriverSubType::PtySlave { in drop() 47 ptm_driver().ttys().remove(&self.core().index); in drop() 59 let core = TtyCoreData { in new() localVariable 81 core, in new() 89 pub fn core(&self) -> &TtyCoreData { in core() method 90 return &self.core; in core() 94 self.core.privete_fields.lock().clone() in private_fields() 98 *self.core.privete_fields.lock() = Some(fields); in set_private_fields() [all …]
|
H A D | tty_job_control.rs | 21 let core = tty.core(); in proc_set_tty() localVariable 22 let mut ctrl = core.contorl_info_irqsave(); in proc_set_tty() 44 let core = tty.core(); in tty_check_change() localVariable 45 let ctrl = core.contorl_info_irqsave(); in tty_check_change() 87 core::mem::size_of::<i32>(), in job_ctrl_ioctl() 95 let mut ctrl = tty.core().contorl_info_irqsave(); in job_ctrl_ioctl() 120 core::mem::size_of::<i32>(), in job_ctrl_ioctl() 126 .core() in job_ctrl_ioctl()
|
/DragonOS/kernel/crates/kprobe/src/arch/rv64/ |
H A D | mod.rs | 2 use core::{ 57 core::ptr::write(address as *mut u16, inst_16); in drop() 60 core::ptr::write(address as *mut u32, inst_32); in drop() 91 let inst_16 = unsafe { core::ptr::read(address as *const u16) }; in replace_inst() 107 core::ptr::write(address as *mut u16, C_EBREAK_INST as u16); in replace_inst() 110 core::ptr::write(inst_tmp_ptr as *mut u16, inst_16); in replace_inst() 111 core::ptr::write((inst_tmp_ptr + 2) as *mut u16, C_EBREAK_INST as u16); in replace_inst() 114 let inst_32 = unsafe { core::ptr::read(address as *const u32) }; in replace_inst() 117 core::ptr::write(address as *mut u32, EBREAK_INST); in replace_inst() 120 core::ptr::write(inst_tmp_ptr as *mut u32, inst_32); in replace_inst() [all …]
|
/DragonOS/kernel/src/driver/tty/tty_ldisc/ |
H A D | ntty.rs | 1 use core::intrinsics::likely; 2 use core::ops::BitXor; 180 let termios = tty.core().termios(); in receive_buf_common() 225 if tty.core().flags().contains(TtyFlag::LDISC_CHANGING) { in receive_buf_common() 242 let termios = tty.core().termios(); in receive_buf() 252 } else if tty.core().is_closing() && !termios.local_mode.contains(LocalMode::EXTPROC) { in receive_buf() 266 tty.flush_chars(tty.core()); in receive_buf() 278 tty.core() in receive_buf() 325 let termios = tty.core().termios(); in flush_echoes() 346 let termios = tty.core().termios(); in receive_buf_standard() [all …]
|
/DragonOS/kernel/crates/klog_types/src/ |
H A D | lib.rs | 7 use core::{fmt::Debug, mem::size_of_val}; 75 core::slice::from_raw_parts( in calculate_checksum() 77 core::mem::size_of::<Self>() - core::mem::size_of::<u64>(), in calculate_checksum() 105 fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> { in partial_cmp() 111 fn cmp(&self, other: &Self) -> core::cmp::Ordering { in cmp() 130 pub layout: core::alloc::Layout, 136 pub fn new(layout: core::alloc::Layout, vaddr: Option<usize>, paddr: Option<usize>) -> Self { in new() 146 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt() 208 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt() 240 element_size: core::mem::size_of::<AllocatorLog>() as u32, in new()
|
/DragonOS/kernel/src/syscall/ |
H A D | user_access.rs | 3 use core::{ 51 let src: &[u8] = core::slice::from_raw_parts(src.data() as *const u8, dst.len()); in copy_from_user() 132 let mut dst = core::mem::transmute::<[usize; 1], [u8; size_of::<usize>()]>(dst); 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() 176 buffer: unsafe { core::slice::from_raw_parts(addr as *const u8, len) }, in new() 206 pub fn copy_from_user<T: core::marker::Copy>( in copy_from_user() 221 pub fn copy_one_from_user<T: core::marker::Copy>( in copy_one_from_user() 246 if byte_buffer.len() % core::mem::size_of::<T>() != 0 || byte_buffer.is_empty() { in convert_with_offset() 253 byte_buffer.len() / core::mem::size_of::<T>(), in convert_with_offset() 260 if offset + core::mem::size_of::<T>() > src.len() { in convert_one_with_offset() [all …]
|
/DragonOS/kernel/crates/kprobe/src/arch/loongarch64/ |
H A D | mod.rs | 2 use core::ops::{Deref, DerefMut}; 45 let inst_32 = unsafe { core::ptr::read(inst_tmp_ptr as *const u32) }; in drop() 47 core::ptr::write(address as *mut u32, inst_32); in drop() 79 let inst_32 = unsafe { core::ptr::read(address as *const u32) }; in replace_inst() 81 core::ptr::write(address as *mut u32, EBREAK_INST); in replace_inst() 84 core::ptr::write(inst_tmp_ptr as *mut u32, inst_32); in replace_inst() 85 core::ptr::write((inst_tmp_ptr + 4) as *mut u32, EBREAK_INST); in replace_inst()
|
/DragonOS/kernel/crates/kprobe/src/arch/x86/ |
H A D | mod.rs | 4 use core::{ 29 core::ptr::copy( in drop() 34 core::arch::x86_64::_mm_mfence(); in drop() 47 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt() 88 core::ptr::copy( in replace_inst() 104 core::ptr::write_volatile(address as *mut u8, EBREAK_INST); in replace_inst() 105 core::arch::x86_64::_mm_mfence(); in replace_inst()
|
/DragonOS/kernel/src/bpf/helper/ |
H A D | mod.rs | 8 use crate::smp::core::smp_get_processor_id; 10 use core::ffi::c_void; 14 type Result<T> = core::result::Result<T, SystemError>; 17 core::mem::transmute::<usize, RawBPFHelperFn>($name as usize) 25 let key = core::slice::from_raw_parts(key as *const u8, key_size); in raw_map_lookup_elem() 32 _ => core::ptr::null_mut(), in raw_map_lookup_elem() 57 let data = core::slice::from_raw_parts(data as *const u8, size as usize); in raw_perf_event_output() 98 let dst = core::slice::from_raw_parts_mut(dst as *mut u8, size as usize); in raw_bpf_probe_read() 99 let src = core::slice::from_raw_parts(unsafe_ptr as *const u8, size as usize); in raw_bpf_probe_read() 128 let key = core::slice::from_raw_parts(key as *const u8, key_size); in raw_map_update_elem() [all …]
|
/DragonOS/kernel/crates/intertrait/src/ |
H A D | hasher.rs | 1 use core::convert::TryInto; 2 use core::hash::{BuildHasherDefault, Hasher}; 3 use core::mem::size_of;
|
/DragonOS/kernel/src/mm/ |
H A D | percpu.rs | 1 use core::sync::atomic::AtomicU32; 8 core::smp_get_processor_id, 36 if cpu_num.load(core::sync::atomic::Ordering::SeqCst) != 0 { in init() 42 CPU_NUM_ATOMIC.store(cpus, core::sync::atomic::Ordering::SeqCst); in init() 69 let cpu_num = CPU_NUM_ATOMIC.load(core::sync::atomic::Ordering::SeqCst); in new()
|
/DragonOS/kernel/crates/ida/src/ |
H A D | lib.rs | 10 use core::cmp::min; 11 use core::intrinsics::unlikely; 12 use core::marker::PhantomData; 13 use core::ops::Deref; 33 core::ptr::null() in into_raw() 150 impl core::fmt::Debug for IdAllocator { 151 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt()
|
/DragonOS/kernel/src/filesystem/vfs/ |
H A D | utils.rs | 1 use core::cmp::Ordering; 2 use core::fmt::{self, Debug}; 3 use core::hash::Hash; 17 let mut path_split: core::str::SplitN<&str> = path.trim_matches('/').splitn(2, "/"); in split_path() 28 let mut path_split: core::str::RSplitN<&str> = path.trim_matches('/').rsplitn(2, "/"); in rsplit_path() 96 fn hash<H: core::hash::Hasher>(&self, state: &mut H) { in hash()
|