arch/powerpc/kernel/io.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/io.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/io.c- Extension
.c- Size
- 3779 bytes
- Lines
- 213
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
Dependency Surface
linux/kernel.hlinux/types.hlinux/compiler.hlinux/export.hasm/io.hasm/firmware.hasm/bug.h
Detected Declarations
function _insbfunction _outsbfunction _inswfunction _outswfunction _inslfunction _outslfunction _memset_iofunction _memcpy_fromiofunction _memcpy_toioexport _insbexport _outsbexport _inswexport _outswexport _inslexport _outslexport _memset_ioexport _memcpy_fromioexport _memcpy_toio
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* I/O string operations
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
* Copyright (C) 2006 IBM Corporation
*
* Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
* and Paul Mackerras.
*
* Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
* PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
*
* Rewritten in C by Stephen Rothwell.
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/export.h>
#include <asm/io.h>
#include <asm/firmware.h>
#include <asm/bug.h>
/* See definition in io.h */
bool isa_io_special;
void _insb(const volatile u8 __iomem *port, void *buf, long count)
{
u8 *tbuf = buf;
u8 tmp;
if (unlikely(count <= 0))
return;
mb();
do {
tmp = *(const volatile u8 __force *)port;
eieio();
*tbuf++ = tmp;
} while (--count != 0);
data_barrier(tmp);
}
EXPORT_SYMBOL(_insb);
void _outsb(volatile u8 __iomem *port, const void *buf, long count)
{
const u8 *tbuf = buf;
if (unlikely(count <= 0))
return;
mb();
do {
*(volatile u8 __force *)port = *tbuf++;
} while (--count != 0);
mb();
}
EXPORT_SYMBOL(_outsb);
void _insw(const volatile u16 __iomem *port, void *buf, long count)
{
u16 *tbuf = buf;
u16 tmp;
if (unlikely(count <= 0))
return;
mb();
do {
tmp = *(const volatile u16 __force *)port;
eieio();
*tbuf++ = tmp;
} while (--count != 0);
data_barrier(tmp);
}
EXPORT_SYMBOL(_insw);
void _outsw(volatile u16 __iomem *port, const void *buf, long count)
{
const u16 *tbuf = buf;
if (unlikely(count <= 0))
return;
mb();
do {
*(volatile u16 __force *)port = *tbuf++;
} while (--count != 0);
mb();
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/compiler.h`, `linux/export.h`, `asm/io.h`, `asm/firmware.h`, `asm/bug.h`.
- Detected declarations: `function _insb`, `function _outsb`, `function _insw`, `function _outsw`, `function _insl`, `function _outsl`, `function _memset_io`, `function _memcpy_fromio`, `function _memcpy_toio`, `export _insb`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.