summaryrefslogtreecommitdiff
path: root/include/rttypes.h
diff options
context:
space:
mode:
authorShell <[email protected]>2024-08-28 20:54:55 +0800
committerMeco Man <[email protected]>2024-09-01 15:12:34 -0400
commitdfd8ccf262d53723056490d8858807f792ffa013 (patch)
tree83cc36f546cf5c17ed407318daf5dda0194b80c3 /include/rttypes.h
parentb6f1b16d7a7a61bc0b5301a6fcf084cef9f31e3b (diff)
feat: kernel/libcpu: fit into ilp32d
Diffstat (limited to 'include/rttypes.h')
-rw-r--r--include/rttypes.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/rttypes.h b/include/rttypes.h
index 0cd12d7614..0b614a492a 100644
--- a/include/rttypes.h
+++ b/include/rttypes.h
@@ -33,8 +33,6 @@ extern "C" {
*/
typedef int rt_bool_t; /**< boolean type */
-typedef signed long rt_base_t; /**< Nbit CPU related data type */
-typedef unsigned long rt_ubase_t; /**< Nbit unsigned CPU related data type */
#ifndef RT_USING_ARCH_DATA_TYPE
#ifdef RT_USING_LIBC
@@ -63,12 +61,24 @@ typedef unsigned long long rt_uint64_t; /**< 64bit unsigned inte
#endif /* RT_USING_LIBC */
#endif /* RT_USING_ARCH_DATA_TYPE */
+#ifdef ARCH_CPU_64BIT
+typedef rt_int64_t rt_base_t; /**< Nbit CPU related data type */
+typedef rt_uint64_t rt_ubase_t; /**< Nbit unsigned CPU related data type */
+#else
+typedef rt_int32_t rt_base_t; /**< Nbit CPU related data type */
+typedef rt_uint32_t rt_ubase_t; /**< Nbit unsigned CPU related data type */
+#endif
+
#if defined(RT_USING_LIBC) && !defined(RT_USING_NANO)
typedef size_t rt_size_t; /**< Type for size number */
typedef ssize_t rt_ssize_t; /**< Used for a count of bytes or an error indication */
+typedef intptr_t rt_intptr_t; /**< Type for signed pointer length integer */
+typedef uintptr_t rt_uintptr_t; /**< Type for unsigned pointer length integer */
#else
typedef rt_ubase_t rt_size_t; /**< Type for size number */
typedef rt_base_t rt_ssize_t; /**< Used for a count of bytes or an error indication */
+typedef rt_ubase_t rt_intptr_t; /**< Type for signed pointer length integer */
+typedef rt_base_t rt_uintptr_t; /**< Type for unsigned pointer length integer */
#endif /* defined(RT_USING_LIBC) && !defined(RT_USING_NANO) */
typedef rt_base_t rt_err_t; /**< Type for error number */