Home
last modified time | relevance | path

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

123

/DragonOS-0.1.7/kernel/src/ktest/
Dtest-idr.c40 for (uint64_t i = 1; i < 64; i++) in ktest_idr_case0() local
42 int id = __lowbit_id(i), chk_id = -1; in ktest_idr_case0()
44 if ((i >> j) & 1) in ktest_idr_case0()
73 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
75 assert(idr_alloc(&k_idr, &a[i], &a[i]) == 0); in ktest_idr_case1()
76 assert(a[i] == i); in ktest_idr_case1()
80 for (int i = 0; i < 128; i++) in ktest_idr_case1() local
82 int *ptr = idr_find(&k_idr, a[i]); in ktest_idr_case1()
83 assert(ptr == &a[i]); in ktest_idr_case1()
85 assert(*ptr == a[i]); in ktest_idr_case1()
[all …]
Dtest-kfifo.c31 for (int i = 1; i <= 10; ++i) in ktest_kfifo_case0_1() local
33 uint64_t tmp = i; in ktest_kfifo_case0_1()
42 for (int i = 1; i <= 10; ++i) in ktest_kfifo_case0_1() local
46 assert(tmp == i); in ktest_kfifo_case0_1()
47 assert(fifo.size == (10 - i) * sizeof(uint64_t)); in ktest_kfifo_case0_1()
49 assert(fifo.out_offset == i * sizeof(uint64_t)); in ktest_kfifo_case0_1()
64 for (int i = 1; i <= 31; ++i) in ktest_kfifo_case0_1() local
66 uint64_t tmp = i; in ktest_kfifo_case0_1()
94 for (int i = 1; i <= 20; ++i) in ktest_kfifo_case0_1() local
110 for (int i = 1; i <= 9; ++i) in ktest_kfifo_case0_1() local
[all …]
Dtest-mutex.c86 for (int i = 0; i < sizeof(kt_mutex_func_table) / sizeof(ktest_case_table); ++i) in ktest_test_mutex() local
88 kTEST("Testing case %d", i); in ktest_test_mutex()
89 kt_mutex_func_table[i](i, 0); in ktest_test_mutex()
/DragonOS-0.1.7/kernel/src/debug/
Dkallsyms.c97 for (uint64_t i = 0; i < entry_count; ++i) in read_map() local
99 if (strcmp(symbol_table[i].symbol, "_text")==0) in read_map()
100 text_vaddr = symbol_table[i].vaddr; in read_map()
101 if (strcmp(symbol_table[i].symbol, "_etext")==0) in read_map()
102 etext_vaddr = symbol_table[i].vaddr; in read_map()
122 for (uint64_t i = 0; i < entry_count; ++i) in generate_result() local
125 if (!symbol_to_write(symbol_table[i].vaddr, text_vaddr, etext_vaddr)) in generate_result()
128 if (symbol_table[i].vaddr == last_vaddr) in generate_result()
132 printf("\t.quad\t%#llx\n", symbol_table[i].vaddr); in generate_result()
135 last_vaddr = symbol_table[i].vaddr; in generate_result()
[all …]
/DragonOS-0.1.7/user/libs/libc/src/
Dstdlib.c9 int abs(int i) in abs() argument
11 return i < 0 ? -i : i; in abs()
14 long labs(long i) in labs() argument
16 return i < 0 ? -i : i; in labs()
19 long long llabs(long long i) in llabs() argument
21 return i < 0 ? -i : i; in llabs()
/DragonOS-0.1.7/kernel/src/mm/
Dmm-stat.c63 for (int i = zone_start; i <= zone_end; ++i) in __count_empty_2m_pages() local
65 result += (memory_management_struct.zones_struct + i)->count_pages_free; in __count_empty_2m_pages()
107 for (int i = zone_start; i <= zone_end; ++i) in __count_in_using_2m_pages() local
109 result += (memory_management_struct.zones_struct + i)->count_pages_using; in __count_in_using_2m_pages()
122 for (int i = 0; i < sizeof(kmalloc_cache_group) / sizeof(struct slab); ++i) in __count_kmalloc_free() local
124 result += kmalloc_cache_group[i].size * kmalloc_cache_group[i].count_total_free; in __count_kmalloc_free()
137 for (int i = 0; i < sizeof(kmalloc_cache_group) / sizeof(struct slab); ++i) in __count_kmalloc_using() local
139 result += kmalloc_cache_group[i].size * kmalloc_cache_group[i].count_total_using; in __count_kmalloc_using()
152 for (int i = 0; i < sizeof(kmalloc_cache_group) / sizeof(struct slab); ++i) in __count_kmalloc_total() local
154 …result += kmalloc_cache_group[i].size * (kmalloc_cache_group[i].count_total_free + kmalloc_cache_g… in __count_kmalloc_total()
Dslab.c229 for (int i = 0; i < slab_obj_ptr->bmp_count; ++i) in slab_malloc() local
232 if (*(slab_obj_ptr->bmp + (i >> 6)) == 0xffffffffffffffffUL) in slab_malloc()
234 i += 63; in slab_malloc()
239 tmp_md = i % 64; in slab_malloc()
240 if ((*(slab_obj_ptr->bmp + (i >> 6)) & (1UL << tmp_md)) == 0) in slab_malloc()
243 *(slab_obj_ptr->bmp + (i >> 6)) |= (1UL << tmp_md); in slab_malloc()
255 … return slab_pool->constructor((char *)slab_obj_ptr->vaddr + slab_pool->size * i, arg); in slab_malloc()
259 return (void *)((char *)slab_obj_ptr->vaddr + slab_pool->size * i); in slab_malloc()
351 for (int i = 0; i < 16; ++i) in slab_init() local
354 spin_init(&kmalloc_cache_group[i].lock); in slab_init()
[all …]
Dmm.c39 for (int i = 0; i < 512; ++i, ++ptr) in mm_check_page_table() local
62 for (int i = 0; i < count; ++i) in mm_init() local
71 memory_management_struct.e820[i].BaseAddr = mb2_mem_info[i].addr; in mm_init()
72 memory_management_struct.e820[i].Length = mb2_mem_info[i].len; in mm_init()
73 memory_management_struct.e820[i].type = mb2_mem_info[i].type; in mm_init()
74 memory_management_struct.len_e820 = i; in mm_init()
77 if (mb2_mem_info[i].type > 4 || mb2_mem_info[i].len == 0 || mb2_mem_info[i].type < 1) in mm_init()
84 for (int i = 0; i < memory_management_struct.len_e820; ++i) in mm_init() local
86 if (memory_management_struct.e820[i].type != 1) in mm_init()
90 ul addr_start = PAGE_2M_ALIGN(memory_management_struct.e820[i].BaseAddr); in mm_init()
[all …]
/DragonOS-0.1.7/kernel/src/sched/
Dcompletion.c201 for (int i = 0; i < n; i++) // 对每一个completion都等一遍 in wait_for_multicompletion() local
203 if (!completion_done(&x[i])) // 如果没有done,直接wait in wait_for_multicompletion()
205 wait_for_completion(&x[i]); in wait_for_multicompletion()
207 else if (!try_wait_for_completion(&x[i])) // 上面测试过done>0,那么这里尝试去获取一个done,如果失败了,就继续wait in wait_for_multicompletion()
209 wait_for_completion(&x[i]); in wait_for_multicompletion()
287 for (int i = 0; i < N; i++) in __test_completion() local
289 completion_init(&one_to_one[i]); in __test_completion()
290 completion_init(&waiter_many_to_one[i]); in __test_completion()
291 completion_init(&worker_many_to_one[i]); in __test_completion()
294 for (int i = 0; i < N; i++) in __test_completion() local
[all …]
/DragonOS-0.1.7/kernel/src/smp/
Dsmp.c37 for (int i = 0; i < total_processor_num; ++i) in smp_init() local
40 proc_local_apic_structs[i] = (struct acpi_Processor_Local_APIC_Structure_t *)(tmp_vaddr[i]); in smp_init()
48 for (int i = 200; i < 210; ++i) in smp_init() local
49 set_intr_gate(i, 0, SMP_interrupt_table[i - 200]); in smp_init()
63 for (int i = 0; i < total_processor_num; ++i) // i从1开始,不初始化bsp in smp_init() local
68 kdebug("[core %d] acpi processor UID=%d, APIC ID=%d, flags=%#010lx", i, in smp_init()
69 … proc_local_apic_structs[i]->ACPI_Processor_UID, proc_local_apic_structs[i]->local_apic_id, in smp_init()
70 proc_local_apic_structs[i]->flags); in smp_init()
71 if (proc_local_apic_structs[i]->local_apic_id == 0) in smp_init()
76 … if (!((proc_local_apic_structs[i]->flags & 0x1) || (proc_local_apic_structs[i]->flags & 0x2))) in smp_init()
[all …]
/DragonOS-0.1.7/kernel/src/driver/usb/
Dusb.c36 for (volatile int i = 0; i < usb_pdevs_count; ++i) in usb_init() local
39 switch (usb_pdevs[i]->ProgIF) in usb_init()
46 kwarn("Unsupported usb host type: %#02x", usb_pdevs[i]->ProgIF); in usb_init()
52 xhci_init((struct pci_device_structure_general_device_t *)usb_pdevs[i]); in usb_init()
57 kerror("Error value of usb_pdevs[%d]->ProgIF: %#02x", i, usb_pdevs[i]->ProgIF); in usb_init()
/DragonOS-0.1.7/user/apps/shell/
Dcmd_test.c12 int fd[2], i, n; in shell_pipe_test() local
30 for (i = 0; i < 3; i++) in shell_pipe_test()
56 for (i = 0; i < 3; i++) in shell_pipe_test()
59 if (i == 1) in shell_pipe_test()
64 if (i == 2) in shell_pipe_test()
Dcmd_help.c18 for (int i = 0; i < help_table_num; ++i) in shell_help() local
19 help_table[i].func(); in shell_help()
/DragonOS-0.1.7/kernel/src/libs/libUI/
Dtextui-render.c43 for (int i = start; i < window->vlines_num && count > 0; ++i, --count) in textui_refresh_vlines() local
47 textui_refresh_vline(window, i); in textui_refresh_vlines()
93 for (int i = 0; i < count; ++i) in textui_refresh_characters() local
96 __textui_render_chromatic(actual_line_id, start + i, &vline->chars[start + i]); in textui_refresh_characters()
135 for (int i = 0; i < TEXTUI_CHAR_HEIGHT; ++i) in __textui_render_chromatic() local
138 addr = (uint32_t *)(fb + textui_framework.buf->width * (y + i) + x); in __textui_render_chromatic()
/DragonOS-0.1.7/kernel/src/libs/
Dglib.c19 for(uint64_t i=0;i<times;++i) in __experimental_beep() local
26 for(uint64_t i=0;i<times;++i) in __experimental_beep() local
/DragonOS-0.1.7/kernel/src/driver/disk/ahci/
Dahci.c22 for (int i = 0; i < *count_ahci_devices; i++) in ahci_cpp_init() local
24 gen_devs[i] = ((struct pci_device_structure_general_device_t *)(ahci_devs[i])); in ahci_cpp_init()
Dmod.rs75 for i in 0..(ahci_dev_counts as usize) { in ahci_rust_init()
81 let virt_addr = AHCI_MAPPING_BASE as usize + unsafe { (*gen_devs[i]).BAR5 as usize } in ahci_rust_init()
88 let pi = volatile_read!(hba_mem_list[i].pi); in ahci_rust_init()
97 let tp = hba_mem_list[i].ports[j].check_type(); in ahci_rust_init()
121 hba_mem_list[i].ports[j].init(clb as u64, fb as u64, &ctbas); in ahci_rust_init()
131 i as u8, in ahci_rust_init()
147 i, in ahci_rust_init()
173 for i in 0..disks_list.len() { in get_disks_by_name()
174 if disks_list[i].0.lock().name == name { in get_disks_by_name()
175 return Ok(disks_list[i].clone()); in get_disks_by_name()
[all …]
/DragonOS-0.1.7/kernel/src/driver/interrupt/8259A/
D8259A.c12 for(int i=32;i<=55;++i) in init_8259A() local
13 set_intr_gate(i, 0, interrupt_table[i-32]); in init_8259A()
/DragonOS-0.1.7/kernel/src/driver/mouse/
Dps2_mouse.c102 for (int i = 0; i < 1000; i++) in ps2_mouse_get_mouse_ID() local
131 for (int i = 0; i < 1000; i++) in ps2_mouse_set_sample_rate() local
138 for (int i = 0; i < 1000; i++) in ps2_mouse_set_sample_rate() local
231 for (int i = 0; i < 1000; i++) in ps2_mouse_init() local
243 for (int i = 0; i < 1000; i++) in ps2_mouse_init() local
252 for (int i = 0; i < 1000; i++) in ps2_mouse_init() local
/DragonOS-0.1.7/user/libs/libc/src/math/
Dpow.c7 for (int i = 0; i < y; ++i) in pow() local
Dround.c15 uint64_t i; in round() member
18 int e = u.i >> 52 & 0x7ff; in round()
23 if (u.i >> 63) in round()
38 if (u.i >> 63) in round()
/DragonOS-0.1.7/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.7/user/port/
Dbuild.sh11 for i in ${path[@]}; do
12 echo "Building $i"
13 cd $i
/DragonOS-0.1.7/user/libs/libc/src/include/export/
Dstdlib.h29 int abs(int i);
30 long labs(long i);
31 long long llabs(long long i);
/DragonOS-0.1.7/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()

123