diff options
| author | Shell <[email protected]> | 2024-08-28 20:54:55 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2024-09-01 15:12:34 -0400 |
| commit | dfd8ccf262d53723056490d8858807f792ffa013 (patch) | |
| tree | 83cc36f546cf5c17ed407318daf5dda0194b80c3 /include | |
| parent | b6f1b16d7a7a61bc0b5301a6fcf084cef9f31e3b (diff) | |
feat: kernel/libcpu: fit into ilp32d
Diffstat (limited to 'include')
| -rw-r--r-- | include/rthw.h | 4 | ||||
| -rw-r--r-- | include/rttypes.h | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/include/rthw.h b/include/rthw.h index f7712cb52f..672e820918 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -172,8 +172,8 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t * Hardware Layer Backtrace Service */ struct rt_hw_backtrace_frame { - rt_base_t fp; - rt_base_t pc; + rt_uintptr_t fp; + rt_uintptr_t pc; }; rt_err_t rt_hw_backtrace_frame_get(rt_thread_t thread, struct rt_hw_backtrace_frame *frame); 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 */ |
