--- include/asm-generic/hal.h | 23 ++++++----------------- ksrc/nucleus/shadow.c | 12 ++++++------ 2 files changed, 12 insertions(+), 23 deletions(-) Index: xenomai/include/asm-generic/hal.h =================================================================== --- xenomai.orig/include/asm-generic/hal.h +++ xenomai/include/asm-generic/hal.h @@ -84,24 +84,18 @@ typedef struct ipipe_domain rthal_pipeline_stage_t; -#ifdef IPIPE_RW_LOCK_UNLOCKED +#ifdef IPIPE_SPIN_LOCK_UNLOCKED typedef ipipe_spinlock_t rthal_spinlock_t; #define RTHAL_SPIN_LOCK_UNLOCKED IPIPE_SPIN_LOCK_UNLOCKED -typedef ipipe_rwlock_t rthal_rwlock_t; -#define RTHAL_RW_LOCK_UNLOCKED IPIPE_RW_LOCK_UNLOCKED -#else /* !IPIPE_RW_LOCK_UNLOCKED */ -#ifdef RAW_RW_LOCK_UNLOCKED +#else /* !IPIPE_SPIN_LOCK_UNLOCKED */ +#ifdef RAW_SPIN_LOCK_UNLOCKED typedef raw_spinlock_t rthal_spinlock_t; #define RTHAL_SPIN_LOCK_UNLOCKED RAW_SPIN_LOCK_UNLOCKED -typedef raw_rwlock_t rthal_rwlock_t; -#define RTHAL_RW_LOCK_UNLOCKED RAW_RW_LOCK_UNLOCKED -#else /* !RAW_RW_LOCK_UNLOCKED */ +#else /* !RAW_SPIN_LOCK_UNLOCKED */ typedef spinlock_t rthal_spinlock_t; #define RTHAL_SPIN_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED -typedef rwlock_t rthal_rwlock_t; -#define RTHAL_RW_LOCK_UNLOCKED RW_LOCK_UNLOCKED -#endif /* RAW_RW_LOCK_UNLOCKED */ -#endif /* IPIPE_RW_LOCK_UNLOCKED */ +#endif /* !RAW_SPIN_LOCK_UNLOCKED */ +#endif /* !IPIPE_SPIN_LOCK_UNLOCKED */ #define rthal_irq_cookie(ipd,irq) __ipipe_irq_cookie(ipd,irq) #define rthal_irq_handler(ipd,irq) __ipipe_irq_handler(ipd,irq) @@ -131,11 +125,6 @@ typedef rwlock_t rthal_rwlock_t; #define rthal_local_irq_disable_hw() local_irq_disable_hw() #define rthal_local_irq_flags_hw(x) local_save_flags_hw(x) -#define rthal_write_lock(lock) write_lock_hw(lock) -#define rthal_write_unlock(lock) write_unlock_hw(lock) -#define rthal_read_lock(lock) read_lock_hw(lock) -#define rthal_read_unlock(lock) read_unlock_hw(lock) - #ifdef spin_lock_hw #define rthal_spin_lock_init(lock) spin_lock_init(lock) #define rthal_spin_lock(lock) spin_lock_hw(lock) Index: xenomai/ksrc/nucleus/shadow.c =================================================================== --- xenomai.orig/ksrc/nucleus/shadow.c +++ xenomai/ksrc/nucleus/shadow.c @@ -295,7 +295,7 @@ static rthal_pipeline_stage_t irq_shield static cpumask_t shielded_cpus, unshielded_cpus; -static rthal_rwlock_t shield_lock = RTHAL_RW_LOCK_UNLOCKED; +static rthal_spinlock_t shield_lock = RTHAL_SPIN_LOCK_UNLOCKED; static inline void engage_irq_shield(void) { @@ -307,13 +307,13 @@ static inline void engage_irq_shield(voi if (xnarch_cpu_test_and_set(cpuid, shielded_cpus)) goto unmask_and_exit; - rthal_read_lock(&shield_lock); + rthal_spin_lock(&shield_lock); xnarch_cpu_clear(cpuid, unshielded_cpus); xnarch_lock_xirqs(&irq_shield, cpuid); - rthal_read_unlock(&shield_lock); + rthal_spin_unlock(&shield_lock); unmask_and_exit: @@ -330,7 +330,7 @@ static void disengage_irq_shield(void) if (xnarch_cpu_test_and_set(cpuid, unshielded_cpus)) goto unmask_and_exit; - rthal_write_lock(&shield_lock); + rthal_spin_lock(&shield_lock); xnarch_cpu_clear(cpuid, shielded_cpus); @@ -339,7 +339,7 @@ static void disengage_irq_shield(void) (i.e. if no CPU asked for shielding). */ if (!cpus_empty(shielded_cpus)) { - rthal_write_unlock(&shield_lock); + rthal_spin_unlock(&shield_lock); goto unmask_and_exit; } @@ -360,7 +360,7 @@ static void disengage_irq_shield(void) } #endif /* CONFIG_SMP */ - rthal_write_unlock(&shield_lock); + rthal_spin_unlock(&shield_lock); rthal_stage_irq_enable(&irq_shield);