Lines Matching refs:pd
149 guard_position (void *mem, size_t size, size_t guardsize, struct pthread *pd, in guard_position() argument
157 return (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1); in guard_position()
187 advise_stack_range (void *mem, size_t size, uintptr_t pd, size_t guardsize) in advise_stack_range() argument
200 uintptr_t free_end = (pd - guardsize) & ~pagesize_m1; in advise_stack_range()
218 struct pthread *pd; in allocate_stack() local
273 pd = (struct pthread *) ((uintptr_t) stackaddr in allocate_stack()
276 pd = (struct pthread *) (((uintptr_t) stackaddr in allocate_stack()
282 memset (pd, '\0', sizeof (struct pthread)); in allocate_stack()
285 pd->specific[0] = pd->specific_1stblock; in allocate_stack()
288 pd->stackblock = (char *) stackaddr - size; in allocate_stack()
289 pd->stackblock_size = size; in allocate_stack()
293 pd->user_stack = true; in allocate_stack()
296 pd->header.multiple_threads = 1; in allocate_stack()
302 SETUP_THREAD_SYSINFO (pd); in allocate_stack()
306 pd->setxid_futex = -1; in allocate_stack()
309 if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL) in allocate_stack()
321 list_add (&pd->list, &GL (dl_stack_user)); in allocate_stack()
364 pd = get_cached_stack (&size, &mem); in allocate_stack()
365 if (pd == NULL) in allocate_stack()
382 pd = (struct pthread *) ((((uintptr_t) mem + size) in allocate_stack()
386 pd = (struct pthread *) ((((uintptr_t) mem + size in allocate_stack()
395 char *guard = guard_position (mem, size, guardsize, pd, in allocate_stack()
405 pd->stackblock = mem; in allocate_stack()
406 pd->stackblock_size = size; in allocate_stack()
409 pd->guardsize = guardsize; in allocate_stack()
414 pd->specific[0] = pd->specific_1stblock; in allocate_stack()
417 pd->header.multiple_threads = 1; in allocate_stack()
423 SETUP_THREAD_SYSINFO (pd); in allocate_stack()
427 pd->setxid_futex = -1; in allocate_stack()
430 if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL) in allocate_stack()
446 __nptl_stack_list_add (&pd->list, &GL (dl_stack_used)); in allocate_stack()
458 int err = __nptl_change_stack_perm (pd); in allocate_stack()
478 if (__glibc_unlikely (guardsize > pd->guardsize)) in allocate_stack()
480 char *guard = guard_position (mem, size, guardsize, pd, in allocate_stack()
488 __nptl_stack_list_del (&pd->list); in allocate_stack()
493 _dl_deallocate_tls (TLS_TPADJ (pd), false); in allocate_stack()
505 pd->guardsize = guardsize; in allocate_stack()
507 else if (__builtin_expect (pd->guardsize - guardsize > size - reqsize, in allocate_stack()
514 char *oldguard = mem + (((size - pd->guardsize) / 2) & ~pagesize_m1); in allocate_stack()
521 oldguard + pd->guardsize - guard - guardsize, in allocate_stack()
525 if (__mprotect ((char *) mem + guardsize, pd->guardsize - guardsize, in allocate_stack()
529 char *new_guard = (char *)(((uintptr_t) pd - guardsize) in allocate_stack()
531 char *old_guard = (char *)(((uintptr_t) pd - pd->guardsize) in allocate_stack()
540 pd->guardsize = guardsize; in allocate_stack()
545 pd->reported_guardsize = reported_guardsize; in allocate_stack()
550 pd->lock = LLL_LOCK_INITIALIZER; in allocate_stack()
555 pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock) in allocate_stack()
558 pd->robust_head.list_op_pending = NULL; in allocate_stack()
560 pd->robust_prev = &pd->robust_head; in allocate_stack()
562 pd->robust_head.list = &pd->robust_head; in allocate_stack()
565 *pdp = pd; in allocate_stack()
571 stacktop = ((char *) (pd + 1) - tls_static_size_for_stack); in allocate_stack()
573 stacktop = (char *) (pd - 1); in allocate_stack()
576 *stacksize = stacktop - pd->stackblock; in allocate_stack()
577 *stack = pd->stackblock; in allocate_stack()