bionic/libc/arch-x86/bionic/_exit_with_stack_teardown.S
Elliott Hughes 31d0398de6 Hide _exit_with_stack_teardown.
Bug: 11156955
Change-Id: Ida3020343c9975177dc324918cd1f10c455eb173
2014-05-16 16:17:44 -07:00

17 lines
546 B
ArmAsm

#include <private/bionic_asm.h>
// void _exit_with_stack_teardown(void* stackBase, size_t stackSize)
ENTRY_PRIVATE(_exit_with_stack_teardown)
// We can trash registers because this function never returns.
mov 4(%esp), %ebx // stackBase
mov 8(%esp), %ecx // stackSize
mov $__NR_munmap, %eax
int $0x80
// If munmap failed, we ignore the failure and exit anyway.
mov $0, %ebx // status
movl $__NR_exit, %eax
int $0x80
// The exit syscall does not return.
END(_exit_with_stack_teardown)