/DragonOS-0.1.2/kernel/src/libs/ |
D | wait_queue.c | 26 wait_queue_node_t *wait = (wait_queue_node_t *)kzalloc(sizeof(wait_queue_node_t), 0); in wait_queue_sleep_on() 42 wait_queue_node_t *wait = (wait_queue_node_t *)kzalloc(sizeof(wait_queue_node_t), 0); in wait_queue_sleep_on_unlock() 57 wait_queue_node_t *wait = (wait_queue_node_t *)kzalloc(sizeof(wait_queue_node_t), 0); in wait_queue_sleep_on_interriptible()
|
D | mutex.c | 40 …struct mutex_waiter_t *waiter = (struct mutex_waiter_t *)kzalloc(sizeof(struct mutex_waiter_t), 0); in mutex_lock()
|
D | idr.c | 101 new_one = kzalloc(sizeof(struct idr_layer), gfp_mask); // 默认清空? in idr_preload() 850 bitmap = kzalloc(sizeof(struct ida_bitmap), gfp_mask); in ida_preload()
|
/DragonOS-0.1.2/kernel/src/sched/ |
D | completion.c | 279 struct completion *one_to_one = kzalloc(sizeof(struct completion) * N, 0); in __test_completion() 280 struct completion *one_to_many = kzalloc(sizeof(struct completion), 0); in __test_completion() 281 struct completion *waiter_many_to_one = kzalloc(sizeof(struct completion) * N, 0); in __test_completion() 282 struct completion *worker_many_to_one = kzalloc(sizeof(struct completion) * N, 0); in __test_completion() 283 struct __test_data *waiter_data = kzalloc(sizeof(struct __test_data) * N, 0); in __test_completion() 284 struct __test_data *worker_data = kzalloc(sizeof(struct __test_data) * N, 0); in __test_completion()
|
/DragonOS-0.1.2/docs/kernel/core_api/ |
D | allocate-memory.md | 7 …()`函数进行分配。并且,出于安全起见,除非内存在分配后一定会被覆盖,且您能确保内存中的脏数据一定不会对程序造成影响,在其余情况下,我们建议使用`kzalloc()`进行内存分配,它将会在`kma…
|
D | mm-api.md | 27 ### `void *kzalloc(unsigned long size, gfp_t gfp)` 52   请不要通过这个函数释放那些不是从`kmalloc()`或`kzalloc()`申请的内存,否则将会导致系统崩溃。
|
/DragonOS-0.1.2/kernel/src/common/ |
D | wait_queue.h | 69 wait_queue_node_t *wait = (wait_queue_node_t *)kzalloc(sizeof(wait_queue_node_t), 0); \ 73 wait_queue_node_t *wait = (wait_queue_node_t *)kzalloc(sizeof(wait_queue_node_t), 0); \
|
/DragonOS-0.1.2/kernel/src/filesystem/VFS/ |
D | VFS.c | 56 new_dentry->name = kzalloc(target_dentry->name_length + 1, 0); in vfs_mount_fs() 160 char *tmpname = kzalloc(tmp_path_len + 1, 0); in vfs_path_walk() 274 char *buf = (char *)kzalloc(last_slash + 2, 0); in vfs_mkdir() 390 char *path = (char *)kzalloc(path_len, 0); in do_open() 494 struct vfs_file_t *file_ptr = (struct vfs_file_t *)kzalloc(sizeof(struct vfs_file_t), 0); in do_open() 576 …struct vfs_dir_entry_t *dentry = (struct vfs_dir_entry_t *)kzalloc(sizeof(struct vfs_dir_entry_t),… in vfs_alloc_dentry() 580 dentry->name = (char *)kzalloc(name_size, 0); in vfs_alloc_dentry() 659 char *buf = (char *)kzalloc(last_slash + 2, 0); in vfs_rmdir() 811 char *buf = (char *)kzalloc(last_slash + 1, 0); in do_unlink_at() 882 struct vfs_index_node_t *inode = kzalloc(sizeof(struct vfs_index_node_t), 0); in vfs_alloc_inode()
|
D | mount.c | 28 struct mountpoint *mp = (struct mountpoint *)kzalloc(sizeof(struct mountpoint), 0); in do_mount()
|
/DragonOS-0.1.2/kernel/src/ipc/ |
D | pipe.c | 116 pipe_ptr = (struct pipe_t *)kzalloc(sizeof(struct pipe_t), 0); in pipe_alloc() 147 read_file = (struct vfs_file_t *)kzalloc(sizeof(struct vfs_file_t), 0); in sys_pipe() 156 write_file = (struct vfs_file_t *)kzalloc(sizeof(struct vfs_file_t), 0); in sys_pipe()
|
/DragonOS-0.1.2/kernel/src/process/ |
D | kthread.c | 54 struct kthread_create_info_t *create = kzalloc(sizeof(struct kthread_create_info_t), 0); in __kthread_create_on_node() 95 char *full_name = kzalloc(1024, 0); in __kthread_create_on_node() 292 struct kthread_info_t *kt = kzalloc(sizeof(struct kthread_info_t), 0); in kthread_set_worker_private()
|
D | fork.c | 39 tsk = (struct process_control_block *)kzalloc(STACK_SIZE, 0); in do_fork()
|
/DragonOS-0.1.2/kernel/src/filesystem/procfs/ |
D | procfs.c | 118 struct procfs_file_private_data *fdata = kzalloc(sizeof(struct procfs_file_private_data), 0); in procfs_open() 122 fdata->rbuffer = kzalloc(FDATA_RBUF_SIZE, 0); in procfs_open() 289 char *name = (char *)kzalloc(target_dent->name_length + 1, 0); in procfs_readdir() 391 …struct procfs_inode_info_t *finode = (struct procfs_inode_info_t *)kzalloc(sizeof(struct procfs_in… in procfs_mkdir() 485 …struct procfs_inode_info_t *finode = (struct procfs_inode_info_t *)kzalloc(sizeof(struct procfs_in… in proc_create_file()
|
/DragonOS-0.1.2/kernel/src/mm/ |
D | slab.h | 69 static __always_inline void *kzalloc(size_t size, gfp_t gfp) in kzalloc() function
|
D | mmio-buddy.c | 43 (struct __mmio_buddy_addr_region *)kzalloc(sizeof(struct __mmio_buddy_addr_region), 0); in __mmio_buddy_create_region()
|
D | mm.c | 680 struct Page *p = (struct Page *)kzalloc(sizeof(struct Page), 0); in __create_mmio_page_struct()
|
/DragonOS-0.1.2/kernel/src/filesystem/fat32/ |
D | fat_ent.c | 27 uint32_t *buf = (uint32_t *)kzalloc(fsbi->bytes_per_sec, 0); in fat32_alloc_clusters() 157 uint32_t *buf = kzalloc(fsbi->bytes_per_sec, 0); in fat32_write_FAT_entry() 193 uint8_t *buf = kzalloc(fsbi->bytes_per_clus, 0); in fat32_find_empty_dentry() 258 void *tmp_buf = kzalloc(fsbi->bytes_per_clus, 0); in fat32_find_empty_dentry()
|
D | fat32.c | 63 uint8_t *buf = kzalloc(fsbi->bytes_per_clus, 0); in __fat32_search_long_short() 340 p->private_inode_info = (void *)kzalloc(sizeof(fat32_inode_info_t), 0); in fat32_lookup() 380 …struct vfs_superblock_t *sb_ptr = (struct vfs_superblock_t *)kzalloc(sizeof(struct vfs_superblock_… in fat32_read_superblock() 384 sb_ptr->private_sb_info = kzalloc(sizeof(fat32_sb_info_t), 0); in fat32_read_superblock() 870 …struct fat32_inode_info_t *finode = (struct fat32_inode_info_t *)kzalloc(sizeof(struct fat32_inode… in fat32_create() 1163 unsigned char *buf = (unsigned char *)kzalloc(fsbi->bytes_per_clus, 0); in fat32_readdir()
|
/DragonOS-0.1.2/docs/kernel/sched/ |
D | waiting.md | 93 | DECLARE_WAIT_ALLOC(name, pcb) | 使用`kzalloc`声明一个wait_queue节点,同时把pcb所代表的进程与该节点绑定,请记得使用kfree释放空间 | 94 | DECLARE_WAIT_ALLOC_SELF(name) | 使用`kzalloc`声明一个wait_queue节点,同时当前进程(即自身进程)与该节点绑定,请记得使用kfree释放…
|
/DragonOS-0.1.2/kernel/src/ |
D | main.c | 109 uchar *ptr = (uchar *)kzalloc(STACK_SIZE, 0) + STACK_SIZE; in system_initialize()
|
/DragonOS-0.1.2/kernel/src/filesystem/devfs/ |
D | devfs.c | 104 char *name = (char *)kzalloc(target_dent->name_length + 1, 0); in devfs_readdir() 228 …struct devfs_private_inode_info_t *private_info = (struct devfs_private_inode_info_t *)kzalloc(siz… in devfs_register_device()
|
/DragonOS-0.1.2/kernel/src/driver/usb/xhci/ |
D | xhci.c | 894 uint64_t device_context_vaddr = (uint64_t)kzalloc(xhci_hc[id].context_size * 32, 0); in xhci_initialize_slot() 1007 uint64_t input_ctx_buffer = (uint64_t)kzalloc(xhci_hc[id].context_size * 33, 0); in xhci_set_address() 1242 (uint64_t)kzalloc(16, 0); // 本来是要申请4bytes的buffer的,但是因为xhci控制器需要16bytes对齐,因此申请16bytes in xhci_control_in() 1250 data_buf_vaddr = (uint64_t)kzalloc(packet->length, 0); in xhci_control_in() 1314 uint64_t status_buf_vaddr = (uint64_t)kzalloc(16, 0); in xhci_control_out() 1323 data_buf_vaddr = (uint64_t)kzalloc(packet->length, 0); in xhci_control_out() 1734 uint64_t input_ctx_buffer = (uint64_t)kzalloc(xhci_hc[id].context_size * 33, 0); in xhci_configure_endpoint() 1810 full_conf = kzalloc(conf_desc.total_len, 0); in xhci_configure_port() 1854 void *hid_report_data = kzalloc(hid_desc->report_desc_len, 0); in xhci_configure_port() 2180 xhci_hc[cid].dcbaap_vaddr = (uint64_t)kzalloc(2048, 0); // 分配2KB的设备上下文地址数组空间 in xhci_init() [all …]
|
/DragonOS-0.1.2/kernel/src/driver/disk/ahci/ |
D | ahci.c | 66 …struct ahci_blk_private_data *data = (struct ahci_blk_private_data *)kzalloc(sizeof(struct ahci_bl… in __alloc_private_data() 67 data->part_table = (struct MBR_disk_partition_table_t *)kzalloc(512, 0); in __alloc_private_data() 119 …ahci_gendisk0.partition = (struct block_device *)kzalloc(ahci_gendisk0.part_cnt * sizeof(struct bl… in ahci_init_gendisk()
|
/DragonOS-0.1.2/kernel/src/filesystem/rootfs/ |
D | rootfs.c | 71 char *name = (char *)kzalloc(target_dent->name_length + 1, 0); in rootfs_readdir()
|
/DragonOS-0.1.2/kernel/src/driver/mouse/ |
D | ps2_mouse.c | 204 …ps2_mouse_buf_ptr = (struct ps2_mouse_input_buffer *)kzalloc(sizeof(struct ps2_mouse_input_buffer)… in ps2_mouse_init()
|