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 &quot;L4_=
Reply()&quot; I used &quot;L4_Send()&quot; 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 &lt;l4io.h&gt;</div><div>#in=
clude &lt;l4/ipc.h&gt;</div><div>#include &lt;l4/schedule.h&gt;</div><div>#=
include &lt;l4/thread.h&gt;</div><div><br></div><div>int main(int argc, cha=
r** argv){</div>

<div><span style=3D"white-space:pre-wrap">	</span>printf(&quot;application =
started\n&quot;);</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(&amp;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(&quot;interrupt received\n&quot;);</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&#39;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&#39;t of any reason why this sh=
ouldn&#39;t work.</div>
</div><br>

--001636e0ae0d4dca8804a4d58233--