From 7f70c9b64eec4a4a86a3948966187ff8ee9fa720 Mon Sep 17 00:00:00 2001 From: Serban Constantinescu Date: Sun, 13 Oct 2013 22:07:26 +0100 Subject: [PATCH] AArch64: Fix uses of stack size for 32/64bit libc builds This patch fixes stack size uses to size_t. Change-Id: I0671c85ddb1c1aceaf9440a7c73c21fe528653fa Signed-off-by: Serban Constantinescu --- libc/arch-arm/bionic/_exit_with_stack_teardown.S | 2 +- libc/arch-mips/bionic/_exit_with_stack_teardown.S | 2 +- libc/arch-x86/bionic/_exit_with_stack_teardown.S | 2 +- libc/arch-x86_64/bionic/_exit_with_stack_teardown.S | 2 +- libc/bionic/libc_init_common.cpp | 2 +- libc/bionic/pthread.c | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libc/arch-arm/bionic/_exit_with_stack_teardown.S b/libc/arch-arm/bionic/_exit_with_stack_teardown.S index 1c1354045..c430edbe4 100644 --- a/libc/arch-arm/bionic/_exit_with_stack_teardown.S +++ b/libc/arch-arm/bionic/_exit_with_stack_teardown.S @@ -29,7 +29,7 @@ #include #include -// void _exit_with_stack_teardown(void* stackBase, int stackSize, int status) +// void _exit_with_stack_teardown(void* stackBase, size_t stackSize, int status) ENTRY(_exit_with_stack_teardown) mov lr, r2 ldr r7, =__NR_munmap diff --git a/libc/arch-mips/bionic/_exit_with_stack_teardown.S b/libc/arch-mips/bionic/_exit_with_stack_teardown.S index e89000889..8351e2ead 100644 --- a/libc/arch-mips/bionic/_exit_with_stack_teardown.S +++ b/libc/arch-mips/bionic/_exit_with_stack_teardown.S @@ -30,7 +30,7 @@ .text -// void _exit_with_stack_teardown(void * stackBase, int stackSize, int status) +// void _exit_with_stack_teardown(void * stackBase, size_t stackSize, int status) .type _exit_with_stack_teardown, @function .global _exit_with_stack_teardown diff --git a/libc/arch-x86/bionic/_exit_with_stack_teardown.S b/libc/arch-x86/bionic/_exit_with_stack_teardown.S index d3b554120..1c6d48adc 100644 --- a/libc/arch-x86/bionic/_exit_with_stack_teardown.S +++ b/libc/arch-x86/bionic/_exit_with_stack_teardown.S @@ -1,7 +1,7 @@ #include #include -// void _exit_with_stack_teardown(void* stackBase, int stackSize, int status) +// void _exit_with_stack_teardown(void* stackBase, size_t stackSize, int status) ENTRY(_exit_with_stack_teardown) // We can trash %ebx here since this call should never return. // We can also take advantage of the fact that the linux syscall trap diff --git a/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S b/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S index 182e0ef3b..a09babe2e 100644 --- a/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S +++ b/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S @@ -29,7 +29,7 @@ #include #include -// void _exit_with_stack_teardown(void* stackBase, int stackSize, int status) +// void _exit_with_stack_teardown(void* stackBase, size_t stackSize, int status) ENTRY(_exit_with_stack_teardown) // We take advantage of the fact that the linux syscall trap // handler saves all the registers, so we don't need to save diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp index 479cadf34..f88a26d26 100644 --- a/libc/bionic/libc_init_common.cpp +++ b/libc/bionic/libc_init_common.cpp @@ -47,7 +47,7 @@ #include "pthread_internal.h" extern "C" abort_msg_t** __abort_message_ptr; -extern "C" unsigned __get_sp(void); +extern "C" uintptr_t __get_sp(void); extern "C" int __system_properties_init(void); // Not public, but well-known in the BSDs. diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c index 32812b4c9..7081445a8 100644 --- a/libc/bionic/pthread.c +++ b/libc/bionic/pthread.c @@ -45,7 +45,7 @@ extern void pthread_debug_mutex_lock_check(pthread_mutex_t *mutex); extern void pthread_debug_mutex_unlock_check(pthread_mutex_t *mutex); -extern void _exit_with_stack_teardown(void * stackBase, int stackSize, int status); +extern void _exit_with_stack_teardown(void * stackBase, size_t stackSize, int status); extern void _exit_thread(int status); int __futex_wake_ex(volatile void *ftx, int pshared, int val) @@ -87,7 +87,7 @@ void pthread_exit(void * retval) { pthread_internal_t* thread = __get_thread(); void* stack_base = thread->attr.stack_base; - int stack_size = thread->attr.stack_size; + size_t stack_size = thread->attr.stack_size; int user_stack = (thread->attr.flags & PTHREAD_ATTR_FLAG_USER_STACK) != 0; sigset_t mask;