arch/sparc/kernel/prom_irqtrans.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/prom_irqtrans.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/prom_irqtrans.c- Extension
.c- Size
- 21988 bytes
- Lines
- 845
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/string.hlinux/init.hlinux/of.hlinux/of_platform.hlinux/platform_device.hasm/oplib.hasm/prom.hasm/irq.hasm/upa.hprom.h
Detected Declarations
struct sabre_irq_datastruct schizo_irq_datastruct fire_irq_datastruct irq_transfunction psycho_pcislot_imap_offsetfunction psycho_irq_buildfunction psycho_irq_trans_initfunction sabre_wsync_handlerfunction sabre_pcislot_imap_offsetfunction sabre_device_needs_wsyncfunction sabre_irq_buildfunction sabre_irq_trans_initfunction schizo_imap_offsetfunction schizo_iclr_offsetfunction schizo_ino_to_iclrfunction schizo_ino_to_imapfunction __volatile__function schizo_irq_buildfunction __schizo_irq_trans_initfunction schizo_irq_trans_initfunction tomatillo_irq_trans_initfunction pci_sun4v_irq_buildfunction pci_sun4v_irq_trans_initfunction fire_imap_offsetfunction fire_iclr_offsetfunction fire_ino_to_iclrfunction fire_ino_to_imapfunction fire_irq_buildfunction fire_irq_trans_initfunction sysio_imap_to_iclrfunction sbus_of_build_irqfunction sbus_irq_trans_initfunction central_build_irqfunction central_irq_trans_initfunction sun4v_vdev_irq_buildfunction sun4v_vdev_irq_trans_initfunction irq_trans_initfunction of_node_name_eqfunction of_node_name_eqfunction of_node_name_eq
Annotated Snippet
struct sabre_irq_data {
unsigned long controller_regs;
unsigned int pci_first_busno;
};
#define SABRE_CONFIGSPACE 0x001000000UL
#define SABRE_WRSYNC 0x1c20UL
#define SABRE_CONFIG_BASE(CONFIG_SPACE) \
(CONFIG_SPACE | (1UL << 24))
#define SABRE_CONFIG_ENCODE(BUS, DEVFN, REG) \
(((unsigned long)(BUS) << 16) | \
((unsigned long)(DEVFN) << 8) | \
((unsigned long)(REG)))
/* When a device lives behind a bridge deeper in the PCI bus topology
* than APB, a special sequence must run to make sure all pending DMA
* transfers at the time of IRQ delivery are visible in the coherency
* domain by the cpu. This sequence is to perform a read on the far
* side of the non-APB bridge, then perform a read of Sabre's DMA
* write-sync register.
*/
static void sabre_wsync_handler(unsigned int ino, void *_arg1, void *_arg2)
{
unsigned int phys_hi = (unsigned int) (unsigned long) _arg1;
struct sabre_irq_data *irq_data = _arg2;
unsigned long controller_regs = irq_data->controller_regs;
unsigned long sync_reg = controller_regs + SABRE_WRSYNC;
unsigned long config_space = controller_regs + SABRE_CONFIGSPACE;
unsigned int bus, devfn;
u16 _unused;
config_space = SABRE_CONFIG_BASE(config_space);
bus = (phys_hi >> 16) & 0xff;
devfn = (phys_hi >> 8) & 0xff;
config_space |= SABRE_CONFIG_ENCODE(bus, devfn, 0x00);
__asm__ __volatile__("membar #Sync\n\t"
"lduha [%1] %2, %0\n\t"
"membar #Sync"
: "=r" (_unused)
: "r" ((u16 *) config_space),
"i" (ASI_PHYS_BYPASS_EC_E_L)
: "memory");
sabre_read(sync_reg);
}
#define SABRE_IMAP_A_SLOT0 0x0c00UL
#define SABRE_IMAP_B_SLOT0 0x0c20UL
#define SABRE_ICLR_A_SLOT0 0x1400UL
#define SABRE_ICLR_B_SLOT0 0x1480UL
#define SABRE_ICLR_SCSI 0x1800UL
#define SABRE_ICLR_ETH 0x1808UL
#define SABRE_ICLR_BPP 0x1810UL
#define SABRE_ICLR_AU_REC 0x1818UL
#define SABRE_ICLR_AU_PLAY 0x1820UL
#define SABRE_ICLR_PFAIL 0x1828UL
#define SABRE_ICLR_KMS 0x1830UL
#define SABRE_ICLR_FLPY 0x1838UL
#define SABRE_ICLR_SHW 0x1840UL
#define SABRE_ICLR_KBD 0x1848UL
#define SABRE_ICLR_MS 0x1850UL
#define SABRE_ICLR_SER 0x1858UL
#define SABRE_ICLR_UE 0x1870UL
#define SABRE_ICLR_CE 0x1878UL
#define SABRE_ICLR_PCIERR 0x1880UL
static unsigned long sabre_pcislot_imap_offset(unsigned long ino)
{
unsigned int bus = (ino & 0x10) >> 4;
unsigned int slot = (ino & 0x0c) >> 2;
if (bus == 0)
return SABRE_IMAP_A_SLOT0 + (slot * 8);
else
return SABRE_IMAP_B_SLOT0 + (slot * 8);
}
#define SABRE_OBIO_IMAP_BASE 0x1000UL
#define SABRE_ONBOARD_IRQ_BASE 0x20
#define sabre_onboard_imap_offset(__ino) \
(SABRE_OBIO_IMAP_BASE + (((__ino) & 0x1f) << 3))
#define sabre_iclr_offset(ino) \
((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \
(SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3)))
static int sabre_device_needs_wsync(struct device_node *dp)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/string.h`, `linux/init.h`, `linux/of.h`, `linux/of_platform.h`, `linux/platform_device.h`, `asm/oplib.h`, `asm/prom.h`.
- Detected declarations: `struct sabre_irq_data`, `struct schizo_irq_data`, `struct fire_irq_data`, `struct irq_trans`, `function psycho_pcislot_imap_offset`, `function psycho_irq_build`, `function psycho_irq_trans_init`, `function sabre_wsync_handler`, `function sabre_pcislot_imap_offset`, `function sabre_device_needs_wsync`.
- 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.