[PATCH v3 3/3] stackchk: Fixed 32bit pointers

Gedare Bloom gedare at rtems.org
Sat Mar 20 06:24:21 UTC 2021


This one is also looks fine by inspection, although I don't
immediately see why it is needed.

On Fri, Mar 19, 2021 at 9:35 AM Stephen Clark <stephen.clark at oarcorp.com> wrote:
>
> Using 32bit types like uint32_t for pointers creates issues on 64 bit
> architectures like AArch64. Replaced occurrences of these with uintptr_t,
> which will work for both 32 and 64 bit architectures.
> ---
>  cpukit/libmisc/stackchk/check.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
> index ab08155c92..a2b63345d9 100644
> --- a/cpukit/libmisc/stackchk/check.c
> +++ b/cpukit/libmisc/stackchk/check.c
> @@ -447,12 +447,13 @@ static bool Stack_check_Dump_threads_usage(
>  {
>    char                 name[ 22 ];
>    const rtems_printer *printer;
> +  uintptr_t sp = _CPU_Context_Get_SP( &the_thread->Registers );
>
>    printer = arg;
>    _Thread_Get_name( the_thread, name, sizeof( name ) );
>    Stack_check_Dump_stack_usage(
>      &the_thread->Start.Initial_stack,
> -    (void *) _CPU_Context_Get_SP( &the_thread->Registers ),
> +    (void *) sp,
>      name,
>      the_thread->Object.id,
>      printer
> --
> 2.27.0
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list