unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andrew Gaylard <ag@computer.org>
To: guile-devel@gnu.org
Subject: [patch] implement scm_init_guile for 1.8.8 on Solaris 10u9
Date: Thu, 28 Apr 2011 17:40:08 +0200	[thread overview]
Message-ID: <BANLkTinqgmjdNjF2FNUBvZAK-UzS7eg-ZA@mail.gmail.com> (raw)

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

             reply	other threads:[~2011-04-28 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28 15:40 Andrew Gaylard [this message]
2011-04-28 17:57 ` [patch] implement scm_init_guile for 1.8.8 on Solaris 10u9 Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTinqgmjdNjF2FNUBvZAK-UzS7eg-ZA@mail.gmail.com \
    --to=ag@computer.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).