Hi,

The attached patch implements the scm_init_guile function on Solaris.
The detection of the stack parameters is done via a new(ish) Solaris
function, stack_getbounds() -- see
http://download.oracle.com/docs/cd/E19253-01/816-5168/stack-getbounds-3c/index.html
for details.

Tested on Solaris 10u9, on both SPARC64 and x86_64.

- Andrew

PS: now, on to get 2.0.1 working...
--- guile-1.8.8/libguile/threads.c.orig	Mon Dec 13 19:24:40 2010
+++ guile-1.8.8/libguile/threads.c	Wed Apr 27 20:07:34 2011
@@ -689,8 +689,25 @@
 {
   return scm_get_stack_base ();
 }
 
+#elif defined (sun)
+
+#define HAVE_GET_THREAD_STACK_BASE
+#include <ucontext.h>
+static SCM_STACKITEM *
+get_thread_stack_base ()
+{
+  stack_t stack;
+  stack_getbounds( &stack );
+
+#if SCM_STACK_GROWS_UP
+  return stack.ss_sp;
+#else
+  return stack.ss_sp + stack.ss_size;
+#endif
+}
+
 #endif /* pthread methods of get_thread_stack_base */
 
 #else /* !SCM_USE_PTHREAD_THREADS */
 

Reply via email to