tools/include/asm-generic/io.h
Source file repositories/reference/linux-study-clean/tools/include/asm-generic/io.h
File Facts
- System
- Linux kernel
- Corpus path
tools/include/asm-generic/io.h- Extension
.h- Size
- 10928 bytes
- Lines
- 483
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
asm/barrier.hasm/byteorder.hlinux/compiler.hlinux/kernel.hlinux/types.h
Detected Declarations
function log_write_mmiofunction __raw_readwfunction __raw_readlfunction __raw_readqfunction __raw_writebfunction __raw_writewfunction __raw_writelfunction __raw_writeqfunction readbfunction readwfunction readlfunction readqfunction writebfunction writewfunction writelfunction writeqfunction readb_relaxedfunction readw_relaxedfunction readl_relaxedfunction readq_relaxedfunction writeb_relaxedfunction writew_relaxedfunction writel_relaxedfunction writeq_relaxedfunction readsbfunction readswfunction readslfunction readsqfunction writesbfunction writeswfunction writeslfunction writesq
Annotated Snippet
#ifndef _TOOLS_ASM_GENERIC_IO_H
#define _TOOLS_ASM_GENERIC_IO_H
#include <asm/barrier.h>
#include <asm/byteorder.h>
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/types.h>
#ifndef mmiowb_set_pending
#define mmiowb_set_pending() do { } while (0)
#endif
#ifndef __io_br
#define __io_br() barrier()
#endif
/* prevent prefetching of coherent DMA data ahead of a dma-complete */
#ifndef __io_ar
#ifdef rmb
#define __io_ar(v) rmb()
#else
#define __io_ar(v) barrier()
#endif
#endif
/* flush writes to coherent DMA data before possibly triggering a DMA read */
#ifndef __io_bw
#ifdef wmb
#define __io_bw() wmb()
#else
#define __io_bw() barrier()
#endif
#endif
/* serialize device access against a spin_unlock, usually handled there. */
#ifndef __io_aw
#define __io_aw() mmiowb_set_pending()
#endif
#ifndef __io_pbw
#define __io_pbw() __io_bw()
#endif
#ifndef __io_paw
#define __io_paw() __io_aw()
#endif
#ifndef __io_pbr
#define __io_pbr() __io_br()
#endif
#ifndef __io_par
#define __io_par(v) __io_ar(v)
#endif
#ifndef _THIS_IP_
#define _THIS_IP_ 0
#endif
static inline void log_write_mmio(u64 val, u8 width, volatile void __iomem *addr,
unsigned long caller_addr, unsigned long caller_addr0) {}
static inline void log_post_write_mmio(u64 val, u8 width, volatile void __iomem *addr,
unsigned long caller_addr, unsigned long caller_addr0) {}
static inline void log_read_mmio(u8 width, const volatile void __iomem *addr,
unsigned long caller_addr, unsigned long caller_addr0) {}
static inline void log_post_read_mmio(u64 val, u8 width, const volatile void __iomem *addr,
unsigned long caller_addr, unsigned long caller_addr0) {}
/*
* __raw_{read,write}{b,w,l,q}() access memory in native endianness.
*
* On some architectures memory mapped IO needs to be accessed differently.
* On the simple architectures, we just read/write the memory location
* directly.
*/
#ifndef __raw_readb
#define __raw_readb __raw_readb
static inline u8 __raw_readb(const volatile void __iomem *addr)
{
return *(const volatile u8 __force *)addr;
}
#endif
#ifndef __raw_readw
#define __raw_readw __raw_readw
static inline u16 __raw_readw(const volatile void __iomem *addr)
{
Annotation
- Immediate include surface: `asm/barrier.h`, `asm/byteorder.h`, `linux/compiler.h`, `linux/kernel.h`, `linux/types.h`.
- Detected declarations: `function log_write_mmio`, `function __raw_readw`, `function __raw_readl`, `function __raw_readq`, `function __raw_writeb`, `function __raw_writew`, `function __raw_writel`, `function __raw_writeq`, `function readb`, `function readw`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.