diff options
| author | SummerGift <[email protected]> | 2019-05-13 14:28:56 +0800 |
|---|---|---|
| committer | SummerGift <[email protected]> | 2019-05-13 14:28:56 +0800 |
| commit | 76431f6b00cb2558f072acf01c442e756c481ad1 (patch) | |
| tree | 36fbeddddda01f4712425d68dcca51322ad5216f /include | |
| parent | 960451695b54bf4478a6af74d50e9876c50cf857 (diff) | |
| parent | 9f7cc78b06e45b18d1385a4827e4c03364a13a8f (diff) | |
Merge remote-tracking branch 'remotes/origin/master' into master_lab
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtdef.h | 7 | ||||
| -rw-r--r-- | include/rthw.h | 14 |
2 files changed, 16 insertions, 5 deletions
diff --git a/include/rtdef.h b/include/rtdef.h index 743b91d959..2aff4afdb0 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -492,9 +492,10 @@ typedef siginfo_t rt_siginfo_t; #define RT_THREAD_CLOSE 0x04 /**< Closed status */ #define RT_THREAD_STAT_MASK 0x0f -#define RT_THREAD_STAT_SIGNAL 0x10 +#define RT_THREAD_STAT_SIGNAL 0x10 /**< task hold signals */ #define RT_THREAD_STAT_SIGNAL_READY (RT_THREAD_STAT_SIGNAL | RT_THREAD_READY) -#define RT_THREAD_STAT_SIGNAL_WAIT 0x20 +#define RT_THREAD_STAT_SIGNAL_WAIT 0x20 /**< task is waiting for signals */ +#define RT_THREAD_STAT_SIGNAL_PENDING 0x40 /**< signals is held and it has not been procressed */ #define RT_THREAD_STAT_SIGNAL_MASK 0xf0 /** @@ -596,7 +597,9 @@ struct rt_thread rt_sigset_t sig_pending; /**< the pending signals */ rt_sigset_t sig_mask; /**< the mask bits of signal */ +#ifndef RT_USING_SMP void *sig_ret; /**< the return stack pointer from signal */ +#endif rt_sighandler_t *sig_vectors; /**< vectors of signal handler */ void *si_list; /**< the signal infor list */ #endif diff --git a/include/rthw.h b/include/rthw.h index dee10b0bee..ef3dc087ad 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -153,10 +153,11 @@ extern rt_hw_spinlock_t _rt_critical_lock; #define __RT_HW_SPIN_LOCK_INITIALIZER(lockname) {0} -#define __RT_HW_SPIN_LOCK_UNLOCKED(lockname) \ - (struct rt_hw_spinlock ) __RT_HW_SPIN_LOCK_INITIALIZER(lockname) +#define __RT_HW_SPIN_LOCK_UNLOCKED(lockname) \ + (rt_hw_spinlock_t) __RT_HW_SPIN_LOCK_INITIALIZER(lockname) -#define RT_DEFINE_SPINLOCK(x) struct rt_hw_spinlock x = __RT_HW_SPIN_LOCK_UNLOCKED(x) +#define RT_DEFINE_SPINLOCK(x) rt_hw_spinlock_t x = __RT_HW_SPIN_LOCK_UNLOCKED(x) +#define RT_DECLARE_SPINLOCK(x) /** * ipi function @@ -172,6 +173,13 @@ void rt_hw_secondary_cpu_up(void); * secondary cpu idle function */ void rt_hw_secondary_cpu_idle_exec(void); +#else + +#define RT_DEFINE_SPINLOCK(x) +#define RT_DECLARE_SPINLOCK(x) rt_ubase_t x + +#define rt_hw_spin_lock(lock) *(lock) = rt_hw_interrupt_disable() +#define rt_hw_spin_unlock(lock) rt_hw_interrupt_enable(*(lock)) #endif |
