RE: Problems with pistachio
Jan Stoess <[email protected]> Fri, 3 Jun 2011 16:24:35 +0000
| Newsgroups | gmane.comp.micro-kernel.l4.l4ka.general |
|---|---|
| Message-ID | <[email protected]> |
--_000_0453D4730CA16449B61476A072CC48BC058BC665i30s6osukade_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Ashford,
L4_INLINE L4_MsgTag_t L4_Reply (L4_ThreadId_t to)
{
return L4_Send_Timeout (to, L4_ZeroTime);
}
L4_Reply(irq1);
Actually does a zero timeout send so you may just not be able to reach the =
guy. Also, bad practice, you do not test for any IPC errors here. Can you c=
heck whether the IPC is successful and/or either send with a real timeout o=
r using L4_Send(), which uses infinite timeout?
Best,
-Jan
--
Dr. Jan Stoess, KIT System Architecture Group
Phone: +49 (721) 6084 4056
From: [email protected] [mailto:[email protected]=
uhe.de] On Behalf Of Ashford Nichols
Sent: Friday, June 03, 2011 9:01 AM
To: [email protected]
Subject: Problems with pistachio
I have fixed the second problem but I would still like to have the answers =
for the other two. I have modified the interrupt handling code so it is eas=
ier to understand. The modified version of the code (with the exact same pr=
oblem) 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 =3D L4_MyGlobalId();
L4_ThreadId_t irq1 =3D L4_GlobalId(1, 1); // keyboard interrupt
L4_AssociateInterrupt(irq1, root);
while(1){
L4_Receive(irq1);
printf("interrupt received\n");
L4_LoadMR(0, 0);
L4_Reply(irq1);
}
return 0;
}
So can anyone tell me why this piece of code does not acknowledge the inter=
rupt?
Ashford
--_000_0453D4730CA16449B61476A072CC48BC058BC665i30s6osukade_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.apple-tab-span
{mso-style-name:apple-tab-span;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">Ashford,<o:p></o:p></span=
></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">L4_INLINE L4_MsgTag_t L4_=
Reply (L4_ThreadId_t to)<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">{<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D"> return=
L4_Send_Timeout (to, L4_ZeroTime);<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">}<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal">L4_Reply(irq1);<o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">Actually does a zero time=
out send so you may just not be able to reach the guy. Also, bad practice, =
you do not test for any IPC errors here. Can you check whether
the IPC is successful and/or either send with a real timeout or using L4_S=
end(), which uses infinite timeout?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">Best,<o:p></o:p></span></=
p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">-Jan<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D"><o:p> </o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">--<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">Dr. Jan Stoess, KIT Syste=
m Architecture Group<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D">Phone: +49 (721) 6084=
4056<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:"Ca=
libri","sans-serif";color:#1F497D"><o:p> </o:p></span><=
/p>
<div style=3D"border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in =
4.0pt">
<div>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:"=
;Tahoma","sans-serif"">From:</span></b><span style=3D"font-s=
ize:10.0pt;font-family:"Tahoma","sans-serif""> l4ka-bou=
[email protected] [mailto:[email protected]]
<b>On Behalf Of </b>Ashford Nichols<br>
<b>Sent:</b> Friday, June 03, 2011 9:01 AM<br>
<b>To:</b> [email protected]<br>
<b>Subject:</b> Problems with pistachio<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">I have fixed the second problem but I would still li=
ke to have the answers for the other two. I have modified the interrupt han=
dling code so it is easier to understand. The modified version of the code =
(with the exact same problem) looks
like this:<o:p></o:p></p>
<div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class=3D"MsoNormal">#include <l4io.h><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">#include <l4/ipc.h><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">#include <l4/schedule.h><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">#include <l4/thread.h><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class=3D"MsoNormal">int main(int argc, char** argv){<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; </span>printf("application started\n=
");<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; </span>L4_ThreadId_t root =3D L4_MyGlobal=
Id();<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; </span>L4_ThreadId_t irq1 =3D L4_GlobalId=
(1, 1); // keyboard interrupt<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; </span>L4_AssociateInterrupt(irq1, root);=
<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; </span>while(1){<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; =
</span>L4_Receive(irq1);<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; =
</span>printf("interrupt received\n&quo=
t;);<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; =
</span>L4_LoadMR(0, 0);<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; =
</span>L4_Reply(irq1);<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; </span>}<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span class=3D"apple-tab-span"> &nb=
sp; </span>return 0;<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">}<o:p></o:p></p>
</div>
</div>
<div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class=3D"MsoNormal">So can anyone tell me why this piece of code does no=
t acknowledge the interrupt?<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class=3D"MsoNormal">Ashford<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>
--_000_0453D4730CA16449B61476A072CC48BC058BC665i30s6osukade_--