/DragonOS-0.1.5/kernel/src/ktest/ |
D | test-idr.c | 40 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 …]
|
D | test-kfifo.c | 31 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 …]
|
D | test-mutex.c | 86 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.5/kernel/src/debug/ |
D | kallsyms.c | 97 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.5/user/libs/libc/src/ |
D | stdlib.c | 9 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.5/kernel/src/mm/ |
D | mm-stat.c | 63 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()
|
D | slab.c | 229 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 …]
|
D | mm.c | 39 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.5/kernel/src/sched/ |
D | completion.c | 201 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.5/kernel/src/smp/ |
D | smp.c | 37 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.5/kernel/src/driver/usb/ |
D | usb.c | 36 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.5/kernel/src/driver/virtio/ |
D | virtio.c | 26 for(int i = 0; i < net_pdevs_count;i++) { in get_virtio_net_device() local 27 struct pci_device_structure_general_device_t *dev = net_pdevs[i]; in get_virtio_net_device() 28 …if(net_pdevs[i]->Vendor_ID==0x1AF4 && net_pdevs[i]->Device_ID>=0x1000 && net_pdevs[i]->Device_ID<=… in get_virtio_net_device() 30 virtio_net_pdev=net_pdevs[i]; in get_virtio_net_device()
|
/DragonOS-0.1.5/kernel/src/libs/libUI/ |
D | textui-render.c | 43 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.5/kernel/src/libs/ |
D | glib.c | 19 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.5/kernel/src/driver/disk/ahci/ |
D | ahci.c | 22 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()
|
/DragonOS-0.1.5/kernel/src/driver/interrupt/8259A/ |
D | 8259A.c | 12 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.5/user/apps/shell/ |
D | cmd_help.c | 18 for (int i = 0; i < help_table_num; ++i) in shell_help() local 19 help_table[i].func(); in shell_help()
|
/DragonOS-0.1.5/kernel/src/driver/mouse/ |
D | ps2_mouse.c | 102 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.5/user/libs/libc/src/math/ |
D | pow.c | 7 for (int i = 0; i < y; ++i) in pow() local
|
D | round.c | 15 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.5/tools/ |
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-0.1.5/user/port/ |
D | build.sh | 11 for i in ${path[@]}; do 12 echo "Building $i" 13 cd $i
|
/DragonOS-0.1.5/user/libs/libc/src/include/export/ |
D | stdlib.h | 29 int abs(int i); 30 long labs(long i); 31 long long llabs(long long i);
|
/DragonOS-0.1.5/kernel/src/common/math/ |
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()
|
D | fabs.c | 10 uint64_t i; in fabs() member 12 u.i &= -1ULL / 2; in fabs() 27 u.i.se &= 0x7fff; in fabsl()
|