/DragonOS/kernel/src/debug/ |
H A D | kallsyms.c | 76 for (int i = 0; i < len; i++) in read_symbol() local 78 if (symbol_name[i] == '"') in read_symbol() 80 char temp[len - i]; in read_symbol() 81 memcpy(temp, symbol_name + i, len - i); in read_symbol() 82 symbol_name[i] = '\\'; in read_symbol() 83 memcpy(symbol_name + i + 1, temp, len - i); in read_symbol() 84 i++; in read_symbol() 116 for (uint64_t i = 0; i < entry_count; ++i) in read_map() local 118 if (text_vaddr == 0ULL && strcmp(symbol_table[i].symbol, "_text") == 0) in read_map() 119 text_vaddr = symbol_table[i].vaddr; in read_map() [all …]
|
/DragonOS/kernel/src/debug/traceback/ |
H A D | traceback.c | 33 for (uint64_t i = 0; i < kallsyms_num; ++i) in addr_from_symbol() local 35 if (strcmp(&str[kallsyms_names_index[i]], symbol) == 0) in addr_from_symbol() 36 return kallsyms_address[i]; in addr_from_symbol() 65 for (int i = 0; i < 10; ++i) in traceback() local 67 if (lookup_kallsyms(ret_addr, i) != 0) in traceback()
|
/DragonOS/user/apps/test_gettimeofday/ |
H A D | main.c | 11 for (int i = 0; i < 15; i++) in main() local 15 for (int i = 0; i < 10; i++) in main() local
|
/DragonOS/user/apps/dmesg/ |
H A D | main.c | 87 for (int i = 0; i < len; i++) in main() local 90 c[0] = buf[i]; in main() 93 if (content == 0 && buf[i] == '>') in main() 97 else if (content == 1 && buf[i] == ']') in main() 102 else if (content == 2 && buf[i] == ')') in main() 107 else if (content == 3 && buf[i] == '\n') in main()
|
/DragonOS/kernel/src/filesystem/ |
H A D | mbr.rs | 99 for i in 0..4 { in from_disk() 100 table.dpte[i].flags = cursor.read_u8()?; in from_disk() 101 table.dpte[i].starting_head = cursor.read_u8()?; in from_disk() 102 table.dpte[i].starting_sector_cylinder = cursor.read_u16()?; in from_disk() 103 table.dpte[i].part_type = cursor.read_u8()?; in from_disk() 104 table.dpte[i].ending_head = cursor.read_u8()?; in from_disk() 105 table.dpte[i].ending_sector_cylinder = cursor.read_u16()?; in from_disk() 106 table.dpte[i].starting_lba = cursor.read_u32()?; in from_disk() 107 table.dpte[i].total_sectors = cursor.read_u32()?; in from_disk() 109 debug!("dpte[{i}] = {:?}", table.dpte[i]); in from_disk() [all …]
|
/DragonOS/kernel/src/mm/ |
H A D | memblock.rs | 112 let mut i = 0; in do_add_block() localVariable 118 while i < inner.initial_memory_regions_num { in do_add_block() 119 let range_base = inner.initial_memory_regions[i].base; in do_add_block() 121 inner.initial_memory_regions[i].base + inner.initial_memory_regions[i].size; in do_add_block() 127 i += 1; in do_add_block() 137 start_index = i as isize; in do_add_block() 139 end_index = (i + 1) as isize; in do_add_block() 140 self.do_insert_area(inner, i, base, range_base - base, flags); in do_add_block() 141 i += 1; in do_add_block() 145 i += 1; in do_add_block() [all …]
|
H A D | early_ioremap.rs | 94 for i in 0..(Self::SLOT_CNT - slot_count + 1) { in map() 98 let slot_idx = i + j; in map() 106 start_slot = Some(i); in map() 127 for i in 0..slot_count { in map() 128 let slot_idx = start_slot + i; in map() 131 if i == 0 { in map() 184 for i in 0..count.data() { in unmap() 185 let slot_idx = idx + i; in unmap()
|
H A D | page.rs | 526 pub fn entry_base(&self, i: usize) -> Option<VirtAddr> { in entry_base() 527 if i < Arch::PAGE_ENTRY_NUM { in entry_base() 529 return Some(self.base.add(i << shift)); in entry_base() 536 pub unsafe fn entry_virt(&self, i: usize) -> Option<VirtAddr> { in entry_virt() 537 if i < Arch::PAGE_ENTRY_NUM { in entry_virt() 538 return Some(self.virt().add(i * Arch::PAGE_ENTRY_SIZE)); in entry_virt() 545 pub unsafe fn entry(&self, i: usize) -> Option<PageEntry<Arch>> { in entry() 546 let entry_virt = self.entry_virt(i)?; in entry() 551 pub unsafe fn set_entry(&self, i: usize, entry: PageEntry<Arch>) -> Option<()> { in set_entry() 552 let entry_virt = self.entry_virt(i)?; in set_entry() [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | keyboard_parser.rs | 112 let i = match self { in handle_pause_break() localVariable 113 TypeOneFSMState::PauseBreak(i) => *i, in handle_pause_break() 118 if scancode != PAUSE_BREAK_SCAN_CODE[i as usize] { in handle_pause_break() 120 } else if i == 5 { in handle_pause_break() 124 return TypeOneFSMState::PauseBreak(i + 1); in handle_pause_break() 381 let i = match self { in handle_prtsc_press() localVariable 382 TypeOneFSMState::PrtscPress(i) => *i, in handle_prtsc_press() 385 if i > 3 { in handle_prtsc_press() 389 if scancode != PRTSC_SCAN_CODE[i as usize] { in handle_prtsc_press() 391 } else if i == 3 { in handle_prtsc_press() [all …]
|
H A D | vec_cursor.rs | 74 for i in 0..4 { in read_u32() 75 res |= ((self.data[self.pos] as u32) & 0xff) << (8 * i); in read_u32() 88 for i in 0..8 { in read_u64() 89 res |= ((self.data[self.pos] as u64) & 0xff) << (8 * i); in read_u64() 182 for i in 0..4 { in write_u32() 183 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u32() 196 for i in 0..8 { in write_u64() 197 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u64()
|
H A D | printk.c | 235 for (int i = 0; i < len; i++) in __do_vsprintf() local 572 for (int i = 0; i < precision && js_num_d-- > 0; ++i) in write_float_point_num() local 608 int i; // 总共输出的字符数 in printk_color() local 609 for (i = 0; i < len; ++i) in printk_color() 611 current = *(buf + i); in printk_color() 618 return i; in printk_color()
|
/DragonOS/user/apps/test_sqlite3/ |
H A D | main.c | 12 for (int i = 0; i < argc; ++i) { in callback() local 13 printf("%s = %s\n", azColName[i], (argv[i] ? argv[i] : "NULL")); in callback()
|
/DragonOS/tools/debugging/logmonitor/src/ |
H A D | app.rs | 186 let i = match self.state.selected() { in next() localVariable 187 Some(i) => { in next() 188 if i >= self.items.len() - 1 { in next() 191 i + 1 in next() 196 self.state.select(Some(i)); in next() 200 let i = match self.state.selected() { in previous() localVariable 201 Some(i) => { in previous() 202 if i == 0 { in previous() 205 i - 1 in previous() 210 self.state.select(Some(i)); in previous()
|
/DragonOS/kernel/src/common/math/ |
H A D | round.c | 17 uint64_t i; in round() member 20 int e = u.i >> 52 & 0x7ff; in round() 25 if (u.i >> 63) in round() 40 if (u.i >> 63) in round()
|
H A D | libm.h | 14 } i; member 26 } i; member 43 } i; member
|
/DragonOS/user/port/ |
H A D | build.sh | 11 for i in ${path[@]}; do 12 echo "Building $i" 13 cd $i
|
/DragonOS/tools/ |
H A D | batch_delete_loop.py | 6 for i in range(start, end+1): 7 print("Deleting: " + str(i)) 8 os.system("sudo losetup -d /dev/loop" + str(i))
|
/DragonOS/kernel/crates/ida/src/ |
H A D | lib.rs | 125 (start_id..end).find(|&i| !self.exists(i)) in do_find_first_free_index() 194 for i in 0..10 { in test_id_allocator() 195 assert_eq!(ida.exists(i), true); in test_id_allocator() 200 for i in 0..10 { in test_id_allocator() 201 if i == 5 { in test_id_allocator() 202 assert_eq!(ida.exists(i), false); in test_id_allocator() 204 assert_eq!(ida.exists(i), true); in test_id_allocator() 212 for i in 0..10 { in test_id_allocator() 213 ida.free(i); in test_id_allocator()
|
/DragonOS/kernel/src/driver/tty/virtual_terminal/ |
H A D | virtual_console.rs | 278 for i in (0..256).step_by(8) { in reset() 279 self.tab_stop.set(i, true); in reset() 491 let mut i = self.screen_buf[self.pos] as u32; in add_softcursor() localVariable 504 *soft_cursor_guard = Some(unsafe { VcCursor::from_bits_unchecked(i) }); in add_softcursor() 508 i |= cursor_type.cursor_set(); in add_softcursor() 509 i ^= cursor_type.cursor_change(); in add_softcursor() 511 && ((soft_cursor.bits & VcCursor::CUR_BG.bits) == (i & VcCursor::CUR_BG.bits)) in add_softcursor() 513 i ^= VcCursor::CUR_BG.bits; in add_softcursor() 516 && ((i & VcCursor::CUR_FG.bits) == ((i & VcCursor::CUR_BG.bits) >> 4)) in add_softcursor() 518 i ^= VcCursor::CUR_FG.bits; in add_softcursor() [all …]
|
/DragonOS/kernel/src/arch/riscv64/mm/ |
H A D | init.rs | 96 for i in 0..MMArch::PAGE_ENTRY_NUM { in riscv_mm_init() 98 .set_entry(i, empty_entry) in riscv_mm_init() 105 for i in 0..total_num { in riscv_mm_init() 106 let area = mem_block_manager().get_initial_memory_region(i).unwrap(); in riscv_mm_init() 108 for i in 0..((area.size + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE) { in riscv_mm_init() 109 let paddr = area.base.add(i * MMArch::PAGE_SIZE); in riscv_mm_init() 187 for i in 0..(size / MMArch::PAGE_SIZE) { in remap_at_low_address() 188 let paddr = PhysAddr::new(base.data() + i * MMArch::PAGE_SIZE); in remap_at_low_address() 189 let vaddr = VirtAddr::new(base.data() + i * MMArch::PAGE_SIZE); in remap_at_low_address() 209 for i in 0..(size / MMArch::PAGE_SIZE) { in unmap_at_low_address() [all …]
|
/DragonOS/kernel/crates/bitmap/src/ |
H A D | bitmap_core.rs | 62 for (i, element) in data.iter().enumerate() { in first_index() 65 return Some(i * T::bit_size() + b); in first_index() 74 for (i, element) in data.iter().enumerate() { in first_false_index() 76 return self.make_index(n, i * T::bit_size() + bit); in first_false_index() 85 for (i, element) in data.iter().enumerate().rev() { in last_index() 87 return self.make_index(n, i * T::bit_size() + bit); in last_index() 139 for (i, element) in data.iter().enumerate().skip(element_index + 1) { in next_index() 141 return self.make_index(n, i * T::bit_size() + bit); in next_index() 162 for (i, element) in data.iter().enumerate().skip(element_index + 1) { in next_false_index() 164 return self.make_index(n, i * T::bit_size() + bit); in next_false_index() [all …]
|
H A D | alloc_bitmap.rs | 25 for i in 0..rhs.data.len() { in bitand_assign() 26 self.data[i] &= rhs.data[i]; in bitand_assign() 125 for i in 0..rhs.data.len() { in bitand() 126 result.data[i] = self.data[i] & rhs.data[i]; in bitand()
|
/DragonOS/kernel/src/process/ |
H A D | idle.rs | 36 for i in 0..PerCpu::MAX_CPU_NUM { in init_idle() 37 let kstack = if unlikely(i == 0) { in init_idle() 47 panic!("Failed to create kernel stack struct for AP {}: {:?}", i, e) in init_idle() 51 let idle_pcb = ProcessControlBlock::new_idle(i, kstack); in init_idle() 61 idle_pcb.sched_info().set_on_cpu(Some(ProcessorId::new(i))); in init_idle() 64 let rq = cpu_rq(i as usize); in init_idle()
|
H A D | cred.rs | 114 for i in 0..ga_count { in fscmp() 115 if ga.gids[i] < gb.gids[i] { in fscmp() 118 if ga.gids[i] > gb.gids[i] { in fscmp()
|
/DragonOS/kernel/src/mm/allocator/ |
H A D | buddy.rs | 132 for i in MIN_ORDER..MAX_ORDER { in new() 134 if remain_pages.data() < (1 << (i - MIN_ORDER)) { in new() 138 assert!(paddr & ((1 << i) - 1) == 0); in new() 140 if likely(i != MAX_ORDER - 1) { in new() 142 if paddr & (1 << i) != 0 { in new() 143 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new() 145 paddr += 1 << i; in new() 146 remain_pages -= 1 << (i - MIN_ORDER); in new() 152 let mut entries = (remain_pages.data() * A::PAGE_SIZE) >> i; in new() 154 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new() [all …]
|