[PATCH] m68k: separate handler for auto and user vector interrupt
Use separate entry points for auto and user vector interrupts and cleanup naming a little. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
f2325ecebc
commit
92445eaaad
@@ -314,7 +314,7 @@ __ALIGN_STR "\n\t"
|
|||||||
"rte");
|
"rte");
|
||||||
|
|
||||||
/* Defined in entry.S; only increments 'num_spurious' */
|
/* Defined in entry.S; only increments 'num_spurious' */
|
||||||
asmlinkage void bad_interrupt(void);
|
asmlinkage void bad_inthandler(void);
|
||||||
|
|
||||||
extern void atari_microwire_cmd( int cmd );
|
extern void atari_microwire_cmd( int cmd );
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ void __init atari_init_IRQ(void)
|
|||||||
|
|
||||||
/* initialize the vector table */
|
/* initialize the vector table */
|
||||||
for (i = 0; i < NUM_INT_SOURCES; ++i) {
|
for (i = 0; i < NUM_INT_SOURCES; ++i) {
|
||||||
vectors[IRQ_SOURCE_TO_VECTOR(i)] = bad_interrupt;
|
vectors[IRQ_SOURCE_TO_VECTOR(i)] = bad_inthandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the MFP(s) */
|
/* Initialize the MFP(s) */
|
||||||
@@ -461,7 +461,7 @@ int atari_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, stru
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vectors[vector] == bad_interrupt) {
|
if (vectors[vector] == bad_inthandler) {
|
||||||
/* int has no handler yet */
|
/* int has no handler yet */
|
||||||
irq_handler[irq].handler = handler;
|
irq_handler[irq].handler = handler;
|
||||||
irq_handler[irq].dev_id = dev_id;
|
irq_handler[irq].dev_id = dev_id;
|
||||||
@@ -528,7 +528,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
vector = IRQ_SOURCE_TO_VECTOR(irq);
|
vector = IRQ_SOURCE_TO_VECTOR(irq);
|
||||||
if (vectors[vector] == bad_interrupt)
|
if (vectors[vector] == bad_inthandler)
|
||||||
goto not_found;
|
goto not_found;
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
@@ -542,7 +542,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
|
|||||||
irq_handler[irq].handler = NULL;
|
irq_handler[irq].handler = NULL;
|
||||||
irq_handler[irq].dev_id = NULL;
|
irq_handler[irq].dev_id = NULL;
|
||||||
irq_param[irq].devname = NULL;
|
irq_param[irq].devname = NULL;
|
||||||
vectors[vector] = bad_interrupt;
|
vectors[vector] = bad_inthandler;
|
||||||
/* If MFP int, also disable it */
|
/* If MFP int, also disable it */
|
||||||
atari_disable_irq(irq);
|
atari_disable_irq(irq);
|
||||||
atari_turnoff_irq(irq);
|
atari_turnoff_irq(irq);
|
||||||
@@ -617,7 +617,7 @@ int show_atari_interrupts(struct seq_file *p, void *v)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NUM_INT_SOURCES; ++i) {
|
for (i = 0; i < NUM_INT_SOURCES; ++i) {
|
||||||
if (vectors[IRQ_SOURCE_TO_VECTOR(i)] == bad_interrupt)
|
if (vectors[IRQ_SOURCE_TO_VECTOR(i)] == bad_inthandler)
|
||||||
continue;
|
continue;
|
||||||
if (i < STMFP_SOURCE_BASE)
|
if (i < STMFP_SOURCE_BASE)
|
||||||
seq_printf(p, "auto %2d: %10u ",
|
seq_printf(p, "auto %2d: %10u ",
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#include <asm/asm-offsets.h>
|
#include <asm/asm-offsets.h>
|
||||||
|
|
||||||
.globl system_call, buserr, trap, resume
|
.globl system_call, buserr, trap, resume
|
||||||
.globl inthandler, sys_call_table
|
.globl sys_call_table
|
||||||
.globl sys_fork, sys_clone, sys_vfork
|
.globl sys_fork, sys_clone, sys_vfork
|
||||||
.globl ret_from_interrupt, bad_interrupt
|
.globl ret_from_interrupt, bad_interrupt
|
||||||
|
|
||||||
@@ -191,44 +191,15 @@ do_delayed_trace:
|
|||||||
jbra resume_userspace
|
jbra resume_userspace
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
/* This is the main interrupt handler for autovector interrupts */
|
||||||
#ifdef CONFIG_AMIGA
|
|
||||||
ami_inthandler:
|
|
||||||
addql #1,irq_stat+CPUSTAT_LOCAL_IRQ_COUNT
|
|
||||||
SAVE_ALL_INT
|
|
||||||
GET_CURRENT(%d0)
|
|
||||||
|
|
||||||
bfextu %sp@(PT_VECTOR){#4,#12},%d0
|
ENTRY(auto_inthandler)
|
||||||
movel %d0,%a0
|
|
||||||
addql #1,%a0@(kstat+STAT_IRQ-VECOFF(VEC_SPUR))
|
|
||||||
movel %a0@(autoirq_list-VECOFF(VEC_SPUR)),%a0
|
|
||||||
|
|
||||||
| amiga vector int handler get the req mask instead of irq vector
|
|
||||||
lea CUSTOMBASE,%a1
|
|
||||||
movew %a1@(C_INTREQR),%d0
|
|
||||||
andw %a1@(C_INTENAR),%d0
|
|
||||||
|
|
||||||
| prepare stack (push frame pointer, dev_id & req mask)
|
|
||||||
pea %sp@
|
|
||||||
movel %a0@(IRQ_DEVID),%sp@-
|
|
||||||
movel %d0,%sp@-
|
|
||||||
pea %pc@(ret_from_interrupt:w)
|
|
||||||
jbra @(IRQ_HANDLER,%a0)@(0)
|
|
||||||
|
|
||||||
ENTRY(nmi_handler)
|
|
||||||
rte
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
** This is the main interrupt handler, responsible for calling process_int()
|
|
||||||
*/
|
|
||||||
inthandler:
|
|
||||||
SAVE_ALL_INT
|
SAVE_ALL_INT
|
||||||
GET_CURRENT(%d0)
|
GET_CURRENT(%d0)
|
||||||
addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
||||||
| put exception # in d0
|
| put exception # in d0
|
||||||
bfextu %sp@(PT_VECTOR){#4,#10},%d0
|
bfextu %sp@(PT_VECTOR){#4,#10},%d0
|
||||||
|
subw #VEC_SPUR,%d0
|
||||||
|
|
||||||
movel %sp,%sp@-
|
movel %sp,%sp@-
|
||||||
movel %d0,%sp@- | put vector # on stack
|
movel %d0,%sp@- | put vector # on stack
|
||||||
@@ -241,15 +212,16 @@ inthandler:
|
|||||||
jbra 3f
|
jbra 3f
|
||||||
1:
|
1:
|
||||||
#endif
|
#endif
|
||||||
jbsr process_int | process the IRQ
|
jsr m68k_handle_int | process the IRQ
|
||||||
3: addql #8,%sp | pop parameters off stack
|
3: addql #8,%sp | pop parameters off stack
|
||||||
|
|
||||||
ret_from_interrupt:
|
ret_from_interrupt:
|
||||||
subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
||||||
jeq 1f
|
jeq ret_from_last_interrupt
|
||||||
2:
|
2: RESTORE_ALL
|
||||||
RESTORE_ALL
|
|
||||||
1:
|
ALIGN
|
||||||
|
ret_from_last_interrupt:
|
||||||
moveq #(~ALLOWINT>>8)&0xff,%d0
|
moveq #(~ALLOWINT>>8)&0xff,%d0
|
||||||
andb %sp@(PT_SR),%d0
|
andb %sp@(PT_SR),%d0
|
||||||
jne 2b
|
jne 2b
|
||||||
@@ -260,12 +232,40 @@ ret_from_interrupt:
|
|||||||
pea ret_from_exception
|
pea ret_from_exception
|
||||||
jra do_softirq
|
jra do_softirq
|
||||||
|
|
||||||
|
/* Handler for user defined interrupt vectors */
|
||||||
|
|
||||||
|
ENTRY(mach_inthandler)
|
||||||
|
SAVE_ALL_INT
|
||||||
|
GET_CURRENT(%d0)
|
||||||
|
addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
||||||
|
| put exception # in d0
|
||||||
|
bfextu %sp@(PT_VECTOR){#4,#10},%d0
|
||||||
|
|
||||||
|
movel %sp,%sp@-
|
||||||
|
movel %d0,%sp@- | put vector # on stack
|
||||||
|
movel mach_process_int,%a0
|
||||||
|
jsr %a0@ | process the IRQ
|
||||||
|
addql #8,%sp | pop parameters off stack
|
||||||
|
|
||||||
|
subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
||||||
|
jeq ret_from_last_interrupt
|
||||||
|
RESTORE_ALL
|
||||||
|
|
||||||
/* Handler for uninitialized and spurious interrupts */
|
/* Handler for uninitialized and spurious interrupts */
|
||||||
|
|
||||||
bad_interrupt:
|
ENTRY(bad_inthandler)
|
||||||
addql #1,num_spurious
|
SAVE_ALL_INT
|
||||||
rte
|
GET_CURRENT(%d0)
|
||||||
|
addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
||||||
|
|
||||||
|
movel %sp,%sp@-
|
||||||
|
jsr handle_badint
|
||||||
|
addql #4,%sp
|
||||||
|
|
||||||
|
subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
|
||||||
|
jeq ret_from_last_interrupt
|
||||||
|
RESTORE_ALL
|
||||||
|
|
||||||
|
|
||||||
ENTRY(sys_fork)
|
ENTRY(sys_fork)
|
||||||
SAVE_SWITCH_STACK
|
SAVE_SWITCH_STACK
|
||||||
|
@@ -248,19 +248,16 @@ static void dummy_free_irq(unsigned int irq, void *dev_id)
|
|||||||
printk("calling uninitialized disable_irq()\n");
|
printk("calling uninitialized disable_irq()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
|
asmlinkage void m68k_handle_int(unsigned int irq, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) {
|
kstat_cpu(0).irqs[irq]++;
|
||||||
vec -= VEC_SPUR;
|
irq_list[irq].handler(irq, irq_list[irq].dev_id, regs);
|
||||||
kstat_cpu(0).irqs[vec]++;
|
}
|
||||||
irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
|
|
||||||
} else {
|
asmlinkage void handle_badint(struct pt_regs *regs)
|
||||||
if (mach_process_int)
|
{
|
||||||
mach_process_int(vec, fp);
|
kstat_cpu(0).irqs[0]++;
|
||||||
else
|
printk("unexpected interrupt from %u\n", regs->vector);
|
||||||
panic("Can't process interrupt vector %ld\n", vec);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int show_interrupts(struct seq_file *p, void *v)
|
int show_interrupts(struct seq_file *p, void *v)
|
||||||
|
@@ -45,7 +45,6 @@
|
|||||||
asmlinkage void system_call(void);
|
asmlinkage void system_call(void);
|
||||||
asmlinkage void buserr(void);
|
asmlinkage void buserr(void);
|
||||||
asmlinkage void trap(void);
|
asmlinkage void trap(void);
|
||||||
asmlinkage void inthandler(void);
|
|
||||||
asmlinkage void nmihandler(void);
|
asmlinkage void nmihandler(void);
|
||||||
#ifdef CONFIG_M68KFPU_EMU
|
#ifdef CONFIG_M68KFPU_EMU
|
||||||
asmlinkage void fpu_emu(void);
|
asmlinkage void fpu_emu(void);
|
||||||
@@ -53,51 +52,7 @@ asmlinkage void fpu_emu(void);
|
|||||||
|
|
||||||
e_vector vectors[256] = {
|
e_vector vectors[256] = {
|
||||||
[VEC_BUSERR] = buserr,
|
[VEC_BUSERR] = buserr,
|
||||||
[VEC_ADDRERR] = trap,
|
|
||||||
[VEC_ILLEGAL] = trap,
|
|
||||||
[VEC_ZERODIV] = trap,
|
|
||||||
[VEC_CHK] = trap,
|
|
||||||
[VEC_TRAP] = trap,
|
|
||||||
[VEC_PRIV] = trap,
|
|
||||||
[VEC_TRACE] = trap,
|
|
||||||
[VEC_LINE10] = trap,
|
|
||||||
[VEC_LINE11] = trap,
|
|
||||||
[VEC_RESV12] = trap,
|
|
||||||
[VEC_COPROC] = trap,
|
|
||||||
[VEC_FORMAT] = trap,
|
|
||||||
[VEC_UNINT] = trap,
|
|
||||||
[VEC_RESV16] = trap,
|
|
||||||
[VEC_RESV17] = trap,
|
|
||||||
[VEC_RESV18] = trap,
|
|
||||||
[VEC_RESV19] = trap,
|
|
||||||
[VEC_RESV20] = trap,
|
|
||||||
[VEC_RESV21] = trap,
|
|
||||||
[VEC_RESV22] = trap,
|
|
||||||
[VEC_RESV23] = trap,
|
|
||||||
[VEC_SPUR] = inthandler,
|
|
||||||
[VEC_INT1] = inthandler,
|
|
||||||
[VEC_INT2] = inthandler,
|
|
||||||
[VEC_INT3] = inthandler,
|
|
||||||
[VEC_INT4] = inthandler,
|
|
||||||
[VEC_INT5] = inthandler,
|
|
||||||
[VEC_INT6] = inthandler,
|
|
||||||
[VEC_INT7] = inthandler,
|
|
||||||
[VEC_SYS] = system_call,
|
[VEC_SYS] = system_call,
|
||||||
[VEC_TRAP1] = trap,
|
|
||||||
[VEC_TRAP2] = trap,
|
|
||||||
[VEC_TRAP3] = trap,
|
|
||||||
[VEC_TRAP4] = trap,
|
|
||||||
[VEC_TRAP5] = trap,
|
|
||||||
[VEC_TRAP6] = trap,
|
|
||||||
[VEC_TRAP7] = trap,
|
|
||||||
[VEC_TRAP8] = trap,
|
|
||||||
[VEC_TRAP9] = trap,
|
|
||||||
[VEC_TRAP10] = trap,
|
|
||||||
[VEC_TRAP11] = trap,
|
|
||||||
[VEC_TRAP12] = trap,
|
|
||||||
[VEC_TRAP13] = trap,
|
|
||||||
[VEC_TRAP14] = trap,
|
|
||||||
[VEC_TRAP15] = trap,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* nmi handler for the Amiga */
|
/* nmi handler for the Amiga */
|
||||||
@@ -132,12 +87,16 @@ void __init trap_init (void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 48; i < 64; i++)
|
vectors[VEC_SPUR] = bad_inthandler;
|
||||||
|
for (i = VEC_INT1; i <= VEC_INT7; i++)
|
||||||
|
vectors[i] = auto_inthandler;
|
||||||
|
|
||||||
|
for (i = 0; i < VEC_USER; i++)
|
||||||
if (!vectors[i])
|
if (!vectors[i])
|
||||||
vectors[i] = trap;
|
vectors[i] = trap;
|
||||||
|
|
||||||
for (i = 64; i < 256; i++)
|
for (i = VEC_USER; i < 256; i++)
|
||||||
vectors[i] = inthandler;
|
vectors[i] = mach_inthandler;
|
||||||
|
|
||||||
#ifdef CONFIG_M68KFPU_EMU
|
#ifdef CONFIG_M68KFPU_EMU
|
||||||
if (FPU_IS_EMU)
|
if (FPU_IS_EMU)
|
||||||
|
@@ -13,8 +13,15 @@
|
|||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
#include <asm/ptrace.h>
|
||||||
|
|
||||||
typedef void (*e_vector)(void);
|
typedef void (*e_vector)(void);
|
||||||
|
|
||||||
|
asmlinkage void auto_inthandler(void);
|
||||||
|
asmlinkage void mach_inthandler(void);
|
||||||
|
asmlinkage void bad_inthandler(void);
|
||||||
|
|
||||||
extern e_vector vectors[];
|
extern e_vector vectors[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user