/DragonOS/docs/ |
H A D | index.rst | 13 introduction/index 21 kernel/configuration/index 22 kernel/boot/index 23 kernel/core_api/index 24 kernel/locking/index 25 kernel/process_management/index 26 kernel/sched/index 27 kernel/ipc/index 28 kernel/memory_management/index 29 kernel/filesystem/index [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | cpumask.rs | 38 .map(|index| ProcessorId::new(index as u32)) in first() 45 .map(|index| ProcessorId::new(index as u32)) in first_zero() 52 .map(|index| ProcessorId::new(index as u32)) in last() 59 .map(|index| ProcessorId::new(index as u32)) in next_index() 66 .map(|index| ProcessorId::new(index as u32)) in next_zero_index() 85 index: None, in iter_cpu() 95 index: None, in iter_zero_cpu() 127 index: Option<ProcessorId>, field 136 if self.index.is_none() && self.begin { in next() 138 self.index = self.mask.first(); in next() [all …]
|
/DragonOS/kernel/crates/bitmap/src/ |
H A D | traits.rs | 7 fn get(bits: &Self, index: usize) -> bool; in get() 8 fn set(bits: &mut Self, index: usize, value: bool) -> bool; in set() 15 fn next_index(bits: &Self, index: usize) -> Option<usize>; in next_index() 16 fn next_false_index(bits: &Self, index: usize) -> Option<usize>; in next_false_index() 17 fn prev_index(bits: &Self, index: usize) -> Option<usize>; in prev_index() 18 fn prev_false_index(bits: &Self, index: usize) -> Option<usize>; in prev_false_index() 33 fn get(bits: &Self, index: usize) -> bool { 34 bits & (1 << index) != 0 38 fn set(bits: &mut Self, index: usize, value: bool) -> bool { 39 let mask = 1 << index; [all …]
|
H A D | bitmap_core.rs | 18 pub(crate) fn get(&self, n: usize, data: &[T], index: usize) -> Option<bool> { in get() 19 if unlikely(index >= n) { in get() 23 let element_index = index / T::bit_size(); in get() 24 let bit_index = index % T::bit_size(); in get() 33 pub(crate) fn set(&self, n: usize, data: &mut [T], index: usize, value: bool) -> Option<bool> { in set() 34 if unlikely(index >= n) { in set() 37 let element_index = index / T::bit_size(); in set() 38 let bit_index = index % T::bit_size(); in set() 126 pub(crate) fn next_index(&self, n: usize, data: &[T], index: usize) -> Option<usize> { in next_index() 127 if unlikely(index >= n) { in next_index() [all …]
|
H A D | static_bitmap.rs | 44 fn get(&self, index: usize) -> Option<bool> { in get() 45 return self.core.get(N, &self.data, index); in get() 49 fn set(&mut self, index: usize, value: bool) -> Option<bool> { in set() 50 return self.core.set(N, &mut self.data, index, value); in set() 84 fn next_index(&self, index: usize) -> Option<usize> { in next_index() 85 self.core.next_index(N, &self.data, index) in next_index() 89 fn next_false_index(&self, index: usize) -> Option<usize> { in next_false_index() 90 self.core.next_false_index(N, &self.data, index) in next_false_index() 94 fn prev_index(&self, index: usize) -> Option<usize> { in prev_index() 95 self.core.prev_index(N, &self.data, index) in prev_index() [all …]
|
H A D | alloc_bitmap.rs | 33 fn get(&self, index: usize) -> Option<bool> { in get() 34 return self.core.get(self.elements, &self.data, index); in get() 38 fn set(&mut self, index: usize, value: bool) -> Option<bool> { in set() 39 return self.core.set(self.elements, &mut self.data, index, value); in set() 73 fn next_index(&self, index: usize) -> Option<usize> { in next_index() 74 self.core.next_index(self.elements, &self.data, index) in next_index() 78 fn next_false_index(&self, index: usize) -> Option<usize> { in next_false_index() 79 self.core.next_false_index(self.elements, &self.data, index) in next_false_index() 83 fn prev_index(&self, index: usize) -> Option<usize> { in prev_index() 84 self.core.prev_index(self.elements, &self.data, index) in prev_index() [all …]
|
/DragonOS/kernel/src/debug/traceback/ |
H A D | traceback.c | 13 uint64_t index = 0; in lookup_kallsyms() local 14 for (index = 0; index < kallsyms_num - 1; ++index) in lookup_kallsyms() 16 if (addr > kallsyms_address[index] && addr <= kallsyms_address[index + 1]) in lookup_kallsyms() 20 if (index < kallsyms_num) // 找到对应的函数 in lookup_kallsyms() 23 …\t(+) %04d address:%#018lx\n", &str[kallsyms_names_index[index]], addr - kallsyms_address[index], … in lookup_kallsyms()
|
/DragonOS/kernel/src/bpf/prog/ |
H A D | verifier.rs | 39 let mut index = 0; in relocation() localVariable 42 if index >= fmt_insn.len() { in relocation() 45 let mut insn = fmt_insn[index].clone(); in relocation() 48 let mut next_insn = fmt_insn[index + 1].clone(); in relocation() 70 index, map_fd in relocation() 88 index, map_fd, map_ptr in relocation() 96 ty, index in relocation() 106 fmt_insn[index] = insn; in relocation() 107 fmt_insn[index + 1] = next_insn; in relocation() 108 index += 2; in relocation() [all …]
|
/DragonOS/kernel/src/mm/ |
H A D | memblock.rs | 173 index: usize, in do_insert_area() 178 let copy_elements = inner.initial_memory_regions_num - index; in do_insert_area() 181 .copy_within(index..index + copy_elements, index + 1); in do_insert_area() 182 inner.initial_memory_regions[index] = PhysMemoryArea::new(base, size, flags); in do_insert_area() 249 fn do_remove_region(&self, inner: &mut SpinLockGuard<'_, InnerMemBlockManager>, index: usize) { in do_remove_region() 250 let copy_elements = inner.initial_memory_regions_num - index - 1; in do_remove_region() 253 .copy_within(index + 1..index + 1 + copy_elements, index); in do_remove_region() 441 index: 0, in to_iter() 451 index: 0, in to_iter_available() 463 pub fn get_initial_memory_region(&self, index: usize) -> Option<PhysMemoryArea> { in get_initial_memory_region() [all …]
|
H A D | no_init.rs | 69 if let Some(index) = self.bmp.first_false_index() { in allocate_page() 70 self.bmp.set(index, true); in allocate_page() 72 self.pages[index].zero(); in allocate_page() 74 let p = &self.pages[index] as *const EarlyRemapPage as usize; in allocate_page() 87 let index = offset / MMArch::PAGE_SIZE; in free_page() localVariable 88 if index < Self::EARLY_REMAP_PAGES_NUM { in free_page() 89 assert!(self.bmp.get(index).unwrap()); in free_page() 90 self.bmp.set(index, false); in free_page()
|
/DragonOS/kernel/src/filesystem/ |
H A D | mbr.rs | 163 index: usize, field 168 MbrPartitionIter { table, index: 0 } in new() 176 while self.index < 4 { in next() 177 let entry = &self.table.dpte[self.index]; in next() 178 let index = self.index; in next() localVariable 179 self.index += 1; in next() 182 self.table.dpte[index].starting_sector() as u64, in next() 183 self.table.dpte[index].starting_lba as u64, in next() 184 self.table.dpte[index].total_sectors as u64, in next() 185 index as u16, in next()
|
/DragonOS/kernel/src/driver/base/char/ |
H A D | mod.rs | 59 for index in (DEV_MAJOR_DYN_END.data()..DEV_MAJOR_HASH_SIZE).rev() { in find_dynamic_major() 60 if let Some(item) = chardevs.get(index as usize) { in find_dynamic_major() 62 return Ok(Major::new(index)); // 返回可用的主设备号 in find_dynamic_major() 67 for index in in find_dynamic_major() 70 if let Some(chardevss) = chardevs.get(Self::major_to_index(Major::new(index))) { in find_dynamic_major() 73 if item.device_number().major().data() == index { in find_dynamic_major() 80 return Ok(Major::new(index)); // 返回可用的主设备号 in find_dynamic_major() 150 for (index, item) in items.iter().enumerate() { in __register_chardev_region() 151 insert_index = index; in __register_chardev_region() 187 for (index, item) in items.iter().enumerate() { in __unregister_chardev_region() [all …]
|
/DragonOS/kernel/src/driver/block/cache/ |
H A D | cached_block_device.rs | 73 for (index, _) in block_iter.enumerate() { in read() 74 Self::read_one_block(cache_block_addr[index], index, buf)?; in read() 96 for (index, i) in block_iter.enumerate() { in check_able_to_read() 104 None => fail_ans.push(FailData::new(i.lba_id(), index)), in check_able_to_read() 147 let index = i.index(); in insert() localVariable 150 data[index * BLOCK_SIZE..(index + 1) * BLOCK_SIZE].to_vec(), in insert() 284 let index = self.frame_selector.index_append(); in insert() localVariable 287 assert!(index == self.root.len() - 1); in insert() 289 mapper.insert(lba_id, index); in insert() 294 let index = self.frame_selector.index_replace(); in insert() localVariable [all …]
|
H A D | cache_iter.rs | 86 index: usize, field 90 pub fn new(lba_id: BlockId, index: usize) -> Self { in new() 91 FailData { lba_id, index } in new() 99 pub fn index(&self) -> usize { in index() method 100 self.index in index()
|
/DragonOS/kernel/src/driver/tty/virtual_terminal/ |
H A D | mod.rs | 70 index: Lazy<usize>, field 83 index: Lazy::new(), in new() 96 pub fn index(&self) -> Option<usize> { in index() method 97 self.index.try_get().cloned() in index() 108 let vcname = format!("vc{}", self.index.get()); in devfs_setup() 119 tty_core_data.set_vc_index(*self.index.get()); in devfs_setup() 160 pub fn get(&self, index: usize) -> Option<Arc<VirtConsole>> { in get() 162 inner.consoles.get(&index).cloned() in get() 167 let index = inner.ida.alloc()?; in alloc() localVariable 168 vc.index.init(index); in alloc() [all …]
|
/DragonOS/kernel/src/bpf/map/ |
H A D | array_map.rs | 55 fn index(&self, index: u32) -> &Self::Output { in index() method 56 let start = index * self.elem_size; in index() 62 fn index_mut(&mut self, index: u32) -> &mut Self::Output { in index_mut() 63 let start = index * self.elem_size; in index_mut() 87 let index = u32::from_ne_bytes(key.try_into().map_err(|_| SystemError::EINVAL)?); in lookup_elem() localVariable 88 if index >= self.max_entries { in lookup_elem() 91 let val = self.data.index(index); in lookup_elem() 98 let index = u32::from_ne_bytes(key.try_into().map_err(|_| SystemError::EINVAL)?); in update_elem() localVariable 99 if index >= self.max_entries { in update_elem() 105 let old_value = self.data.index_mut(index); in update_elem() [all …]
|
/DragonOS/kernel/src/arch/x86_64/process/ |
H A D | table.rs | 52 let index = (10 + smp_get_processor_id().data() * 2) as u16; in load_tr() localVariable 53 let selector = SegmentSelector::new(index, Ring::Ring0); in load_tr() 56 index, in load_tr() 63 unsafe fn set_tss_descriptor(index: u16, vaddr: VirtAddr) { in set_tss_descriptor() 70 gdt[index as usize] = (LIMIT & 0xffff) in set_tss_descriptor() 75 gdt[index as usize + 1] = (vaddr >> 32) & 0xffffffff; in set_tss_descriptor()
|
/DragonOS/tools/debugging/logmonitor/src/ |
H A D | app.rs | 109 pub index: usize, field 114 TabsState { titles, index: 0 } in new() 117 self.index = (self.index + 1) % self.titles.len(); in next() 121 if self.index > 0 { in previous() 122 self.index -= 1; in previous() 124 self.index = self.titles.len() - 1; in previous()
|
/DragonOS/docs/kernel/container/ |
H A D | index.rst | 12 namespaces/index 13 ../filesystem/unionfs/index
|
/DragonOS/docs/kernel/filesystem/ |
H A D | index.rst | 13 vfs/index 16 unionfs/index
|
/DragonOS/kernel/src/driver/tty/ |
H A D | tty_driver.rs | 181 pub fn tty_line_name(&self, index: usize) -> String { in tty_line_name() 188 return format!("{}{}", self.name, index + self.name_base); in tty_line_name() 193 self.ttys.lock().insert(tty_core.core().index(), tty_core); in add_tty() 203 pub fn device_number(&self, index: usize) -> Option<DeviceNumber> { in device_number() 204 if index >= self.device_count as usize { in device_number() 209 self.minor_start + index as u32, in device_number() 257 fn lookup_tty(&self, index: usize) -> Option<Arc<TtyCore>> { in lookup_tty() 260 .lookup(index, TtyDriverPrivateData::Unused); in lookup_tty() 263 return device_guard.get(&index).cloned(); in lookup_tty() 275 self.ttys.lock().insert(tty.index(), tty_core); in standard_install() [all …]
|
/DragonOS/kernel/src/driver/base/ |
H A D | subsys.rs | 178 let index = drivers.iter().position(|d| Arc::ptr_eq(d, driver)); in remove_driver_from_vec() localVariable 179 if let Some(index) = index { in remove_driver_from_vec() 180 drivers.remove(index); in remove_driver_from_vec() 196 let index = devices.iter().position(|d| Arc::ptr_eq(d, device)); in remove_device_from_vec() localVariable 197 if let Some(index) = index { in remove_device_from_vec() 198 devices.remove(index); in remove_device_from_vec()
|
/DragonOS/kernel/src/libs/lib_ui/ |
H A D | textui.rs | 340 pub fn put_color_in_pixel(&mut self, color: u32, index: usize) { in put_color_in_pixel() 341 let index = index as isize; in put_color_in_pixel() localVariable 346 *buf.offset(index) = color; in put_color_in_pixel() 352 copy_nonoverlapping(&color as *const u32 as *const u8, buf.offset(index * 3), 3) in put_color_in_pixel() 360 buf.offset(index * 2), in put_color_in_pixel() 534 index: LineIndex, // 当前操作的位置 field 540 index: LineIndex::new(0), in new() 651 let mut index = start; in textui_refresh_characters() localVariable 655 vline.chars[<LineIndex as Into<usize>>::into(index)] in textui_refresh_characters() 656 .textui_refresh_character(actual_line_id, index)?; in textui_refresh_characters() [all …]
|
/DragonOS/docs/kernel/memory_management/ |
H A D | mmio.md | 158 …index)与内存块的大小有关。由于每个内存块大小都为$2^{n}$ bytes,那么可以令$exp = n$。index与exp的换算公式如下:$index = exp - 12$。e.g. 一… 187 | __exp2index(exp) | 将$2^{exp}$的exp转换成内存池中的数组的下标(index) |
|
/DragonOS/kernel/src/libs/lib_ui/font/ |
H A D | mod.rs | 49 let index = self.glyph_mapping.index(character); in char_map() localVariable 50 let pos = index * self.bytes_per_char; in char_map()
|