arch/powerpc/include/asm/io.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/io.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/io.h- Extension
.h- Size
- 28119 bytes
- Lines
- 975
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/compiler.hlinux/mm.hasm/page.hasm/byteorder.hasm/synch.hasm/delay.hasm/mmiowb.hasm/mmu.hasm/eeh.hasm/io-defs.hasm-generic/io.h
Detected Declarations
struct pci_devfunction in_le64function out_le64function in_be64function out_be64function __raw_rm_writebfunction __raw_rm_writewfunction __raw_rm_writelfunction __raw_rm_writeqfunction __raw_rm_writeq_befunction __raw_rm_readbfunction __raw_rm_readwfunction __raw_rm_readlfunction __raw_rm_readqfunction eeh_memcpy_fromiofunction readwfunction readlfunction readw_befunction readl_befunction writebfunction writewfunction writelfunction writew_befunction writel_befunction readsbfunction readswfunction readslfunction writesbfunction writeswfunction writeslfunction memset_iofunction memcpy_fromiofunction memcpy_toiofunction readqfunction readq_befunction writeqfunction writeq_befunction ioread16befunction ioread32befunction ioread64befunction iowrite16befunction iowrite32befunction iowrite64befunction iosyncfunction physicalfunction phys_to_virtfunction virt_to_busfunction bus_to_virt
Annotated Snippet
#ifndef _ASM_POWERPC_IO_H
#define _ASM_POWERPC_IO_H
#ifdef __KERNEL__
/*
*/
/* Check of existence of legacy devices */
extern int check_legacy_ioport(unsigned long base_port);
#define I8042_DATA_REG 0x60
#define FDC_BASE 0x3f0
#if defined(CONFIG_PPC64) && defined(CONFIG_PCI)
extern struct pci_dev *isa_bridge_pcidev;
/*
* has legacy ISA devices ?
*/
#define arch_has_dev_port() (isa_bridge_pcidev != NULL || isa_io_special)
#endif
#include <linux/device.h>
#include <linux/compiler.h>
#include <linux/mm.h>
#include <asm/page.h>
#include <asm/byteorder.h>
#include <asm/synch.h>
#include <asm/delay.h>
#include <asm/mmiowb.h>
#include <asm/mmu.h>
#define SIO_CONFIG_RA 0x398
#define SIO_CONFIG_RD 0x399
/* 32 bits uses slightly different variables for the various IO
* bases. Most of this file only uses _IO_BASE though which we
* define properly based on the platform
*/
#ifndef CONFIG_PCI
#define _IO_BASE POISON_POINTER_DELTA
#define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0
#elif defined(CONFIG_PPC32)
#define _IO_BASE isa_io_base
#define _ISA_MEM_BASE isa_mem_base
#define PCI_DRAM_OFFSET pci_dram_offset
#else
#define _IO_BASE pci_io_base
#define _ISA_MEM_BASE isa_mem_base
#define PCI_DRAM_OFFSET 0
#endif
extern unsigned long isa_io_base;
extern unsigned long pci_io_base;
extern unsigned long pci_dram_offset;
extern resource_size_t isa_mem_base;
/* Boolean set by platform if PIO accesses are suppored while _IO_BASE
* is not set or addresses cannot be translated to MMIO. This is typically
* set when the platform supports "special" PIO accesses via a non memory
* mapped mechanism, and allows things like the early udbg UART code to
* function.
*/
extern bool isa_io_special;
#ifdef CONFIG_PPC32
#ifdef CONFIG_PPC_INDIRECT_PIO
#error CONFIG_PPC_INDIRECT_PIO is not yet supported on 32 bits
#endif
#endif
/*
*
* Low level MMIO accessors
*
* This provides the non-bus specific accessors to MMIO. Those are PowerPC
* specific and thus shouldn't be used in generic code. The accessors
* provided here are:
*
* in_8, in_le16, in_be16, in_le32, in_be32, in_le64, in_be64
* out_8, out_le16, out_be16, out_le32, out_be32, out_le64, out_be64
* _insb, _insw, _insl, _outsb, _outsw, _outsl
*
* Those operate directly on a kernel virtual address. Note that the prototype
* for the out_* accessors has the arguments in opposite order from the usual
* linux PCI accessors. Unlike those, they take the address first and the value
* next.
*/
/* -mprefixed can generate offsets beyond range, fall back hack */
Annotation
- Immediate include surface: `linux/device.h`, `linux/compiler.h`, `linux/mm.h`, `asm/page.h`, `asm/byteorder.h`, `asm/synch.h`, `asm/delay.h`, `asm/mmiowb.h`.
- Detected declarations: `struct pci_dev`, `function in_le64`, `function out_le64`, `function in_be64`, `function out_be64`, `function __raw_rm_writeb`, `function __raw_rm_writew`, `function __raw_rm_writel`, `function __raw_rm_writeq`, `function __raw_rm_writeq_be`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.