/DragonOS-0.1.2/docs/kernel/core_api/ |
D | allocate-memory.md | 3 DragonOS提供了一些用于内存分配的api。您可以使用*kmalloc*来分配小的内存块,也可以使用*alloc_pages*分配连续的2MB大小的内存页面。 7 …,最直接、最简单的分配内存的方式就是,使用`kmalloc()`函数进行分配。并且,出于安全起见,除非内存在分配后一定会被覆盖,且您能确保内存中的脏数据一定不会对程序造成影响,在其余情况下,我们建… 9 您可以通过`kmalloc()`函数分配得到32bytes到1MBytes之间的内存对象。并且,这些内存对象具有以下的性质: 15 当内存空间不再被使用时,那么必须释放他们。若您使用的是`kmalloc()`分配的内存,那么您需要使用`kfree()`释放它。若是使用`alloc_pages()`分配的内存,则需要使用`free…
|
D | mm-api.md | 9 ### `void *kmalloc(unsigned long size, gfp_t gfp)` 15   kmalloc用于获取那些小于2M内存页大小的内存对象。可分配的内存对象大小为32bytes~1MBytes. 且分配的内存块大小、起始地址按照2的n次幂进行对齐。(比如,申… 31   获取小块的内存,并将其清零。其余功能与kmalloc相同。 50   该函数用于释放通过kmalloc申请的内存。如果`address`为NULL,则函数被调用后,无事发生。 52   请不要通过这个函数释放那些不是从`kmalloc()`或`kzalloc()`申请的内存,否则将会导致系统崩溃。 267 | available | 系统总空闲内存大小(包括kmalloc缓冲区) |
|
D | data_structures.md | 285   为ida预分配空间.您可以不自行调用, 因为当ida需要空间的时候, 内部会自行使用`kmalloc`函数获取空间. 当然, 设计这个函数的目的是为了让您有更多的选择. 当您… 431   为idr预分配空间.您可以不自行调用, 因为当idr需要空间的时候, 内部会自行使用`kmalloc`函数获取空间. 当然, 设计这个函数的目的是为了让您有更多的选择. 当您…
|
/DragonOS-0.1.2/kernel/src/mm/ |
D | allocator.rs | 1 use crate::include::bindings::bindings::{gfp_t, kfree, kmalloc, PAGE_2M_SIZE}; 21 return kmalloc(layout.size() as u64, gfp) as *mut u8; in local_alloc() 28 return kmalloc(layout.size() as u64, gfp | __GFP_ZERO) as *mut u8; in local_alloc_zeroed()
|
D | slab.h | 60 void *kmalloc(unsigned long size, gfp_t gfp); 71 return kmalloc(size, gfp | __GFP_ZERO); in kzalloc()
|
D | slab.c | 35 struct slab *slab_pool = (struct slab *)kmalloc(sizeof(struct slab), 0); in slab_create() 50 slab_pool->cache_pool_entry = (struct slab_obj *)kmalloc(sizeof(struct slab_obj), 0); in slab_create() 97 slab_pool->cache_pool_entry->bmp = (ul *)kmalloc(slab_pool->cache_pool_entry->bmp_len, 0); in slab_create() 171 tmp_slab_obj = (struct slab_obj *)kmalloc(sizeof(struct slab_obj), 0); in slab_malloc() 199 tmp_slab_obj->bmp = (ul *)kmalloc(tmp_slab_obj->bmp_len, 0); in slab_malloc() 503 slab_obj_ptr = (struct slab_obj *)kmalloc(sizeof(struct slab_obj), 0); in kmalloc_create_slab_obj() 511 slab_obj_ptr->bmp = (ul *)kmalloc(slab_obj_ptr->bmp_len, 0); in kmalloc_create_slab_obj() 540 void *kmalloc(unsigned long size, gfp_t gfp) in kmalloc() function
|
D | vma.c | 13 struct vm_area_struct *vma = (struct vm_area_struct *)kmalloc(sizeof(struct vm_area_struct), 0); in vm_area_alloc() 184 struct anon_vma_t *anon_vma = (struct anon_vma_t *)kmalloc(sizeof(struct anon_vma_t), 0); in __anon_vma_create_alloc()
|
D | mmap.c | 105 ul *virt_addr = kmalloc(PAGE_4K_SIZE, 0); in mm_map_proc_page_table() 122 ul *virt_addr = kmalloc(PAGE_4K_SIZE, 0); in mm_map_proc_page_table() 143 uint64_t *vaddr = kmalloc(PAGE_4K_SIZE, 0); in mm_map_proc_page_table()
|
/DragonOS-0.1.2/kernel/src/ktest/ |
D | test-bitree.c | 40 struct test_value_t *tv1 = (struct test_value_t *)kmalloc(sizeof(struct test_value_t), 0); in ktest_bitree_case1() 56 struct test_value_t *tv2 = (struct test_value_t *)kmalloc(sizeof(struct test_value_t), 0); in ktest_bitree_case1() 65 struct test_value_t *tv3 = (struct test_value_t *)kmalloc(sizeof(struct test_value_t), 0); in ktest_bitree_case1() 87 struct test_value_t *tv4 = (struct test_value_t *)kmalloc(sizeof(struct test_value_t), 0); in ktest_bitree_case1() 101 …struct test_value_t *tv_not_exists = (struct test_value_t *)kmalloc(sizeof(struct test_value_t), 0… in ktest_bitree_case1()
|
D | test-kfifo.c | 16 void *buf = kmalloc(fifo_size, 0); in ktest_kfifo_case0_1()
|
/DragonOS-0.1.2/kernel/src/time/ |
D | sleep.c | 50 …struct timer_func_list_t *sleep_task = (struct timer_func_list_t *)kmalloc(sizeof(struct timer_fun… in nanosleep()
|
D | timer.c | 28 …struct timer_func_list_t *tmp = (struct timer_func_list_t *)kmalloc(sizeof(struct timer_func_list_… in timer_init()
|
/DragonOS-0.1.2/kernel/src/process/ |
D | fork.c | 197 pcb->fds[i] = (struct vfs_file_t *)kmalloc(sizeof(struct vfs_file_t), 0); in process_copy_files() 223 struct mm_struct *new_mms = (struct mm_struct *)kmalloc(sizeof(struct mm_struct), 0); in process_copy_mm() 231 new_mms->pgd = (pml4t_t *)virt_2_phys(kmalloc(PAGE_4K_SIZE, 0)); in process_copy_mm() 279 uint64_t va = (uint64_t)kmalloc(map_size, 0); in process_copy_mm()
|
D | process.c | 145 filp = (struct vfs_file_t *)kmalloc(sizeof(struct vfs_file_t), 0); in process_open_exec_file() 176 void *buf = kmalloc(PAGE_4K_SIZE, 0); in process_load_elf_file() 285 uint64_t paddr = virt_2_phys((uint64_t)kmalloc(PAGE_4K_SIZE, 0)); in process_load_elf_file() 363 struct mm_struct *new_mms = (struct mm_struct *)kmalloc(sizeof(struct mm_struct), 0); in do_execve() 368 new_mms->pgd = (pml4t_t *)virt_2_phys(kmalloc(PAGE_4K_SIZE, 0)); in do_execve()
|
/DragonOS-0.1.2/kernel/src/smp/ |
D | smp.c | 85 … cpu_core_info[current_starting_cpu].stack_start = (uint64_t)kmalloc(STACK_SIZE, 0) + STACK_SIZE; in smp_init() 86 …cpu_core_info[current_starting_cpu].ist_stack_start = (uint64_t)(kmalloc(STACK_SIZE, 0)) + STACK_S… in smp_init()
|
/DragonOS-0.1.2/kernel/src/libs/ |
D | bitree.c | 25 struct bt_root_t *root = (struct bt_root_t *)kmalloc(sizeof(struct bt_root_t), 0); in bt_create_tree() 45 struct bt_node_t *node = (struct bt_node_t *)kmalloc(sizeof(struct bt_node_t), 0); in bt_create_node()
|
D | kfifo.c | 18 fifo->buffer = kmalloc(size, 0); in kfifo_alloc()
|
/DragonOS-0.1.2/kernel/src/libs/libUI/ |
D | screen_manager.c | 32 …struct scm_buffer_info_t *buf = (struct scm_buffer_info_t *)kmalloc(sizeof(struct scm_buffer_info_… in __create_buffer() 136 …struct scm_ui_framework_t *ui = (struct scm_ui_framework_t *)kmalloc(sizeof(struct scm_ui_framewor… in scm_register_alloc()
|
/DragonOS-0.1.2/kernel/src/filesystem/fat32/ |
D | fat32.c | 437 sb_ptr->root->dir_inode->private_inode_info = kmalloc(sizeof(struct fat32_inode_info_t), 0); in fat32_read_superblock() 495 struct fat32_Directory_t *buf = (struct fat32_Directory_t *)kmalloc(fsbi->bytes_per_clus, 0); in fat32_write_inode() 607 void *tmp_buffer = kmalloc(fsbi->bytes_per_clus, 0); in fat32_read() 702 void *tmp_buffer = kmalloc(fsbi->bytes_per_clus, 0); in fat32_write() 992 inode->private_inode_info = (fat32_inode_info_t *)kmalloc(sizeof(fat32_inode_info_t), 0); in fat32_mkdir() 1032 void *buf = kmalloc(fsbi->bytes_per_clus, 0); in fat32_mkdir() 1237 dir_name = (char *)kmalloc(count_long_dentry * 26 + 1, 0); in fat32_readdir() 1274 dir_name = (char *)kmalloc(15, 0); in fat32_readdir()
|
/DragonOS-0.1.2/kernel/src/exception/ |
D | irq.c | 170 p->irq_name = (char *)kmalloc(namelen, 0); in irq_register()
|
/DragonOS-0.1.2/docs/community/ChangeLog/V0.1.x/ |
D | V0.1.1.md | 30 - port kmalloc and printk to rust 262 port kmalloc and printk to rust (#83)
|
/DragonOS-0.1.2/kernel/src/syscall/ |
D | syscall.c | 391 char *path = kmalloc(dest_path_len + 1, 0); in sys_chdir() 469 char *path = (char *)kmalloc(path_len + 1, 0); in sys_execve()
|
/DragonOS-0.1.2/docs/kernel/sched/ |
D | waiting.md | 134 - 声明一个完成量(可以在栈中/使用kmalloc/使用数组)
|
/DragonOS-0.1.2/kernel/src/driver/disk/ahci/ |
D | ahci.c | 174 ahci_port_base_vaddr = (uint64_t)kmalloc(1048576, 0); in ahci_init() 551 …struct ahci_request_packet_t *pack = (struct ahci_request_packet_t *)kmalloc(sizeof(struct ahci_re… in ahci_make_request()
|
/DragonOS-0.1.2/kernel/src/driver/usb/xhci/ |
D | xhci.c | 546 const uint64_t vaddr = (uint64_t)kmalloc(total_size, 0); in xhci_create_ring() 565 const uint64_t table_vaddr = (const uint64_t)kmalloc(64, 0); // table支持8个segment in xhci_create_event_ring() 572 const uint64_t seg_vaddr = (const uint64_t)kmalloc(trbs * sizeof(struct xhci_TRB_t), 0); in xhci_create_event_ring() 1947 char *buf = (char *)kmalloc(16, 0); in xhci_hc_init_intr()
|