diff options
| author | armink <[email protected]> | 2019-05-17 16:36:34 +0800 |
|---|---|---|
| committer | armink <[email protected]> | 2019-05-17 17:07:14 +0800 |
| commit | bf4a51b599b56cddb93f7f2ad576f6f0d022a64e (patch) | |
| tree | e9c54e3d37a1d3342d1bf19c44384b6c38703fac /include | |
| parent | 94e3f77f25249b52c6f72921a2d2564f68bcd6ff (diff) | |
Update the kernel and components to master version.
Diffstat (limited to 'include')
| -rw-r--r-- | include/libc/libc_errno.h | 2 | ||||
| -rw-r--r-- | include/rtdbg.h | 20 | ||||
| -rw-r--r-- | include/rtdef.h | 3 | ||||
| -rw-r--r-- | include/rthw.h | 6 | ||||
| -rw-r--r-- | include/rtthread.h | 8 |
5 files changed, 30 insertions, 9 deletions
diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h index bb9a4dea2a..0f3bc7635a 100644 --- a/include/libc/libc_errno.h +++ b/include/libc/libc_errno.h @@ -13,7 +13,7 @@ #include <rtconfig.h> -#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(RT_USING_NEWLIB) || defined(_WIN32) /* use errno.h file in toolchains */ #include <errno.h> #endif diff --git a/include/rtdbg.h b/include/rtdbg.h index 77382c656b..a2dfbd9697 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -18,9 +18,9 @@ * In your C/C++ file, enable/disable DEBUG_ENABLE macro, and then include this * header file. * - * #define DBG_SECTION_NAME "MOD" - * #define DBG_LEVEL DBG_INFO - * #include <rtdbg.h> // must after of DBG_LEVEL, DBG_SECTION_NAME or other options + * #define DBG_TAG "MOD_TAG" + * #define DBG_LVL DBG_INFO + * #include <rtdbg.h> // must after of DBG_LVL, DBG_TAG or other options * * Then in your C/C++ file, you can use LOG_X macro to print out logs: * LOG_D("this is a debug log!"); @@ -53,15 +53,29 @@ #define DBG_INFO 2 #define DBG_LOG 3 +#ifdef DBG_TAG +#ifndef DBG_SECTION_NAME +#define DBG_SECTION_NAME DBG_TAG +#endif +#else +/* compatible with old version */ #ifndef DBG_SECTION_NAME #define DBG_SECTION_NAME "DBG" #endif +#endif /* DBG_TAG */ #ifdef DBG_ENABLE +#ifdef DBG_LVL +#ifndef DBG_LEVEL +#define DBG_LEVEL DBG_LVL +#endif +#else +/* compatible with old version */ #ifndef DBG_LEVEL #define DBG_LEVEL DBG_WARNING #endif +#endif /* DBG_LVL */ /* * The color for terminal (foreground) diff --git a/include/rtdef.h b/include/rtdef.h index 6346a77c6d..2c60ed76f7 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -359,7 +359,8 @@ typedef struct rt_object *rt_object_t; /**< Type for kernel obj */ enum rt_object_class_type { - RT_Object_Class_Thread = 0, /**< The object is a thread. */ + RT_Object_Class_Null = 0, /**< The object is not used. */ + RT_Object_Class_Thread, /**< The object is a thread. */ RT_Object_Class_Semaphore, /**< The object is a semaphore. */ RT_Object_Class_Mutex, /**< The object is a mutex. */ RT_Object_Class_Event, /**< The object is a event. */ diff --git a/include/rthw.h b/include/rthw.h index f4ede56924..3e74df0f22 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -117,6 +117,12 @@ void rt_hw_exception_install(rt_err_t (*exception_handle)(void *context)); */ void rt_hw_us_delay(rt_uint32_t us); +#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)) + #ifdef __cplusplus } #endif diff --git a/include/rtthread.h b/include/rtthread.h index 5d3fd3def6..bfe41a3e32 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -74,7 +74,7 @@ void rt_system_tick_init(void); rt_tick_t rt_tick_get(void); void rt_tick_set(rt_tick_t tick); void rt_tick_increase(void); -int rt_tick_from_millisecond(rt_int32_t ms); +rt_tick_t rt_tick_from_millisecond(rt_int32_t ms); void rt_system_timer_init(void); void rt_system_timer_thread_init(void); @@ -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 |
