blob: c2785c3635ed6a294b392edf6932e8de73ba68fc [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#ifndef __DRV_LINUX_SPINLOCK_H__
2#define __DRV_LINUX_SPINLOCK_H__
3
4#ifndef _OS_LINUX
5
6typedef 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) \
14CYG_MACRO_START; \
15CYG_UNUSED_PARAM(spinlock_t *, lock); \
16CYG_MACRO_END
17
18#define spin_lock(lock) \
19CYG_MACRO_START; \
20CYG_UNUSED_PARAM(spinlock_t *, lock); \
21CYG_MACRO_END
22
23#define spin_unlock(lock) \
24CYG_MACRO_START; \
25CYG_UNUSED_PARAM(spinlock_t *, lock); \
26CYG_MACRO_END
27
28#define spin_lock_bh(lock) \
29CYG_MACRO_START; \
30CYG_UNUSED_PARAM(spinlock_t *, lock); \
31CYG_MACRO_END
32
33#define spin_unlock_bh(lock) \
34CYG_MACRO_START; \
35CYG_UNUSED_PARAM(spinlock_t *, lock); \
36CYG_MACRO_END
37
38#endif
39
40#endif /* __LINUX_SPINLOCK_H__ */