arch/alpha/kernel/sys_marvel.c
Source file repositories/reference/linux-study-clean/arch/alpha/kernel/sys_marvel.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/kernel/sys_marvel.c- Extension
.c- Size
- 10972 bytes
- Lines
- 466
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- 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/kernel.hlinux/types.hlinux/mm.hlinux/sched.hlinux/pci.hlinux/init.hlinux/bitops.hasm/ptrace.hasm/dma.hasm/irq.hasm/mmu_context.hasm/io.hasm/core_marvel.hasm/hwrpb.hasm/tlbflush.hasm/vga.hproto.herr_impl.hirq_impl.hpci_impl.hmachvec_impl.h
Detected Declarations
function io7_device_interruptfunction io7_get_irq_ctlfunction io7_enable_irqfunction io7_disable_irqfunction marvel_irq_noopfunction io7_redirect_irqfunction io7_redirect_one_lsifunction io7_redirect_one_msifunction init_one_io7_lsifunction init_one_io7_msifunction init_io7_irqsfunction marvel_init_irqfunction marvel_map_irqfunction marvel_init_pcifunction marvel_init_rtcfunction marvel_smp_callin
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* linux/arch/alpha/kernel/sys_marvel.c
*
* Marvel / IO7 support
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <asm/ptrace.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/mmu_context.h>
#include <asm/io.h>
#include <asm/core_marvel.h>
#include <asm/hwrpb.h>
#include <asm/tlbflush.h>
#include <asm/vga.h>
#include "proto.h"
#include "err_impl.h"
#include "irq_impl.h"
#include "pci_impl.h"
#include "machvec_impl.h"
#if NR_IRQS < MARVEL_NR_IRQS
# error NR_IRQS < MARVEL_NR_IRQS !!!
#endif
/*
* Interrupt handling.
*/
static void
io7_device_interrupt(unsigned long vector)
{
unsigned int pid;
unsigned int irq;
/*
* Vector is 0x800 + (interrupt)
*
* where (interrupt) is:
*
* ...16|15 14|13 4|3 0
* -----+-----+--------+---
* PE | 0 | irq | 0
*
* where (irq) is
*
* 0x0800 - 0x0ff0 - 0x0800 + (LSI id << 4)
* 0x1000 - 0x2ff0 - 0x1000 + (MSI_DAT<8:0> << 4)
*/
pid = vector >> 16;
irq = ((vector & 0xffff) - 0x800) >> 4;
irq += 16; /* offset for legacy */
irq &= MARVEL_IRQ_VEC_IRQ_MASK; /* not too many bits */
irq |= pid << MARVEL_IRQ_VEC_PE_SHIFT; /* merge the pid */
handle_irq(irq);
}
static volatile unsigned long *
io7_get_irq_ctl(unsigned int irq, struct io7 **pio7)
{
volatile unsigned long *ctl;
unsigned int pid;
struct io7 *io7;
pid = irq >> MARVEL_IRQ_VEC_PE_SHIFT;
if (!(io7 = marvel_find_io7(pid))) {
printk(KERN_ERR
"%s for nonexistent io7 -- vec %x, pid %d\n",
__func__, irq, pid);
return NULL;
}
irq &= MARVEL_IRQ_VEC_IRQ_MASK; /* isolate the vector */
irq -= 16; /* subtract legacy bias */
if (irq >= 0x180) {
printk(KERN_ERR
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/mm.h`, `linux/sched.h`, `linux/pci.h`, `linux/init.h`, `linux/bitops.h`, `asm/ptrace.h`.
- Detected declarations: `function io7_device_interrupt`, `function io7_get_irq_ctl`, `function io7_enable_irq`, `function io7_disable_irq`, `function marvel_irq_noop`, `function io7_redirect_irq`, `function io7_redirect_one_lsi`, `function io7_redirect_one_msi`, `function init_one_io7_lsi`, `function init_one_io7_msi`.
- Atlas domain: Architecture Layer / arch/alpha.
- 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.