Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static void scc_perform_callbacks ( void   )  [static]

Perform callbacks registered by scc_monitor_security_failure().

Make sure callbacks only happen once... Since there may be some reason why the interrupt isn't generated, this routine could be called from base(task) level.

One at a time, go through scc_callbacks[] and call any non-null pointers.

Definition at line 889 of file mxc_scc.c.

References SCC_CALLBACK_SIZE, scc_callbacks, and scc_callbacks_lock.

Referenced by scc_set_sw_alarm(), and scc_update_state().

{
      static int callbacks_performed = 0;
      unsigned long irq_flags;      /* for IRQ save/restore */
      int i;

      /* Acquire lock of callbacks table and callbacks_performed flag */
      spin_lock_irqsave(&scc_callbacks_lock, irq_flags);

      if (!callbacks_performed) {
            callbacks_performed = 1;

            /* Loop over all of the entries in the table */
            for (i = 0; i < SCC_CALLBACK_SIZE; i++) {
                  /* If not null, ... */
                  if (scc_callbacks[i]) {
                        scc_callbacks[i] ();    /* invoke the callback routine */
                  }
            }
      }

      spin_unlock_irqrestore(&scc_callbacks_lock, irq_flags);

      return;
}


Generated by  Doxygen 1.6.0   Back to index