arch/arm/mach-pxa/irq.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-pxa/irq.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-pxa/irq.c- Extension
.c- Size
- 6197 bytes
- Lines
- 274
- Domain
- Architecture Layer
- Bucket
- arch/arm
- 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/bitops.hlinux/init.hlinux/module.hlinux/interrupt.hlinux/syscore_ops.hlinux/io.hlinux/irq.hlinux/of_address.hlinux/of_irq.hlinux/soc/pxa/cpu.hasm/exception.hirqs.hgeneric.hpxa-regs.h
Detected Declarations
function pxa_mask_irqfunction pxa_unmask_irqfunction icip_handle_irqfunction ichp_handle_irqfunction pxa_irq_mapfunction pxa_init_irq_commonfunction pxa_init_irqfunction pxa_irq_suspendfunction pxa_irq_resumefunction pxa_dt_irq_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* linux/arch/arm/mach-pxa/irq.c
*
* Generic PXA IRQ handling
*
* Author: Nicolas Pitre
* Created: Jun 15, 2001
* Copyright: MontaVista Software Inc.
*/
#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/syscore_ops.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/soc/pxa/cpu.h>
#include <asm/exception.h>
#include "irqs.h"
#include "generic.h"
#include "pxa-regs.h"
#define ICIP (0x000)
#define ICMR (0x004)
#define ICLR (0x008)
#define ICFR (0x00c)
#define ICPR (0x010)
#define ICCR (0x014)
#define ICHP (0x018)
#define IPR(i) (((i) < 32) ? (0x01c + ((i) << 2)) : \
((i) < 64) ? (0x0b0 + (((i) - 32) << 2)) : \
(0x144 + (((i) - 64) << 2)))
#define ICHP_VAL_IRQ (1 << 31)
#define ICHP_IRQ(i) (((i) >> 16) & 0x7fff)
#define IPR_VALID (1 << 31)
#define MAX_INTERNAL_IRQS 128
/*
* This is for peripheral IRQs internal to the PXA chip.
*/
static void __iomem *pxa_irq_base;
static int pxa_internal_irq_nr;
static bool cpu_has_ipr;
static struct irq_domain *pxa_irq_domain;
static inline void __iomem *irq_base(int i)
{
static unsigned long phys_base_offset[] = {
0x0,
0x9c,
0x130,
};
return pxa_irq_base + phys_base_offset[i];
}
void pxa_mask_irq(struct irq_data *d)
{
void __iomem *base = irq_data_get_irq_chip_data(d);
irq_hw_number_t irq = irqd_to_hwirq(d);
uint32_t icmr = __raw_readl(base + ICMR);
icmr &= ~BIT(irq & 0x1f);
__raw_writel(icmr, base + ICMR);
}
void pxa_unmask_irq(struct irq_data *d)
{
void __iomem *base = irq_data_get_irq_chip_data(d);
irq_hw_number_t irq = irqd_to_hwirq(d);
uint32_t icmr = __raw_readl(base + ICMR);
icmr |= BIT(irq & 0x1f);
__raw_writel(icmr, base + ICMR);
}
static struct irq_chip pxa_internal_irq_chip = {
.name = "SC",
.irq_ack = pxa_mask_irq,
.irq_mask = pxa_mask_irq,
.irq_unmask = pxa_unmask_irq,
};
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/init.h`, `linux/module.h`, `linux/interrupt.h`, `linux/syscore_ops.h`, `linux/io.h`, `linux/irq.h`, `linux/of_address.h`.
- Detected declarations: `function pxa_mask_irq`, `function pxa_unmask_irq`, `function icip_handle_irq`, `function ichp_handle_irq`, `function pxa_irq_map`, `function pxa_init_irq_common`, `function pxa_init_irq`, `function pxa_irq_suspend`, `function pxa_irq_resume`, `function pxa_dt_irq_init`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.