Changeset 327ae9ac in rtems


Ignore:
Timestamp:
Apr 18, 2019, 4:29:57 AM (5 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
45d0659
Parents:
cc060f0
git-author:
Sebastian Huber <sebastian.huber@…> (04/18/19 04:29:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/15/19 13:38:02)
Message:

score: Fix per-CPU job done handling

File:
1 edited

Legend:

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

    rcc060f0 r327ae9ac  
    3838typedef struct Per_CPU_Jobs Per_CPU_Jobs;
    3939
     40/*
     41 * Value for the Per_CPU_Job::done member to indicate that a job is done
     42 * (handler was called on the target processor).  Must not be a valid pointer
     43 * value since it overlaps with the Per_CPU_Job::next member.
     44 */
     45#define PER_CPU_JOB_DONE 1
     46
    4047/**
    4148 * @brief A per-processor job.
     
    5158     * @brief Indication if the job is done.
    5259     *
    53      * A job is done if this member has the value one.  This assumes that one
    54      * is not a valid pointer value.
     60     * A job is done if this member has the value PER_CPU_JOB_DONE.  This
     61     * assumes that PER_CPU_JOB_DONE is not a valid pointer value.
    5562     */
    5663    Atomic_Ulong done;
     
    100107    jobs = job->jobs;
    101108    ( *jobs->handler )( jobs->arg );
    102     _Atomic_Store_ulong( &job->done, 1, ATOMIC_ORDER_RELEASE );
     109    _Atomic_Store_ulong( &job->done, PER_CPU_JOB_DONE, ATOMIC_ORDER_RELEASE );
    103110
    104111     _ISR_lock_ISR_disable( &lock_context );
     
    186193      cpu = _Per_CPU_Get_by_index( cpu_index );
    187194
    188       while ( _Atomic_Load_ulong( &job->done, ATOMIC_ORDER_ACQUIRE ) == 0 ) {
     195      while (
     196        _Atomic_Load_ulong( &job->done, ATOMIC_ORDER_ACQUIRE )
     197          != PER_CPU_JOB_DONE
     198      ) {
    189199        switch ( cpu->state ) {
    190200          case PER_CPU_STATE_INITIAL:
Note: See TracChangeset for help on using the changeset viewer.