cregit-Linux how code gets into the kernel

Release 4.14 arch/h8300/kernel/irq.c

// SPDX-License-Identifier: GPL-2.0
/*
 * linux/arch/h8300/kernel/irq.c
 *
 * Copyright 2014-2015 Yoshinori Sato <ysato@users.sourceforge.jp>
 */

#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/of_irq.h>
#include <asm/traps.h>

#ifdef CONFIG_RAMKERNEL

typedef void (*h8300_vector)(void);


static const h8300_vector __initconst trap_table[] = {
	0, 0, 0, 0,
	_trace_break,
	0, 0,
	_nmi,
	_system_call,
	0, 0,
	_trace_break,
};


static unsigned long __init *get_vector_address(void) { unsigned long *rom_vector = CPU_VECTOR; unsigned long base, tmp; int vec_no; base = rom_vector[EXT_IRQ0] & ADDR_MASK; /* check romvector format */ for (vec_no = EXT_IRQ0 + 1; vec_no <= EXT_IRQ0+EXT_IRQS; vec_no++) { if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & ADDR_MASK)) return NULL; } /* ramvector base address */ base -= EXT_IRQ0*4; /* writerble? */ tmp = ~(*(volatile unsigned long *)base); (*(volatile unsigned long *)base) = tmp; if ((*(volatile unsigned long *)base) != tmp) return NULL; return (unsigned long *)base; }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato143100.00%1100.00%
Total143100.00%1100.00%


static void __init setup_vector(void) { int i; unsigned long *ramvec, *ramvec_p; const h8300_vector *trap_entry; ramvec = get_vector_address(); if (ramvec == NULL) panic("interrupt vector serup failed."); else pr_debug("virtual vector at 0x%p\n", ramvec); /* create redirect table */ ramvec_p = ramvec; trap_entry = trap_table; for (i = 0; i < NR_IRQS; i++) { if (i < 12) { if (*trap_entry) *ramvec_p = VECTOR(*trap_entry); ramvec_p++; trap_entry++; } else *ramvec_p++ = REDIRECT(_interrupt_entry); } _interrupt_redirect_table = ramvec; }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato115100.00%1100.00%
Total115100.00%1100.00%

#else
void setup_vector(void) { /* noting do */ }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato8100.00%1100.00%
Total8100.00%1100.00%

#endif
void __init init_IRQ(void) { setup_vector(); irqchip_init(); }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato14100.00%1100.00%
Total14100.00%1100.00%


asmlinkage void do_IRQ(int irq) { irq_enter(); generic_handle_irq(irq); irq_exit(); }

Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato20100.00%1100.00%
Total20100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Yoshinori Sato36999.73%150.00%
Greg Kroah-Hartman10.27%150.00%
Total370100.00%2100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.