Re: interrupt dependencies.

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

 



Hi...

On Mon, Feb 8, 2010 at 7:45 PM, Andrea Gasparini <gaspa@xxxxxxxxxxx> wrote:
> Hi,
> Let's say I have two kind of interrupt: IntA e IntB
> After the former, I should do something, let's say "funcA()".
> and after the second I should do (guess what?) funcB().
>
> My constraints are that funcB have to be called after the relative funcA,
> and *not* viceversa, and funcA have to be called during IntA handlers just
> for speeding up things.

First idea that crosses my mind is:

create an atomic (maybe 64 bit one?) counter. Increase it every time
funcA() is executed. then, create same type of counter, let;s name it
old_counter.

Initially, old_counter=counter. Now, when funcB() is about to run, it
checks whether old_counter is still equal to counter. If it's lower,
then we know funcA() has run (at least once) and funcB() needs to
catch up. Then on every iteration of funcB, we increase old_counter up
until it's equal to current counter value.

Hopefully it gives you a clue...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux