Thank you, Erwin,

The kernel with your code is still crashed as following. How to handle the
case?  there is no irq or fiq, I have checked the AIC_ISR, AIC_OISR,
AIC_ISNR, AIC_IPER, both of them are zero, it means there is no IRQ or FIQ
occurred. So get_irqnr_and_base returned irqnr(r0) with 0x13. It will be
handled by bad_irq_desc, is the crash related with this bad_irq_desc? 

Unhandled fault: vector exception (0x800) at 0x00000000
Internal error: : 800 [#1]
CPU: 0    Not tainted  (2.6.22-uc0 #90)
PC is at __irq_svc+0x54/0x80
LR is at asm_do_IRQ+0x4c/0x60
pc : [<00013a54>]    lr : [<0001304c>]    psr: 60000093
sp : 00757f68  ip : 00757f48  fp : 007aff14
r10: 007a6660  r9 : 000003ab  r8 : 20000010
r7 : ef900003  r6 : 00000000  r5 : fff82108  r4 : ffffffff
r3 : 00000000  r2 : 00000001  r1 : 00757ef0  r0 : 00000013
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  Segment kernel
Process linuxrc (pid: 1, stack limit = 0x00756258)
Stack: (0x00757f68 to 0x00758000)
7f60:                   00000000 007aff27 00000001 007a6680 007a6680
007a6670 
7f80: 00000000 ef900003 20000010 000003ab 007a6660 007aff14 007aff18
00757fb0 
7fa0: 007a28a0 00013e4c 20000013 ffffffff 00000000 007aff27 00000001
007a6680 
7fc0: 007a6680 007a6670 00000000 00000000 00000000 00000003 007a6660
007aff14 
7fe0: 007aff18 007aff04 007a0170 007a28a0 20000010 00000000 0f008981
42200300 
Backtrace: 
Code: 3afffff9 11a0100d 124fe030 1afffd6a (e5878000) 
Kernel panic - not syncing: Attempted to kill init!

The assemble code is listed:
00013a00 <__irq_svc>:
   13a00:       e24dd048        sub     sp, sp, #72     ; 0x48
   13a04:       e98d1ffe        stmib   sp, {r1, r2, r3, r4, r5, r6, r7, r8,
r9, sl, fp, ip}
   13a08:       e890000e        ldmia   r0, {r1, r2, r3}
   13a0c:       e28d5034        add     r5, sp, #52     ; 0x34
   13a10:       e3e04000        mvn     r4, #0  ; 0x0
   13a14:       e28d0048        add     r0, sp, #72     ; 0x48
   13a18:       e58d1000        str     r1, [sp]
   13a1c:       e1a0100e        mov     r1, lr
   13a20:       e885001f        stmia   r5, {r0, r1, r2, r3, r4}
   13a24:       e59f5038        ldr     r5, [pc, #56]   ; 13a64
<__irq_svc+0x64>
   13a28:       e5956000        ldr     r6, [r5]
   13a2c:       e3a00001        mov     r0, #1  ; 0x1
   13a30:       e3160002        tst     r6, #2  ; 0x2
   13a34:       1a000003        bne     13a48 <__irq_svc+0x48>
   13a38:       e2800001        add     r0, r0, #1      ; 0x1
   13a3c:       e1a060a6        mov     r6, r6, lsr #1
   13a40:       e3500013        cmp     r0, #19 ; 0x13
   13a44:       3afffff9        bcc     13a30 <__irq_svc+0x30>
   13a48:       11a0100d        movne   r1, sp
   13a4c:       124fe030        subne   lr, pc, #48     ; 0x30
   13a50:       1afffd6a        bne     13000 <__init_end>
   13a54:       e5878000        str     r8, [r7]
   13a58:       e59d0040        ldr     r0, [sp, #64]
   13a5c:       e16ff000        msr     SPSR_fsxc, r0
   13a60:       e8ddffff        ldmia   sp, {r0, r1, r2, r3, r4, r5, r6, r7,
r8, r9, sl, fp, ip, sp, lr, pc}^
   13a64:       fff82108        swinv   0x00f82108

00013000 <asm_do_IRQ>:
   13000:       e59f204c        ldr     r2, [pc, #76]   ; 13054 <.text+0x54>
   13004:       e0803080        add     r3, r0, r0, lsl #1
   13008:       e1a0c00d        mov     ip, sp
   1300c:       e3500012        cmp     r0, #18 ; 0x12
   13010:       e0803103        add     r3, r0, r3, lsl #2
   13014:       e92dd8f0        stmdb   sp!, {r4, r5, r6, r7, fp, ip, lr,
pc}
   13018:       e0825103        add     r5, r2, r3, lsl #2
   1301c:       e59f6034        ldr     r6, [pc, #52]   ; 13058 <.text+0x58>
   13020:       859f5034        ldrhi   r5, [pc, #52]   ; 1305c <.text+0x5c>
   13024:       e24cb004        sub     fp, ip, #4      ; 0x4
   13028:       e1a04000        mov     r4, r0
   1302c:       e5967000        ldr     r7, [r6]
   13030:       e5861000        str     r1, [r6]
   13034:       eb005553        bl      28588 <irq_enter>
   13038:       e1a00004        mov     r0, r4
   1303c:       e1a01005        mov     r1, r5
   13040:       e1a0e00f        mov     lr, pc
   13044:       e595f000        ldr     pc, [r5]
   13048:       eb005554        bl      285a0 <irq_exit>
   1304c:       e5867000        str     r7, [r6]
   13050:       e89da8f0        ldmia   sp, {r4, r5, r6, r7, fp, sp, pc}
   13054:       0011666c        andeqs  r6, r1, ip, ror #12
   13058:       001497f8        ldreqsh r9, [r4], -r8
   1305c:       00114dfc        ldreqsh r4, [r1], -ip

Thanks again.
Darwin.
-----邮件原件-----
发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
org] 代表 Erwin Authried
发送时间: 2007年8月2日 2:20
收件人: uClinux development list
主题: Re: [uClinux-dev] How to implement get_irqnr_and_base?

Hi Darwin,

could you please turn off the HTML crap in your e-mail, it is almost
unreadable in my mail client.

Your get_irqnr_and_base macro is probably not working. Try the following
code instead:

Regards,
Erwin

                .macro  disable_fiq
                .endm

                .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
                ldr     \base, =AIC_ISR
                ldr     \irqstat, [\base]
                mov     \irqnr, #1
1001:
                tst     \irqstat, #2
                bne     1002f
                add     \irqnr, \irqnr, #1
                mov     \irqstat, \irqstat, lsr #1
                cmp     \irqnr, #19
                bcc     1001b
1002:           /* EQ will be set if we reach 19 */
                .endm

                .macro  irq_prio_table
                .endm



Am Donnerstag, den 02.08.2007, 01:36 +0800 schrieb Darwin Chen:
> Dear all,
> 
>  
> 
> I have a big problem about porting Linux-2.6.22.-uc0 to Winbond
> W90N740. When get_irqnr_and_base is implemented as following, the
> listed error will occurred. Is this get_irqnr_and_base  mistake? The
> error prompts “Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  Segment
> kernel”, but the error is occurred in __irq_svc, why does the Flag
> prompt “IRQs off”? 
> 
>  
> 
> /*
> 
>  *  include/asm/arch-w90n740/entry-macro.S
> 
>  *
> 
>  *  defines machine dependent entry macros.
> 
>  *  included in the arch/arm/kernel/entry-armv.S
> 
>  */
> 
> #include <asm/mach-types.h>
> 
> #include <asm/arch/hardware.h>
> 
> #ifndef CONFIG_ARCH_W90N740
> 
> #error "Did not defined WINBOND W90N740"
> 
> #endif
> 
>          .macro get_irqnr_preamble base, tmp
> 
>          /* FIXME */
> 
>          .endm
> 
>  
> 
>         ..macro  disable_fiq
> 
>          /* FIXME */
> 
>         ..endm
> 
>  
> 
>          .macro arch_ret_to_user base, tmp
> 
>          /* FIXME */
> 
>          .endm
> 
>  
> 
>          .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
> 
>          mov          \irqnr, #0
> 
>          ldr     r10, =AIC_IPER
> 
>          ldr     r10,[r10]
> 
>          ldr     \tmp, =AIC_ISNR
> 
>          ldr     \tmp,[\tmp]
> 
>          mov r9,#0
> 
>          add  r9,r9, r10, LSR#2
> 
>          cmp r10, \tmp
> 
>          bne  99f
> 
>          mov \irqnr, \tmp
> 
> 99:
> 
>          .endm



_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to