include/linux/mmiotrace.h
Source file repositories/reference/linux-study-clean/include/linux/mmiotrace.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mmiotrace.h- Extension
.h- Size
- 3122 bytes
- Lines
- 113
- 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
linux/types.hlinux/list.h
Detected Declarations
struct kmmio_probestruct pt_regsstruct kmmio_probestruct mmiotrace_rwstruct mmiotrace_mapenum mm_io_opcodefunction is_kmmio_activefunction is_kmmio_activefunction kmmio_handlerfunction mmiotrace_ioremap
Annotated Snippet
struct kmmio_probe {
/* kmmio internal list: */
struct list_head list;
/* start location of the probe point: */
unsigned long addr;
/* length of the probe region: */
unsigned long len;
/* Called before addr is executed: */
kmmio_pre_handler_t pre_handler;
/* Called after addr is executed: */
kmmio_post_handler_t post_handler;
void *private;
};
extern unsigned int kmmio_count;
extern int register_kmmio_probe(struct kmmio_probe *p);
extern void unregister_kmmio_probe(struct kmmio_probe *p);
extern int kmmio_init(void);
extern void kmmio_cleanup(void);
#ifdef CONFIG_MMIOTRACE
/* kmmio is active by some kmmio_probes? */
static inline int is_kmmio_active(void)
{
return kmmio_count;
}
/* Called from page fault handler. */
extern int kmmio_handler(struct pt_regs *regs, unsigned long addr);
/* Called from ioremap.c */
extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
void __iomem *addr);
extern void mmiotrace_iounmap(volatile void __iomem *addr);
/* For anyone to insert markers. Remember trailing newline. */
extern __printf(1, 2) int mmiotrace_printk(const char *fmt, ...);
#else /* !CONFIG_MMIOTRACE: */
static inline int is_kmmio_active(void)
{
return 0;
}
static inline int kmmio_handler(struct pt_regs *regs, unsigned long addr)
{
return 0;
}
static inline void mmiotrace_ioremap(resource_size_t offset,
unsigned long size, void __iomem *addr)
{
}
static inline void mmiotrace_iounmap(volatile void __iomem *addr)
{
}
static inline __printf(1, 2) int mmiotrace_printk(const char *fmt, ...)
{
return 0;
}
#endif /* CONFIG_MMIOTRACE */
enum mm_io_opcode {
MMIO_READ = 0x1, /* struct mmiotrace_rw */
MMIO_WRITE = 0x2, /* struct mmiotrace_rw */
MMIO_PROBE = 0x3, /* struct mmiotrace_map */
MMIO_UNPROBE = 0x4, /* struct mmiotrace_map */
MMIO_UNKNOWN_OP = 0x5, /* struct mmiotrace_rw */
};
struct mmiotrace_rw {
resource_size_t phys; /* PCI address of register */
unsigned long value;
unsigned long pc; /* optional program counter */
int map_id;
unsigned char opcode; /* one of MMIO_{READ,WRITE,UNKNOWN_OP} */
unsigned char width; /* size of register access in bytes */
};
struct mmiotrace_map {
resource_size_t phys; /* base address in PCI space */
unsigned long virt; /* base virtual address */
unsigned long len; /* mapping size */
int map_id;
unsigned char opcode; /* MMIO_PROBE or MMIO_UNPROBE */
};
/* in kernel/trace/trace_mmiotrace.c */
Annotation
- Immediate include surface: `linux/types.h`, `linux/list.h`.
- Detected declarations: `struct kmmio_probe`, `struct pt_regs`, `struct kmmio_probe`, `struct mmiotrace_rw`, `struct mmiotrace_map`, `enum mm_io_opcode`, `function is_kmmio_active`, `function is_kmmio_active`, `function kmmio_handler`, `function mmiotrace_ioremap`.
- 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.