linux-mips-fnet
[Top] [All Lists]

RE: question about int-handler.S

To: linux-mips@fnet.fr
Subject: RE: question about int-handler.S
From: Harald Koerfgen <Harald.Koerfgen@home.ivm.de>
Date: Tue, 13 Apr 1999 23:40:13 +0200 (MEST)
In-reply-to: <Pine.LNX.3.95.990413110143.315B-100000@skynet.csn.ul.ie>
Organization: none
Reply-to: "Harald Koerfgen" <Harald.Koerfgen@home.ivm.de>
Sender: harry@franz.no.dom
Hi,

On 13-Apr-99 Dave Airlie wrote:
> 
> Hi,
>       I know nothing about mips assembly, I'm just try to find a bug by
> asking silly questions :-)
> 
> The piece of code below is from int-handler.S,
> on line 7 below (b find_int) does this jump unconditionally to find_int?
> because if it does what is the and for afterwards as surely it will
> never get processed... 
> 
> 1:   EXPORT(kn02_io_int)
> 2:kn02_io_int:    lui     t0,0xbff0               # get interrupt status
> and mask
> 3:                lw      t0,(t0)
> 4:                la      t1,asic_mask_tbl
> 5:                move    t3,t0
> 6:                sll     t3,16                   # shift interrupt
> status
> 7:                b       find_int
> 8:                 and    t0,t3                   # mask out allowed
> ones

As already pointed out the "and" will be executed in the branch delay
slot and, yes, it will do something useful. This snippet loads the content
of the System Control and Status Register (CSR) and masks out the allowed
interrupt status bits. The alternative would be:

kn02_io_int:    lui     t0,0xbff0
                lw      t0,(t0)
                nop                     # load delay
                move    t3,t0
                sll     t3,16
                and     t0,t3
                la      t1,asic_mask_tbl
                b       find_int
                nop                     # branch delay

> If the question is silly sorry!!

There are no silly questions, only silly answers :-).
---
Regards,
Harald

<Prev in Thread] Current Thread [Next in Thread>