#include #include #include "system.h" struct spinlock_t { #ifdef LEON4_IN_PROGRESS volatile uint32_t mutex; #endif #ifdef RTEMS rtems_id mutex; #endif } typedef spinlock_t; void init_spinlock(spinlock_t* sp); int lock_spinlock(spinlock_t sp); int unlock_spinlock(spinlock_t sp);