include/linux/iommu-helper.h
Source file repositories/reference/linux-study-clean/include/linux/iommu-helper.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/iommu-helper.h- Extension
.h- Size
- 1146 bytes
- Lines
- 45
- 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.
Dependency Surface
linux/bug.hlinux/log2.hlinux/math.hlinux/types.h
Detected Declarations
function iommu_device_max_indexfunction iommu_is_span_boundaryfunction iommu_num_pages
Annotated Snippet
#ifndef _LINUX_IOMMU_HELPER_H
#define _LINUX_IOMMU_HELPER_H
#include <linux/bug.h>
#include <linux/log2.h>
#include <linux/math.h>
#include <linux/types.h>
static inline unsigned long iommu_device_max_index(unsigned long size,
unsigned long offset,
u64 dma_mask)
{
if (size + offset > dma_mask)
return dma_mask - offset + 1;
else
return size;
}
static inline int iommu_is_span_boundary(unsigned int index, unsigned int nr,
unsigned long shift, unsigned long boundary_size)
{
BUG_ON(!is_power_of_2(boundary_size));
shift = (shift + index) & (boundary_size - 1);
return shift + nr > boundary_size;
}
extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
unsigned long start, unsigned int nr,
unsigned long shift,
unsigned long boundary_size,
unsigned long align_mask);
static inline unsigned long iommu_num_pages(unsigned long addr,
unsigned long len,
unsigned long io_page_size)
{
unsigned long size = (addr & (io_page_size - 1)) + len;
return DIV_ROUND_UP(size, io_page_size);
}
#endif
Annotation
- Immediate include surface: `linux/bug.h`, `linux/log2.h`, `linux/math.h`, `linux/types.h`.
- Detected declarations: `function iommu_device_max_index`, `function iommu_is_span_boundary`, `function iommu_num_pages`.
- 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.