Problems with pistachio
Ashford Nichols <[email protected]> Fri, 3 Jun 2011 14:33:47 -0700
| Newsgroups | gmane.comp.micro-kernel.l4.l4ka.general |
|---|---|
| Message-ID | <[email protected]> |
--001636e0ae0d4dca8804a4d58233
Content-Type: text/plain; charset=ISO-8859-1
I took your advice so instead of using "L4_Reply()" I used "L4_Send()" and i
took out the unnecessary error check, but nothing changed. The code still
does not seem to be able to acknowledge the interrupt the new code looks
like this:
#include <l4io.h>
#include <l4/ipc.h>
#include <l4/schedule.h>
#include <l4/thread.h>
int main(int argc, char** argv){
printf("application started\n");
L4_ThreadId_t root = L4_MyGlobalId(); //roottask
L4_ThreadId_t irq1 = L4_GlobalId(1, 1); //keyboard interrupt
L4_Time_t one_sec = L4_TimePeriod(1000000);
L4_ThreadId_t from;
L4_AssociateInterrupt(irq1, root);
while(1){
L4_Wait(&from);
if(from == irq1){
printf("interrupt received\n");
L4_LoadMR(0, 0);
L4_Send(from, one_sec); //here I'm assuming that 1 second is enough time
}
}
return 0;
}
I don't of any reason why this shouldn't work.
--001636e0ae0d4dca8804a4d58233
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div class=3D"gmail_quote">I took your advice so instead of using "L4_=
Reply()" I used "L4_Send()" and i took out the=A0unnecessary=
=A0error check, but nothing changed. The code still does not seem to be abl=
e to acknowledge the interrupt the new code looks like this:<div>
<br></div><div><div class=3D"im"><div>#include <l4io.h></div><div>#in=
clude <l4/ipc.h></div><div>#include <l4/schedule.h></div><div>#=
include <l4/thread.h></div><div><br></div><div>int main(int argc, cha=
r** argv){</div>
<div><span style=3D"white-space:pre-wrap"> </span>printf("application =
started\n");</div></div><div><span style=3D"white-space:pre-wrap"> </s=
pan>L4_ThreadId_t root =3D L4_MyGlobalId(); //roottask</div><div class=3D"i=
m">
<div><span style=3D"white-space:pre-wrap"> </span>L4_ThreadId_t irq1 =3D L4=
_GlobalId(1, 1); //keyboard interrupt</div></div><div><span style=3D"white-=
space:pre-wrap"> </span>L4_Time_t one_sec =3D L4_TimePeriod(1000000);</div>
<div><span style=3D"white-space:pre-wrap"> </span>L4_ThreadId_t from;</div>=
<div class=3D"im"><div><span style=3D"white-space:pre-wrap"> </span>L4_Asso=
ciateInterrupt(irq1, root);</div><div><span style=3D"white-space:pre-wrap">=
</span>while(1){</div>
</div><div><span style=3D"white-space:pre-wrap"> </span>L4_Wait(&from)=
;</div><div><span style=3D"white-space:pre-wrap"> </span>if(from =3D=3D ir=
q1){</div><div class=3D"im"><div><span style=3D"white-space:pre-wrap"> </=
span>printf("interrupt received\n");</div>
<div><span style=3D"white-space:pre-wrap"> </span>L4_LoadMR(0, 0);</div><=
/div><div><span style=3D"white-space:pre-wrap"> </span>L4_Send(from, one_=
sec); //here I'm assuming that 1 second is enough time</div>
<div><span style=3D"white-space:pre-wrap"> </span>}</div><div><span style=
=3D"white-space:pre-wrap"> </span>}</div><div><span style=3D"white-space:pr=
e-wrap"> </span>return 0;</div>
<div>}</div></div><div><br></div><div>I don't of any reason why this sh=
ouldn't work.</div>
</div><br>
--001636e0ae0d4dca8804a4d58233--