<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hello! <br>
</p>
<p><br>
</p>
<p>I am following the Create a Plugin Tutorial and I am getting a compilation error after I add the scheduling decision logic in step 5. The error seems to be a problem with the demo_requeue() method. Here is the error message generated on compilation:
<br>
</p>
<p><br>
</p>
<p></p>
<div><span style="font-size: 10pt;">litmus/sched_demo.c: In function ‘demo_requeue’:</span><br>
<span style="font-size: 10pt;">litmus/sched_demo.c:32:28: error: dereferencing pointer to incomplete type</span><br>
<span style="font-size: 10pt;"> __add_ready(&cpu_state->l</span><span style="font-size: 10pt;">o</span><span style="font-size: 10pt;">cal_queues,tsk);</span><br>
<span style="font-size: 10pt;"> ^</span><br>
<span style="font-size: 10pt;">litmus/sched_demo.c:37:28: error: dereferencing pointer to incomplete type</span><br>
<span style="font-size: 10pt;"> add_release(&cpu_state->local_queues,tsk);</span><br>
<span style="font-size: 10pt;"> ^</span><br>
<span style="font-size: 10pt;">litmus/sched_demo.c: In function ‘demo_schedule’:</span><br>
<span style="font-size: 10pt;">litmus/sched_demo.c:69:10: error: implicit declaration of function ‘__get_cpu_var’ [-Werror=implicit-function-declaration]</span><br>
<span style="font-size: 10pt;"> struct demo_cpu_state *local_state = local_cpu_state();</span><br>
<span style="font-size: 10pt;"> ^</span><br>
<span style="font-size: 10pt;">litmus/sched_demo.c:14:28: error: lvalue required as unary ‘&’ operand</span><br>
<span style="font-size: 10pt;"> #define local_cpu_state() (&__get_cpu_var(demo_cpu_state))</span><br>
<span style="font-size: 10pt;"> ^</span><br>
<span style="font-size: 10pt;">litmus/sched_demo.c:69:40: note: in expansion of macro ‘local_cpu_state’</span><br>
<span style="font-size: 10pt;"> struct demo_cpu_state *local_state = local_cpu_state();</span><br>
<span style="font-size: 10pt;"> ^</span><br>
<span style="font-size: 10pt;">litmus/sched_demo.c:83:3: error: implicit declaration of function ‘is_running’ [-Werror=implicit-function-declaration]</span><br>
<span style="font-size: 10pt;"> self_suspends = exists && !is_running(prev);</span><br>
<span style="font-size: 10pt;"> ^</span><br>
<span style="font-size: 10pt;">cc1: some warnings being treated as errors</span><br>
<span style="font-size: 10pt;">scripts/Makefile.build:258: recipe for target 'litmus/sched_demo.o' failed</span><br>
</div>
<p></p>
<p><br>
</p>
<p>In searching the mailing list for similar problems I ran into a thread which did describe the dereferencing pointer to incomplete type error. There are two responses in that thread which I found to be possibly illuminating. One:
<br>
</p>
<p><br>
</p>
<p></p>
<div><span style="font-size: 10pt;">On May 7, 2013, at 2:11 PM, Björn Brandenburg <bbb at mpi-sws.org> wrote:</span><br>
<br>
<span style="font-size: 10pt;">> </span><br>
<span style="font-size: 10pt;">> On May 7, 2013, at 9:29 AM, Schorr Stefan <stschorr at eit.uni-kl.de> wrote:</span><br>
<span style="font-size: 10pt;">>> </span><br>
<span style="font-size: 10pt;">>> I'm trying to follow the Create A Plugin Tutorial from the webpage.</span><br>
<span style="font-size: 10pt;">>> The first steps work like a charm, step 4 however doesn't compile :(</span><br>
<span style="font-size: 10pt;">>> </span><br>
<span style="font-size: 10pt;">>> I copied the code from the website and I created a new local git</span><br>
<span style="font-size: 10pt;">>> branch, so I'm absolutely sure that the only file I changed - apart</span><br>
<span style="font-size: 10pt;">>> from the Makefile - is sched_demo.c (so I don't understand why</span><br>
<span style="font-size: 10pt;">>> the error messages below point to .h files).</span><br>
<span style="font-size: 10pt;">>> </span><br>
<span style="font-size: 10pt;">>> Please give me some hint what goes wrong here...</span><br>
<span style="font-size: 10pt;">>> </span><br>
<span style="font-size: 10pt;">>> Best Regards</span><br>
<span style="font-size: 10pt;">>> Stefan</span><br>
<span style="font-size: 10pt;">>> </span><br>
<span style="font-size: 10pt;">>> </span><br>
<span style="font-size: 10pt;">>> Here's the error I get, when doing make bzImage</span><br>
<span style="font-size: 10pt;">>> </span><br>
<span style="font-size: 10pt;">>> In file included from litmus/sched_demo.c:3:</span><br>
<span style="font-size: 10pt;">>> include/litmus/litmus.h:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘litmus_clock’</span><br>
<span style="font-size: 10pt;">>> include/litmus/litmus.h: In function ‘is_kernel_np’:</span><br>
<span style="font-size: 10pt;">>> include/litmus/litmus.h:120: error: dereferencing pointer to incomplete type</span><br>
<span style="font-size: 10pt;">> </span><br>
<span style="font-size: 10pt;">> </span><br>
<span style="font-size: 10pt;">> Hi Stefan,</span><br>
<span style="font-size: 10pt;">> </span><br>
<span style="font-size: 10pt;">> this is a configuration error in LITMUS^RT. Please enable the configuration option CONFIG_NP_SECTION, which should silence the error. Sorry about that...</span><br>
<br>
<br>
<span style="font-size: 10pt;">Actually, litmus/litmus.h already has correct dummy implementations for the !CONFIG_NP_SECTION case, so it's something different. Have you tried a 'make clean'?</span><br>
<span style="font-size: 10pt;">- Björn<br>
<br>
<span style="font-size: 12pt;">And two: <br>
<br>
<div>
<div><span style="font-size: 10pt;">> On 05/07/2013 02:19 PM, Björn Brandenburg wrote:</span><br>
<span style="font-size: 10pt;">>> If it doesn't go away, you are probably missing a header file. Here are the one from the reference version. Does it fail with these headers as well?</span><br>
<span style="font-size: 10pt;">> </span><br>
<span style="font-size: 10pt;">> Hi Björn,</span><br>
<span style="font-size: 10pt;">> thanks for the fast reply!</span><br>
<span style="font-size: 10pt;">> There's no change after make clean.</span><br>
<span style="font-size: 10pt;">> I paste my C code here:</span><br>
<span style="font-size: 10pt;">> </span><br>
<br>
<span style="font-size: 10pt;">Commit c5248a7288e54c2b5e2bba8aa2677772542bf90e compiles for me. Can you please try compiling c5248a7288e54c2b5e2bba8aa2677772542bf90e and, if it doesn't work, send me your configuration?</span><br>
<br>
<span style="font-size: 10pt;">Thanks,</span><br>
<span style="font-size: 10pt;">Björn</span><br>
</div>
<br>
</div>
</span><span style="font-size: 12pt;">I have verified that CONFIG_NP_SECTION is in fact enabled and as well I have run a 'make clean'. My next option was to try to checkout commit
<span style="font-size: 10pt;"><span style="font-size: 12pt;"><span style="font-size: 10pt;">c5248a7288e54c2b5e2bba8aa2677772542bf90e</span></span></span>, however, this is not allowed for my local repository. The error:
<br>
<br>
</span></span><span style="font-size: 10pt;">fatal: reference is not a tree: c5248a7288e54c2b5e2bba8aa2677772542bf90e</span><br>
<br>
Is there something else I should do to make this work? Thanks! <br>
<span style="font-size: 10pt;"><span style="font-size: 12pt;"><br>
</span></span></div>
- Nick<br>
<p></p>
</div>
</body>
</html>