Changeset aabfcd0 in rtems


Ignore:
Timestamp:
Jun 12, 2013, 1:11:57 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
873859a4
Parents:
df244cfc
git-author:
Sebastian Huber <sebastian.huber@…> (06/12/13 13:11:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/12/13 14:12:54)
Message:

smp: Fix _Thread_Dispatch_decrement_disable_level

We must obtain the processor ID after interrupts are disabled since a
non-optimizing compiler may store the value on the stack and read it
back.

File:
1 edited

Legend:

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

    rdf244cfc raabfcd0  
    5757  Thread_Dispatch_disable_level_lock_control *level_lock =
    5858    &_Thread_Dispatch_disable_level_lock;
    59   int self_cpu = bsp_smp_processor_id();
     59  int self_cpu;
    6060  ISR_Level isr_level;
    6161  uint32_t disable_level;
    6262
    6363  _ISR_Disable_on_this_core( isr_level );
     64
     65  /*
     66   * We must obtain the processor ID after interrupts are disabled since a
     67   * non-optimizing compiler may store the value on the stack and read it back.
     68   */
     69  self_cpu = bsp_smp_processor_id();
    6470
    6571  if ( level_lock->owner_cpu != self_cpu ) {
Note: See TracChangeset for help on using the changeset viewer.