lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #ifndef __DRV_LINUX_SPINLOCK_H__
|
| 2 | #define __DRV_LINUX_SPINLOCK_H__
|
| 3 |
|
| 4 | #ifndef _OS_LINUX
|
| 5 |
|
| 6 | typedef int spinlock_t; //Howard Hu TempChanged
|
| 7 | #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
|
| 8 | #define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
|
| 9 |
|
| 10 | #define spin_lock_irqsave(_lock, f) LOCK_SAVE(_lock) /*//Howard Hu TempChanged */
|
| 11 | #define spin_unlock_irqrestore(_lock, f) LOCK_RESTORE(_lock) /*//Howard Hu TempChanged */
|
| 12 |
|
| 13 | #define spin_lock_init(lock) \
|
| 14 | CYG_MACRO_START; \
|
| 15 | CYG_UNUSED_PARAM(spinlock_t *, lock); \
|
| 16 | CYG_MACRO_END
|
| 17 |
|
| 18 | #define spin_lock(lock) \
|
| 19 | CYG_MACRO_START; \
|
| 20 | CYG_UNUSED_PARAM(spinlock_t *, lock); \
|
| 21 | CYG_MACRO_END
|
| 22 |
|
| 23 | #define spin_unlock(lock) \
|
| 24 | CYG_MACRO_START; \
|
| 25 | CYG_UNUSED_PARAM(spinlock_t *, lock); \
|
| 26 | CYG_MACRO_END
|
| 27 |
|
| 28 | #define spin_lock_bh(lock) \
|
| 29 | CYG_MACRO_START; \
|
| 30 | CYG_UNUSED_PARAM(spinlock_t *, lock); \
|
| 31 | CYG_MACRO_END
|
| 32 |
|
| 33 | #define spin_unlock_bh(lock) \
|
| 34 | CYG_MACRO_START; \
|
| 35 | CYG_UNUSED_PARAM(spinlock_t *, lock); \
|
| 36 | CYG_MACRO_END
|
| 37 |
|
| 38 | #endif
|
| 39 |
|
| 40 | #endif /* __LINUX_SPINLOCK_H__ */
|