diff options
| author | Bernard Xiong <[email protected]> | 2018-11-20 23:53:29 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-11-20 23:53:29 +0800 |
| commit | 25ee668feb7c4cfe9d5f131bcbb019e29409c06f (patch) | |
| tree | 47f132d0a7472768deabd2add67d990c0c6e64e7 /include | |
| parent | 6b6d122e3673ca64d2171d3daf1ae940edfa699a (diff) | |
| parent | 46dae3f35f5cc44664a26ebd87803156033a166a (diff) | |
Merge pull request #1988 from RT-Thread/dev-4.0.x
Dev 4.0.x
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtdef.h | 20 | ||||
| -rw-r--r-- | include/rthw.h | 10 | ||||
| -rw-r--r-- | include/rtthread.h | 12 |
3 files changed, 25 insertions, 17 deletions
diff --git a/include/rtdef.h b/include/rtdef.h index bed9a5a076..fef08599c7 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -24,7 +24,8 @@ * 2018-05-31 Bernard change version number to v3.1.0 * 2018-09-04 Bernard change version number to v3.1.1 * 2018-09-14 Bernard apply Apache License v2.0 to RT-Thread Kernel - * 2018-11-18 Bernard change version number to v4.0.0 + * 2018-10-13 Bernard change version number to v4.0.0 + * 2018-10-02 Bernard add 64bit arch support */ #ifndef __RT_DEF_H__ @@ -55,13 +56,20 @@ extern "C" { /* RT-Thread basic data type definitions */ 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 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 int rt_bool_t; /**< boolean type */ +typedef unsigned int rt_uint32_t; /**< 32bit unsigned integer type */ -/* 32bit CPU */ +#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 */ typedef long rt_base_t; /**< Nbit CPU related date type */ typedef unsigned long rt_ubase_t; /**< Nbit unsigned CPU related data type */ @@ -648,7 +656,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 */ diff --git a/include/rthw.h b/include/rthw.h index c6af392e62..17151de99a 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -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 96ebe1940a..3fc77d343c 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -257,7 +257,7 @@ void rt_page_free(void *addr, rt_size_t npages); #endif #ifdef RT_USING_HOOK -void rt_malloc_sethook(void (*hook)(void *ptr, rt_uint32_t size)); +void rt_malloc_sethook(void (*hook)(void *ptr, rt_size_t size)); void rt_free_sethook(void (*hook)(void *ptr)); #endif @@ -270,9 +270,9 @@ void rt_free_sethook(void (*hook)(void *ptr)); rt_err_t rt_memheap_init(struct rt_memheap *memheap, const char *name, void *start_addr, - rt_uint32_t size); + rt_size_t size); rt_err_t rt_memheap_detach(struct rt_memheap *heap); -void *rt_memheap_alloc(struct rt_memheap *heap, rt_uint32_t size); +void *rt_memheap_alloc(struct rt_memheap *heap, rt_size_t size); void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize); void rt_memheap_free(void *ptr); #endif @@ -348,11 +348,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 |
