On 04/07/2016 12:25, Peter Lieven wrote: >>> >> No, you just pass the stack and the runtime takes care of initializing >> the two stack pointers: >> >> uc.uc_link = &old_uc; >> uc.uc_stack.ss_sp = co->stack; >> uc.uc_stack.ss_size = stack_size; >> uc.uc_stack.ss_flags = 0; > > So, you would basically copy the if/elif part from allocatestack.c ?
Yes, but note that _STACK_GROWS_{DOWN,UP} and NEED_SEPARATE_REGISTER_STACK are glibc-specific. You need to use HOST_IA64 and HOST_HPPA. > In this case I would also count the guardpage as part of the stack, so > that the usable stack size is actually reduced by one page? Yes. Paolo