public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: "Lewin A.R.W. Edwards" <larwe@larwe.com>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] More information on crash with CVS sources
Date: Wed, 14 Feb 2001 13:50:00 -0000	[thread overview]
Message-ID: <3A8AFDB3.BDF179C7@redhat.com> (raw)
In-Reply-To: <4.3.2.7.2.20010213203638.00ad0f00@larwe.com>

"Lewin A.R.W. Edwards" wrote:
> 
> However, in further news, I built a little test proglet that consists of
> just a cyg_user_start that does a printf [and nothing else] and a main()
> that also does a printf.
> 
> In 1.3.1, it is seemingly not necessary to explicitly create and start a
> thread. cyg_user_start enables interrupts, and then control passes to
> main(). So my program at the moment runs in main() [since it was ported
> from a different OS].
> 
> When I compile the above test prog with anoncvs everything, I get the
> printf from cyg_user_start but not the one from main; after the printf("hi
> from cyg_user_start") I get an exception at 0xfffffffc. So I assume the
> 1.3.1 behavior I describe above is no longer true and that I must
> explicitly start a thread for my main application task.

There is stuff in the CYGPKG_LIBC_STARTUP package to do this for you - it
provides a default cyg_user_start() that will create (and resume) a thread
that will call main(). This differs from v1.3.1 because this used to happen
in cyg_package_start(). But this wasn't right because it polluted the
design, and meant that people who weren't interested in having their own
main(), and instead wanted to just write their own eCos program (which
would therefore include a cyg_user_start() entry point) would still get a
main() thread created. This way they don't.

You don't need to start a thread by hand. But if you provide your _own_
cyg_user_start() then you can instead call "cyg_iso_c_start()" from your
cyg_user_start(), since the default cyg_user_start() isn't being run.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

  reply	other threads:[~2001-02-14 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-13 12:42 Lewin A.R.W. Edwards
2001-02-13 17:34 ` Jonathan Larmour
2001-02-13 20:38   ` Lewin A.R.W. Edwards
2001-02-14 13:50     ` Jonathan Larmour [this message]
2001-02-15  6:31       ` Lewin A.R.W. Edwards

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

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

  git send-email \
    --in-reply-to=3A8AFDB3.BDF179C7@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=larwe@larwe.com \
    /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).