summaryrefslogtreecommitdiff
path: root/include/rtdef.h
diff options
context:
space:
mode:
authorShell <[email protected]>2023-12-22 15:44:45 +0800
committerMeco Man <[email protected]>2024-01-02 19:42:46 +0800
commit3a7903b799c9f379048368df029cac3e42c28be4 (patch)
tree63d7f7cecb462207bcaae6153f2bdf15ee4e5ed4 /include/rtdef.h
parent7c07a974792b0f6dc60375eb54095c903e250091 (diff)
[kernel] Add hook for malloc services
Including the patch for memory allocation, testsuites and fixups of static analysis. Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'include/rtdef.h')
-rw-r--r--include/rtdef.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/rtdef.h b/include/rtdef.h
index f8c7503b5a..26b344073a 100644
--- a/include/rtdef.h
+++ b/include/rtdef.h
@@ -198,6 +198,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define rt_used __attribute__((used))
#define rt_align(n) __attribute__((aligned(n)))
#define rt_weak __attribute__((weak))
+#define rt_noreturn
#define rt_inline static __inline
#define rt_always_inline rt_inline
#elif defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */
@@ -206,6 +207,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define PRAGMA(x) _Pragma(#x)
#define rt_align(n) PRAGMA(data_alignment=n)
#define rt_weak __weak
+#define rt_noreturn
#define rt_inline static inline
#define rt_always_inline rt_inline
#elif defined (__GNUC__) /* GNU GCC Compiler */
@@ -223,6 +225,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define rt_used __attribute__((used))
#define rt_align(n) __attribute__((aligned(n)))
#define rt_weak __attribute__((weak))
+#define rt_noreturn
#define rt_inline static inline
#define rt_always_inline rt_inline
#elif defined (_MSC_VER)
@@ -230,6 +233,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define rt_used
#define rt_align(n) __declspec(align(n))
#define rt_weak
+#define rt_noreturn
#define rt_inline static __inline
#define rt_always_inline rt_inline
#elif defined (__TI_COMPILER_VERSION__)
@@ -400,6 +404,7 @@ typedef int (*init_fn_t)(void);
#define RT_ENOSPC ENOSPC /**< No space left */
#define RT_EPERM EPERM /**< Operation not permitted */
#define RT_EFAULT EFAULT /**< Bad address */
+#define RT_ENOBUFS ENOBUFS /**< No buffer space is available */
#define RT_ETRAP 254 /**< Trap event */
#else
#define RT_EOK 0 /**< There is no error */
@@ -418,6 +423,7 @@ typedef int (*init_fn_t)(void);
#define RT_EPERM 13 /**< Operation not permitted */
#define RT_ETRAP 14 /**< Trap event */
#define RT_EFAULT 15 /**< Bad address */
+#define RT_ENOBUFS 16 /**< No buffer space is available */
#endif /* defined(RT_USING_LIBC) && !defined(RT_USING_NANO) */
/**@}*/
@@ -604,6 +610,12 @@ struct rt_object_information
#ifndef __on_rt_malloc_hook
#define __on_rt_malloc_hook(addr, size) __ON_HOOK_ARGS(rt_malloc_hook, (addr, size))
#endif
+#ifndef __on_rt_realloc_entry_hook
+ #define __on_rt_realloc_entry_hook(addr, size) __ON_HOOK_ARGS(rt_realloc_entry_hook, (addr, size))
+#endif
+#ifndef __on_rt_realloc_exit_hook
+ #define __on_rt_realloc_exit_hook(addr, size) __ON_HOOK_ARGS(rt_realloc_exit_hook, (addr, size))
+#endif
#ifndef __on_rt_free_hook
#define __on_rt_free_hook(rmem) __ON_HOOK_ARGS(rt_free_hook, (rmem))
#endif