/DragonOS-0.1.8/kernel/src/libs/ |
D | kfifo.c | 15 int kfifo_alloc(struct kfifo_t *fifo, uint32_t size, uint64_t reserved) in kfifo_alloc() argument 18 fifo->buffer = kmalloc(size, 0); in kfifo_alloc() 22 fifo->total_size = size; in kfifo_alloc() 35 void kfifo_init(struct kfifo_t *fifo, void *buffer, uint32_t size) in kfifo_init() argument 40 fifo->total_size = size; in kfifo_init() 51 uint32_t kfifo_in(struct kfifo_t *fifo, const void *from, uint32_t size) in kfifo_in() argument 54 if (unlikely(fifo->size + size > fifo->total_size)) in kfifo_in() 60 if (fifo->in_offset + size > fifo->total_size) // 发生回环 in kfifo_in() 64 memcpy(fifo->buffer, from + tmp, size - tmp); in kfifo_in() 65 fifo->in_offset = size - tmp; in kfifo_in() [all …]
|
D | string.c | 84 long strncpy_from_user(char *dst, const char *src, unsigned long size) in strncpy_from_user() argument 86 if (!verify_area((uint64_t)src, size)) in strncpy_from_user() 89 strncpy(dst, src, size); in strncpy_from_user() 90 return size; in strncpy_from_user() 102 unsigned long size = strlen(src); in strnlen_user() local 104 if (!verify_area((uint64_t)src, size)) in strnlen_user() 107 return size <= maxlen ? size : maxlen; in strnlen_user()
|
D | glib.c | 38 void *memmove(void *dst, const void *src, uint64_t size) in memmove() argument 43 if (!size) in memmove() 48 return memcpy(dst, src, size); in memmove() 51 _src += size; in memmove() 52 _dst += size; in memmove() 55 while (size--) in memmove()
|
D | bitree.c | 30 root->size = (node == NULL) ? 0 : 1; in bt_create_tree() 94 ++root->size; in bt_insert() 193 --root->size; in bt_delete() 209 kfifo_alloc(&fifo, ((root->size + 1) / 2) * sizeof(struct bt_node_t *), 0); in bt_destroy_tree()
|
/DragonOS-0.1.8/kernel/src/common/ |
D | kfifo.h | 9 uint32_t size; // 元素所占的字节数 member 20 (fifo)->size = 0; \ 30 (fifo)->size = 0; \ 47 #define kfifo_size(fifo) ((fifo)->size) 55 #define kfifo_empty(fifo) (((fifo)->size == 0) ? 1 : 0) 63 #define kfifo_full(fifo) (((fifo)->size == (fifo)->total_size) ? 1 : 0) 73 int kfifo_alloc(struct kfifo_t *fifo, uint32_t size, uint64_t reserved); 89 void kfifo_init(struct kfifo_t *fifo, void *buffer, uint32_t size); 99 uint32_t kfifo_in(struct kfifo_t *fifo, const void *from, uint32_t size); 109 uint32_t kfifo_out(struct kfifo_t *fifo, void *to, uint32_t size); [all …]
|
D | glib.h | 68 void *memset(void *dst, unsigned char C, ul size) in memset() argument 87 : "a"(tmp), "q"(size), "0"(size / 8), "1"(dst) in memset() 217 static inline uint64_t copy_from_user(void *dst, void *src, uint64_t size) in copy_from_user() argument 220 if (!verify_area((uint64_t)src, size)) in copy_from_user() 232 : "=&c"(size), "=&D"(tmp0), "=&S"(tmp1) in copy_from_user() 233 : "r"(size & 7), "0"(size >> 3), "1"(dst), "2"(src) in copy_from_user() 235 return size; in copy_from_user() 246 static inline uint64_t copy_to_user(void *dst, void *src, uint64_t size) in copy_to_user() argument 249 if (verify_area((uint64_t)src, size)) in copy_to_user() 265 memcpy(dst,src,size); in copy_to_user() [all …]
|
D | compiler.h | 49 static __always_inline void __read_once_size(void *dst, const volatile void *src, int size) in __read_once_size() argument 51 switch (size) in __read_once_size() 67 __builtin_memcpy((void *)dst, (const void *)src, size); in __read_once_size() 80 static __always_inline void __write_once_size(volatile void *dst, void *src, int size) in __write_once_size() argument 82 switch (size) in __write_once_size() 98 __builtin_memcpy((void *)dst, (const void *)src, size); in __write_once_size()
|
D | hid.h | 91 int size; // 路径中的节点数目 member 106 int size; // size of data in bits member
|
/DragonOS-0.1.8/user/libs/libc/src/ |
D | malloc.c | 67 static malloc_mem_chunk_t *malloc_query_free_chunk_bf(uint64_t size) in malloc_query_free_chunk_bf() argument 82 if (ptr->length == size) in malloc_query_free_chunk_bf() 88 if (ptr->length > 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() argument 115 if (ptr->length >= size) in malloc_query_free_chunk_ff() 130 static int malloc_enlarge(int64_t size) in malloc_enlarge() argument 142 if (free_space < size) // 现有堆空间不足 in malloc_enlarge() 144 if (sbrk(size - free_space) != (void *)(-1)) in malloc_enlarge() 272 void *malloc(ssize_t size) in malloc() argument 276 if (size + sizeof(uint64_t) <= sizeof(malloc_mem_chunk_t)) in malloc() [all …]
|
D | string.c | 36 void *memset(void *dst, unsigned char C, uint64_t size) in memset() argument 55 : "a"(tmp), "q"(size), "0"(size / 8), "1"(dst) in memset()
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | c_adapter.rs | 29 pub unsafe extern "C" fn rs_pseudo_map_phys(vaddr: usize, paddr: usize, size: usize) { in rs_pseudo_map_phys() 32 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_pseudo_map_phys() 38 pub unsafe extern "C" fn rs_map_phys(vaddr: usize, paddr: usize, size: usize, flags: usize) { in rs_map_phys() 41 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_map_phys() 67 pub unsafe extern "C" fn kzalloc(size: usize, _gfp: gfp_t) -> usize { in kzalloc() 69 return do_kmalloc(size, true); in kzalloc() 73 pub unsafe extern "C" fn kmalloc(size: usize, _gfp: gfp_t) -> usize { in kmalloc() 76 return do_kmalloc(size, true); in kmalloc() 79 fn do_kmalloc(size: usize, zero: bool) -> usize { in do_kmalloc() 81 vec![0u8; size] in do_kmalloc() [all …]
|
D | slab.h | 12 extern void *kmalloc(unsigned long size, gfp_t gfp); 21 extern void *kzalloc(size_t size, gfp_t gfp);
|
D | mod.rs | 317 pub size: usize, field 469 size: usize, field 475 pub fn new(start: VirtAddr, size: usize) -> Self { in new() 476 VirtRegion { start, size } in new() 488 return self.start().add(self.size); in end() 498 let size = end.data() - start.data(); in between() localVariable 499 return Some(VirtRegion::new(start, size)); in between() 518 pub fn size(&self) -> usize { in size() method 519 self.size in size() 524 pub fn set_size(&mut self, size: usize) { in set_size() [all …]
|
D | mmio.h | 4 extern void mmio_create(uint32_t size, uint64_t vm_flagsu, uint64_t* res_vaddr, uint64_t* res_lengt…
|
/DragonOS-0.1.8/kernel/src/ktest/ |
D | test-kfifo.c | 23 assert(fifo.size == 0); in ktest_kfifo_case0_1() 38 assert(fifo.size == 10 * sizeof(uint64_t)); in ktest_kfifo_case0_1() 47 assert(fifo.size == (10 - i) * sizeof(uint64_t)); in ktest_kfifo_case0_1() 61 assert(fifo.size == 0); in ktest_kfifo_case0_1() 70 assert(fifo.size == 31 * sizeof(uint64_t)); in ktest_kfifo_case0_1() 78 assert(fifo.size == 31 * sizeof(uint64_t)); in ktest_kfifo_case0_1() 88 assert(fifo.size == fifo.total_size); in ktest_kfifo_case0_1() 99 assert(fifo.size == (fifo.total_size - 20 * sizeof(uint64_t))); in ktest_kfifo_case0_1() 115 assert(fifo.size == 22 * sizeof(uint64_t)); in ktest_kfifo_case0_1() 123 assert(fifo.size == 2 * (sizeof(uint64_t))); in ktest_kfifo_case0_1() [all …]
|
D | test-bitree.c | 53 assert(tree->size == 1); in ktest_bitree_case1() 60 int last_size = tree->size; in ktest_bitree_case1() 63 assert(last_size + 1 == tree->size); in ktest_bitree_case1() 69 int last_size = tree->size; in ktest_bitree_case1() 72 assert(last_size + 1 == tree->size); in ktest_bitree_case1() 91 int last_size = tree->size; in ktest_bitree_case1() 94 assert(last_size + 1 == tree->size); in ktest_bitree_case1()
|
/DragonOS-0.1.8/kernel/src/driver/hid/ |
D | hidparse.c | 61 static __always_inline uint32_t __format_value(uint32_t value, uint8_t size) in __format_value() argument 63 switch (size) in __format_value() 186 parser->data.path.node[parser->data.path.size].u_page = parser->usage_table[0].u_page; in hid_parse() 187 parser->data.path.node[parser->data.path.size].usage = parser->usage_table[0].usage; in hid_parse() 188 ++parser->data.path.size; in hid_parse() 197 parser->data.path.node[parser->data.path.size].u_page = 0xff; in hid_parse() 198 parser->data.path.node[parser->data.path.size].usage = parser->value & 0x7f; in hid_parse() 199 ++parser->data.path.size; in hid_parse() 208 --parser->data.path.size; // 为什么要--????? in hid_parse() 210 if (parser->data.path.node[parser->data.path.size].u_page == 0xff) in hid_parse() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/multiboot2/ |
D | multiboot2.h | 124 unsigned int size; member 130 unsigned int size; member 138 unsigned int size; member 150 unsigned int size; member 159 unsigned int size; member 168 unsigned int size; member 179 unsigned int size; member 186 unsigned int size; member 213 unsigned int size; member 411 unsigned int size; member
|
D | multiboot2.c | 27 tag = (struct iter_data_t *)((uint8_t *)tag + ALIGN(tag->size, 8))) in multiboot2_iter() 64 for (; (uint8_t *)mmap < (uint8_t *)_iter_data + _iter_data->size; in multiboot2_get_memory()
|
/DragonOS-0.1.8/kernel/src/driver/acpi/ |
D | acpi.c | 178 uint64_t size = 0; in acpi_init() local 179 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_rsdt_virt_addr_base, &size); in acpi_init() 198 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_description_header_base, &size); in acpi_init() 217 uint64_t size = 0; in acpi_init() local 218 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_rsdt_virt_addr_base, &size); in acpi_init() 220 …: mmio created. acpi_rsdt_virt_addr_base = %#018lx,size= %#010lx", acpi_rsdt_virt_addr_base, size); in acpi_init() 241 mmio_create(PAGE_2M_SIZE, VM_IO | VM_DONTCOPY, &acpi_description_header_base, &size); in acpi_init()
|
/DragonOS-0.1.8/kernel/src/driver/video/ |
D | video.c | 39 …me_buffer_info.vaddr, __fb_info.framebuffer_addr, video_frame_buffer_info.size, PAGE_KERNEL_PAGE |… in init_frame_buffer() 64 video_refresh_target->size); in video_refresh_daemon() 181 video_frame_buffer_info.size = in video_init() 188 …_map_phys(video_frame_buffer_info.vaddr, __fb_info.framebuffer_addr, video_frame_buffer_info.size); in video_init()
|
/DragonOS-0.1.8/docs/kernel/core_api/ |
D | data_structures.md | 12 `int kfifo_alloc(struct kfifo_t *fifo, uint32_t size, uint64_t reserved)` 24 **size** 38 `void kfifo_init(struct kfifo_t *fifo, void *buffer, uint32_t size)` 54 **size** 74 `uint32_t kfifo_in(struct kfifo_t *fifo, const void *from, uint32_t size)` 90 **size** 100 `uint32_t kfifo_out(struct kfifo_t *fifo, void *to, uint32_t size)` 116 **size** 126 `uint32_t kfifo_out_peek(struct kfifo_t *fifo, void *to, uint32_t size)` 142 **size**
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/include/asm/ |
D | cmpxchg.h | 20 #define __raw_try_cmpxchg(_ptr, _old_ptr, _new, size) \ argument 26 switch (size) \
|
/DragonOS-0.1.8/user/libs/libc/src/include/export/ |
D | stdlib.h | 14 void *malloc(ssize_t size);
|
/DragonOS-0.1.8/docs/userland/libc/apis/api-list/ |
D | stdlib.md | 8 ``void *malloc(ssize_t size)`` : 普通的 ``malloc``
|