/DragonOS-0.1.9/kernel/src/libs/ |
D | vec_cursor.rs | 14 data: Vec<u8>, field 21 pub fn new(data: Vec<u8>) -> Self { in new() 22 return Self { data: data, pos: 0 }; in new() 28 data: Vec::new(), in zerod() 31 result.data.resize(length, 0); in zerod() 37 return &mut self.data; in get_mut() 42 return &self.data; in get_ref() 47 if self.pos >= self.data.len() { in read_u8() 51 return Ok(self.data[self.pos - 1]); in read_u8() 56 if self.pos + 2 > self.data.len() { in read_u16() [all …]
|
D | volatile.rs | 2 ($data: expr) => { 3 unsafe { core::ptr::read_volatile(core::ptr::addr_of!($data)) } 8 ($data: expr, $value: expr) => { 9 unsafe { core::ptr::write_volatile(core::ptr::addr_of_mut!($data), $value) } 17 ($data: expr, $val: expr, $flag: expr) => { 19 $data, 21 true => core::ptr::read_volatile(core::ptr::addr_of!($data)) | $val, 22 false => core::ptr::read_volatile(core::ptr::addr_of!($data)) & (!$val), 33 ($data: expr, $bits: expr, $val: expr) => { 34 volatile_set_bit!($data, $bits, false); [all …]
|
D | rwlock.rs | 40 data: UnsafeCell<T>, field 46 data: *const T, field 56 data: *const T, field 65 data: *mut T, field 77 pub const fn new(data: T) -> Self { in new() 80 data: UnsafeCell::new(data), in new() 88 let RwLock { data, .. } = self; in into_inner() 89 return data.into_inner(); in into_inner() 97 return self.data.get(); in as_mut_ptr() 148 data: unsafe { &*self.data.get() }, in inner_try_read() [all …]
|
D | spinlock.rs | 20 data: UnsafeCell<T>, field 29 data: *mut T, field 48 unsafe { &mut *this.lock.data.get() } in leak() 66 data: UnsafeCell::new(value), in new() 108 data: unsafe { &mut *self.data.get() }, in try_lock() 134 data: unsafe { &mut *self.data.get() }, in try_lock_irqsave() 148 data: unsafe { &mut *self.data.get() }, in try_lock_no_preempt() 177 return unsafe { &*self.data }; in deref() 184 return unsafe { &mut *self.data }; in deref_mut()
|
/DragonOS-0.1.9/kernel/src/driver/hid/ |
D | hidparse.c | 84 parser->data.report_id = 1; // we must give it a non-zero value or the parser doesn't work in hid_reset_parser() 113 static bool hid_parse(struct hid_parser *parser, struct hid_data_t *data) in hid_parse() argument 186 parser->data.path.node[parser->data.path.size].u_page = parser->usage_table[0].u_page; in hid_parse() 187 parser->data.path.node[parser->data.path.size].usage = parser->usage_table[0].usage; in hid_parse() 188 ++parser->data.path.size; in hid_parse() 197 parser->data.path.node[parser->data.path.size].u_page = 0xff; in hid_parse() 198 parser->data.path.node[parser->data.path.size].usage = parser->value & 0x7f; in hid_parse() 199 ++parser->data.path.size; in hid_parse() 208 --parser->data.path.size; // 为什么要--????? in hid_parse() 210 if (parser->data.path.node[parser->data.path.size].u_page == 0xff) in hid_parse() [all …]
|
/DragonOS-0.1.9/kernel/crates/bitmap/src/ |
D | alloc_bitmap.rs | 8 data: Vec<usize>, field 14 let data = vec![0usize; (elements + usize::BITS as usize - 1) / (usize::BITS as usize)]; in new() localVariable 17 data, in new() 26 return self.core.get(self.elements, &self.data, index); in get() 31 return self.core.set(self.elements, &mut self.data, index, value); in set() 41 self.data.len() * core::mem::size_of::<usize>() in size() 46 self.core.first_index(&self.data) in first_index() 51 self.core.first_false_index(self.elements, &self.data) in first_false_index() 56 self.core.last_index(self.elements, &self.data) in last_index() 61 self.core.last_false_index(self.elements, &self.data) in last_false_index() [all …]
|
D | static_bitmap.rs | 13 pub data: [usize; (N + usize::BITS as usize - 1) / (usize::BITS as usize)], field 24 data: [0; (N + usize::BITS as usize - 1) / (usize::BITS as usize)], in new() 36 return self.core.get(N, &self.data, index); in get() 41 return self.core.set(N, &mut self.data, index, value); in set() 51 self.data.len() * size_of::<usize>() in size() 56 self.core.first_index(&self.data) in first_index() 61 self.core.first_false_index(N, &self.data) in first_false_index() 66 self.core.last_index(N, &self.data) in last_index() 71 self.core.last_false_index(N, &self.data) in last_false_index() 76 self.core.next_index(N, &self.data, index) in next_index() [all …]
|
D | bitmap_core.rs | 18 pub(crate) fn get(&self, n: usize, data: &[T], index: usize) -> Option<bool> { in get() 26 let element = data.get(element_index)?; in get() 33 pub(crate) fn set(&self, n: usize, data: &mut [T], index: usize, value: bool) -> Option<bool> { in set() 40 let element = data.get_mut(element_index)?; in set() 46 pub(crate) fn set_all(&self, n: usize, data: &mut [T], value: bool) { in set_all() 48 for element in data.iter_mut() { in set_all() 53 let last_element = data.last_mut().unwrap(); in set_all() 61 pub(crate) fn first_index(&self, data: &[T]) -> Option<usize> { in first_index() 62 for (i, element) in data.iter().enumerate() { in first_index() 73 pub(crate) fn first_false_index(&self, n: usize, data: &[T]) -> Option<usize> { in first_false_index() [all …]
|
/DragonOS-0.1.9/kernel/src/driver/multiboot2/ |
D | multiboot2.c | 28 void *data, unsigned int *count) in multiboot2_iter() argument 45 if (_fun(tag, data, count) == true) in multiboot2_iter() 71 bool multiboot2_get_memory(const struct iter_data_t *_iter_data, void *data, unsigned int *count) in multiboot2_get_memory() argument 76 struct multiboot_mmap_entry_t *resource = (struct multiboot_mmap_entry_t *)data; in multiboot2_get_memory() 96 bool multiboot2_get_VBE_info(const struct iter_data_t *_iter_data, void *data, unsigned int *reserv… in multiboot2_get_VBE_info() argument 101 *(struct multiboot_tag_vbe_t *)data = *(struct multiboot_tag_vbe_t *)_iter_data; in multiboot2_get_VBE_info() 110 bool multiboot2_get_load_base(const struct iter_data_t *_iter_data, void *data, unsigned int *reser… in multiboot2_get_load_base() argument 115 …*(struct multiboot_tag_load_base_addr_t *)data = *(struct multiboot_tag_load_base_addr_t *)_iter_d… in multiboot2_get_load_base() 125 bool multiboot2_get_Framebuffer_info(const struct iter_data_t *_iter_data, void *data, unsigned int… in multiboot2_get_Framebuffer_info() argument 129 …*(struct multiboot_tag_framebuffer_info_t *)data = *(struct multiboot_tag_framebuffer_info_t *)_it… in multiboot2_get_Framebuffer_info() [all …]
|
/DragonOS-0.1.9/kernel/src/driver/base/device/ |
D | device_number.rs | 24 pub const fn data(&self) -> u32 { in data() method 31 data: u32, field 40 data: (major.data() << Self::MINOR_BITS) | minor, in new() 45 Major::new(self.data >> Self::MINOR_BITS) in major() 49 self.data & 0xfffff in minor() 52 pub const fn data(&self) -> u32 { in data() method 53 self.data in data() 65 Self { data: x } in from()
|
/DragonOS-0.1.9/kernel/src/arch/x86_64/driver/apic/ |
D | mod.rs | 130 data: u32, field 137 pub fn new(register: LVTRegister, data: u32) -> Option<Self> { in new() 139 let mut result = Self { register, data: 0 }; in new() 140 result.set_vector((data & 0xFF) as u8); in new() 145 .set_delivery_mode(DeliveryMode::try_from(((data >> 8) & 0b111) as u8).ok()?) in new() 151 result.set_interrupt_input_pin_polarity((data & (1 << 13)) == 0); in new() 153 if data & (1 << 15) != 0 { in new() 159 result.set_mask((data & (1 << 16)) != 0); in new() 163 .set_timer_mode(LocalApicTimerMode::try_from(((data >> 17) & 0b11) as u8).ok()?) in new() 172 pub fn data(&self) -> u32 { in data() method [all …]
|
/DragonOS-0.1.9/kernel/src/driver/firmware/efi/ |
D | memmap.rs | 84 let res = unsafe { *(vaddr.data() as *const Self::Item) }; in next() 94 pub(super) fn memmap_init_early(&self, data: &EFIFdtParams) -> Result<(), SystemError> { in memmap_init_early() 95 return self.do_efi_memmap_init(data, true); in memmap_init_early() 104 fn do_efi_memmap_init(&self, data: &EFIFdtParams, early: bool) -> Result<(), SystemError> { in do_efi_memmap_init() 105 let paddr = data.mmap_base.expect("mmap_base is not set"); in do_efi_memmap_init() 110 let offset = paddr.data() - page_align_down(paddr.data()); in do_efi_memmap_init() 111 let map_size = data.mmap_size.unwrap() as usize + offset; in do_efi_memmap_init() 117 PhysAddr::new(page_align_down(paddr.data())), in do_efi_memmap_init() 138 inner_guard.mmap.size = data.mmap_size.unwrap() as usize; in do_efi_memmap_init() 140 data.mmap_size.unwrap() as usize / data.mmap_desc_size.unwrap() as usize; in do_efi_memmap_init() [all …]
|
/DragonOS-0.1.9/kernel/src/arch/x86_64/asm/ |
D | pio.rs | 22 unsafe fn out8(port: u16, data: u8) { in out8() 23 x86::io::outb(port, data) in out8() 27 unsafe fn out16(port: u16, data: u16) { in out16() 28 x86::io::outw(port, data) in out16() 32 unsafe fn out32(port: u16, data: u32) { in out32() 33 x86::io::outl(port, data) in out32()
|
/DragonOS-0.1.9/kernel/src/exception/ |
D | msi.rs | 17 pub data: u32, field 25 self.address_lo, self.address_hi, self.data in fmt() 33 pub const fn new(address: u64, data: u32) -> Self { in new() 37 data, in new() 42 pub const fn new_lo_hi(address_lo: u32, address_hi: u32, data: u32) -> Self { in new_lo_hi() 46 data, in new_lo_hi() 59 data: 0, in new_zeroed() 108 data: 0, in new() 130 fn write_msi_msg(&self, data: Arc<dyn MsiDescFuncData>); in write_msi_msg()
|
/DragonOS-0.1.9/kernel/src/driver/tty/ |
D | kthread.rs | 52 let mut data = [0u8; TO_DEQUEUE_MAX]; in tty_refresh_thread() localVariable 54 data[i] = KEYBUF.pop().unwrap(); in tty_refresh_thread() 57 let _ = current_tty_port().receive_buf(&data[0..to_dequeue], &[], to_dequeue); in tty_refresh_thread() 62 pub fn send_to_tty_refresh_thread(data: &[u8]) { in send_to_tty_refresh_thread() 63 for i in 0..data.len() { in send_to_tty_refresh_thread() 64 KEYBUF.push(data[i]).ok(); in send_to_tty_refresh_thread()
|
/DragonOS-0.1.9/kernel/src/arch/x86_64/interrupt/ |
D | trap.rs | 76 smp_get_processor_id().data(), in do_divide_error() 90 smp_get_processor_id().data(), in do_debug() 104 smp_get_processor_id().data(), in do_nmi() 118 smp_get_processor_id().data(), in do_int3() 132 smp_get_processor_id().data(), in do_overflow() 146 smp_get_processor_id().data(), in do_bounds() 160 smp_get_processor_id().data(), in do_undefined_opcode() 174 smp_get_processor_id().data(), in do_dev_not_avaliable() 188 smp_get_processor_id().data(), in do_double_fault() 202 smp_get_processor_id().data(), in do_coprocessor_segment_overrun() [all …]
|
/DragonOS-0.1.9/kernel/src/arch/x86_64/ |
D | link.lds | 18 *(.bootstrap.data) 40 .data (data_start_pa): AT(data_start_pa - KERNEL_VMA) 43 *(.data) 44 *(.data.*) 63 .data.init_proc_union (init_proc_union_start_pa): AT(init_proc_union_start_pa - KERNEL_VMA) 64 { *(.data.init_proc_union) }
|
/DragonOS-0.1.9/kernel/src/mm/ |
D | percpu.rs | 60 pub fn new(data: Vec<T>) -> Option<Self> { in new() 66 if data.len() != cpu_num.try_into().unwrap() { in new() 70 return Some(Self { inner: data }); in new() 80 &self.inner[cpu_id.data() as usize] in get() 85 &mut self.inner[cpu_id.data() as usize] in get_mut() 89 &self.inner[cpu_id.data() as usize] in force_get() 93 &mut self.inner[cpu_id.data() as usize] in force_get_mut()
|
/DragonOS-0.1.9/kernel/src/driver/video/fbdev/ |
D | vesafb.rs | 422 fn fb_copyarea(&self, data: super::base::CopyAreaData) { in fb_copyarea() 428 if data.sx > var.xres as i32 in fb_copyarea() 429 || data.sy > var.yres as i32 in fb_copyarea() 430 || data.dx > var.xres as i32 in fb_copyarea() 431 || data.dy > var.yres as i32 in fb_copyarea() 432 || (data.sx + data.width as i32) < 0 in fb_copyarea() 433 || (data.sy + data.height as i32) < 0 in fb_copyarea() 434 || (data.dx + data.width as i32) < 0 in fb_copyarea() 435 || (data.dy + data.height as i32) < 0 in fb_copyarea() 441 let (s_visiable_x, s_w) = if data.sx < 0 { in fb_copyarea() [all …]
|
/DragonOS-0.1.9/kernel/src/libs/lib_ui/font/ |
D | mod.rs | 51 return &self.bitmap.data[pos..pos + self.bytes_per_char]; in char_map() 69 pub data: &'a [u8], field 75 pub const fn new(data: &'static [u8], width: usize) -> Self { in new() 78 height: data.len() / width / 8, in new() 80 Self { data, size } in new() 88 self.data.len() in len()
|
/DragonOS-0.1.9/kernel/src/arch/ |
D | io.rs | 6 unsafe fn out8(port: u16, data: u8); in out8() 7 unsafe fn out16(port: u16, data: u16); in out16() 8 unsafe fn out32(port: u16, data: u32); in out32()
|
/DragonOS-0.1.9/kernel/src/arch/riscv64/ |
D | link.ld | 45 .data (data_start_pa): AT(data_start_pa - KERNEL_VMA) 48 *(.data) 49 *(.data.*) 69 .data.init_proc_union (init_proc_union_start_pa): AT(init_proc_union_start_pa - KERNEL_VMA) 70 { *(.data.init_proc_union) }
|
/DragonOS-0.1.9/kernel/src/ipc/ |
D | pipe.rs | 52 data: [u8; PIPE_BUFF_SIZE], field 112 data: [0; PIPE_BUFF_SIZE], in new() 153 data: &mut FilePrivateData, in read_at() 157 if let FilePrivateData::Pipefs(pdata) = data { in read_at() 213 buf[0..(PIPE_BUFF_SIZE - start)].copy_from_slice(&inode.data[start..PIPE_BUFF_SIZE]); in read_at() 214 buf[(PIPE_BUFF_SIZE - start)..num].copy_from_slice(&inode.data[0..end]); in read_at() 216 buf[0..num].copy_from_slice(&inode.data[start..end]); in read_at() 235 let pollflag = EPollEventType::from_bits_truncate(inode.poll(&data)? as u32); in read_at() 245 data: &mut FilePrivateData, in open() 261 *data = FilePrivateData::Pipefs(PipeFsPrivateData { mode: *mode }); in open() [all …]
|
/DragonOS-0.1.9/kernel/src/filesystem/procfs/ |
D | kmsg.rs | 35 data: Vec<u8>, field 46 data: Vec::new(), in new() 70 let len = self.data.len().min(buf.len()); in read_all() 73 let src = &self.data[0..len]; in read_all() 112 self.data.clear(); in clear() 140 self.data.clear(); in tobytes() 144 self.data.append(&mut msg.to_string().as_bytes().to_owned()); in tobytes() 151 return self.data.len(); in tobytes()
|
/DragonOS-0.1.9/kernel/src/mm/allocator/ |
D | bump.rs | 63 let area_base = area.area_base_aligned().data(); in remain_areas() 66 let area_end = area.area_end_aligned().data(); in remain_areas() 82 ret_offset_aligned = offset - area.area_base_aligned().data(); in remain_areas() 140 let area_base = area.area_base_aligned().data(); in allocate() 143 let area_end = area.area_end_aligned().data(); in allocate() 158 if offset + count.data() * MMA::PAGE_SIZE <= area_end { in allocate() 161 self.offset = offset + count.data() * MMA::PAGE_SIZE; in allocate() 184 let area_base = (area.base.data() + MMA::PAGE_SHIFT) & !(MMA::PAGE_SHIFT); in usage() 186 let area_end = (area.base.data() + area.size) & !(MMA::PAGE_SHIFT); in usage()
|