diff options
| author | Bernard Xiong <[email protected]> | 2019-12-21 06:40:47 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-12-21 06:40:47 +0800 |
| commit | 0c11cd86717295bc4c41d7421e4119a62bbbfa11 (patch) | |
| tree | 594994078d07de40ba37c47d5d5c536a51bfe0fc /include | |
| parent | 3491b2f0f470d3834763b9d78071ce7804597c94 (diff) | |
| parent | a383385a3c0a676cee4471fd3cb4f372a36e1023 (diff) | |
Merge pull request #3274 from armink/lts-v3.1.x
Lts v3.1.x
Diffstat (limited to 'include')
| -rw-r--r-- | include/libc/libc_signal.h | 21 | ||||
| -rw-r--r-- | include/rtdef.h | 27 | ||||
| -rw-r--r-- | include/rthw.h | 12 | ||||
| -rw-r--r-- | include/rtthread.h | 15 |
4 files changed, 42 insertions, 33 deletions
diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index 71f8de125d..898fe13f43 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -24,7 +24,7 @@ extern "C" { NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and sigev_notify_attributes to the sigevent structure. */ -union sigval +union sigval { int sival_int; /* Integer signal value */ void *sival_ptr; /* Pointer signal value */ @@ -63,13 +63,14 @@ typedef struct siginfo siginfo_t; #define SI_MESGQ 0x05 /* Signal generated by arrival of a message on an empty message queue. */ -#ifdef RT_USING_NEWLIB -#include <sys/signal.h> +#if !defined(RT_USING_NEWLIB) +typedef void (*_sig_func_ptr)(int); +typedef unsigned long sigset_t; #endif -#if defined(__CC_ARM) || defined(__CLANG_ARM) #include <signal.h> -typedef unsigned long sigset_t; + +#if defined(__CC_ARM) || defined(__CLANG_ARM) #define SIGHUP 1 /* #define SIGINT 2 */ @@ -105,9 +106,7 @@ typedef unsigned long sigset_t; #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ -typedef void (*_sig_func_ptr)(int); - -struct sigaction +struct sigaction { _sig_func_ptr sa_handler; sigset_t sa_mask; @@ -124,8 +123,6 @@ int sigprocmask (int how, const sigset_t *set, sigset_t *oset); int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); #elif defined(__IAR_SYSTEMS_ICC__) -#include <signal.h> -typedef unsigned long sigset_t; #define SIGHUP 1 #define SIGINT 2 @@ -161,9 +158,7 @@ typedef unsigned long sigset_t; #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ -typedef void (*_sig_func_ptr)(int); - -struct sigaction +struct sigaction { _sig_func_ptr sa_handler; sigset_t sa_mask; diff --git a/include/rtdef.h b/include/rtdef.h index 269dc2cecf..ababbf0945 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -58,16 +58,21 @@ extern "C" { #ifndef RT_USING_ARCH_DATA_TYPE typedef signed char rt_int8_t; /**< 8bit integer type */ typedef signed short rt_int16_t; /**< 16bit integer type */ -typedef signed long rt_int32_t; /**< 32bit integer type */ -typedef signed long long rt_int64_t; /**< 64bit integer type */ +typedef signed int rt_int32_t; /**< 32bit integer type */ typedef unsigned char rt_uint8_t; /**< 8bit unsigned integer type */ typedef unsigned short rt_uint16_t; /**< 16bit unsigned integer type */ -typedef unsigned long rt_uint32_t; /**< 32bit unsigned integer type */ +typedef unsigned int rt_uint32_t; /**< 32bit unsigned integer type */ + +#ifdef ARCH_CPU_64BIT +typedef signed long rt_int64_t; /**< 64bit integer type */ +typedef unsigned long rt_uint64_t; /**< 64bit unsigned integer type */ +#else +typedef signed long long rt_int64_t; /**< 64bit integer type */ typedef unsigned long long rt_uint64_t; /**< 64bit unsigned integer type */ #endif -typedef int rt_bool_t; /**< boolean type */ +#endif -/* 32bit CPU */ +typedef int rt_bool_t; /**< boolean type */ typedef long rt_base_t; /**< Nbit CPU related date type */ typedef unsigned long rt_ubase_t; /**< Nbit unsigned CPU related data type */ @@ -191,11 +196,11 @@ typedef int (*init_fn_t)(void); }; #define INIT_EXPORT(fn, level) \ const char __rti_##fn##_name[] = #fn; \ - RT_USED const struct rt_init_desc __rt_init_desc_##fn SECTION(".rti_fn."level) = \ + RT_USED const struct rt_init_desc __rt_init_desc_##fn SECTION(".rti_fn." level) = \ { __rti_##fn##_name, fn}; #else #define INIT_EXPORT(fn, level) \ - RT_USED const init_fn_t __rt_init_##fn SECTION(".rti_fn."level) = fn + RT_USED const init_fn_t __rt_init_##fn SECTION(".rti_fn." level) = fn #endif #endif #else @@ -546,7 +551,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 @@ -657,7 +664,7 @@ struct rt_mailbox { struct rt_ipc_object parent; /**< inherit from ipc_object */ - rt_uint32_t *msg_pool; /**< start address of message buffer */ + rt_ubase_t *msg_pool; /**< start address of message buffer */ rt_uint16_t size; /**< size of message pool */ @@ -688,6 +695,8 @@ struct rt_messagequeue void *msg_queue_head; /**< list head */ void *msg_queue_tail; /**< list tail */ void *msg_queue_free; /**< pointer indicated the free node of queue */ + + rt_list_t suspend_sender_thread; /**< sender thread suspended on this message queue */ }; typedef struct rt_messagequeue *rt_mq_t; #endif @@ -761,7 +770,6 @@ struct rt_mempool rt_size_t block_free_count; /**< numbers of free memory block */ rt_list_t suspend_thread; /**< threads pended on this resource */ - rt_size_t suspend_thread_count; /**< numbers of thread pended on this resource */ }; typedef struct rt_mempool *rt_mp_t; #endif @@ -800,6 +808,7 @@ enum rt_device_class_type RT_Device_Class_Timer, /**< Timer device */ RT_Device_Class_Miscellaneous, /**< Miscellaneous device */ RT_Device_Class_Sensor, /**< Sensor device */ + RT_Device_Class_Touch, /**< Touch device */ RT_Device_Class_Unknown /**< unknown device */ }; diff --git a/include/rthw.h b/include/rthw.h index 3e74df0f22..21ac3da6c8 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -35,7 +35,7 @@ extern "C" { #endif #ifndef RT_CPU_CACHE_LINE_SZ -#define RT_CPU_CACHE_LINE_SZ 32 +#define RT_CPU_CACHE_LINE_SZ 32 #endif enum RT_HW_CACHE_OPS @@ -98,14 +98,14 @@ void rt_hw_interrupt_enable(rt_base_t level); /* * Context interfaces */ -void rt_hw_context_switch(rt_uint32_t from, rt_uint32_t to); -void rt_hw_context_switch_to(rt_uint32_t to); -void rt_hw_context_switch_interrupt(rt_uint32_t from, rt_uint32_t to); +void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to); +void rt_hw_context_switch_to(rt_ubase_t to); +void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to); void rt_hw_console_output(const char *str); -void rt_hw_backtrace(rt_uint32_t *fp, rt_uint32_t thread_entry); -void rt_hw_show_memory(rt_uint32_t addr, rt_uint32_t size); +void rt_hw_backtrace(rt_uint32_t *fp, rt_ubase_t thread_entry); +void rt_hw_show_memory(rt_uint32_t addr, rt_size_t size); /* * Exception interfaces diff --git a/include/rtthread.h b/include/rtthread.h index bfe41a3e32..32fe011ab2 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -137,6 +137,7 @@ rt_err_t rt_thread_delete(rt_thread_t thread); rt_err_t rt_thread_yield(void); rt_err_t rt_thread_delay(rt_tick_t tick); +rt_err_t rt_thread_delay_until(rt_tick_t *tick, rt_tick_t inc_tick); rt_err_t rt_thread_mdelay(rt_int32_t ms); rt_err_t rt_thread_control(rt_thread_t thread, int cmd, void *arg); rt_err_t rt_thread_suspend(rt_thread_t thread); @@ -348,11 +349,11 @@ rt_err_t rt_mb_detach(rt_mailbox_t mb); rt_mailbox_t rt_mb_create(const char *name, rt_size_t size, rt_uint8_t flag); rt_err_t rt_mb_delete(rt_mailbox_t mb); -rt_err_t rt_mb_send(rt_mailbox_t mb, rt_uint32_t value); +rt_err_t rt_mb_send(rt_mailbox_t mb, rt_ubase_t value); rt_err_t rt_mb_send_wait(rt_mailbox_t mb, - rt_uint32_t value, + rt_ubase_t value, rt_int32_t timeout); -rt_err_t rt_mb_recv(rt_mailbox_t mb, rt_uint32_t *value, rt_int32_t timeout); +rt_err_t rt_mb_recv(rt_mailbox_t mb, rt_ubase_t *value, rt_int32_t timeout); rt_err_t rt_mb_control(rt_mailbox_t mb, int cmd, void *arg); #endif @@ -373,8 +374,12 @@ rt_mq_t rt_mq_create(const char *name, rt_uint8_t flag); rt_err_t rt_mq_delete(rt_mq_t mq); -rt_err_t rt_mq_send(rt_mq_t mq, void *buffer, rt_size_t size); -rt_err_t rt_mq_urgent(rt_mq_t mq, void *buffer, rt_size_t size); +rt_err_t rt_mq_send(rt_mq_t mq, const void *buffer, rt_size_t size); +rt_err_t rt_mq_send_wait(rt_mq_t mq, + const void *buffer, + rt_size_t size, + rt_int32_t timeout); +rt_err_t rt_mq_urgent(rt_mq_t mq, const void *buffer, rt_size_t size); rt_err_t rt_mq_recv(rt_mq_t mq, void *buffer, rt_size_t size, |
