Changeset 9be97a3 in rtems


Ignore:
Timestamp:
10/19/21 14:37:03 (10 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
0221da5f
Parents:
a4112bd
git-author:
Sebastian Huber <sebastian.huber@…> (10/19/21 14:37:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/25/21 06:01:02)
Message:

score: Optimize default idle task stack allocator

Update #4524.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/stackallocatorforidle.c

    ra4112bd r9be97a3  
    3232#include <rtems/score/stack.h>
    3333#include <rtems/score/thread.h>
     34#include <rtems/score/assert.h>
    3435
    3536/**
     
    4243 * statically allocated area provided via confdefs.h.
    4344 *
    44  * @param cpu Index of the CPU for the IDLE thread using this stack
     45 * @param cpu_index Index of the CPU for the IDLE thread using this stack
    4546 * @param stack_size The size of the stack area to allocate in bytes.
    4647 *
     
    4950 */
    5051static void *_Stack_Allocator_allocate_for_idle_default(
    51   uint32_t  cpu,
     52  uint32_t  cpu_index,
    5253  size_t    stack_size
    5354)
    5455{
    55   return &_Thread_Idle_stacks[ cpu * stack_size ];
     56#if defined(RTEMS_SMP)
     57  return &_Thread_Idle_stacks[ cpu_index * stack_size ];
     58#else
     59  _Assert( cpu_index == 0 );
     60  return &_Thread_Idle_stacks[ 0 ];
     61#endif
    5662}
    5763
Note: See TracChangeset for help on using the changeset viewer.