ÂÂ Here is my patch which hacked set_vi_srs_handler, with this I could successfully bring timer(compare/counter),
ÂÂ But I still not reach the root problem,
Could someone shine some lights on me.
ÂÂ Thanks
Dennis
On Mon, Dec 27, 2010 at 4:40 PM, Dennis.Yxun <dennis.yxun@xxxxxxxxx> wrote:
HI ALL:
ÂÂÂ I'm try to porting kernel-2.6.36 to one mips24kc board, seems it can't bind vectored irq 7 to timer interrupt.
The hardware wired IP7 to timer interrupt (CP0 compare/counter interrupt)
ÂÂÂ I implemented my own time.c, use set_vi_handler to map cp0_compare_irq(value: 7) to mips_timer_dispatch,
Âbut weird problem, it didn't successfully map to mips_timer_dispatch, but print out "Caught unexpected vectored interrupt."
which means it still use " static asmlinkage void do_default_vi(void)"Â [1]
ÂÂ My question is : why first call to "set_vi_srs_handler" successfully mapped to vectored irq7 [2]
but later is fail[3], see my attached file, bad_kernel.txt
Dennis
[1] arch/mips/kernel/traps.c 1339
[2] arch/mips/kernel/traps.c 1436, when addr == NULL
[3] my attached file time.c get_c0_compare_int
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index e971043..ead8750 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1377,6 +1377,11 @@ static asmlinkage void do_default_vi(void) panic("Caught unexpected vectored interrupt."); } +static asmlinkage void mips_timer_dispatch(void) +{ + do_IRQ(7); +} + static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) { unsigned long handler; @@ -1388,7 +1393,14 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) BUG_ON(!cpu_has_veic && !cpu_has_vint); if (addr == NULL) { - handler = (unsigned long) do_default_vi; + switch(n) { + case 7: + handler = (unsigned long) mips_timer_dispatch; + break; + default: + handler = (unsigned long) do_default_vi; + break; + } srs = 0; } else handler = (unsigned long) addr;