#ifndef hal_arch_arch_h #define hal_arch_arch_h /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file hal/arch/arch.h * \brief Architecture specific definitions. * \ingroup hal_arch */ /** * Forbid any interrupt handling. * * This function maintains a counter of the number of times it is called. */ extern inline void arch_isr_lock (void); /** * Enable again interrupt handling if the lock counter reaches zero. */ extern inline void arch_isr_unlock (void); /** * Forbid any DSR handling. * * This function maintains a counter of the number of times it is called. */ extern inline void arch_dsr_lock (void); /** * Enable again DSR handling if the lock counter reaches zero. */ extern inline void arch_dsr_unlock (void); /** Forbid instruction reordering across this barrier. */ extern inline void arch_reorder_barrier (void); /** * Atomically add an integer value, regarding interrupts. * \param p pointer to value to change * \param d difference to add * \return the new value */ extern inline int arch_atomic_add (volatile int *p, int d); #if defined (ECOS) && ECOS # include "hal/arch/inc/ecos.h" #else /* There is no interrupt support anyway without Ecos. */ extern inline void arch_isr_lock (void) { } extern inline void arch_isr_unlock (void) { } extern inline void arch_dsr_lock (void) { } extern inline void arch_dsr_unlock (void) { } extern inline void arch_reorder_barrier (void) { } #endif /* defined (ECOS) && ECOS */ #if defined (__sparc__) # include "hal/arch/inc/sparc.h" #else /* others. */ # include "hal/arch/inc/generic.h" #endif #endif /* hal_arch_arch_h */