Home
last modified time | relevance | path

Searched refs:i (Results 1 – 25 of 72) sorted by relevance

123

/DragonOS-0.1.9/kernel/src/debug/
Dkallsyms.c76 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-0.1.9/kernel/src/smp/
Dsmp.c75 for (int i = 0; i < total_processor_num; ++i) // i从1开始,不初始化bsp in smp_init() local
80 kdebug("[core %d] acpi processor UID=%d, APIC ID=%d, can_boot=%d", i, in smp_init()
81 __cpu_info[i].core_id, __cpu_info[i].apic_id, in smp_init()
82 __cpu_info[i].can_boot); in smp_init()
83 if (__cpu_info[i].apic_id == 0) in smp_init()
88 if (__cpu_info[i].can_boot == false) in smp_init()
91 kdebug("processor %d cannot be enabled.", __cpu_info[i].core_id); in smp_init()
98 current_starting_cpu = __cpu_info[i].apic_id; in smp_init()
105 kdebug("core %d, to send start up", __cpu_info[i].apic_id); in smp_init()
108 int r = rs_ipi_send_smp_startup(__cpu_info[i].apic_id); in smp_init()
[all …]
/DragonOS-0.1.9/user/apps/dmesg/
Dmain.c87 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-0.1.9/kernel/src/mm/
Dmemblock.rs111 let mut i = 0; in do_add_block() localVariable
117 while i < inner.initial_memory_regions_num { in do_add_block()
118 let range_base = inner.initial_memory_regions[i].base; in do_add_block()
120 inner.initial_memory_regions[i].base + inner.initial_memory_regions[i].size; in do_add_block()
126 i += 1; in do_add_block()
136 start_index = i as isize; in do_add_block()
138 end_index = (i + 1) as isize; in do_add_block()
139 self.do_insert_area(inner, i, base, range_base - base, flags); in do_add_block()
140 i += 1; in do_add_block()
144 i += 1; in do_add_block()
[all …]
Dpage.rs84 pub fn entry_base(&self, i: usize) -> Option<VirtAddr> { in entry_base()
85 if i < Arch::PAGE_ENTRY_NUM { in entry_base()
87 return Some(self.base.add(i << shift)); in entry_base()
94 pub unsafe fn entry_virt(&self, i: usize) -> Option<VirtAddr> { in entry_virt()
95 if i < Arch::PAGE_ENTRY_NUM { in entry_virt()
96 return Some(self.virt().add(i * Arch::PAGE_ENTRY_SIZE)); in entry_virt()
103 pub unsafe fn entry(&self, i: usize) -> Option<PageEntry<Arch>> { in entry()
104 let entry_virt = self.entry_virt(i)?; in entry()
109 pub unsafe fn set_entry(&self, i: usize, entry: PageEntry<Arch>) -> Option<()> { in set_entry()
110 let entry_virt = self.entry_virt(i)?; in set_entry()
[all …]
Dearly_ioremap.rs94 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()
/DragonOS-0.1.9/user/apps/test_sqlite3/
Dmain.c12 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-0.1.9/user/port/
Dbuild.sh11 for i in ${path[@]}; do
12 echo "Building $i"
13 cd $i
/DragonOS-0.1.9/tools/
Dbatch_delete_loop.py6 for i in range(start, end+1):
7 print("Deleting: " + str(i))
8 os.system("sudo losetup -d /dev/loop" + str(i))
/DragonOS-0.1.9/kernel/src/libs/
Dkeyboard_parser.rs112 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()
121 if i == 5 { in handle_pause_break()
125 return TypeOneFSMState::PauseBreak(i + 1); in handle_pause_break()
366 let i = match self { in handle_prtsc_press() localVariable
367 TypeOneFSMState::PrtscPress(i) => *i, in handle_prtsc_press()
370 if i > 3 { in handle_prtsc_press()
374 if scancode != PRTSC_SCAN_CODE[i as usize] { in handle_prtsc_press()
377 if i == 3 { in handle_prtsc_press()
[all …]
Dvec_cursor.rs74 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()
119 for i in 0..buf.len() { in read_u16_into()
120 buf[i] = self.read_u16()?; in read_u16_into()
189 for i in 0..4 { in write_u32()
190 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u32()
203 for i in 0..8 { in write_u64()
204 self.data[self.pos] = ((value >> (i * 8)) & 0xff) as u8; in write_u64()
Dprintk.c235 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-0.1.9/kernel/src/common/math/
Dround.c17 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()
Dlibm.h14 } i; member
26 } i; member
43 } i; member
/DragonOS-0.1.9/tools/debugging/logmonitor/src/
Dapp.rs186 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-0.1.9/kernel/src/arch/riscv64/mm/
Dinit.rs94 for i in 0..MMArch::PAGE_ENTRY_NUM { in riscv_mm_init()
96 .set_entry(i, empty_entry) in riscv_mm_init()
103 for i in 0..total_num { in riscv_mm_init()
104 let area = mem_block_manager().get_initial_memory_region(i).unwrap(); in riscv_mm_init()
106 for i in 0..((area.size + MMArch::PAGE_SIZE - 1) / MMArch::PAGE_SIZE) { in riscv_mm_init()
107 let paddr = area.base.add(i * MMArch::PAGE_SIZE); in riscv_mm_init()
185 for i in 0..(size / MMArch::PAGE_SIZE) { in remap_at_low_address()
186 let paddr = PhysAddr::new(base.data() + i * MMArch::PAGE_SIZE); in remap_at_low_address()
187 let vaddr = VirtAddr::new(base.data() + i * MMArch::PAGE_SIZE); in remap_at_low_address()
207 for i in 0..(size / MMArch::PAGE_SIZE) { in unmap_at_low_address()
[all …]
/DragonOS-0.1.9/kernel/src/debug/traceback/
Dtraceback.c52 for (int i = 0; i < 10; ++i) in traceback() local
54 if (lookup_kallsyms(ret_addr, i) != 0) in traceback()
/DragonOS-0.1.9/kernel/src/driver/tty/virtual_terminal/
Dvirtual_console.rs279 for i in (0..256).step_by(8) { in reset()
280 self.tab_stop.set(i, true); in reset()
492 let mut i = self.screen_buf[self.pos] as u32; in add_softcursor() localVariable
505 *soft_cursor_guard = Some(unsafe { VcCursor::from_bits_unchecked(i as u32) }); in add_softcursor()
509 i |= cursor_type.cursor_set(); in add_softcursor()
510 i ^= cursor_type.cursor_change(); in add_softcursor()
512 && ((soft_cursor.bits & VcCursor::CUR_BG.bits) == (i & VcCursor::CUR_BG.bits)) in add_softcursor()
514 i ^= VcCursor::CUR_BG.bits; in add_softcursor()
517 && ((i & VcCursor::CUR_FG.bits) == ((i & VcCursor::CUR_BG.bits) >> 4)) in add_softcursor()
519 i ^= VcCursor::CUR_FG.bits; in add_softcursor()
[all …]
/DragonOS-0.1.9/kernel/src/driver/tty/
Dkthread.rs53 for i in 0..to_dequeue { in tty_refresh_thread()
54 data[i] = KEYBUF.pop().unwrap(); in 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/process/
Didle.rs35 for i in 0..PerCpu::MAX_CPU_NUM { in init_idle()
36 let kstack = if unlikely(i == 0) { in init_idle()
46 panic!("Failed to create kernel stack struct for AP {}: {:?}", i, e) in init_idle()
50 let idle_pcb = ProcessControlBlock::new_idle(i as u32, kstack); in init_idle()
60 idle_pcb.sched_info().set_on_cpu(Some(ProcessorId::new(i))); in init_idle()
/DragonOS-0.1.9/kernel/crates/bitmap/src/
Dbitmap_core.rs62 for (i, element) in data.iter().enumerate() { in first_index()
65 return Some(i * T::bit_size() + bit.unwrap()); 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 …]
/DragonOS-0.1.9/kernel/src/driver/disk/ahci/
Dahcidisk.rs140 for i in 0..((volatile_read!(cmdheader.prdtl) - 1) as usize) { in read_at()
141 volatile_write!(cmdtbl.prdt_entry[i].dba, virt_2_phys(buf_ptr) as u64); in read_at()
142 cmdtbl.prdt_entry[i].dbc = 8 * 1024 - 1; in read_at()
143 volatile_set_bit!(cmdtbl.prdt_entry[i].dbc, 1 << 31, true); // 允许中断 prdt_entry.i in read_at()
296 for i in 0..((volatile_read!(cmdheader.prdtl) - 1) as usize) { in write_at()
297 volatile_write!(cmdtbl.prdt_entry[i].dba, virt_2_phys(buf_ptr) as u64); in write_at()
298 volatile_write_bit!(cmdtbl.prdt_entry[i].dbc, (1 << 22) - 1, 8 * 1024 - 1); // 数据长度 in write_at()
299 volatile_set_bit!(cmdtbl.prdt_entry[i].dbc, 1 << 31, true); // 允许中断 in write_at()
380 for i in 0..4 { in new()
382 if table.dpte[i].part_type != 0 { in new()
[all …]
/DragonOS-0.1.9/kernel/src/mm/allocator/
Dbuddy.rs130 for i in MIN_ORDER..MAX_ORDER { in new()
132 if remain_pages.data() < (1 << (i - MIN_ORDER)) { in new()
136 assert!(paddr & ((1 << i) - 1) == 0); in new()
138 if likely(i != MAX_ORDER - 1) { in new()
140 if paddr & (1 << i) != 0 { in new()
141 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
143 paddr += 1 << i; in new()
144 remain_pages -= 1 << (i - MIN_ORDER); in new()
150 let mut entries = (remain_pages.data() * A::PAGE_SIZE) >> i; in new()
152 allocator.buddy_free(PhysAddr::new(paddr), i as u8); in new()
[all …]
/DragonOS-0.1.9/kernel/src/arch/x86_64/mm/
Dmod.rs344 for i in 0..mb2_count { in init_memory_area_from_multiboot2()
346 if mb2_mem_info[i].type_ == 1 { in init_memory_area_from_multiboot2()
348 if mb2_mem_info[i].len == 0 { in init_memory_area_from_multiboot2()
352 total_mem_size += mb2_mem_info[i].len as usize; in init_memory_area_from_multiboot2()
356 PhysAddr::new(mb2_mem_info[i].addr as usize), in init_memory_area_from_multiboot2()
357 mb2_mem_info[i].len as usize, in init_memory_area_from_multiboot2()
362 mb2_mem_info[i].addr, in init_memory_area_from_multiboot2()
363 mb2_mem_info[i].len, in init_memory_area_from_multiboot2()
440 for i in 0..MMArch::PAGE_ENTRY_NUM { in allocator_init()
442 .set_entry(i, empty_entry) in allocator_init()
[all …]
/DragonOS-0.1.9/kernel/src/driver/hid/
Dhidparse.c137 for (int i = 0; i < 4; ++i) in hid_parse() local
139 if (i < item_size[parser->item & HID_SIZE_MASK]) in hid_parse()
140 printk("%02X ", parser->report_desc[parser->pos + i]); in hid_parse()
376 int i = 0; in hid_get_usage_page() local
377 while ((hid_usage_page_strings[i].value < u_page) && (hid_usage_page_strings[i].value < 0xffff)) in hid_get_usage_page()
378 ++i; in hid_get_usage_page()
379 if ((hid_usage_page_strings[i].value != u_page) || (hid_usage_page_strings[i].value == 0xffff)) in hid_get_usage_page()
382 return &hid_usage_page_strings[i]; in hid_get_usage_page()
401 int i = 0; in hid_get_usage_type() local
402 while ((types[i].value < type) && (types[i].value != 0xffff)) in hid_get_usage_type()
[all …]

123