comp.lang.ada
 help / color / mirror / Atom feed
From: Rolf <rolf.ebert_nospam_@gmx.net>
Subject: Re: Passing Ada Proc as a C Function Pointer
Date: Thu, 5 Aug 2010 00:33:15 -0700 (PDT)
Date: 2010-08-05T00:33:15-07:00	[thread overview]
Message-ID: <60b8a494-fed1-4e0f-ba27-a2b7070d5818@k19g2000yqc.googlegroups.com> (raw)
In-Reply-To: 581d2a1a-d7bb-48f5-9ca6-ae3c0e27c9bf@d17g2000yqb.googlegroups.com

On 5 Aug., 02:45, Warren <ve3...@gmail.com> wrote:
> On Aug 4, 3:46 pm, Simon Wright <si...@pushface.org> wrote:
>
> > I would be a bit worried about Thread_Proc's *Ada* environment. There's
> > this thing called the Secondary Stack, used for - for example - string
> > catenation; and it's not set up here.
>
> Yikes, that could be a problem. I vaguely remember something about
> a "secondary stack".  I'm going to need to research this.

The current version of AVR-Ada does not support the secondary stack.
It is required for returning unconstrained objects from functions.
Using unconstrained arrays already consumes so much of the valuable
RAM that I never felt the need to support returning these objects from
functions.

BTW, GNAT-AVR (GPL 2010) from Adacore supports the secondary stack
(and some other Ada features currently missing in AVR-Ada).

> > I think you'll be OK so long as you restrain yourself! Twiddling LEDs
> > should be OK.

You can write quite complex programs without returning unconstrained
objects!

>
> Well LED twiddling is just the "hello world" test.  I hope to do
> a lot more than that, down the road!
>
> > There may be a pragma to prevent secondary stack usage?
>
> I'm all ears! ;-)

pragma Restrictions (No_Secondary_Stack);

It is already active if you use AVR-Ada.  See the file gnat.adc

    Rolf



  reply	other threads:[~2010-08-05  7:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 16:40 Passing Ada Proc as a C Function Pointer Warren
2010-08-04 17:14 ` Dmitry A. Kazakov
2010-08-05  0:24   ` Warren
2010-08-04 18:46 ` Jeffrey Carter
2010-08-04 19:36   ` Dmitry A. Kazakov
2010-08-05  0:42   ` Warren
2010-08-05  0:55     ` Warren
2010-08-04 19:46 ` Simon Wright
2010-08-05  0:45   ` Warren
2010-08-05  7:33     ` Rolf [this message]
2010-08-05 20:50       ` Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
2010-08-05 14:31 Warren
2010-08-05 15:37 ` Warren
2010-08-05 16:51   ` Warren
replies disabled

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