/DragonOS-0.1.8/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.8/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.8/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.8/kernel/src/mm/allocator/ |
D | kernel_allocator.rs | 10 ptr::NonNull, 19 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc() 47 unsafe fn free_in_buddy(&self, ptr: *mut u8, layout: Layout) { in free_in_buddy() 51 let phy_addr = MMArch::virt_2_phys(VirtAddr::new(ptr as usize)).unwrap(); in free_in_buddy() 62 .unwrap_or(core::ptr::null_mut() as *mut u8); in local_alloc() 69 let ptr: *mut u8 = x.as_mut_ptr(); in local_alloc_zeroed() localVariable 70 core::ptr::write_bytes(ptr, 0, x.len()); in local_alloc_zeroed() 71 ptr in local_alloc_zeroed() 73 .unwrap_or(core::ptr::null_mut() as *mut u8); in local_alloc_zeroed() 76 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout) { in local_dealloc() [all …]
|
D | slab.rs | 52 pub fn free(&mut self, ptr: *mut u8) { in free() 53 let ptr = ptr as *mut FreeBlock; in free() localVariable 55 self.free_block_list.push(&mut *ptr); in free()
|
/DragonOS-0.1.8/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.8/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) \ argument 81 __raw_try_cmpxchg((ptr), (old_ptr), (new), sizeof(*ptr)) 83 bool __try_cmpxchg_q(uint64_t *ptr, uint64_t *old_ptr, uint64_t *new_ptr);
|
/DragonOS-0.1.8/kernel/src/libs/ |
D | volatile.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), 150 VolatileReadable::vread(core::ptr::addr_of!((*$nonnull.as_ptr()).$field)) 169 VolatileWritable::vwrite(core::ptr::addr_of_mut!((*$nonnull.as_ptr()).$field), $value)
|
D | align.rs | 4 use core::{alloc::GlobalAlloc, fmt::Debug, ptr::Unique}; 51 let ptr = unsafe { KERNEL_ALLOCATOR.alloc_zeroed(Self::LAYOUT) }; in new_zeroed() localVariable 52 if ptr.is_null() { in new_zeroed() 56 inner: unsafe { Unique::new_unchecked(ptr.cast()) }, in new_zeroed() 79 core::ptr::drop_in_place(self.inner.as_ptr()); in drop()
|
D | atomic.rs | 2 use core::ptr::{read_volatile, write_volatile};
|
/DragonOS-0.1.8/kernel/src/ |
D | main.c | 107 uchar *ptr = (uchar *)kzalloc(STACK_SIZE, 0) + STACK_SIZE; in system_initialize() local 108 ((struct process_control_block *)(ptr - STACK_SIZE))->cpu_id = 0; in system_initialize() 110 initial_tss[0].ist1 = (ul)ptr; in system_initialize() 111 initial_tss[0].ist2 = (ul)ptr; in system_initialize() 112 initial_tss[0].ist3 = (ul)ptr; in system_initialize() 113 initial_tss[0].ist4 = (ul)ptr; in system_initialize() 114 initial_tss[0].ist5 = (ul)ptr; in system_initialize() 115 initial_tss[0].ist6 = (ul)ptr; in system_initialize() 116 initial_tss[0].ist7 = (ul)ptr; in system_initialize()
|
/DragonOS-0.1.8/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()
|
/DragonOS-0.1.8/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.8/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() 342 …struct scm_ui_framework_t *ptr = container_of(list_next(&scm_framework_list), struct scm_ui_framew… in scm_reinit() local 345 if (ptr->buf == &video_frame_buffer_info) in scm_reinit() 347 ptr->ui_ops->change(&video_frame_buffer_info); in scm_reinit() 349 } while (list_next(&ptr->list) != &scm_framework_list); in scm_reinit()
|
/DragonOS-0.1.8/user/libs/libc/src/include/export/ |
D | stdlib.h | 21 void free(void* ptr);
|
/DragonOS-0.1.8/kernel/src/filesystem/vfs/ |
D | mount.rs | 61 let ptr: *mut MountFS = Arc::into_raw(mount_fs) as *mut Self; in wrap() localVariable 63 (*ptr).self_ref = weak; in wrap() 65 return Arc::from_raw(ptr); in wrap() 94 let ptr: *mut MountFSInode = Arc::into_raw(inode) as *mut Self; in wrap() localVariable 96 (*ptr).self_ref = weak; in wrap() 99 return Arc::from_raw(ptr); in wrap()
|
/DragonOS-0.1.8/docs/userland/libc/apis/api-list/ |
D | stdlib.md | 10 ``void free(void *ptr)`` : 释放内存
|
/DragonOS-0.1.8/kernel/src/driver/acpi/ |
D | acpi.rs | 3 use core::ptr::{slice_from_raw_parts_mut, NonNull};
|
/DragonOS-0.1.8/kernel/src/process/ |
D | mod.rs | 2 ptr::null_mut,
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | c_adapter.rs | 91 let (ptr, len, cap) = space.into_raw_parts(); in do_kmalloc() 92 if !ptr.is_null() { in do_kmalloc() 93 let vaddr = VirtAddr::new(ptr as usize); in do_kmalloc()
|