Home
last modified time | relevance | path

Searched refs:ptr (Results 1 – 25 of 34) sorted by relevance

12

/DragonOS-0.1.2/kernel/src/driver/pci/
Dmsi.c111 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 …]
Dpci.c435 …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()
442ptr->Class_code, ptr->SubClass, ptr->Status, ((struct pci_device_structure_general_device_t *)ptr)… in pci_init()
443ptr->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.2/user/libs/libc/src/
Dmalloc.c76 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 …]
Dstdlib.h17 void free(void* ptr);
/DragonOS-0.1.2/kernel/src/libs/libELF/
Delf.c12 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.2/kernel/src/common/
Derr.h15 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()
Dlist.h137 #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 …]
Didr.h86 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…
Dglib.h27 #define container_of(ptr, type, member) \ argument
29 typeof(((type *)0)->member) *p = (ptr); \
/DragonOS-0.1.2/kernel/src/ktest/
Dtest-idr.c82 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.2/kernel/src/arch/x86_64/include/asm/
Dcmpxchg.h33 [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))
/DragonOS-0.1.2/kernel/src/mm/
Dallocator.rs10 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()
Dvma.c156 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()
Dmmio-buddy.c149 … struct __mmio_buddy_addr_region *ptr = container_of(list, struct __mmio_buddy_addr_region, list); in __buddy_merge() local
151 struct __mmio_buddy_addr_region *bd = __find_buddy(ptr, exp); in __buddy_merge()
159 list_del(&ptr->list); in __buddy_merge()
161 __buddy_merge_blocks(ptr, bd, exp); in __buddy_merge()
/DragonOS-0.1.2/kernel/src/
Dmain.c109 uchar *ptr = (uchar *)kzalloc(STACK_SIZE, 0) + STACK_SIZE; in system_initialize() local
110 ((struct process_control_block *)(ptr - STACK_SIZE))->cpu_id = 0; in system_initialize()
112 initial_tss[0].ist1 = (ul)ptr; in system_initialize()
113 initial_tss[0].ist2 = (ul)ptr; in system_initialize()
114 initial_tss[0].ist3 = (ul)ptr; in system_initialize()
115 initial_tss[0].ist4 = (ul)ptr; in system_initialize()
116 initial_tss[0].ist5 = (ul)ptr; in system_initialize()
117 initial_tss[0].ist6 = (ul)ptr; in system_initialize()
118 initial_tss[0].ist7 = (ul)ptr; in system_initialize()
/DragonOS-0.1.2/docs/kernel/core_api/
Ddata_structures.md406 4. 根据ID使用新的ptr替换旧的ptr
448 `int idr_alloc(struct idr *idp, void *ptr, int *id)`
453 &emsp;&emsp; 调用这个函数,需要您保证ptr是非空的,即: `ptr != NULL`, 否则将会影响 `idr_find/idr_find_next/idr_find_next_get…
460 **ptr**
478 &emsp;&emsp;删除一个id, 但是不释放对应的ptr指向的空间, 同时返回这个被删除id所对应的ptr
492 &emsp;&emsp;如果删除成功,就返回被删除id所对应的ptr;否则返回NULL。注意:如果这个id本来就和NULL绑定,那么也会返回NULL
598 `int idr_replace(struct idr *idp, void *ptr, int id)`
602 &emsp;&emsp;传进一个ptr,使用该ptr替换掉id所对应的Old_ptr。
609 **ptr**
623 `int idr_replace_get_old(struct idr *idp, void *ptr, int id, void **oldptr)`
[all …]
Dkernel_api.md129 ### `list_entry(ptr, type, member)`
133 &emsp;&emsp;该宏能通过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.2/kernel/src/driver/usb/xhci/
Dinternal.h76 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.2/kernel/src/libs/libUI/
Dscreen_manager.c248 …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.2/kernel/src/filesystem/devfs/
Dchardev.c55 char *ptr = devname + strlen(chardev_name_prefix[private_info->sub_type]); in __devfs_chardev_register() local
56 sprintk(ptr, "%d", chardev_manage_info[private_info->sub_type].count); in __devfs_chardev_register()
/DragonOS-0.1.2/kernel/src/arch/x86_64/asm/
Dirqflags.rs1 use core::{arch::asm, ptr::read_volatile};
/DragonOS-0.1.2/kernel/src/libs/
Datomic.rs2 use core::ptr::{read_volatile, write_volatile};
Dspinlock.rs2 use core::ptr::read_volatile;
Didr.c357 static int __idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id) in __idr_get_new_above_int() argument
368 stk[0]->ary[IDR_MASK & id] = ptr; in __idr_get_new_above_int()
383 int idr_alloc(struct idr *idp, void *ptr, int *id) in idr_alloc() argument
385 int rv = __idr_get_new_above_int(idp, ptr, 0); in idr_alloc()
657 void *ptr = idr_find_next_getid(idp, start_id, &nextid); in idr_find_next() local
659 return ptr; // 当 nextid == -1 时, 出现错误 in idr_find_next()
671 int idr_replace_get_old(struct idr *idp, void *ptr, int id, void **old_ptr) in idr_replace_get_old() argument
703 cur_layer->ary[__id] = ptr; in idr_replace_get_old()
716 int idr_replace(struct idr *idp, void *ptr, int id) in idr_replace() argument
723 int flags = idr_replace_get_old(idp, ptr, __id, &old_ptr); in idr_replace()
/DragonOS-0.1.2/docs/userland/libc/apis/api-list/
Dstdlib.md10 ``void free(void *ptr)`` : 释放内存

12