<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE style="DISPLAY: none" type=text/css><!-- P {margin-top:0;margin-bottom:0;} --></STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css>
body {border-width:0;margin:0}
img {border:0;margin:0;padding:0}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 11.00.10570.1001"></HEAD>
<BODY
style="BORDER-LEFT-WIDTH: 0px; FONT-SIZE: 10.5pt; FONT-FAMILY: times new roman; BORDER-RIGHT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; COLOR: #000000; MARGIN: 12px; LINE-HEIGHT: 1.5; BORDER-TOP-WIDTH: 0px"
marginheight="0" marginwidth="0">
<DIV>Because of the based linux version has been changed, some functions have
been reweitten. You need to compare the tutorial with the latest
version of LITMUS-RT's plugin (for example sched_pfp.c) . Rewrite
the related functions yourself.</DIV>
<DIV> </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; COLOR: #c0c0c0"
align=left>2016-10-26
<HR id=SignNameHR
style="BORDER-TOP: #c0c0c0 1px solid; HEIGHT: 1px; BORDER-RIGHT: 0px; WIDTH: 122px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px"
align=left>
<SPAN id=_FlashSignName>shijunjie92</SPAN> </DIV>
<HR
style="BORDER-TOP: #c0c0c0 1px solid; HEIGHT: 1px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px">
<BLOCKQUOTE id=ntes-flashmail-quote
style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; PADDING-LEFT: 0px; MARGIN-LEFT: 0px">
<DIV><STRONG>发件人:</STRONG>NICHOLAS ALLAN KLEPP <nickbk@uga.edu></DIV>
<DIV><STRONG>发送时间:</STRONG>2016-10-26 19:01</DIV>
<DIV><STRONG>主题:</STRONG>[LITMUS^RT] Create a Plugin Tutorial Step 5</DIV>
<DIV><STRONG>收件人:</STRONG>"litmus-dev@lists.litmus-rt.org"<litmus-dev@lists.litmus-rt.org></DIV>
<DIV><STRONG>抄送:</STRONG></DIV>
<DIV> </DIV>
<DIV>
<DIV id=divtagdefaultwrapper
style="FONT-SIZE: 12pt; FONT-FAMILY: Calibri,Arial,Helvetica,sans-serif; COLOR: #000000">
<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></DIV></BLOCKQUOTE></BODY></HTML>