simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Re: interrupt flag/enable bits update


From: Theodore A. Roth
Subject: Re: [Simulavr-devel] Re: interrupt flag/enable bits update
Date: Sat, 29 Nov 2003 12:43:42 -0800 (PST)

On Sat, 29 Nov 2003, John Regehr wrote:

> >   if ((read (irq->enable.addr) & irq->enable.mask)
> 
> Just to document the idiom here I'd wrap this in a little function that'll
> get inlined:
> 
>   int int_bit_set (IntBit intbit) {
>     return ((read (intbit.addr) & intbit.mask) != 0);
>   }

Agreed. I just intended that to be psuedo code to get the idea out there.

Speaking of inlining, I've got a huge patch that inlines many of the small 
wrapper functions. My tests show that it gives about a 10% speed increase. 
I'm not gonig to commit until I get Keith's patches in though (hopefully 
this weekend).

> 
> > I'm hoping that you are thinking about something like this for
> > avr_core_check_interrupts():
> >
> >   if ((read (irq->enable.addr) & irq->enable.mask)
> >       && ((irq->flag.mask == 0) ||
> >           (read (irq->flag.addr) & irq->flag.mask)))
> >   {
> >       uint8_t clr_flag = read (irq->flag.addr) & ~irq->flag.mask;
> >
> >       /* vector in the irq */
> >
> >       write (irq->flag.addr, clf_flag);
> >   }
> 
> Yes, that is what I was thinking.

Good. I'll leave the implementation to you then. Once I hear from Keith 
about the remaining USB irq info, I'll commit the irq ctrl bit patch. That 
should give you the infrastructure for your net patch.

Ted Roth





reply via email to

[Prev in Thread] Current Thread [Next in Thread]