Project

General

Profile

Feature #8793 » hpux-ia64-threads.diff

michal@rokos.cz (Michal Rokos), 08/16/2013 04:01 PM

View differences:

thread_pthread.c
#define STACKADDR_AVAILABLE 1
#elif defined HAVE_PTHREAD_GETTHRDS_NP
#define STACKADDR_AVAILABLE 1
#elif defined __ia64 && defined _HPUX_SOURCE
#define STACKADDR_AVAILABLE 1
/*
* Do not lower the thread's stack to PTHREAD_STACK_MIN,
* otherwise one would receive a 'sendsig: useracc failed.'
* and a coredump.
*/
#undef PTHREAD_STACK_MIN
#endif
#ifndef MAINSTACKADDR_AVAILABLE
......
*addr = thinfo.__pi_stackaddr;
*size = thinfo.__pi_stacksize;
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
#elif defined __ia64 && defined _HPUX_SOURCE
/*
* Although HP-UX defines _pthread_stack_info_np(), it cannot be
* used since it returns an error when the thread is not suspended.
* So lets use some other way to get the stack information...
*/
pthread_attr_t attr;
/*
* Using value of sp is very rough... To make it more real,
* addr would need to be aligned to vps_pagesize.
* The vps_pagesize is 'Default user page size (kBytes)'
* and could be retrieved by gettune().
*/
*addr = _Asm_get_sp();
/*
* As the PTHREAD_STACK_MIN is undefined and
* noone touches the default stacksize,
* it is just fine to use the default.
*/
CHECK_ERR(pthread_attr_init(&attr));
CHECK_ERR(pthread_attr_getstacksize(&attr, size));
pthread_attr_destroy(&attr);
#else
#error STACKADDR_AVAILABLE is defined but not implemented.
#endif
(1-1/2)