<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 12:22 PM, Amaan Cheval <span dir="ltr"><<a href="mailto:amaan.cheval@gmail.com" target="_blank">amaan.cheval@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In reference to #2138; I'd like to give fixing this issue a shot to get my<br>
feet<br>
wet with RTEMS.<br>
<br>
I tried enabling the tests in ./testsuites/smptests/ to find a way to make<br>
the<br>
test fail at first, so I'd have a frame of reference, but I couldn't quite<br>
get<br>
the test to be compiled for i386 at all.<br>
<br>
(I'm not quite sure yet how --enable-tests determines which of the<br>
testsuites<br>
get built - I think <a href="http://bspopts.h.in" rel="noreferrer" target="_blank">bspopts.h.in</a> is generated based on the BSP-specific<br>
config?)<br>
<br>
Based on the little note about --enable-smp in the docs[1], I added the<br>
switch,<br>
along with --enable-tests during the configure stage.<br>
<br>
Full command:<br>
<br>
../kernel/configure --prefix=$HOME/bin/rtems/5-<wbr>i386 --target=i386-rtems5<br>
--enable-rtemsbsp=pc386 --enable-posix --enable-tests --enable-smp<br></blockquote><div><br></div><div>I don't think it is your problem but you have to build a higher CPU model</div><div>to have atomic instructions. I think pc586-sse is OK. </div><div><br></div><div>I tried to build it and got these build errors:</div><div><br></div><div><div>In file included from ../../../../../../../../rtems/c/src/../../cpukit/score/cpu/i386/cpu.c:29:0:</div><div>/home/joel/rtems-work/rtems/cpukit/include/rtems/score/percpu.h:384:23: error: variable or field 'Interrupt_frame' declared void</div><div> CPU_Interrupt_frame Interrupt_frame;</div><div> ^~~~~~~~~~~~~~~</div><div>/home/joel/rtems-work/rtems/cpukit/include/rtems/score/percpu.h:520:8: error: size of array 'unused_space_for_cache_line_alignment' is too large</div><div> char unused_space_for_cache_line_alignment</div><div> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div></div><div><br></div><div>Is that what you see?</div><div><br></div><div>The history of the SMP effort is that the SPARC, PowerPC, and ARM</div><div>turned out to be more attractive to developers and early adopters. The</div><div>i386 didn't get updated as the SMP evolved.</div><div><br></div><div>The i386 has a handful of known SMP issues with tickets and apparently</div><div>some bitrot as the SMP implementation evolved and no one kept the</div><div>i386 up to date.</div><div><br></div><div>It would be appreciated to fix build errors and get it working no matter</div><div>what the issues are. Look at the comparable code in the architectures</div><div>I listed to see what the proper thing to do is. I suspect the i386 is not that</div><div>far off.</div><div><br></div><div>Disclaimer: the pc386 is based primarily on legacy hardware. It supports</div><div>just enough of the new PIC to handle SMP interrupts. This limits the number</div><div>of IRQ sources. There is an open project related to that. But the SMP</div><div>did work and should be a few patches of rot and known bugs away.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
This results in a failure at the make step[2] (at least as of commit cf2024<br>
(and<br>
a quick test against 828049, after running bootstrap -H as well)).<br>
<br>
Before the preinstall stage was removed, BSP_HAS_SMP in<br>
./c/src/lib/libbsp/i386/pc386/<wbr>include/<a href="http://bspopts.h.in" rel="noreferrer" target="_blank">bspopts.h.in</a> was undef'd as well,<br>
which<br>
seems to be relevant.<br>
<br>
I haven't dug enough into what may be causing the error; I'm sending this<br>
email<br>
erring on the side of asking too many questions, since I figured it'd be<br>
more<br>
effective to just get help and work faster from the collective genius of the<br>
community!<br>
<br>
Am I just doing something inherently misguided in even trying to enable<br>
these<br>
tests for i386?<br>
<br>
<br>
[1]<br>
<a href="https://docs.rtems.org/branches/master/c-user/symmetric_multiprocessing_services.html#introduction" rel="noreferrer" target="_blank">https://docs.rtems.org/<wbr>branches/master/c-user/<wbr>symmetric_multiprocessing_<wbr>services.html#introduction</a><br>
[2] <a href="https://gist.github.com/AmaanC/03566c18793ff61a25328bfaf395df09" rel="noreferrer" target="_blank">https://gist.github.com/<wbr>AmaanC/<wbr>03566c18793ff61a25328bfaf395df<wbr>09</a><br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</blockquote></div><br></div></div>