Move common macros into bionic_macros.h.

Bug: 15590152
Change-Id: I730636613ef3653f68c5ab1d43b53beaf8e0dc25
This commit is contained in:
Christopher Ferris
2014-06-13 13:57:51 -07:00
parent 64dfbd242c
commit 03eebcb6e8
8 changed files with 42 additions and 29 deletions

View File

@@ -33,6 +33,7 @@
#include "pthread_internal.h"
#include "private/bionic_macros.h"
#include "private/bionic_ssp.h"
#include "private/bionic_tls.h"
#include "private/libc_logging.h"
@@ -183,8 +184,8 @@ int pthread_create(pthread_t* thread_out, pthread_attr_t const* attr,
}
// Make sure the stack size and guard size are multiples of PAGE_SIZE.
thread->attr.stack_size = (thread->attr.stack_size + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
thread->attr.guard_size = (thread->attr.guard_size + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
thread->attr.stack_size = BIONIC_ALIGN(thread->attr.stack_size, PAGE_SIZE);
thread->attr.guard_size = BIONIC_ALIGN(thread->attr.guard_size, PAGE_SIZE);
if (thread->attr.stack_base == NULL) {
// The caller didn't provide a stack, so allocate one.