2023-02-02 21:00:40 +00:00
|
|
|
#ifndef SOCKS_LOCKS_H_
|
|
|
|
|
#define SOCKS_LOCKS_H_
|
|
|
|
|
|
2023-02-04 17:46:05 +00:00
|
|
|
#include <socks/compiler.h>
|
|
|
|
|
#include <socks/machine/hwlock.h>
|
2023-02-02 21:00:40 +00:00
|
|
|
|
2023-03-20 20:41:39 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-02-04 17:46:05 +00:00
|
|
|
typedef __aligned(8) ml_hwlock_t spin_lock_t;
|
2023-02-02 21:00:40 +00:00
|
|
|
|
2023-02-04 17:46:05 +00:00
|
|
|
#define SPIN_LOCK_INIT ML_HWLOCK_INIT
|
|
|
|
|
|
2023-06-02 19:35:07 +01:00
|
|
|
#define spin_lock(lck) ml_hwlock_lock(lck);
|
|
|
|
|
#define spin_unlock(lck) ml_hwlock_unlock(lck);
|
|
|
|
|
|
2023-02-04 17:46:05 +00:00
|
|
|
#define spin_lock_irqsave(lck, flags) ml_hwlock_lock_irqsave(lck, flags);
|
|
|
|
|
#define spin_unlock_irqrestore(lck, flags) ml_hwlock_unlock_irqrestore(lck, flags);
|
2023-02-02 21:00:40 +00:00
|
|
|
|
2023-03-20 20:41:39 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-02-02 21:00:40 +00:00
|
|
|
#endif
|