arch/alpha/include/asm/io.h
Source file repositories/reference/linux-study-clean/arch/alpha/include/asm/io.h
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/include/asm/io.h- Extension
.h- Size
- 16069 bytes
- Lines
- 654
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- 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.
Dependency Surface
linux/kernel.hlinux/mm.hasm/compiler.hasm/machvec.hasm/hwrpb.hasm/core_cia.hasm/core_irongate.hasm/core_marvel.hasm/core_mcpcia.hasm/core_polaris.hasm/core_t2.hasm/core_tsunami.hasm/core_titan.hasm/core_wildfire.hasm-generic/io.h
Detected Declarations
function updatesfunction set_haefunction virt_to_physfunction phys_to_virtfunction virt_to_physfunction phys_to_virtfunction isa_virt_to_busfunction isa_bus_to_virtfunction generic_iounmapfunction generic_is_ioaddrfunction generic_is_mmiofunction ioport_unmapfunction iounmapfunction __is_ioaddrfunction __is_mmiofunction ioread8function ioread16function iowrite8function iowrite16function inbfunction inwfunction outbfunction outwfunction ioread32function ioread64function iowrite32function iowrite64function inlfunction outlfunction __raw_readbfunction __raw_readwfunction __raw_writebfunction __raw_writewfunction readbfunction readwfunction writebfunction writewfunction __raw_readlfunction __raw_readqfunction __raw_writelfunction __raw_writeqfunction readlfunction readqfunction writelfunction writeqfunction readb_relaxedfunction readw_relaxedfunction readl_relaxed
Annotated Snippet
#ifndef __ALPHA_IO_H
#define __ALPHA_IO_H
#ifdef __KERNEL__
#include <linux/kernel.h>
#include <linux/mm.h>
#include <asm/compiler.h>
#include <asm/machvec.h>
#include <asm/hwrpb.h>
/*
* Virtual -> physical identity mapping starts at this offset
*/
#ifdef USE_48_BIT_KSEG
#define IDENT_ADDR 0xffff800000000000UL
#else
#define IDENT_ADDR 0xfffffc0000000000UL
#endif
/*
* We try to avoid hae updates (thus the cache), but when we
* do need to update the hae, we need to do it atomically, so
* that any interrupts wouldn't get confused with the hae
* register not being up-to-date with respect to the hardware
* value.
*/
extern inline void __set_hae(unsigned long new_hae)
{
unsigned long flags = swpipl(IPL_MAX);
barrier();
alpha_mv.hae_cache = new_hae;
*alpha_mv.hae_register = new_hae;
mb();
/* Re-read to make sure it was written. */
new_hae = *alpha_mv.hae_register;
setipl(flags);
barrier();
}
extern inline void set_hae(unsigned long new_hae)
{
if (new_hae != alpha_mv.hae_cache)
__set_hae(new_hae);
}
/*
* Change virtual addresses to physical addresses and vv.
*/
#ifdef USE_48_BIT_KSEG
static inline unsigned long virt_to_phys(volatile void *address)
{
return (unsigned long)address - IDENT_ADDR;
}
static inline void * phys_to_virt(unsigned long address)
{
return (void *) (address + IDENT_ADDR);
}
#else
static inline unsigned long virt_to_phys(volatile void *address)
{
unsigned long phys = (unsigned long)address;
/* Sign-extend from bit 41. */
phys <<= (64 - 41);
phys = (long)phys >> (64 - 41);
/* Crop to the physical address width of the processor. */
phys &= (1ul << hwrpb->pa_bits) - 1;
return phys;
}
static inline void * phys_to_virt(unsigned long address)
{
return (void *)(IDENT_ADDR + (address & ((1ul << 41) - 1)));
}
#endif
#define virt_to_phys virt_to_phys
#define phys_to_virt phys_to_virt
/* Maximum PIO space address supported? */
#define IO_SPACE_LIMIT 0xffff
/*
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/mm.h`, `asm/compiler.h`, `asm/machvec.h`, `asm/hwrpb.h`, `asm/core_cia.h`, `asm/core_irongate.h`, `asm/core_marvel.h`.
- Detected declarations: `function updates`, `function set_hae`, `function virt_to_phys`, `function phys_to_virt`, `function virt_to_phys`, `function phys_to_virt`, `function isa_virt_to_bus`, `function isa_bus_to_virt`, `function generic_iounmap`, `function generic_is_ioaddr`.
- Atlas domain: Architecture Layer / arch/alpha.
- 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.