All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Sambasiva Rao Manchili <sambasiva.manchili@domain.hid>
Cc: Antonio Gambin <antonio.gambin@domain.hid>,
	"Xenomai-help@domain.hid" <Xenomai-help@domain.hid>
Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake
Date: Wed, 03 Aug 2011 16:40:11 +0200	[thread overview]
Message-ID: <1312382411.2135.16.camel@domain.hid> (raw)
In-Reply-To: <509DA52866E38F47878413CF102D751FD4207794FB@poseidon.nexus-ag.com>

On Wed, 2011-08-03 at 16:30 +0200, Sambasiva Rao Manchili wrote:
> Hi Philippe,
> Why do you say that I try to grab the mutex from non-xenomai thread
> context ?

Because this is what you are very likely doing. Calling a Xenomai-only
service over a non-Xenomai thread.

> During porting we had written main() only this main function does
> pthread_create to call the very first function of VxWorks code which
> inturn does taskSpawn. All the taskSpawns has to go through Xenomai
> thread context right ?

Task created by taskSpawn() are valid Xenomai context for sure. main()
is not by default.

I can't check your code, but EPERM is typical of calling a resource
grabbing service out of a valid Xenomai context. Xenomai can't move your
calling context to primary mode before executing this service and fails
early with EPERM. 

>  
> Samba.
>  
>  
> -----Original Message-----
> From: Philippe Gerum [mailto:rpm@xenomai.org] 
> Sent: Wednesday, 03. August, 2011 15:53
> To: Sambasiva Rao Manchili
> Cc: Gilles Chanteperdrix; Antonio Gambin; Xenomai-help@domain.hid
> Subject: RE: [Xenomai-help] Xenomai VxWorks Skin--->semTake
>  
> On Wed, 2011-08-03 at 15:31 +0200, Sambasiva Rao Manchili wrote:
> > Hi Gilles,
> > I had seen the code  in src\skins\vxworks\semLib.c it returns ERROR
> which is -1.
> > 
> > The value that I sent earlier is the value that I got out of the
> following statement.
> > serrLog( serrErr,
> >              "resu_getonline_1_svc: semTake for restab_access_smp
> failed!!<%s>",
> >               strerror(errnoGet()));
> > 
> > Is it right ?
> > 
> > 
> > Now again I tried with
> >  serrLog( serrErr,
> >              "resu_getonline_1_svc: semTake for restab_access_smp
> failed!!<%s> <%d>",
> >               strerror(errnoGet()), errno);
> > 
> > Here I get value 1 for errno.
>  
> You are trying to grab the mutex from a non-Xenomai thread context.
> This is invalid.
>  
> > 
> > Samba.
> > -----Original Message-----
> > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> > Sent: Wednesday, 03. August, 2011 15:18
> > To: Sambasiva Rao Manchili
> > Cc: Philippe Gerum; Antonio Gambin; Xenomai-help@domain.hid
> > Subject: Re: [Xenomai-help] Xenomai VxWorks Skin--->semTake
> > 
> > On 08/03/2011 02:44 PM, Sambasiva Rao Manchili wrote:
> > > Hi Philppe,
> > > Failed and return with error code is  <Unknown error 4294967295>
> and continues. I do not know the granularity of time  here, if it is
> returning immediately or not.
> > > We have about 15 tasks spawned in this whole system. Done very
> very minimal changes to our VxWorks code to run on Linux over Xenomai
> version 2.5.6.   Board does not crash.
> > > CPU Platform is Intel x86 Arch 32 Bit.
> > 
> > semTake does not return error code directly, it returns ERROR (which
> is -1, or 4294967295 if you cast to unsigned), and the real error is
> in the errno variable.
> > 
> > --
> >                                             Gilles.
> > 
> > 
> > This email and any attachment may contain confidential information
> which is intended for use only by the addressee(s) named above. If you
> received this email by mistake, please notify the sender immediately,
> and delete the email from your system. You are prohibited from
> copying, disseminating or otherwise using the email or any attachment.
> > 
>  
> --
> Philippe.
>  
>  
>  
> 
> 
>   ________________________________  
> This email and any attachment may contain confidential information
> which is intended for use only by the addressee(s) named above. If you
> received this email by mistake, please notify the sender immediately,
> and delete the email from your system. You are prohibited from
> copying, disseminating or otherwise using the email or any attachment.
> 

-- 
Philippe.




  reply	other threads:[~2011-08-03 14:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 10:15 [Xenomai-help] Xenomai VxWorks Skin--->semTake Sambasiva Rao Manchili
2011-08-03 11:27 ` Philippe Gerum
2011-08-03 12:44   ` Sambasiva Rao Manchili
2011-08-03 13:17     ` Gilles Chanteperdrix
2011-08-03 13:31       ` Sambasiva Rao Manchili
2011-08-03 13:53         ` Philippe Gerum
2011-08-03 14:30           ` Sambasiva Rao Manchili
2011-08-03 14:40             ` Philippe Gerum [this message]
2011-08-03 14:03         ` Gilles Chanteperdrix
2011-08-03 14:24           ` Sambasiva Rao Manchili
2011-08-03 15:19             ` Gilles Chanteperdrix
2011-08-05  6:48               ` Sambasiva Rao Manchili

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=1312382411.2135.16.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=Xenomai-help@domain.hid \
    --cc=antonio.gambin@domain.hid \
    --cc=sambasiva.manchili@domain.hid \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.