diff options
| author | HubretXie <[email protected]> | 2019-05-16 10:22:41 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-16 10:22:41 +0800 |
| commit | 9de2942b159b7d08bc79aa370008bc42eeafc1e0 (patch) | |
| tree | c6ed31f70123415e96da63973a8184e96eaad824 /include | |
| parent | fd05ad76d69e02ee2c36e8eb73781a5654073be4 (diff) | |
| parent | 4539172f5c97306a322ac1768c5c8eb4f878ea3c (diff) | |
Merge pull request #4 from RT-Thread/master
sync
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 |
