arch/parisc/kernel/irq.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/irq.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/irq.c- Extension
.c- Size
- 14844 bytes
- Lines
- 580
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/errno.hlinux/init.hlinux/interrupt.hlinux/kernel_stat.hlinux/seq_file.hlinux/types.hlinux/sched/task_stack.hasm/io.hasm/softirq_stack.hasm/smp.hasm/ldcw.h
Detected Declarations
function cpu_mask_irqfunction __cpu_unmask_irqfunction cpu_unmask_irqfunction cpu_ack_irqfunction cpu_eoi_irqfunction cpu_check_affinityfunction arch_show_interruptsfunction show_interruptsfunction txn_XXXfunction txn_claim_irqfunction txn_alloc_irqfunction txn_affinity_addrfunction txn_alloc_addrfunction txn_alloc_datafunction eirr_to_irqfunction stack_overflow_checkfunction execute_on_irq_stackfunction do_softirq_own_stackfunction do_cpu_irq_maskfunction claim_cpu_irqsfunction init_IRQ
Annotated Snippet
if (hist) {
avg += hist;
} else
break;
if (hist > max) max = hist;
if (hist < min) min = hist;
}
avg /= k;
seq_printf(p, " %s[%d/%d/%d]", action->name,
min,avg,max);
}
#endif
seq_putc(p, '\n');
skip:
raw_spin_unlock_irqrestore(&desc->lock, flags);
}
if (i == NR_IRQS)
arch_show_interrupts(p, 3);
return 0;
}
/*
** The following form a "set": Virtual IRQ, Transaction Address, Trans Data.
** Respectively, these map to IRQ region+EIRR, Processor HPA, EIRR bit.
**
** To use txn_XXX() interfaces, get a Virtual IRQ first.
** Then use that to get the Transaction address and data.
*/
int cpu_claim_irq(unsigned int irq, struct irq_chip *type, void *data)
{
if (irq_has_action(irq))
return -EBUSY;
if (irq_get_chip(irq) != &cpu_interrupt_type)
return -EBUSY;
/* for iosapic interrupts */
if (type) {
irq_set_chip_and_handler(irq, type, handle_percpu_irq);
irq_set_chip_data(irq, data);
__cpu_unmask_irq(irq);
}
return 0;
}
int txn_claim_irq(int irq)
{
return cpu_claim_irq(irq, NULL, NULL) ? -1 : irq;
}
/*
* The bits_wide parameter accommodates the limitations of the HW/SW which
* use these bits:
* Legacy PA I/O (GSC/NIO): 5 bits (architected EIM register)
* V-class (EPIC): 6 bits
* N/L/A-class (iosapic): 8 bits
* PCI 2.2 MSI: 16 bits
* Some PCI devices: 32 bits (Symbios SCSI/ATM/HyperFabric)
*
* On the service provider side:
* o PA 1.1 (and PA2.0 narrow mode) 5-bits (width of EIR register)
* o PA 2.0 wide mode 6-bits (per processor)
* o IA64 8-bits (0-256 total)
*
* So a Legacy PA I/O device on a PA 2.0 box can't use all the bits supported
* by the processor...and the N/L-class I/O subsystem supports more bits than
* PA2.0 has. The first case is the problem.
*/
int txn_alloc_irq(unsigned int bits_wide)
{
int irq;
/* never return irq 0 cause that's the interval timer */
for (irq = CPU_IRQ_BASE + 1; irq <= CPU_IRQ_MAX; irq++) {
if (cpu_claim_irq(irq, NULL, NULL) < 0)
continue;
if ((irq - CPU_IRQ_BASE) >= (1 << bits_wide))
continue;
return irq;
}
/* unlikely, but be prepared */
return -1;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/errno.h`, `linux/init.h`, `linux/interrupt.h`, `linux/kernel_stat.h`, `linux/seq_file.h`, `linux/types.h`, `linux/sched/task_stack.h`.
- Detected declarations: `function cpu_mask_irq`, `function __cpu_unmask_irq`, `function cpu_unmask_irq`, `function cpu_ack_irq`, `function cpu_eoi_irq`, `function cpu_check_affinity`, `function arch_show_interrupts`, `function show_interrupts`, `function txn_XXX`, `function txn_claim_irq`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.