/DragonOS-0.1.5/kernel/src/driver/pci/ |
D | msi.c | 111 uint64_t *ptr = in __msix_set_entry() local 113 *ptr = ((uint64_t)(msi_desc->msg.address_hi) << 32) | (msi_desc->msg.address_lo); in __msix_set_entry() 115 ++ptr; in __msix_set_entry() 117 *ptr = ((uint64_t)(msi_desc->msg.vector_control) << 32) | (msi_desc->msg.data); in __msix_set_entry() 129 uint64_t *ptr = (uint64_t *)(pci_dev->msix_mmio_vaddr + pci_dev->msix_offset + msi_index * 16); in __msix_clear_entry() local 130 *ptr = 0; in __msix_clear_entry() 131 ++ptr; in __msix_clear_entry() 132 *ptr = 0; in __msix_clear_entry() 148 struct pci_device_structure_header_t *ptr = msi_desc->pci_dev; in pci_enable_msi() local 157 cap_ptr = pci_enumerate_capability_list(ptr, 0x11); in pci_enable_msi() [all …]
|
D | pci.c | 435 …struct pci_device_structure_header_t *ptr = container_of(pci_device_structure_list, struct pci_dev… in pci_init() local 438 if (ptr->HeaderType == 0x0) in pci_init() 440 if (ptr->Status & 0x10) in pci_init() 442 …ptr->Class_code, ptr->SubClass, ptr->Status, ((struct pci_device_structure_general_device_t *)ptr)… in pci_init() 443 … ptr->Vendor_ID, ptr->Device_ID); in pci_init() 444 …uint32_t tmp = pci_read_config(ptr->bus, ptr->device, ptr->func, ((struct pci_device_structure_gen… in pci_init() 449 …e %d ] class code = %d\tsubclass=%d\tstatus=%#010lx\t", i, ptr->Class_code, ptr->SubClass, ptr->St… in pci_init() 452 else if (ptr->HeaderType == 0x1) in pci_init() 454 if (ptr->Status & 0x10) in pci_init() 456 …tcap_pointer=%#010lx", i, ptr->Class_code, ptr->SubClass, ptr->Status, ((struct pci_device_structu… in pci_init() [all …]
|
/DragonOS-0.1.5/user/libs/libc/src/ |
D | malloc.c | 76 malloc_mem_chunk_t *ptr = malloc_free_list; in malloc_query_free_chunk_bf() local 79 while (ptr != NULL) in malloc_query_free_chunk_bf() 82 if (ptr->length == size) in malloc_query_free_chunk_bf() 84 best = ptr; in malloc_query_free_chunk_bf() 88 if (ptr->length > size) in malloc_query_free_chunk_bf() 91 best = ptr; in malloc_query_free_chunk_bf() 92 else if (best->length > ptr->length) in malloc_query_free_chunk_bf() 93 best = ptr; in malloc_query_free_chunk_bf() 95 ptr = ptr->next; in malloc_query_free_chunk_bf() 111 malloc_mem_chunk_t *ptr = malloc_free_list; in malloc_query_free_chunk_ff() local [all …]
|
/DragonOS-0.1.5/kernel/src/libs/libELF/ |
D | elf.c | 12 Elf32_Ehdr *ptr = (Elf32_Ehdr *)ehdr; in elf_check() local 13 …bool flag = ptr->e_ident[EI_MAG0] == ELFMAG0 && ptr->e_ident[EI_MAG1] == ELFMAG1 && ptr->e_ident[E… in elf_check() 20 if (ptr->e_ident[EI_CLASS] == 0 || ptr->e_ident[EI_CLASS] > 2) in elf_check() 24 if (ptr->e_ident[EI_DATA] == 0 || ptr->e_ident[EI_DATA] > 2) in elf_check() 28 if(ptr->e_ident[EI_VERSION]==EV_NONE) in elf_check()
|
/DragonOS-0.1.5/kernel/src/common/ |
D | err.h | 15 static inline long __must_check IS_ERR(const void* ptr) in IS_ERR() argument 17 return IS_ERR_VALUE((uint64_t)ptr); in IS_ERR() 27 static inline long __must_check IS_ERR_OR_NULL(const void* ptr) in IS_ERR_OR_NULL() argument 29 return !ptr || IS_ERR_VALUE((uint64_t)ptr); in IS_ERR_OR_NULL() 43 static inline long __must_check PTR_ERR(void * ptr) in PTR_ERR() argument 45 return (long)ptr; in PTR_ERR()
|
D | list.h | 137 #define list_entry(ptr, type, member) container_of(ptr, type, member) argument 147 #define list_first_entry(ptr, type, member) list_entry((ptr)->next, type, member) argument 157 #define list_first_entry_or_null(ptr, type, member) (!list_empty(ptr) ? list_entry((ptr)->next, typ… argument 167 #define list_last_entry(ptr, type, member) list_entry((ptr)->prev, type, member) argument 177 #define list_last_entry_or_full(ptr, type, member) (!list_empty(ptr) ? list_entry((ptr)->prev, type… argument 201 #define list_for_each(ptr, head) \ argument 202 for ((ptr) = (head)->next; (ptr) != (head); (ptr) = (ptr)->next) 210 #define list_for_each_prev(ptr, head) \ argument 211 for ((ptr) = (head)->prev; (ptr) != (head); (ptr) = (ptr)->prev) 221 #define list_for_each_safe(ptr, n, head) \ argument [all …]
|
D | idr.h | 86 int idr_alloc(struct idr *idp, void *ptr, int *id); 93 int idr_replace_get_old(struct idr *idp, void *ptr, int id, void **oldptr); 94 int idr_replace(struct idr *idp, void *ptr, int id); 111 #define for_each_idr_entry(idp, id, ptr) \ argument 112 …for (id = -1, ptr = idr_find_next_getid(idp, id, &id); ptr != NULL || !idr_count(idp, id); ptr = i… 120 #define for_each_idr_entry_continue(idp, id, ptr) \ argument 121 …for (ptr = idr_find_next_getid(idp, id - 1, &id); ptr != NULL || !idr_count(idp, id); ptr = idr_fi…
|
/DragonOS-0.1.5/kernel/src/libs/ |
D | volatile_io.rs | 3 unsafe { core::ptr::read_volatile(core::ptr::addr_of!($data)) } 9 unsafe { core::ptr::write_volatile(core::ptr::addr_of_mut!($data), $value) } 21 true => core::ptr::read_volatile(core::ptr::addr_of!($data)) | $val, 22 false => core::ptr::read_volatile(core::ptr::addr_of!($data)) & (!$val),
|
D | atomic.rs | 2 use core::ptr::{read_volatile, write_volatile};
|
/DragonOS-0.1.5/kernel/src/arch/x86_64/include/asm/ |
D | cmpxchg.h | 33 [ptr] "+m"(*__ptr), \ 44 [ptr] "+m"(*__ptr), \ 55 [ptr] "+m"(*__ptr), \ 66 [ptr] "+m"(*__ptr), \ 80 #define arch_try_cmpxchg(ptr, old_ptr, new_ptr) \ argument 81 __raw_try_cmpxchg((ptr), (old_ptr), (new_ptr), sizeof(*ptr)) 83 bool __try_cmpxchg_q(uint64_t *ptr, uint64_t *old_ptr, uint64_t *new_ptr);
|
/DragonOS-0.1.5/kernel/src/ktest/ |
D | test-idr.c | 82 int *ptr = idr_find(&k_idr, a[i]); in ktest_idr_case1() local 83 assert(ptr == &a[i]); in ktest_idr_case1() 84 assert(ptr != NULL); in ktest_idr_case1() 85 assert(*ptr == a[i]); in ktest_idr_case1() 155 int *ptr = idr_find(&k_idr, a[i]); in ktest_idr_case1() local 156 assert(ptr == &a[i]); in ktest_idr_case1() 157 assert(*ptr == a[i]); in ktest_idr_case1() 206 int *ptr = idr_find(&k_idr, i); in ktest_idr_case2() local 208 assert(ptr != NULL); in ktest_idr_case2() 209 assert(*ptr == i); in ktest_idr_case2() [all …]
|
/DragonOS-0.1.5/kernel/src/mm/ |
D | allocator.rs | 10 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc() 19 return core::ptr::null_mut(); in local_alloc() 26 return core::ptr::null_mut(); in local_alloc_zeroed() 31 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout) { in local_dealloc() 32 kfree(ptr as *mut ::core::ffi::c_void); in local_dealloc() 46 unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { in dealloc() 47 self.local_dealloc(ptr, layout); in dealloc()
|
D | vma.c | 156 struct vm_area_struct *ptr = mm->vmas; in vma_insert() local 157 while (ptr) in vma_insert() 159 if (ptr->vm_next) in vma_insert() 160 ptr = ptr->vm_next; in vma_insert() 163 prev = ptr; in vma_insert()
|
/DragonOS-0.1.5/kernel/src/ |
D | main.c | 102 uchar *ptr = (uchar *)kzalloc(STACK_SIZE, 0) + STACK_SIZE; in system_initialize() local 103 ((struct process_control_block *)(ptr - STACK_SIZE))->cpu_id = 0; in system_initialize() 105 initial_tss[0].ist1 = (ul)ptr; in system_initialize() 106 initial_tss[0].ist2 = (ul)ptr; in system_initialize() 107 initial_tss[0].ist3 = (ul)ptr; in system_initialize() 108 initial_tss[0].ist4 = (ul)ptr; in system_initialize() 109 initial_tss[0].ist5 = (ul)ptr; in system_initialize() 110 initial_tss[0].ist6 = (ul)ptr; in system_initialize() 111 initial_tss[0].ist7 = (ul)ptr; in system_initialize()
|
/DragonOS-0.1.5/kernel/src/arch/x86_64/asm/ |
D | cmpxchg.rs | 3 fn __try_cmpxchg_q(ptr: *mut u64, old_ptr: *mut u64, new_ptr: *mut u64) -> bool; in __try_cmpxchg_q() 9 pub unsafe fn try_cmpxchg_q(ptr: *mut u64, old_ptr: *mut u64, new_ptr: *mut u64) -> bool { in try_cmpxchg_q() 10 let retval = __try_cmpxchg_q(ptr, old_ptr, new_ptr); in try_cmpxchg_q()
|
D | cmpxchg.c | 3 bool __try_cmpxchg_q(uint64_t *ptr, uint64_t *old_ptr, uint64_t *new_ptr) in __try_cmpxchg_q() argument 5 bool success = __raw_try_cmpxchg(ptr, old_ptr, *new_ptr, 8); in __try_cmpxchg_q()
|
D | irqflags.rs | 1 use core::{arch::asm, ptr::read_volatile};
|
/DragonOS-0.1.5/docs/kernel/core_api/ |
D | data_structures.md | 406 4. 根据ID使用新的ptr替换旧的ptr 448 `int idr_alloc(struct idr *idp, void *ptr, int *id)` 453    调用这个函数,需要您保证ptr是非空的,即: `ptr != NULL`, 否则将会影响 `idr_find/idr_find_next/idr_find_next_get… 460 **ptr** 478   删除一个id, 但是不释放对应的ptr指向的空间, 同时返回这个被删除id所对应的ptr。 492   如果删除成功,就返回被删除id所对应的ptr;否则返回NULL。注意:如果这个id本来就和NULL绑定,那么也会返回NULL 598 `int idr_replace(struct idr *idp, void *ptr, int id)` 602   传进一个ptr,使用该ptr替换掉id所对应的Old_ptr。 609 **ptr** 623 `int idr_replace_get_old(struct idr *idp, void *ptr, int id, void **oldptr)` [all …]
|
D | kernel_api.md | 129 ### `list_entry(ptr, type, member)` 133   该宏能通过ptr指向的List获取到List所处的结构体的地址 137 **ptr** 149 ### `list_first_entry(ptr, type, member)` 159 ### `list_first_entry_or_null(ptr, type, member)` 169 ### `list_last_entry(ptr, type, member)` 179 ### `list_last_entry_or_full(ptr, type, member)` 217 ### `list_for_each(ptr, head)` 225 **ptr** 233 ### `list_for_each_prev(ptr, head)` [all …]
|
/DragonOS-0.1.5/kernel/src/filesystem/vfs/ |
D | syscall.rs | 173 let ptr = regs.r8 as usize as *const c_char; in sys_chdir() localVariable 175 if ptr.is_null() in sys_chdir() 176 || (user_mode(regs) && unsafe { !verify_area(ptr as u64, PAGE_2M_SIZE as u64) }) in sys_chdir() 181 let dest_path: &CStr = unsafe { CStr::from_ptr(ptr) }; in sys_chdir() 265 let ptr = regs.r8 as usize as *const c_char; in sys_mkdir() localVariable 266 if ptr.is_null() in sys_mkdir() 267 || (user_mode(regs) && unsafe { !verify_area(ptr as u64, PAGE_2M_SIZE as u64) }) in sys_mkdir() 271 let path: &CStr = unsafe { CStr::from_ptr(ptr) }; in sys_mkdir() 305 let ptr = regs.r9 as usize as *const c_char; in sys_unlink_at() localVariable 306 if ptr.is_null() in sys_unlink_at() [all …]
|
/DragonOS-0.1.5/kernel/src/driver/usb/xhci/ |
D | internal.h | 76 struct xhci_TRB_normal_t *ptr = (struct xhci_TRB_normal_t *)(trb_vaddr); \ 77 ptr->TRB_type = TRB_TYPE_LINK; \ 78 ptr->ioc = 0; \ 79 ptr->chain = 0; \ 80 ptr->ent = 0; \ 81 ptr->cycle = 1; \
|
/DragonOS-0.1.5/kernel/src/libs/libUI/ |
D | screen_manager.c | 248 …struct scm_ui_framework_t *ptr = container_of(list_next(&scm_framework_list), struct scm_ui_framew… in scm_enable_double_buffer() local 252 if (ptr->buf == &video_frame_buffer_info) in scm_enable_double_buffer() 260 if (ptr->ui_ops->change(buf) != 0) // 这里的change回调函数不会是空指针吗 问题2 in scm_enable_double_buffer() 268 } while (list_next(&ptr->list) != &scm_framework_list); // 枚举链表的每一个ui框架 in scm_enable_double_buffer() 315 …struct scm_ui_framework_t *ptr = container_of(list_next(&scm_framework_list), struct scm_ui_framew… in scm_reinit() local 318 if (ptr->buf == &video_frame_buffer_info) in scm_reinit() 320 ptr->ui_ops->change(&video_frame_buffer_info); in scm_reinit() 322 } while (list_next(&ptr->list) != &scm_framework_list); in scm_reinit()
|
/DragonOS-0.1.5/user/libs/libc/src/include/export/ |
D | stdlib.h | 21 void free(void* ptr);
|
/DragonOS-0.1.5/kernel/src/driver/virtio/ |
D | volatile.rs | 81 VolatileReadable::vread(core::ptr::addr_of!((*$nonnull.as_ptr()).$field)) 100 VolatileWritable::vwrite(core::ptr::addr_of_mut!((*$nonnull.as_ptr()).$field), $value)
|
/DragonOS-0.1.5/kernel/src/arch/x86_64/mm/ |
D | mod.rs | 5 use core::ptr::read_volatile;
|