Changeset a4bca685 in rtems


Ignore:
Timestamp:
Sep 21, 2017, 11:32:25 AM (19 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
714cb06
Parents:
b800f88
git-author:
Sebastian Huber <sebastian.huber@…> (09/21/17 11:32:25)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/21/17 11:33:00)
Message:

bsps/powerpc: Fix robust thread dispatch

Implement thread dispatch code in ppc_exc_wrapup() similar to
ppc_exc_interrupt().

Update #2811.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_hdl.c

    rb800f88 ra4bca685  
    9494void ppc_exc_wrapup(BSP_Exception_frame *frame)
    9595{
    96   /* dispatch_disable level is decremented from assembly code.  */
    97   if ( _Thread_Dispatch_necessary ) {
    98     /* FIXME: I believe it should be OK to re-enable
    99      *        interrupts around the execution of _Thread_Dispatch();
    100      */
    101     _Thread_Dispatch();
     96  Per_CPU_Control *cpu_self;
     97
     98  cpu_self = _Per_CPU_Get();
     99
     100  if (cpu_self->isr_dispatch_disable) {
     101    return;
    102102  }
     103
     104  while (cpu_self->dispatch_necessary) {
     105    uint32_t msr;
     106    rtems_interrupt_level level;
     107
     108    cpu_self->isr_dispatch_disable = 1;
     109    cpu_self->thread_dispatch_disable_level = 1;
     110    msr = ppc_machine_state_register();
     111    _Thread_Do_dispatch(cpu_self, msr | MSR_EE);
     112    rtems_interrupt_local_disable(level);
     113    (void) level;
     114    cpu_self = _Per_CPU_Get();
     115  }
     116
     117  cpu_self->isr_dispatch_disable = 0;
    103118}
Note: See TracChangeset for help on using the changeset viewer.