in src/postgres/src_backend_tcop_postgres.c [544:592]
__asm__ __volatile__(
";;\n"
" mov %0=ar.bsp \n"
: "=r"(ret));
return ret;
}
#endif
#endif /* IA64 */
/*
* set_stack_base: set up reference point for stack depth checking
*
* Returns the old reference point, if any.
*/
#if defined(__ia64__) || defined(__ia64)
#else
#endif
#if defined(__ia64__) || defined(__ia64)
#endif
/*
* restore_stack_base: restore reference point for stack depth checking
*
* This can be used after set_stack_base() to restore the old value. This
* is currently only used in PL/Java. When PL/Java calls a backend function
* from different thread, the thread's stack is at a different location than
* the main thread's stack, so it sets the base pointer before the call, and
* restores it afterwards.
*/
#if defined(__ia64__) || defined(__ia64)
#else
#endif
/*
* check_stack_depth/stack_is_too_deep: check for excessively deep recursion
*
* This should be called someplace in any recursive routine that might possibly
* recurse deep enough to overflow the stack. Most Unixen treat stack
* overflow as an unrecoverable SIGSEGV, so we want to error out ourselves
* before hitting the hardware limit.
*
* check_stack_depth() just throws an error summarily. stack_is_too_deep()
* can be used by code that wants to handle the error condition itself.
*/
void
check_stack_depth(void)
{