unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [patch] implement scm_init_guile for 1.8.8 on Solaris 10u9
@ 2011-04-28 15:40 Andrew Gaylard
  2011-04-28 17:57 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Gaylard @ 2011-04-28 15:40 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

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...

[-- Attachment #2: fix-solaris-scm_init_guile.patch --]
[-- Type: text/x-diff, Size: 575 bytes --]

--- 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 */
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-28 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 15:40 [patch] implement scm_init_guile for 1.8.8 on Solaris 10u9 Andrew Gaylard
2011-04-28 17:57 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).