arch/sparc/kernel/irq_64.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/irq_64.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/irq_64.c- Extension
.c- Size
- 28594 bytes
- Lines
- 1155
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/sched.hlinux/linkage.hlinux/ptrace.hlinux/errno.hlinux/kernel_stat.hlinux/signal.hlinux/mm.hlinux/interrupt.hlinux/slab.hlinux/random.hlinux/init.hlinux/delay.hlinux/proc_fs.hlinux/seq_file.hlinux/ftrace.hlinux/irq.hlinux/string_choices.hasm/ptrace.hasm/processor.hlinux/atomic.hasm/irq.hasm/io.hasm/iommu.hasm/upa.hasm/oplib.hasm/prom.hasm/timer.hasm/smp.hasm/starfire.hlinux/uaccess.hasm/cache.hasm/cpudata.h
Detected Declarations
struct irq_handler_datastruct sun5_timerfunction bucket_get_chain_pafunction bucket_clear_chain_pafunction bucket_get_irqfunction bucket_set_irqfunction early_hvirq_majorfunction sourcesfunction irq_init_hvfunction arch_probe_nr_irqsfunction size_nr_ivecfunction irq_data_to_handlefunction irq_data_to_inofunction irq_data_to_sysinofunction irq_freefunction irq_allocfunction cookie_existsfunction sysino_existsfunction ack_bad_irqfunction irq_install_pre_handlerfunction arch_show_interruptsfunction sun4u_compute_tidfunction irq_choose_cpufunction sun4u_irq_enablefunction sun4u_set_affinityfunction handler_irqfunction sun4v_irq_enablefunction sun4v_set_affinityfunction sun4v_irq_disablefunction sun4v_irq_eoifunction sun4v_virq_enablefunction sun4v_virt_set_affinityfunction sun4v_virq_disablefunction sun4v_virq_eoifunction build_irqfunction sun4v_build_commonfunction cookie_assignfunction cookie_handler_datafunction cookie_build_irqfunction sun4v_build_cookiefunction sysino_set_bucketfunction sysino_handler_datafunction sysino_build_irqfunction sun4v_build_sysinofunction sun4v_build_irqfunction sun4v_build_virqfunction handler_irqfunction do_softirq_own_stack
Annotated Snippet
struct irq_handler_data {
union {
struct {
unsigned int dev_handle;
unsigned int dev_ino;
};
unsigned long sysino;
};
struct ino_bucket bucket;
unsigned long iclr;
unsigned long imap;
};
static inline unsigned int irq_data_to_handle(struct irq_data *data)
{
struct irq_handler_data *ihd = irq_data_get_irq_handler_data(data);
return ihd->dev_handle;
}
static inline unsigned int irq_data_to_ino(struct irq_data *data)
{
struct irq_handler_data *ihd = irq_data_get_irq_handler_data(data);
return ihd->dev_ino;
}
static inline unsigned long irq_data_to_sysino(struct irq_data *data)
{
struct irq_handler_data *ihd = irq_data_get_irq_handler_data(data);
return ihd->sysino;
}
void irq_free(unsigned int irq)
{
void *data = irq_get_handler_data(irq);
kfree(data);
irq_set_handler_data(irq, NULL);
irq_free_descs(irq, 1);
}
unsigned int irq_alloc(unsigned int dev_handle, unsigned int dev_ino)
{
int irq;
irq = __irq_alloc_descs(-1, 1, 1, numa_node_id(), NULL, NULL);
if (irq <= 0)
goto out;
return irq;
out:
return 0;
}
static unsigned int cookie_exists(u32 devhandle, unsigned int devino)
{
unsigned long hv_err, cookie;
struct ino_bucket *bucket;
unsigned int irq = 0U;
hv_err = sun4v_vintr_get_cookie(devhandle, devino, &cookie);
if (hv_err) {
pr_err("HV get cookie failed hv_err = %ld\n", hv_err);
goto out;
}
if (cookie & ((1UL << 63UL))) {
cookie = ~cookie;
bucket = (struct ino_bucket *) __va(cookie);
irq = bucket->__irq;
}
out:
return irq;
}
static unsigned int sysino_exists(u32 devhandle, unsigned int devino)
{
unsigned long sysino = sun4v_devino_to_sysino(devhandle, devino);
struct ino_bucket *bucket;
unsigned int irq;
bucket = &ivector_table[sysino];
irq = bucket_get_irq(__pa(bucket));
return irq;
}
void ack_bad_irq(unsigned int irq)
Annotation
- Immediate include surface: `linux/sched.h`, `linux/linkage.h`, `linux/ptrace.h`, `linux/errno.h`, `linux/kernel_stat.h`, `linux/signal.h`, `linux/mm.h`, `linux/interrupt.h`.
- Detected declarations: `struct irq_handler_data`, `struct sun5_timer`, `function bucket_get_chain_pa`, `function bucket_clear_chain_pa`, `function bucket_get_irq`, `function bucket_set_irq`, `function early_hvirq_major`, `function sources`, `function irq_init_hv`, `function arch_probe_nr_irqs`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.