/DragonOS-0.1.2/kernel/src/ktest/ |
D | test-kfifo.c | 7 static long ktest_kfifo_case0_1(uint64_t arg0, uint64_t arg1) in ktest_kfifo_case0_1() 33 uint64_t tmp = i; in ktest_kfifo_case0_1() 34 assert(kfifo_in(&fifo, &tmp, sizeof(uint64_t)) == sizeof(uint64_t)); in ktest_kfifo_case0_1() 36 assert(fifo.in_offset == 10 * sizeof(uint64_t)); in ktest_kfifo_case0_1() 38 assert(fifo.size == 10 * sizeof(uint64_t)); in ktest_kfifo_case0_1() 44 uint64_t tmp = 0; in ktest_kfifo_case0_1() 45 assert(kfifo_out(&fifo, &tmp, sizeof(uint64_t)) == sizeof(uint64_t)); in ktest_kfifo_case0_1() 47 assert(fifo.size == (10 - i) * sizeof(uint64_t)); in ktest_kfifo_case0_1() 48 assert(fifo.in_offset == 10 * sizeof(uint64_t)); in ktest_kfifo_case0_1() 49 assert(fifo.out_offset == i * sizeof(uint64_t)); in ktest_kfifo_case0_1() [all …]
|
/DragonOS-0.1.2/user/libs/libsystem/ |
D | syscall.c | 4 …l_invoke(uint64_t syscall_id, uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t… in syscall_invoke() 6 uint64_t __err_code; in syscall_invoke()
|
D | syscall.h | 49 long syscall_invoke(uint64_t syscall_id, uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3… 50 uint64_t arg5, uint64_t arg6, uint64_t arg7);
|
/DragonOS-0.1.2/user/libs/libc/src/sys/ |
D | stat.h | 10 uint64_t total; // 计算机的总内存数量大小 11 uint64_t used; // 已使用的内存大小 12 uint64_t free; // 空闲物理页所占的内存大小 13 uint64_t shared; // 共享的内存大小 14 uint64_t cache_used; // 位于slab缓冲区中的已使用的内存大小 15 uint64_t cache_free; // 位于slab缓冲区中的空闲的内存大小 16 uint64_t available; // 系统总空闲内存大小(包括kmalloc缓冲区)
|
D | stat.c | 6 return syscall_invoke(SYS_MKDIR, (uint64_t)path, (uint64_t)mode, 0, 0, 0, 0, 0, 0); in mkdir() 17 return syscall_invoke(SYS_MSTAT, (uint64_t)stat, 0, 0, 0, 0, 0, 0, 0); in mstat() 22 return syscall_invoke(SYS_PIPE, (uint64_t)fd, 0, 0,0,0,0,0,0); in pipe()
|
/DragonOS-0.1.2/kernel/src/arch/x86_64/include/asm/ |
D | asm.h | 37 uint64_t tmp1 = 0, tmp2 = 0; \ 50 uint64_t *tmp; in get_rsp() 64 uint64_t *tmp; in get_rbp() 78 uint64_t *tmp; in get_ds() 92 uint64_t *tmp; in get_rax() 105 uint64_t *tmp; in get_rbx() 119 void wrmsr(uint64_t address, uint64_t value) in wrmsr() 131 uint64_t rdmsr(uint64_t address) in rdmsr() 138 return ((uint64_t)tmp0 << 32) | tmp1; in rdmsr() 141 uint64_t get_rflags() in get_rflags()
|
/DragonOS-0.1.2/kernel/src/process/ |
D | fork.c | 12 int process_copy_files(uint64_t clone_flags, struct process_control_block *pcb); 13 int process_copy_flags(uint64_t clone_flags, struct process_control_block *pcb); 14 int process_copy_mm(uint64_t clone_flags, struct process_control_block *pcb); 15 int process_copy_thread(uint64_t clone_flags, struct process_control_block *pcb, uint64_t stack_sta… 16 uint64_t stack_size, struct pt_regs *current_regs); 18 extern int process_copy_sighand(uint64_t clone_flags, struct process_control_block *pcb); 19 extern int process_copy_signal(uint64_t clone_flags, struct process_control_block *pcb); 169 int process_copy_flags(uint64_t clone_flags, struct process_control_block *pcb) in process_copy_flags() 183 int process_copy_files(uint64_t clone_flags, struct process_control_block *pcb) in process_copy_files() 211 int process_copy_mm(uint64_t clone_flags, struct process_control_block *pcb) in process_copy_mm() [all …]
|
/DragonOS-0.1.2/kernel/src/mm/ |
D | mmap.c | 7 extern uint64_t mm_total_2M_pages; 27 static void mm_calculate_entry_num(uint64_t length, mm_pgt_entry_num_t *ent) in mm_calculate_entry_num() 48 uint64_t global_CR3 = (uint64_t)get_CR3(); in mm_map_phys_addr() 55 uint64_t global_CR3 = (uint64_t)get_CR3(); in mm_map_phys_addr_user() 79 uint64_t length_mapped = 0; in mm_map_proc_page_table() 87 uint64_t pml4e_id = ((virt_addr_start >> PAGE_GDT_SHIFT) & 0x1ff); in mm_map_proc_page_table() 88 uint64_t *pml4_ptr; in mm_map_proc_page_table() 110 uint64_t pdpte_id = (((virt_addr_start + length_mapped) >> PAGE_1G_SHIFT) & 0x1ff); in mm_map_proc_page_table() 111 uint64_t *pdpt_ptr = (uint64_t *)phys_2_virt(*pml4e_ptr & (~0xfffUL)); in mm_map_proc_page_table() 117 uint64_t *pdpte_ptr = (pdpt_ptr + pdpte_id); in mm_map_proc_page_table() [all …]
|
D | mm-stat.c | 21 static uint64_t __count_kmalloc_free(); 22 static uint64_t __count_kmalloc_using(); 23 static uint64_t __count_kmalloc_total(); 24 uint64_t sys_mm_stat(struct pt_regs *regs); 36 uint64_t attr = 0; in __count_empty_2m_pages() 62 uint64_t result = 0; in __count_empty_2m_pages() 80 uint64_t attr = 0; in __count_in_using_2m_pages() 106 uint64_t result = 0; in __count_in_using_2m_pages() 119 static uint64_t __count_kmalloc_free() in __count_kmalloc_free() 121 uint64_t result = 0; in __count_kmalloc_free() [all …]
|
D | mmio.h | 15 int mmio_create(uint32_t size, vm_flags_t vm_flags, uint64_t * res_vaddr, uint64_t *res_size); 24 int mmio_release(uint64_t vaddr, uint64_t size);
|
D | mm.h | 166 uint64_t total; // 计算机的总内存数量大小 167 uint64_t used; // 已使用的内存大小 168 uint64_t free; // 空闲物理页所占的内存大小 169 uint64_t shared; // 共享的内存大小 170 uint64_t cache_used; // 位于slab缓冲区中的已使用的内存大小 171 uint64_t cache_free; // 位于slab缓冲区中的空闲的内存大小 172 uint64_t available; // 系统总空闲内存大小(包括kmalloc缓冲区) 381 struct vm_area_struct *vma_find(struct mm_struct *mm, uint64_t addr); 442 #define mm_unmap_addr(virt_addr, length) ({ mm_unmap_proc_table((uint64_t)get_CR3(), true, virt_add… 455 int mm_create_vma(struct mm_struct *mm, uint64_t vaddr, uint64_t length, vm_flags_t vm_flags, [all …]
|
D | mm-types.h | 9 typedef uint64_t vm_flags_t; 66 uint64_t start_brk; // 堆地址的起始位置 123 uint64_t vm_start; // 区域的起始地址 124 uint64_t vm_end; // 区域的结束地址 147 uint64_t code_addr_start, code_addr_end; 149 uint64_t data_addr_start, data_addr_end; 151 uint64_t rodata_addr_start, rodata_addr_end; 153 uint64_t bss_start, bss_end; 155 uint64_t brk_start, brk_end; 157 uint64_t stack_start;
|
/DragonOS-0.1.2/kernel/src/common/ |
D | glib.h | 201 bool verify_area(uint64_t addr_start, uint64_t length) in verify_area() 217 static inline uint64_t copy_from_user(void *dst, void *src, uint64_t size) in copy_from_user() 219 uint64_t tmp0, tmp1; in copy_from_user() 220 if (!verify_area((uint64_t)src, size)) in copy_from_user() 246 static inline uint64_t copy_to_user(void *dst, void *src, uint64_t size) in copy_to_user() 248 uint64_t tmp0, tmp1; in copy_to_user() 249 if (verify_area((uint64_t)src, size)) in copy_to_user() 275 void __experimental_beep(uint64_t times); 284 static __always_inline void __write8b(uint64_t vaddr, uint64_t value) in __write8b() 298 static __always_inline void __write4b(uint64_t vaddr, uint32_t value) in __write4b() [all …]
|
D | blk_types.h | 30 …long (*transfer)(struct blk_gendisk *gd, long cmd, uint64_t base_addr, uint64_t count, uint64_t bu… 40 uint64_t LBA_start; 42 uint64_t buffer_vaddr; 68 uint64_t bd_start_LBA; // 起始LBA号
|
/DragonOS-0.1.2/user/libs/libc/src/ |
D | unistd.c | 30 return (ssize_t)syscall_invoke(SYS_READ, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in read() 43 return (ssize_t)syscall_invoke(SYS_WRITE, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in write() 88 uint64_t brk(uint64_t end_brk) in brk() 90 uint64_t x = (uint64_t)syscall_invoke(SYS_BRK, (uint64_t)end_brk, 0, 0, 0, 0, 0, 0, 0); in brk() 103 void *retval = (void *)syscall_invoke(SYS_SBRK, (uint64_t)increment, 0, 0, 0, 0, 0, 0, 0); in sbrk() 128 return syscall_invoke(SYS_CHDIR, (uint64_t)dest_path, 0, 0, 0, 0, 0, 0, 0); in chdir() 146 int retval = syscall_invoke(SYS_EXECVE, (uint64_t)path, (uint64_t)argv, 0, 0, 0, 0, 0, 0); in execv() 161 return syscall_invoke(SYS_UNLINK_AT, 0, (uint64_t)path, AT_REMOVEDIR, 0, 0, 0, 0, 0); in rmdir() 172 return syscall_invoke(SYS_UNLINK_AT, 0, (uint64_t)path, 0, 0, 0, 0, 0, 0); in rm()
|
D | malloc.c | 32 uint64_t length; // 整个块所占用的内存区域的大小 37 static uint64_t brk_base_addr = 0; // 堆区域的内存基地址 38 static uint64_t brk_max_addr = 0; // 堆区域的内存最大地址 39 static uint64_t brk_managed_addr = 0; // 堆区域已经被管理的地址 46 static uint64_t count_last_free_size = 0; // 统计距离上一次回收内存,已经free了多少内存 67 static malloc_mem_chunk_t *malloc_query_free_chunk_bf(uint64_t size) in malloc_query_free_chunk_bf() 107 static malloc_mem_chunk_t *malloc_query_free_chunk_ff(uint64_t size) in malloc_query_free_chunk_ff() 182 if (((uint64_t)(ptr->prev) + ptr->prev->length == (uint64_t)ptr)) in malloc_merge_free_chunk() 219 if ((uint64_t)ptr < (uint64_t)ck) in malloc_insert_free_list() 229 else if ((uint64_t)(ptr->next) > (uint64_t)ck) in malloc_insert_free_list() [all …]
|
/DragonOS-0.1.2/kernel/src/driver/interrupt/apic/ |
D | apic_timer.c | 9 uint64_t apic_timer_ticks_result = 0; 11 void apic_timer_enable(uint64_t irq_num) in apic_timer_enable() 15 uint64_t val = apic_timer_get_LVT(); in apic_timer_enable() 23 void apic_timer_disable(uint64_t irq_num) in apic_timer_disable() 35 uint64_t apic_timer_install(ul irq_num, void *arg) in apic_timer_install() 45 apic_timer_set_init_cnt(*(uint64_t *)arg); in apic_timer_install() 74 void apic_timer_handler(uint64_t number, uint64_t param, struct pt_regs *regs) in apic_timer_handler()
|
/DragonOS-0.1.2/kernel/src/debug/traceback/ |
D | traceback.c | 5 static int lookup_kallsyms(uint64_t addr, int level) in lookup_kallsyms() 12 uint64_t index = 0; in lookup_kallsyms() 43 uint64_t *rbp = (uint64_t *)regs->rbp; in traceback() 50 uint64_t ret_addr = regs->rip; in traceback() 59 if((uint64_t)(rbp) >= current_pcb->thread->rbp || ((uint64_t)rbp<regs->rsp)) in traceback() 67 rbp = (uint64_t *)(*rbp); in traceback()
|
/DragonOS-0.1.2/kernel/src/filesystem/fat32/ |
D | fat32.h | 137 uint64_t fsinfo_sector_addr_infat; 138 uint64_t bootsector_bak_sector_addr_infat; 140 uint64_t starting_sector; 141 uint64_t sector_count; 143 uint64_t sec_per_clus; // 每簇扇区数 144 uint64_t bytes_per_sec; // 每扇区字节数 145 uint64_t bytes_per_clus; // 每簇字节数 147 uint64_t first_data_sector; // 数据区起始扇区号 148 uint64_t FAT1_base_sector; // FAT1表的起始簇号 149 uint64_t FAT2_base_sector; // FAT2表的起始簇号 [all …]
|
/DragonOS-0.1.2/user/libs/libc/src/math/ |
D | libm.h | 12 uint64_t m; 22 uint64_t lo; 29 uint64_t lo; 30 uint64_t hi; 42 uint64_t lo; 46 uint64_t hi; 47 uint64_t lo;
|
/DragonOS-0.1.2/kernel/src/common/math/ |
D | libm.h | 12 uint64_t m; 22 uint64_t lo; 29 uint64_t lo; 30 uint64_t hi; 42 uint64_t lo; 46 uint64_t hi; 47 uint64_t lo;
|
/DragonOS-0.1.2/kernel/src/syscall/ |
D | syscall.c | 18 extern uint64_t sys_clock(struct pt_regs *regs); 19 extern uint64_t sys_mstat(struct pt_regs *regs); 20 extern uint64_t sys_open(struct pt_regs *regs); 21 extern uint64_t sys_unlink_at(struct pt_regs *regs); 22 extern uint64_t sys_kill(struct pt_regs *regs); 23 extern uint64_t sys_sigaction(struct pt_regs * regs); 24 extern uint64_t sys_rt_sigreturn(struct pt_regs * regs); 135 uint64_t sys_close(struct pt_regs *regs) in sys_close() 152 uint64_t sys_read(struct pt_regs *regs) in sys_read() 159 if (SYSCALL_FROM_USER(regs) && (!verify_area((uint64_t)buf, count))) in sys_read() [all …]
|
/DragonOS-0.1.2/kernel/src/time/ |
D | timer.h | 10 uint64_t volatile timer_jiffies = 0; // 系统时钟计数 28 uint64_t expire_jiffies; 42 …it(struct timer_func_list_t *timer_func, void (*func)(void *data), void *data, uint64_t expire_ms); 52 …us(struct timer_func_list_t *timer_func, void (*func)(void *data), void *data, uint64_t expire_us); 68 uint64_t clock();
|
/DragonOS-0.1.2/kernel/src/common/sys/ |
D | types.h | 22 typedef uint64_t ino_t; 36 typedef uint64_t fsblkcnt_t; 37 typedef uint64_t fsfilcnt_t; 39 typedef uint64_t sector_t; 78 typedef uint64_t pthread_rwlock_t; 89 typedef uint64_t gfp_t; 93 #define __aligned_u64 uint64_t __attribute__((aligned(8)))
|
/DragonOS-0.1.2/kernel/src/debug/ |
D | kallsyms.c | 29 uint64_t vaddr; 37 uint64_t table_size = 0; 39 uint64_t entry_count = 0; 41 uint64_t text_vaddr, etext_vaddr; 97 for (uint64_t i = 0; i < entry_count; ++i) in read_map() 118 uint64_t last_vaddr = 0; in generate_result() 119 uint64_t total_syms_to_write = 0; // 真正输出的符号的数量 in generate_result() 122 for (uint64_t i = 0; i < entry_count; ++i) in generate_result() 152 uint64_t position = 0; in generate_result() 154 for (uint64_t i = 0; i < entry_count; ++i) in generate_result() [all …]
|