arch/alpha/kernel/io.c
Source file repositories/reference/linux-study-clean/arch/alpha/kernel/io.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/kernel/io.c- Extension
.c- Size
- 13792 bytes
- Lines
- 714
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/types.hlinux/string.hlinux/module.hasm/io.hasm/vga.h
Detected Declarations
struct Sstruct Sfunction ioread8function ioread16function ioread32function ioread64function iowrite8function iowrite16function iowrite32function iowrite64function inbfunction inwfunction inlfunction outbfunction outwfunction outlfunction __raw_readbfunction __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 ioread8_repfunction insbfunction inwfunction inswfunction inlfunction inslfunction wayfunction outsbfunction outwfunction outswfunction outlfunction outsl
Annotated Snippet
struct S { int x __attribute__((packed)); };
((struct S *)dst)->x = ioread32(port);
dst += 4;
}
} else {
/* Buffer 32-bit aligned. */
while (count--) {
*(unsigned int *)dst = ioread32(port);
dst += 4;
}
}
}
void insl(unsigned long port, void *dst, unsigned long count)
{
ioread32_rep(ioport_map(port, 4), dst, count);
}
EXPORT_SYMBOL(ioread32_rep);
EXPORT_SYMBOL(insl);
/*
* Like insb but in the opposite direction.
* Don't worry as much about doing aligned memory transfers:
* doing byte reads the "slow" way isn't nearly as slow as
* doing byte writes the slow way (no r-m-w cycle).
*/
void iowrite8_rep(void __iomem *port, const void *xsrc, unsigned long count)
{
const unsigned char *src = xsrc;
while (count--)
iowrite8(*src++, port);
}
void outsb(unsigned long port, const void *src, unsigned long count)
{
iowrite8_rep(ioport_map(port, 1), src, count);
}
EXPORT_SYMBOL(iowrite8_rep);
EXPORT_SYMBOL(outsb);
/*
* Like insw but in the opposite direction. This is used by the IDE
* driver to write disk sectors. Performance is important, but the
* interfaces seems to be slow: just using the inlined version of the
* outw() breaks things.
*/
void iowrite16_rep(void __iomem *port, const void *src, unsigned long count)
{
if (unlikely((unsigned long)src & 0x3)) {
if (!count)
return;
BUG_ON((unsigned long)src & 0x1);
iowrite16(*(unsigned short *)src, port);
src += 2;
--count;
}
while (count >= 2) {
unsigned int w;
count -= 2;
w = *(unsigned int *)src;
src += 4;
iowrite16(w >> 0, port);
iowrite16(w >> 16, port);
}
if (count) {
iowrite16(*(unsigned short *)src, port);
}
}
void outsw(unsigned long port, const void *src, unsigned long count)
{
iowrite16_rep(ioport_map(port, 2), src, count);
}
EXPORT_SYMBOL(iowrite16_rep);
EXPORT_SYMBOL(outsw);
/*
* Like insl but in the opposite direction. This is used by the IDE
* driver to write disk sectors. Works with any alignment in SRC.
* Performance is important, but the interfaces seems to be slow:
* just using the inlined version of the outl() breaks things.
*/
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/string.h`, `linux/module.h`, `asm/io.h`, `asm/vga.h`.
- Detected declarations: `struct S`, `struct S`, `function ioread8`, `function ioread16`, `function ioread32`, `function ioread64`, `function iowrite8`, `function iowrite16`, `function iowrite32`, `function iowrite64`.
- Atlas domain: Architecture Layer / arch/alpha.
- Implementation status: integration 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.