comp.lang.ada
 help / color / mirror / Atom feed
From: awdorrin <awdorrin@gmail.com>
Subject: Re: Stumped: Seg Fault with System.Secondary_Stack.SS_Mark()
Date: Fri, 7 Sep 2012 09:18:30 -0700 (PDT)
Date: 2012-09-07T09:18:30-07:00	[thread overview]
Message-ID: <00367705-1c58-4ae1-9965-c6415feae8c3@googlegroups.com> (raw)
In-Reply-To: <m2zk51ong1.fsf@pushface.org>

On Friday, September 7, 2012 11:35:42 AM UTC-4, Simon Wright wrote:
> 
> Have you registered these threads with the Ada RTS? See
> g-thread.ads. You need to do this before doing anything (such as
> accessing the secondary stack) which requires Ada-specific setup in the
> TCB or equivalent.

I thought I was, but perhaps I'm not doing it correctly.

I have all of the Ada code compiled into a library (libsimlib.a) and I initialize the Ada through a generated function: 'simlibinit()'

The C code then makes multiple pthread_create() calls to spawn off each thread.
The function pointer passed to pthread_create() is a C function that wraps the Ada call. For example:

extern e_mainline();
int rtctl_rts() {
  e_mainline();
  return 0;
}

pthread_create(&tid, attrp, &rtctl_rts, NULL);

where 'e_mainline' is exported from the RTCTL package with:
pragma EXPORT(Ada, E_MAINLINE, "e_mainline");




  reply	other threads:[~2012-09-07 16:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 19:34 Stumped: Seg Fault with System.Secondary_Stack.SS_Mark() awdorrin
2012-09-06 19:57 ` Ludovic Brenta
2012-09-06 20:53   ` awdorrin
2012-09-06 21:18     ` Ludovic Brenta
2012-09-06 22:13       ` awdorrin
2012-09-07 14:38         ` awdorrin
2012-09-07 14:55           ` Ludovic Brenta
2012-09-07 15:35           ` Simon Wright
2012-09-07 16:18             ` awdorrin [this message]
2012-09-07 16:31               ` awdorrin
2012-09-07 17:07                 ` Simon Wright
2012-09-07 17:50                   ` awdorrin
2012-09-08 13:23                     ` francois_fabien
2012-09-10 13:50                       ` awdorrin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox