Changeset 5803f37 in rtems


Ignore:
Timestamp:
Jun 28, 2019, 6:30:11 AM (4 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b89d6cc
Parents:
c43071f
Message:

score: Add and use _Thread_Get_unmapped_priority().

Add and use _Thread_Get_unmapped_real_priority().

Location:
cpukit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/capture.h

    rc43071f r5803f37  
    3535#include <rtems.h>
    3636#include <rtems/rtems/tasksimpl.h>
    37 #include <rtems/score/schedulerimpl.h>
    3837
    3938#include <string.h>
     
    891890rtems_capture_task_real_priority (rtems_tcb* tcb)
    892891{
    893   return SCHEDULER_PRIORITY_UNMAP (tcb->Real_priority.priority);
     892  return _Thread_Get_unmapped_real_priority (tcb);
    894893}
    895894
     
    906905rtems_capture_task_curr_priority (rtems_tcb* tcb)
    907906{
    908   return SCHEDULER_PRIORITY_UNMAP (_Thread_Get_priority (tcb));
     907  return _Thread_Get_unmapped_priority (tcb);
    909908}
    910909
  • cpukit/include/rtems/score/schedulerimpl.h

    rc43071f r5803f37  
    3939 * @{
    4040 */
    41 
    42 /**
    43  * @brief Maps a priority value to support the append indicator.
    44  */
    45 #define SCHEDULER_PRIORITY_MAP( priority ) ( ( priority ) << 1 )
    46 
    47 /**
    48  * @brief Returns the plain priority value.
    49  */
    50 #define SCHEDULER_PRIORITY_UNMAP( priority ) ( ( priority ) >> 1 )
    51 
    52 /**
    53  * @brief Clears the priority append indicator bit.
    54  */
    55 #define SCHEDULER_PRIORITY_PURIFY( priority )  \
    56   ( ( priority ) & ~( (Priority_Control) SCHEDULER_PRIORITY_APPEND_FLAG ) )
    57 
    58 /**
    59  * @brief Returns the priority control with the append indicator bit set.
    60  */
    61 #define SCHEDULER_PRIORITY_APPEND( priority )  \
    62   ( ( priority ) | SCHEDULER_PRIORITY_APPEND_FLAG )
    63 
    64 /**
    65  * @brief Returns true, if the item should be appended to its priority group,
    66  * otherwise returns false and the item should be prepended to its priority
    67  * group.
    68  */
    69 #define SCHEDULER_PRIORITY_IS_APPEND( priority ) \
    70   ( ( ( priority ) & SCHEDULER_PRIORITY_APPEND_FLAG ) != 0 )
    7141
    7242/**
  • cpukit/include/rtems/score/schedulernodeimpl.h

    rc43071f r5803f37  
    5050 */
    5151#define SCHEDULER_PRIORITY_APPEND_FLAG 1
     52
     53/**
     54 * @brief Maps a priority value to support the append indicator.
     55 */
     56#define SCHEDULER_PRIORITY_MAP( priority ) ( ( priority ) << 1 )
     57
     58/**
     59 * @brief Returns the plain priority value.
     60 */
     61#define SCHEDULER_PRIORITY_UNMAP( priority ) ( ( priority ) >> 1 )
     62
     63/**
     64 * @brief Clears the priority append indicator bit.
     65 */
     66#define SCHEDULER_PRIORITY_PURIFY( priority )  \
     67  ( ( priority ) & ~( (Priority_Control) SCHEDULER_PRIORITY_APPEND_FLAG ) )
     68
     69/**
     70 * @brief Returns the priority control with the append indicator bit set.
     71 */
     72#define SCHEDULER_PRIORITY_APPEND( priority )  \
     73  ( ( priority ) | SCHEDULER_PRIORITY_APPEND_FLAG )
     74
     75/**
     76 * @brief Returns true, if the item should be appended to its priority group,
     77 * otherwise returns false and the item should be prepended to its priority
     78 * group.
     79 */
     80#define SCHEDULER_PRIORITY_IS_APPEND( priority ) \
     81  ( ( ( priority ) & SCHEDULER_PRIORITY_APPEND_FLAG ) != 0 )
    5282
    5383/**
  • cpukit/include/rtems/score/threadimpl.h

    rc43071f r5803f37  
    15991599  scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
    16001600  return _Priority_Get_priority( &scheduler_node->Wait.Priority );
     1601}
     1602
     1603/**
     1604 * @brief Returns the unmapped priority of the thread.
     1605 *
     1606 * @param the_thread The thread of which to get the unmapped priority.
     1607 *
     1608 * @return The unmapped priority of the thread.
     1609 */
     1610RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_priority(
     1611  const Thread_Control *the_thread
     1612)
     1613{
     1614  return SCHEDULER_PRIORITY_UNMAP( _Thread_Get_priority( the_thread ) );
     1615}
     1616
     1617/**
     1618 * @brief Returns the unmapped real priority of the thread.
     1619 *
     1620 * @param the_thread The thread of which to get the unmapped real priority.
     1621 *
     1622 * @return The unmapped real priority of the thread.
     1623 */
     1624RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_real_priority(
     1625  const Thread_Control *the_thread
     1626)
     1627{
     1628  return SCHEDULER_PRIORITY_UNMAP( the_thread->Real_priority.priority );
    16011629}
    16021630
  • cpukit/libdebugger/rtems-debugger-threads.c

    rc43071f r5803f37  
    3232#include <rtems.h>
    3333#include <rtems/assoc.h>
    34 #include <rtems/score/schedulerimpl.h>
    3534#include <rtems/score/threadimpl.h>
    3635
     
    505504rtems_debugger_thread_current_priority(rtems_debugger_thread* thread)
    506505{
    507   return SCHEDULER_PRIORITY_UNMAP(_Thread_Get_priority(thread->tcb));
     506  return _Thread_Get_unmapped_priority(thread->tcb);
    508507}
    509508
     
    511510rtems_debugger_thread_real_priority(rtems_debugger_thread* thread)
    512511{
    513   return SCHEDULER_PRIORITY_UNMAP(thread->tcb->Real_priority.priority);
     512  return _Thread_Get_unmapped_real_priority(thread->tcb);
    514513}
    515514
  • cpukit/libmisc/cpuuse/cpuusagetop.c

    rc43071f r5803f37  
    449449                   thread->Object.id,
    450450                   name,
    451                    thread->Real_priority.priority,
    452                    _Thread_Get_priority(thread));
     451                   _Thread_Get_unmapped_real_priority(thread),
     452                   _Thread_Get_unmapped_priority(thread));
    453453
    454454      usage = data->usage[i];
  • cpukit/libmisc/monitor/mon-task.c

    rc43071f r5803f37  
    1010#include <rtems/monitor.h>
    1111#include <rtems/rtems/tasksdata.h>
    12 #include <rtems/score/schedulerimpl.h>
    1312#include <rtems/score/threadimpl.h>
    1413#include <rtems/score/threadqimpl.h>
     
    113112    canonical_task->stack = rtems_thread->Start.Initial_stack.area;
    114113    canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
    115     canonical_task->priority = SCHEDULER_PRIORITY_UNMAP(
    116       _Thread_Get_priority( rtems_thread )
    117     );
     114    canonical_task->priority = _Thread_Get_unmapped_priority( rtems_thread );
    118115    canonical_task->events = api->Event.pending_events;
    119116    /*
Note: See TracChangeset for help on using the changeset viewer.