<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="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:0cm;
        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.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">At some point you need to implement the accessor functions for reading/writing PCI space and device memory. ACPI doesn&#8217;t do any of that for you (it doesn&#8217;t
 know how &#8211; the mappings are OS specific). Part of the ACPI host code you need to implement is for performing those accesses. The ACPICA code is really just a bytecode interpreter with some knowledge of the ACPI data structures. It doesn&#8217;t directly implement
 device access.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">You can either use the traditional IO ports, or the PCIe memory-mapped config space region. Barrelfish does both depending on the device and some heuristics.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Andrew<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> hilfialkaff@gmail.com [mailto:hilfialkaff@gmail.com]
<b>On Behalf Of </b>hilfi alkaff<br>
<b>Sent:</b> Monday, 15 August, 2011 12:57<br>
<b>To:</b> Roscoe Timothy<br>
<b>Cc:</b> barrelfish-users@lists.inf.ethz.ch; Baumann Andrew<br>
<b>Subject:</b> Re: [Barrelfish-users] Details regarding pci support with acpi<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I seee. Do you know whether it's possible to use pure acpi functions only w/o reading the conf space manually? I'm just wondering how much could I acpi-ed my kernel<br>
<br>
Hilfi Alkaff<o:p></o:p></p>
<div>
<p class="MsoNormal">On Mon, Aug 15, 2011 at 11:42 AM, Timothy Roscoe &lt;<a href="mailto:troscoe@inf.ethz.ch">troscoe@inf.ethz.ch</a>&gt; wrote:<o:p></o:p></p>
<p class="MsoNormal"><br>
Hilfi,<br>
<br>
We do low-level PCI reads/writes to configuration space just like<br>
everyone else does - the only difference is the use of the Mackerel<br>
DSL to specify register formats. &nbsp;pci_hdr1.dev is a Mackerel<br>
specification of the PCI type 1 (bridge) header; the format is<br>
documented in the Mackerel manual (Technical note #2). &nbsp; If you read<br>
that documentation, plus the pci_hdr1.dev file, you'll see that<br>
pci_hdr1_vendor_id_rd() is the function to read the vendor id field of<br>
a PCI config header.<br>
<br>
&nbsp;-- Mothy<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
At Mon, 15 Aug 2011 11:03:41 -0700, hilfi alkaff &lt;<a href="mailto:hilfialkaff@berkeley.edu">hilfialkaff@berkeley.edu</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I have some follow up questions regarding the same topic. how do you guys<br>
&gt; read the device ID, vendor ID of the pci? I see this function<br>
&gt; pci_hdr1_vendor_id_rd() but I don't really understand about the .dev file<br>
&gt; format. Do you guys read from the pci conf headers or using acpi commands?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Hilfi Alkaff<br>
&gt;<br>
&gt; On Thu, Aug 4, 2011 at 5:01 PM, hilfi alkaff &lt;<a href="mailto:hilfialkaff@berkeley.edu">hilfialkaff@berkeley.edu</a>&gt;wrote:<br>
&gt;<br>
&gt; &gt; Oh, of course, how I did not realize that, &gt;.&lt;,, Thanks!<br>
&gt; &gt;<br>
&gt; &gt; Hilfi Alkaff<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Thu, Aug 4, 2011 at 4:16 PM, Baumann Andrew &lt;<a href="mailto:andrewb@inf.ethz.ch">andrewb@inf.ethz.ch</a>&gt;wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; &nbsp;Hi,****<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; ** **<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I&#8217;m not sure what you mean by this, since pci_add_root() is a function in<br>
&gt; &gt;&gt; Barrelfish and not ACPICA, but the general answer to your question is<br>
&gt; &gt;&gt; probably that you can&#8217;t use the ACPICA reference in isolation: you also need<br>
&gt; &gt;&gt; to grok parts of the PCI spec (or just the bad Mindshare books), the ACPI<br>
&gt; &gt;&gt; spec, the PNPBIOS spec (mainly just for the device IDs), and if in doubt<br>
&gt; &gt;&gt; also the source code to something clean like FreeBSD to make sense of it<br>
&gt; &gt;&gt; all.****<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; ** **<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Good luck :)****<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; ** **<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Andrew****<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; ** **<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; *From:* hilfi alkaff [mailto:<a href="mailto:hilfialkaff@berkeley.edu">hilfialkaff@berkeley.edu</a>]<br>
&gt; &gt;&gt; *Sent:* Thursday, 04 August, 2011 15:47<br>
&gt; &gt;&gt; *To:* <a href="mailto:barrelfish-users@lists.inf.ethz.ch">barrelfish-users@lists.inf.ethz.ch</a><br>
&gt; &gt;&gt; *Subject:* [Barrelfish-users] Details regarding pci support with acpi****<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; ** **<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Hi,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I'm an undergraduate currently working on a research operating system and<br>
&gt; &gt;&gt; I'm having problems when initializing pci and mapping its interrupts with<br>
&gt; &gt;&gt; ACPI. I'm wondering how do you guys figure out the pci_add_root() function<br>
&gt; &gt;&gt; because I could not find any meaningful details in Intel's acpica reference.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thanks,<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">&gt; &gt;&gt; Hilfi Alkaff****<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>