/DragonOS-0.1.3/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.3/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.3/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.3/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 | mmio.c | 54 for (uint32_t i = 0; i < len_2m; i += PAGE_2M_SIZE) in mmio_create() local 57 … retval = mm_create_vma(&initial_mm, buddy_region->vaddr + i, PAGE_2M_SIZE, vm_flags, NULL, NULL); in mmio_create() 62 for (uint32_t i = len_2m; i < size; i += PAGE_4K_SIZE) in mmio_create() local 64 … retval = mm_create_vma(&initial_mm, buddy_region->vaddr + i, PAGE_4K_SIZE, vm_flags, NULL, NULL); in mmio_create() 89 for (uint64_t i = 0; i < length;) in mmio_release() local 91 struct vm_area_struct *vma = vma_find(&initial_mm, vaddr + i); in mmio_release() 94 …kerror("mmio_release failed: vma not found. At address: %#018lx, pid=%ld", vaddr + i, current_pcb-… in mmio_release() 98 if (unlikely(vma->vm_start != (vaddr + i))) in mmio_release() 100 kerror("mmio_release failed: addr_start is not equal to current: %#018lx.", vaddr + i); in mmio_release() 105 i += vma->vm_end - vma->vm_start; in mmio_release()
|
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.3/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.3/kernel/src/smp/ |
D | smp.c | 31 for (int i = 0; i < total_processor_num; ++i) in smp_init() local 34 proc_local_apic_structs[i] = (struct acpi_Processor_Local_APIC_Structure_t *)(tmp_vaddr[i]); in smp_init() 42 for (int i = 200; i < 210; ++i) in smp_init() local 43 set_intr_gate(i, 0, SMP_interrupt_table[i - 200]); in smp_init() 54 for (int i = 0; i < total_processor_num; ++i) // i从1开始,不初始化bsp in smp_init() local 59 kdebug("[core %d] acpi processor UID=%d, APIC ID=%d, flags=%#010lx", i, in smp_init() 60 … proc_local_apic_structs[i]->ACPI_Processor_UID, proc_local_apic_structs[i]->local_apic_id, in smp_init() 61 proc_local_apic_structs[i]->flags); in smp_init() 62 if (proc_local_apic_structs[i]->local_apic_id == 0) in smp_init() 67 … if (!((proc_local_apic_structs[i]->flags & 0x1) || (proc_local_apic_structs[i]->flags & 0x2))) in smp_init() [all …]
|
/DragonOS-0.1.3/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.3/kernel/src/driver/disk/ahci/ |
D | ahci.c | 110 for (int i = 0; i < 4; ++i) in ahci_init_gendisk() local 113 if (ptable->DPTE[i].type != 0) in ahci_init_gendisk() 122 for (int i = 0; i < 4; ++i) in ahci_init_gendisk() local 125 if (ptable->DPTE[i].type != 0) in ahci_init_gendisk() 131 ahci_gendisk0.partition[cnt].bd_sectors_num = ptable->DPTE[i].total_sectors; in ahci_init_gendisk() 132 ahci_gendisk0.partition[cnt].bd_start_sector = ptable->DPTE[i].starting_sector; in ahci_init_gendisk() 134 ahci_gendisk0.partition[cnt].bd_start_LBA = ptable->DPTE[i].starting_LBA; in ahci_init_gendisk() 164 for (int i = 0; i < count_ahci_devices; ++i) in ahci_init() local 168 ahci_devices[i].dev_struct = ahci_devs[i]; in ahci_init() 169 ahci_devices[i].hba_mem = (HBA_MEM *)(cal_HBA_MEM_VIRT_ADDR(i)); in ahci_init() [all …]
|
/DragonOS-0.1.3/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.3/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.3/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.3/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.3/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.3/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.3/user/port/ |
D | build.sh | 11 for i in ${path[@]}; do 12 echo "Building $i" 13 cd $i
|
/DragonOS-0.1.3/user/libs/libc/src/include/ |
D | stdlib.h | 29 int abs(int i); 30 long labs(long i); 31 long long llabs(long long i);
|
/DragonOS-0.1.3/kernel/src/ipc/ |
D | pipe.c | 33 int i = 0; in pipe_read() local 47 for (i = 0; i < pipe_ptr->data.valid_cnt; i++) in pipe_read() 49 if (i == count) in pipe_read() 53 copy_to_user(buf + i, &pipe_ptr->buf[pipe_ptr->data.read_pos], sizeof(char)); in pipe_read() 56 pipe_ptr->data.valid_cnt = pipe_ptr->data.valid_cnt - i; in pipe_read() 61 return i; in pipe_read() 66 int i = 0; in pipe_write() local 80 for (i = pipe_ptr->data.valid_cnt; i < PIPE_BUFF_SIZE; i++) in pipe_write() 82 if (i - pipe_ptr->data.valid_cnt == count) in pipe_write() 86 copy_from_user(&pipe_ptr->buf[pipe_ptr->data.write_pos], buf + i, sizeof(char)); in pipe_write()
|
/DragonOS-0.1.3/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.3/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()
|