include/linux/dma-fence-unwrap.h
Source file repositories/reference/linux-study-clean/include/linux/dma-fence-unwrap.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/dma-fence-unwrap.h- Extension
.h- Size
- 2368 bytes
- Lines
- 78
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct dma_fencestruct dma_fence_unwrap
Annotated Snippet
struct dma_fence_unwrap {
/**
* @chain: potential dma_fence_chain, but can be other fence as well
*/
struct dma_fence *chain;
/**
* @array: potential dma_fence_array, but can be other fence as well
*/
struct dma_fence *array;
/**
* @index: last returned index if @array is really a dma_fence_array
*/
unsigned int index;
};
struct dma_fence *dma_fence_unwrap_first(struct dma_fence *head,
struct dma_fence_unwrap *cursor);
struct dma_fence *dma_fence_unwrap_next(struct dma_fence_unwrap *cursor);
/**
* dma_fence_unwrap_for_each - iterate over all fences in containers
* @fence: current fence
* @cursor: current position inside the containers
* @head: starting point for the iterator
*
* Unwrap dma_fence_chain and dma_fence_array containers and deep dive into all
* potential fences in them. If @head is just a normal fence only that one is
* returned.
*/
#define dma_fence_unwrap_for_each(fence, cursor, head) \
for (fence = dma_fence_unwrap_first(head, cursor); fence; \
fence = dma_fence_unwrap_next(cursor))
struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences,
struct dma_fence **fences,
struct dma_fence_unwrap *cursors);
int dma_fence_dedup_array(struct dma_fence **array, int num_fences);
/**
* dma_fence_unwrap_merge - unwrap and merge fences
*
* All fences given as parameters are unwrapped and merged back together as flat
* dma_fence_array. Useful if multiple containers need to be merged together.
*
* Implemented as a macro to allocate the necessary arrays on the stack and
* account the stack frame size to the caller.
*
* Returns NULL on memory allocation failure, a dma_fence object representing
* all the given fences otherwise.
*/
#define dma_fence_unwrap_merge(...) \
({ \
struct dma_fence *__f[] = { __VA_ARGS__ }; \
struct dma_fence_unwrap __c[ARRAY_SIZE(__f)]; \
\
__dma_fence_unwrap_merge(ARRAY_SIZE(__f), __f, __c); \
})
#endif
Annotation
- Detected declarations: `struct dma_fence`, `struct dma_fence_unwrap`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.