<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 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:11.0pt;
        font-family:"Calibri","sans-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;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.E-MailFormatvorlage18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#002060;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:2076589644;
        mso-list-type:hybrid;
        mso-list-template-ids:988308562 67567617 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</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=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US style='color:#002060'>Hello, Folks<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#002060'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#002060'>It turned out that
the below mentioned statement<br>
</span><span
lang=EN-US>‘static const word_t CACHE_LINE_MASK = (CACHE_LINE_SIZE
– 1)’</span><span lang=EN-US style='color:#002060'><br>
is not only superfluous, but is fatal to the build. It creates a number of
loader errors of the sort:<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US
style='color:black'>arm-linux-ld: sam/pistachio/bin/kernel: warning: allocated
section `.text' not in segment<o:p></o:p></span></i></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US
style='color:black'>arm-linux-ld: sam/pistachio/bin/kernel: warning: allocated
section `.glue_7' not in segment<o:p></o:p></span></i></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US
style='color:black'>arm-linux-ld: sam/pistachio/bin/kernel: warning: allocated
section `.glue_7t' not in segment<o:p></o:p></span></i></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US
style='color:black'>…<o:p></o:p></span></i></p>
<p class=MsoNormal><span lang=EN-US style='color:#002060'>I can only guess that
this has something to do with the fact that the statement creates a code
allocation in any source files which includes ‘cache.h’. Commenting
the statement out heals the problem.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#002060'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#002060'>Regards<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#002060'>Frank<o:p></o:p></span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
developer-bounces@okl4.org [mailto:developer-bounces@okl4.org] <b>On Behalf Of </b>Frank
Kaiser<br>
<b>Sent:</b> Wednesday, July 09, 2008 4:31 PM<br>
<b>To:</b> developer@okl4.org<br>
<b>Subject:</b> [okl4-developer] OKL4 2.1: Original version
of'arch/arm/pistachio/cpu/arm926ejs/include/cache.h' is not compilable<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span lang=EN-US>Hello<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>When I started my platform development, I
drew the okl4_2.1.tar.gz tarball from <a
href="http://wiki.ok-labs.com/FrontPage?action=AttachFile">http://wiki.ok-labs.com/FrontPage?action=AttachFile</a>.
Unzipping it, for some reason, I did not get out the core specific include
files ‘cache.h’, ‘cpu.h’ and ‘syscon.h’
located at ‘arch/arm/pistachio/cpu/arm926ejs/include/’. Since there
is no example platform in the tarball using the ARM926EJ-S core, I thought they
were left out intentionally, and I created my own ones by combining the XSCALE
and ARM920T variants with ARM926EJ-S variants from OKL4 1.4.9. It just did not
occur to me that the unzip went wrong.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Meanwhile a colleague also used the
mentioned tarball and put it in our SVN repository. Recently I began to
integrate my new platform code into the SVN repository and discovered the
missing header file. Comparing them with my own creation showed that I have
some insignificant differences with ‘cpu.h’ and
‘syscon.h’, but a significant difference in the referenced header
files with ‘cache.h’.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Here the include statements of the
original:<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include
<debug.h><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include
<cpu/syscon.h><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include
<cache.h><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include <plat/platform.h>
/* Get cache size */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Here the include statements of my private
version:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
#include <kernel/debug.h><o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>#include
<kernel/arch/asm.h><o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>#include
<kernel/cpu/syscon.h><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Another difference is that the original version
contains the definition <br>
‘static const word_t CACHE_LINE_MASK = (CACHE_LINE_SIZE – 1)’
<br>
which does not exist in my private version, and I do not see that
CACHE_LINE_MASK is anywhere referenced.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>My private version compiles w/o a flaw, but
the original one files for the first compiled source file (asid.cc) with the
following multiple error:<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>sam/pistachio/include/kernel/cpu/cache.h:
In static member function `static void arm_cache::cache_flush_i()':<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>sam/pistachio/include/kernel/cpu/cache.h:150:
error: expected `)' before "_"<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>sam/pistachio/include/kernel/cpu/cache.h:148:
warning: unused variable 'zero'<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>The relevant code lines are:<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>
__asm__ __volatile__ (<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>
" mcr p15, 0, "_(zero)", c7, c5,
0 ;" /* Flush I cache */<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#if
defined(__GNUC__)<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>
:: [zero] "r" (zero)<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#endif<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>The problem is that ‘_()’ is a
preprocessor macro defined in ‘kernel/arch/asm.h’ which the
original file misses.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>I made the addition to the original file by
following its include path scheme:<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include
<debug.h><o:p></o:p></span></p>
<p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>#include
<arch/asm.h><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include
<cpu/syscon.h><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include
<cache.h><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>#include
<plat/platform.h> /* Get cache size */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Surprisingly this correction does not work.
I get most of the files of the PISTACHIO kernel compiled until it comes to the platform
specific ones. With ‘platform/at91/pistachio/src/interrupt.cc’ the
error reappears, and additionally the compiler claims that it does not find the
header files ‘debug.h’, ‘arch/asm.h’,
‘cpu/syscon.h’, ‘cache.h’ and
‘plat/platform.h’, the 5 ones included by
‘…/arm926ejs/include/cache.h’. Something must we wrong the
the include paths seen by the compiler, and a view in the log shows the
difference.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>When compiling, for instance
‘asid.cc’, the include paths are (‘sam’ is the build
directory):<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>-Isam/pistachio/include
<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>-Isam/pistachio/object/pistachio/include
<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>-Ipistachio/include
<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>-Iarch/arm/pistachio/v5/include<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>However, for ‘interrupt.cc’ the
include paths are:<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>-Isam/pistachio/include
<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>-Isam/pistachio/object/pistachio/src
<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>-Ipistachio/src<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Both files share only the first include
paths of both list. Checking this location shows that ‘asm.h’ is
found at ‘sam/pistachio/include/kernel/arch’. That explains why my
private version of ‘cache.h’ finds it. But when compiling
‘asid.cc’ the original version finds it too, and that is thru the
second include path ‘sam/pistachio/object/pistachio/include’ under
which copy of the arch directory exists. It looks as if there is a mix-up of
include paths versus header file copies in the build directory. The question
is:<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span
lang=EN-US style='font-family:Symbol'><span style='mso-list:Ignore'>·<span
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span
lang=EN-US>Why are there different include paths for the pistachio kernel
source files and for the platform-dependent source files?<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span
lang=EN-US style='font-family:Symbol'><span style='mso-list:Ignore'>·<span
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span
lang=EN-US>Why are there two copies of the architectural-, cpu-, kdb- and
platform-specific header files, one set in ‘<build_dir>/pistachio/include/kernel’
and one set in
‘<build_dir>/pistachio/object/pistachio/include’?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Although the copies are created by SCONS,
it is confusing regarding the correct set-up of #include directives in the
source file. If I had to write my platform source files totally from scratch,
I’d have had a hard time with this. Actually I made a test compilation
with an existing platform to figure out how the build directory looks like
after a successful build.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Regards<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Frank<o:p></o:p></span></p>
</div>
</div>
</body>
</html>