<div dir="ltr">Thanks. I have pushed this.<div><br></div><div>--joel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 23, 2019 at 10:23 AM Maksim Kozlov <<a href="mailto:maksim.e.kozlov@gmail.com">maksim.e.kozlov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Hi,<br><br>I encountered an error when tried launch 'top' command from RTEMS Sell:<br><br>SHLL [/] # top<br><br>*** FATAL ***<br>fatal source: 0 (INTERNAL_ERROR_CORE)<br>fatal code: 38 (INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT)<br>RTEMS version: 5.0.0.97cce5c9a18563f58aadc2af1049957420ad561d-modified<br>RTEMS tools: 7.4.0 20181206 (RTEMS 5, RSB<br>0bb29a38fb73342c3c25c6917884e08f7386a6f4, Newlib<br>dc6e94551f09d3a983afd571478d)<br>executing thread ID: 0x08a010004<br>executing thread name: CPlt<br>Idle loop start...<br><br>After some investigation, I found out that this occurs because lazy floating point switch mechanism triggered here:<br><br>040536d4 <_vfprintf_r>:<br><br> 40537a0: 03 01 01 b4 sethi %hi(0x406d000), %g1<br> 40537a4: c0 27 bf 54 clr [ %fp + -172 ]<br> 40537a8: d1 18 63 58 ldd [ %g1 + 0x358 ], %f8<br> 40537ac: c0 27 bf 50 clr [ %fp + -176 ]<br> 40537b0: 25 01 01 b5 sethi %hi(0x406d400), %l2<br> 40537b4: c0 27 be ac clr [ %fp + -340 ]<br> 40537b8: d1 3f be b8 std %f8, [ %fp + -328 ]<br> 40537bc: c0 27 be a0 clr [ %fp + -352 ]<br><br>and after following check in cpukit/score/cpu/sparc/syscall.S we get mentioned error<br><br>/* Ensure that we are a proper floating point thread */<br>cmp %l6, 0<br>be .Lillegal_use_of_floating_point_unit<br> ld [%l4 + %lo(SPARC_THREAD_CONTROL_REGISTERS_FP_CONTEXT_OFFSET)], %l6<br><br>This is because in rtems_task_create(), at first, was swapped modes and attributes, and, at second, was not enabled FP flag. So, I hope the attached small patch resolves this.<br clear="all"></div><div><div dir="ltr" class="gmail-m_1388024381928539666gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><font size="2" face="verdana, sans-serif">--</font></div><div><font size="2" face="verdana, sans-serif">Best regards,</font></div><font size="2" face="verdana, sans-serif">Maksim Kozlov</font></div><div><font size="2" face="verdana, sans-serif"><br></font></div><div><span style="font-family:monospace,monospace">From d48f4c13c61a9287ddf55b33564ce4816e77f40b Mon Sep 17 00:00:00 2001<br>From: Maksim E. Kozlov <<a href="mailto:maksim.e.kozlov@gmail.com" target="_blank">maksim.e.kozlov@gmail.com</a>><br>Date: Wed, 23 Jan 2019 15:17:44 +0300<br>Subject: [PATCH] libmisc: Fix swapped parameters and enable floating point<br> usage.<br><br>---<br> cpukit/libmisc/cpuuse/cpuusagetop.c | 2 +-<br> 1 file changed, 1 insertion(+), 1 deletion(-)<br><br>diff --git a/cpukit/libmisc/cpuuse/cpuusagetop.c b/cpukit/libmisc/cpuuse/cpuusagetop.c<br>index 8e0063bc88..c4bfa704d1 100644<br>--- a/cpukit/libmisc/cpuuse/cpuusagetop.c<br>+++ b/cpukit/libmisc/cpuuse/cpuusagetop.c<br>@@ -530,8 +530,8 @@ void rtems_cpu_usage_top_with_plugin(<br> name = rtems_build_name('C', 'P', 'l', 't');<br> <br> sc = rtems_task_create (name, priority, 4 * 1024,<br>- RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,<br> RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR,<br>+ RTEMS_FLOATING_POINT | RTEMS_LOCAL,<br> &id);<br> <br> if (sc != RTEMS_SUCCESSFUL)<br>--<br>2.17.1</span><font size="2" face="verdana, sans-serif"><br></font></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div>