mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-20 17:44:20 +08:00
Merge branch 'master' into RT_MACRO
This commit is contained in:
+27
-27
@@ -97,7 +97,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
|
||||
#define RT_UNUSED __attribute__((unused))
|
||||
#define RT_USED __attribute__((used))
|
||||
#define ALIGN(n) __attribute__((aligned(n)))
|
||||
#define RT_WEAK __weak
|
||||
#define RT_WEAK __weak
|
||||
#define rt_inline static __inline
|
||||
/* module compiling */
|
||||
#ifdef RT_USING_MODULE
|
||||
@@ -121,7 +121,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
|
||||
#ifdef RT_USING_NEWLIB
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
/* the version of GNU GCC must be greater than 4.x */
|
||||
/* the version of GNU GCC must be greater than 4.x */
|
||||
typedef __builtin_va_list __gnuc_va_list;
|
||||
typedef __gnuc_va_list va_list;
|
||||
#define va_start(v,l) __builtin_va_start(v,l)
|
||||
@@ -142,7 +142,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
|
||||
#define RT_UNUSED __attribute__((unused))
|
||||
#define RT_USED __attribute__((used))
|
||||
#define ALIGN(n) __attribute__((aligned(n)))
|
||||
#define RT_WEAK __attribute__((weak))
|
||||
#define RT_WEAK __attribute__((weak))
|
||||
#define rt_inline static inline
|
||||
#define RTT_API
|
||||
#elif defined (_MSC_VER)
|
||||
@@ -151,7 +151,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
|
||||
#define RT_UNUSED
|
||||
#define RT_USED
|
||||
#define ALIGN(n) __declspec(align(n))
|
||||
#define RT_WEAK
|
||||
#define RT_WEAK
|
||||
#define rt_inline static __inline
|
||||
#define RTT_API
|
||||
#elif defined (__TI_COMPILER_VERSION__)
|
||||
@@ -177,20 +177,20 @@ typedef int (*init_fn_t)(void);
|
||||
#ifdef _MSC_VER /* we do not support MS VC++ compiler */
|
||||
#define INIT_EXPORT(fn, level)
|
||||
#else
|
||||
#if RT_DEBUG_INIT
|
||||
struct rt_init_desc
|
||||
{
|
||||
const char* fn_name;
|
||||
const init_fn_t fn;
|
||||
};
|
||||
#define INIT_EXPORT(fn, level) \
|
||||
const char __rti_##fn##_name[] = #fn; \
|
||||
const struct rt_init_desc __rt_init_desc_##fn SECTION(".rti_fn."level) = \
|
||||
{ __rti_##fn##_name, fn};
|
||||
#else
|
||||
#define INIT_EXPORT(fn, level) \
|
||||
const init_fn_t __rt_init_##fn SECTION(".rti_fn."level) = fn
|
||||
#endif
|
||||
#if RT_DEBUG_INIT
|
||||
struct rt_init_desc
|
||||
{
|
||||
const char* fn_name;
|
||||
const init_fn_t fn;
|
||||
};
|
||||
#define INIT_EXPORT(fn, level) \
|
||||
const char __rti_##fn##_name[] = #fn; \
|
||||
const struct rt_init_desc __rt_init_desc_##fn SECTION(".rti_fn."level) = \
|
||||
{ __rti_##fn##_name, fn};
|
||||
#else
|
||||
#define INIT_EXPORT(fn, level) \
|
||||
const init_fn_t __rt_init_##fn SECTION(".rti_fn."level) = fn
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define INIT_EXPORT(fn, level)
|
||||
@@ -206,7 +206,7 @@ typedef int (*init_fn_t)(void);
|
||||
/* file system initialization (dfs-elm, dfs-rom, ...) */
|
||||
#define INIT_FS_EXPORT(fn) INIT_EXPORT(fn, "4")
|
||||
/* environment initialization (mount disk, ...) */
|
||||
#define INIT_ENV_EXPORT(fn) INIT_EXPORT(fn, "5")
|
||||
#define INIT_ENV_EXPORT(fn) INIT_EXPORT(fn, "5")
|
||||
/* appliation initialization (rtgui application etc ...) */
|
||||
#define INIT_APP_EXPORT(fn) INIT_EXPORT(fn, "6")
|
||||
|
||||
@@ -759,8 +759,8 @@ enum rt_device_class_type
|
||||
RT_Device_Class_Pipe, /**< Pipe device */
|
||||
RT_Device_Class_Portal, /**< Portal device */
|
||||
RT_Device_Class_Timer, /**< Timer device */
|
||||
RT_Device_Class_Miscellaneous, /**< Miscellaneous device */
|
||||
RT_Device_Class_Unknown /**< unknown device */
|
||||
RT_Device_Class_Miscellaneous, /**< Miscellaneous device */
|
||||
RT_Device_Class_Unknown /**< unknown device */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -778,9 +778,9 @@ enum rt_device_class_type
|
||||
#define RT_DEVICE_FLAG_SUSPENDED 0x020 /**< device is suspended */
|
||||
#define RT_DEVICE_FLAG_STREAM 0x040 /**< stream mode */
|
||||
|
||||
#define RT_DEVICE_CTRL_CONFIG 0x03 /* configure device */
|
||||
#define RT_DEVICE_CTRL_SET_INT 0x10 /* enable receive irq */
|
||||
#define RT_DEVICE_CTRL_CLR_INT 0x11 /* disable receive irq */
|
||||
#define RT_DEVICE_CTRL_CONFIG 0x03 /* configure device */
|
||||
#define RT_DEVICE_CTRL_SET_INT 0x10 /* enable receive irq */
|
||||
#define RT_DEVICE_CTRL_CLR_INT 0x11 /* disable receive irq */
|
||||
#define RT_DEVICE_CTRL_GET_INT 0x12
|
||||
|
||||
#define RT_DEVICE_FLAG_INT_RX 0x100 /**< INT mode on Rx */
|
||||
@@ -969,15 +969,15 @@ struct rt_module
|
||||
{
|
||||
struct rt_object parent; /**< inherit from object */
|
||||
|
||||
rt_uint32_t vstart_addr; /**< VMA base address for the
|
||||
rt_uint32_t vstart_addr; /**< VMA base address for the
|
||||
first LOAD segment. */
|
||||
rt_uint8_t *module_space; /**< module memory space */
|
||||
|
||||
void *module_entry; /**< the entry address of module */
|
||||
rt_thread_t module_thread; /**< the main thread of module */
|
||||
|
||||
rt_uint8_t* module_cmd_line; /**< module command line */
|
||||
rt_uint32_t module_cmd_size; /**< the size of module command line */
|
||||
rt_uint8_t *module_cmd_line; /**< module command line */
|
||||
rt_uint32_t module_cmd_size; /**< the size of module command line */
|
||||
|
||||
#ifdef RT_USING_SLAB
|
||||
/* module memory allocator */
|
||||
|
||||
+9
-9
@@ -262,8 +262,8 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap,
|
||||
void *start_addr,
|
||||
rt_uint32_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_realloc(struct rt_memheap* heap, void* ptr, rt_size_t newsize);
|
||||
void *rt_memheap_alloc(struct rt_memheap *heap, rt_uint32_t size);
|
||||
void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize);
|
||||
void rt_memheap_free(void *ptr);
|
||||
#endif
|
||||
|
||||
@@ -429,7 +429,7 @@ rt_module_t rt_module_load(const char *name, void *module_ptr);
|
||||
rt_err_t rt_module_unload(rt_module_t module);
|
||||
#ifdef RT_USING_DFS
|
||||
rt_module_t rt_module_open(const char *filename);
|
||||
rt_module_t rt_module_exec_cmd(const char *path, const char* cmd_line, int size);
|
||||
rt_module_t rt_module_exec_cmd(const char *path, const char *cmd_line, int size);
|
||||
#endif
|
||||
void *rt_module_malloc(rt_size_t size);
|
||||
void *rt_module_realloc(void *ptr, rt_size_t size);
|
||||
@@ -496,7 +496,7 @@ void rt_kputs(const char *str);
|
||||
#endif
|
||||
rt_int32_t rt_vsprintf(char *dest, const char *format, va_list arg_ptr);
|
||||
rt_int32_t rt_vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list args);
|
||||
rt_int32_t rt_sprintf(char *buf ,const char *format, ...);
|
||||
rt_int32_t rt_sprintf(char *buf, const char *format, ...);
|
||||
rt_int32_t rt_snprintf(char *buf, rt_size_t size, const char *format, ...);
|
||||
|
||||
#if defined(RT_USING_DEVICE) && defined(RT_USING_CONSOLE)
|
||||
@@ -517,8 +517,8 @@ void *rt_memset(void *src, int c, rt_ubase_t n);
|
||||
void *rt_memcpy(void *dest, const void *src, rt_ubase_t n);
|
||||
|
||||
rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_ubase_t count);
|
||||
rt_int32_t rt_strcmp (const char *cs, const char *ct);
|
||||
rt_size_t rt_strlen (const char *src);
|
||||
rt_int32_t rt_strcmp(const char *cs, const char *ct);
|
||||
rt_size_t rt_strlen(const char *src);
|
||||
char *rt_strdup(const char *s);
|
||||
|
||||
char *rt_strstr(const char *str1, const char *str2);
|
||||
@@ -531,10 +531,10 @@ rt_uint32_t rt_strcasecmp(const char *a, const char *b);
|
||||
void rt_show_version(void);
|
||||
|
||||
#ifdef RT_DEBUG
|
||||
extern void (*rt_assert_hook)(const char* ex, const char* func, rt_size_t line);
|
||||
void rt_assert_set_hook(void (*hook)(const char* ex, const char* func, rt_size_t line));
|
||||
extern void (*rt_assert_hook)(const char *ex, const char *func, rt_size_t line);
|
||||
void rt_assert_set_hook(void (*hook)(const char *ex, const char *func, rt_size_t line));
|
||||
|
||||
void rt_assert_handler(const char* ex, const char* func, rt_size_t line);
|
||||
void rt_assert_handler(const char *ex, const char *func, rt_size_t line);
|
||||
#endif /* RT_DEBUG */
|
||||
|
||||
/**@}*/
|
||||
|
||||
Reference in New Issue
Block a user