<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Hello Sebastian,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">thank you for your answer. In the RTEMS Manual you can read</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">that the initialization task should run at Maximum Priority (Classic API).</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">(which sounds reasonable)</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">If then the POSIX_Init should also be startet at that level -> POSIX prio 254?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Instead of the low prio “2” ?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Heinz</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><h4 class="subsection" style="font-family: -webkit-standard;">23.8.5 Specifying Classic API Initialization Task Priority</h4><a name="index-CONFIGURE_005fINIT_005fTASK_005fPRIORITY" style="font-family: -webkit-standard;"></a><span style="font-family: -webkit-standard; font-size: medium;"></span><dl compact="compact" style="font-family: -webkit-standard;"><dt><b>CONSTANT:</b></dt><dd><p><code>CONFIGURE_INIT_TASK_PRIORITY</code></p></dd><dt><b>DATA TYPE:</b></dt><dd><p>RTEMS Task Priority (<code>rtems_task_priority</code>).</p></dd><dt><b>RANGE:</b></dt><dd><p>One (1) to CONFIGURE_MAXIMUM_PRIORITY.</p></dd><dt><b>DEFAULT VALUE:</b></dt><dd><p>The default value is 1, which is the highest priority in the Classic API.</p></dd></dl><a name="DESCRIPTION_003a-149" style="font-family: -webkit-standard;"></a><span style="font-family: -webkit-standard; font-size: medium;"></span><h4 class="subheading" style="font-family: -webkit-standard;">DESCRIPTION:</h4><p style="font-family: -webkit-standard;"><code>CONFIGURE_INIT_TASK_PRIORITY</code> is the initial priority of the single initialization task defined by the Classic API Initialization Tasks Table.</p><a name="NOTES_003a-145" style="font-family: -webkit-standard;"></a><span style="font-family: -webkit-standard; font-size: medium;"></span><h4 class="subheading" style="font-family: -webkit-standard;">NOTES:</h4><p style="font-family: -webkit-standard;">None.</p></div> <br> <div id="bloop_sign_1490984175578322944" class="bloop_sign"><div><div style="font-family: Helvetica, Arial;"><span style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;">------------------------------------------------------------------------------</span></div></div><span style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;">Fritz-Haber-Institut    | Phone:         (+49 30) 8413-4270</span><br style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;"><span style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;">Heinz Junkes             | Fax (G3+G4):   (+49 30) 8413-5900</span><br style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;"><span style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;">Faradayweg 4-6        | </span><br style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;"><span style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;">D - 14195 Berlin        | E-Mail:     </span><a href="mailto:junkes@fhi-berlin.mpg.de" style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;">junkes@fhi-berlin.mpg.de</a><br style="font-family: Helvetica; font-size: 12px; orphans: 2; widows: 2;"><div style="orphans: 2; widows: 2;"><span style="font-family: Helvetica; font-size: 12px;">------------------------------------------------------------------------------</span></div></div> <br><p class="airmail_on">On 31 March 2017 at 14:00:13, users-request@rtems.org (<a href="mailto:users-request@rtems.org">users-request@rtems.org</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Send users mailing list submissions to
<br>      users@rtems.org
<br>
<br>To subscribe or unsubscribe via the World Wide Web, visit
<br>      http://lists.rtems.org/mailman/listinfo/users
<br>or, via email, send a message with subject or body 'help' to
<br>      users-request@rtems.org
<br>
<br>You can reach the person managing the list at
<br>      users-owner@rtems.org
<br>
<br>When replying, please edit your Subject line so it is more specific
<br>than "Re: Contents of users digest..."
<br>
<br>
<br>Today's Topics:
<br>
<br>   1. Posix priority vs. RTEMS priority (Heinz Junkes)
<br>   2. Re: Posix priority vs. RTEMS priority (Sebastian Huber)
<br>
<br>
<br>----------------------------------------------------------------------
<br>
<br>Message: 1
<br>Date: Thu, 30 Mar 2017 15:16:48 +0200
<br>From: Heinz Junkes <junkes@fhi-berlin.mpg.de>
<br>To: "=?utf-8?Q?rtems-users=40rtems.org?=" <users@rtems.org>
<br>Subject: Posix priority vs. RTEMS priority
<br>Message-ID: <etPan.58dd0540.1c44c80b.89fd@fhi-berlin.mpg.de>
<br>Content-Type: text/plain; charset="utf-8"
<br>
<br>Dear list,
<br>
<br>I?m a bit confused about the priorities used with POSIX in ?RTEMS 4.12.
<br>
<br>In the system config I am using the POSIX initialization:
<br>
<br>extern void *EPICS_WITH_POSIX_Init(void *argument);
<br>
<br>#define CONFIGURE_POSIX_INIT_THREAD_TABLE
<br>#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT EPICS_WITH_POSIX_Init
<br>
<br>Requesting the task priority in EPICS_WITH_POSIX_Init() I get Prio ?2? whitch looks like ?RTEMS_HIGH_PRIO? ?
<br>
<br>void *
<br>EPICS_WITH_POSIX_Init (void *argument)
<br>{
<br>?int policy;
<br>? ? struct sched_param param;
<br>
<br>? ? if (pthread_getschedparam(pthread_self(), &policy, &param) != 0)
<br>? ? ? delayedPanic("pthread_getschedparam failed?);
<br>
<br>? ? printf(" main priority = %d\n", param.sched_priority);
<br>
<br>leads to the output:
<br>
<br>...
<br>?main priority = 2
<br>
<br>***** RTEMS Version: rtems-4.11.99.0 (PowerPC/Generic (classic FPU)/beatnik) *****
<br>?
<br>
<br>I expected Prio 254 or 253 because at Posix higher priorities -> higher value.
<br>
<br>
<br>What do I think wrong here?
<br>
<br>Heinz
<br>
<br>-------------- next part --------------
<br>An HTML attachment was scrubbed...
<br>URL: <http://lists.rtems.org/pipermail/users/attachments/20170330/377614c0/attachment-0001.html>
<br>-------------- next part --------------
<br>A non-text attachment was scrubbed...
<br>Name: smime.p7s
<br>Type: application/pkcs7-signature
<br>Size: 2209 bytes
<br>Desc: not available
<br>URL: <http://lists.rtems.org/pipermail/users/attachments/20170330/377614c0/attachment-0001.bin>
<br>
<br>------------------------------
<br>
<br>Message: 2
<br>Date: Fri, 31 Mar 2017 06:51:02 +0200
<br>From: Sebastian Huber <sebastian.huber@embedded-brains.de>
<br>To: Heinz Junkes <junkes@fhi-berlin.mpg.de>, "rtems-users@rtems.org"
<br>      <users@rtems.org>
<br>Subject: Re: Posix priority vs. RTEMS priority
<br>Message-ID: <58DDE036.3030809@embedded-brains.de>
<br>Content-Type: text/plain; charset=windows-1252; format=flowed
<br>
<br>Hello Heinz,
<br>
<br>the POSIX initialization threads are created with the default priority  
<br>value (_POSIX_Threads_Default_attributes) which is POSIX 2. You can map  
<br>a POSIX priority to the RTEMS priority via:
<br>
<br>static int get_current_prio( pthread_t thread )
<br>{
<br>   rtems_status_code sc;
<br>   rtems_task_priority prio;
<br>   int max;
<br>
<br>   sc = rtems_task_set_priority( thread, RTEMS_CURRENT_PRIORITY, &prio );
<br>   rtems_test_assert( sc == RTEMS_SUCCESSFUL );
<br>
<br>   max = sched_get_priority_max( SCHED_FIFO );
<br>
<br>   return max + 1 - (int) prio;
<br>}
<br>
<br>On 30/03/17 15:16, Heinz Junkes wrote:
<br>> Dear list,
<br>>
<br>> I?m a bit confused about the priorities used with POSIX in  RTEMS 4.12.
<br>>
<br>> In the system config I am using the POSIX initialization:
<br>>
<br>> extern void *EPICS_WITH_POSIX_Init(void *argument);
<br>>
<br>> #define CONFIGURE_POSIX_INIT_THREAD_TABLE
<br>> #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT EPICS_WITH_POSIX_Init
<br>>
<br>> Requesting the task priority in EPICS_WITH_POSIX_Init() I get Prio ?2?  
<br>> whitch looks like ?RTEMS_HIGH_PRIO? ?
<br>>
<br>> void *
<br>> EPICS_WITH_POSIX_Init (void *argument)
<br>> {
<br>>  int policy;
<br>>     struct sched_param param;
<br>>
<br>>     if (pthread_getschedparam(pthread_self(), &policy, &param) != 0)
<br>> delayedPanic("pthread_getschedparam failed?);
<br>>
<br>>     printf(" main priority = %d\n", param.sched_priority);
<br>>
<br>> leads to the output:
<br>>
<br>> ...
<br>>  main priority = 2
<br>>
<br>> ***** RTEMS Version: rtems-4.11.99.0 (PowerPC/Generic (classic  
<br>> FPU)/beatnik) *****
<br>> ?
<br>>
<br>> I expected Prio 254 or 253 because at Posix higher priorities ->  
<br>> higher value.
<br>>
<br>>
<br>> What do I think wrong here?
<br>>
<br>> Heinz
<br>>
<br>>
<br>>
<br>> _______________________________________________
<br>> users mailing list
<br>> users@rtems.org
<br>> http://lists.rtems.org/mailman/listinfo/users
<br>
<br>--  
<br>Sebastian Huber, embedded brains GmbH
<br>
<br>Address : Dornierstr. 4, D-82178 Puchheim, Germany
<br>Phone   : +49 89 189 47 41-16
<br>Fax     : +49 89 189 47 41-09
<br>E-Mail  : sebastian.huber@embedded-brains.de
<br>PGP     : Public key available on request.
<br>
<br>Diese Nachricht ist keine gesch?ftliche Mitteilung im Sinne des EHUG.
<br>
<br>
<br>
<br>------------------------------
<br>
<br>Subject: Digest Footer
<br>
<br>_______________________________________________
<br>users mailing list
<br>users@rtems.org
<br>http://lists.rtems.org/mailman/listinfo/users
<br>
<br>------------------------------
<br>
<br>End of users Digest, Vol 126, Issue 36
<br>**************************************
<br></div></div></span></blockquote></body></html>