arch/sparc/include/asm/upa.h
Source file repositories/reference/linux-study-clean/arch/sparc/include/asm/upa.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/include/asm/upa.h- Extension
.h- Size
- 3810 bytes
- Lines
- 111
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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
asm/asi.h
Detected Declarations
function _upa_readbfunction _upa_readwfunction _upa_readlfunction _upa_readqfunction _upa_writebfunction _upa_writewfunction _upa_writelfunction _upa_writeq
Annotated Snippet
#ifndef _SPARC64_UPA_H
#define _SPARC64_UPA_H
#include <asm/asi.h>
/* UPA level registers and defines. */
/* UPA Config Register */
#define UPA_CONFIG_RESV 0xffffffffc0000000 /* Reserved. */
#define UPA_CONFIG_PCON 0x000000003fc00000 /* Depth of various sys queues. */
#define UPA_CONFIG_MID 0x00000000003e0000 /* Module ID. */
#define UPA_CONFIG_PCAP 0x000000000001ffff /* Port Capabilities. */
/* UPA Port ID Register */
#define UPA_PORTID_FNP 0xff00000000000000 /* Hardcoded to 0xfc on ultra. */
#define UPA_PORTID_RESV 0x00fffff800000000 /* Reserved. */
#define UPA_PORTID_ECCVALID 0x0000000400000000 /* Zero if mod can generate ECC */
#define UPA_PORTID_ONEREAD 0x0000000200000000 /* Set if mod generates P_RASB */
#define UPA_PORTID_PINTRDQ 0x0000000180000000 /* # outstanding P_INT_REQ's */
#define UPA_PORTID_PREQDQ 0x000000007e000000 /* slave-wr's to mod supported */
#define UPA_PORTID_PREQRD 0x0000000001e00000 /* # incoming P_REQ's supported */
#define UPA_PORTID_UPACAP 0x00000000001f0000 /* UPA capabilities of mod */
#define UPA_PORTID_ID 0x000000000000ffff /* Module Identification bits */
/* UPA I/O space accessors */
#if defined(__KERNEL__) && !defined(__ASSEMBLER__)
static inline unsigned char _upa_readb(unsigned long addr)
{
unsigned char ret;
__asm__ __volatile__("lduba\t[%1] %2, %0\t/* upa_readb */"
: "=r" (ret)
: "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
return ret;
}
static inline unsigned short _upa_readw(unsigned long addr)
{
unsigned short ret;
__asm__ __volatile__("lduha\t[%1] %2, %0\t/* upa_readw */"
: "=r" (ret)
: "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
return ret;
}
static inline unsigned int _upa_readl(unsigned long addr)
{
unsigned int ret;
__asm__ __volatile__("lduwa\t[%1] %2, %0\t/* upa_readl */"
: "=r" (ret)
: "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
return ret;
}
static inline unsigned long _upa_readq(unsigned long addr)
{
unsigned long ret;
__asm__ __volatile__("ldxa\t[%1] %2, %0\t/* upa_readq */"
: "=r" (ret)
: "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
return ret;
}
static inline void _upa_writeb(unsigned char b, unsigned long addr)
{
__asm__ __volatile__("stba\t%0, [%1] %2\t/* upa_writeb */"
: /* no outputs */
: "r" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
}
static inline void _upa_writew(unsigned short w, unsigned long addr)
{
__asm__ __volatile__("stha\t%0, [%1] %2\t/* upa_writew */"
: /* no outputs */
: "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
}
static inline void _upa_writel(unsigned int l, unsigned long addr)
{
__asm__ __volatile__("stwa\t%0, [%1] %2\t/* upa_writel */"
: /* no outputs */
: "r" (l), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
}
Annotation
- Immediate include surface: `asm/asi.h`.
- Detected declarations: `function _upa_readb`, `function _upa_readw`, `function _upa_readl`, `function _upa_readq`, `function _upa_writeb`, `function _upa_writew`, `function _upa_writel`, `function _upa_writeq`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.