realmz6 | 1 Sep 03:38 2011
Picon

Re: gpio irq always set to level sensitive with Xenomai on Blackfin

any update?

On Tue, Aug 30, 2011 at 6:59 PM, realmz6 <realmz6 <at> gmail.com> wrote:
> Hi Philippe,
>
> Thanks for your quick response. I have a few questions.
>
> On Tue, Aug 30, 2011 at 6:07 PM, Philippe Gerum <rpm <at> xenomai.org> wrote:
>> On Tue, 2011-08-30 at 16:40 +0800, realmz6 wrote:
>>> Hi Guys,
>>>
>>> in adeos patch bfin_set_irq_handler(), this will set irq handle to
>>> handle_level_irq even it is a edge gpio irq, is it true?
>>>
>>>  #ifdef CONFIG_IPIPE
>>> -       _set_irq_handler(irq, handle_level_irq);
>>> -#else
>>> -       struct irq_desc *desc = irq_desc + irq;
>>> +       handle = __fixup_irq_handler(desc, handle_level_irq, 0);
>>> +#endif
>>>
>>> should it like the follows, it just fixup original handle and will not
>>> always set it to handle_level_irq.
>>
>> No, this code is correct Adeos-wise. See there for an explanation, and a
>> pending fix for a related issue:
>> https://mail.gna.org/public/xenomai-help/2011-08/msg00081.html
> why adeos is designed to use handle_level_irq for all interrupts even
> it is a edge interrupt in hardware?
> you means it should be fixed in the ipipe fixup_handler for
(Continue reading)

yi zheng | 1 Sep 03:49 2011
Picon

cann't find head file

Hi all

       I want to compile a kernel module.The source code file ,written by native skin, prepared to compile is named "kernel-test.c".The comment of makefile is described as follows:
       ifneq ($(KERNELRELEASE),)
obj-m :=kernel-test.o
else
KSRC ?=/usr/src/xenomai/linux-2.6.31.8
PWD     :=$(shell pwd)
default:
$(MAKE) -C  $(KSRC)    M=$(PWD)        modules
endif
        I tried to compile kernel module.Then I got:
make -I/usr/xenomai/include/  ARCH=arm CROSS_COMPILE=arm-linux-
make -C  /usr/src/xenomai/linux-2.6.31.8    M=/home/zhengyi/xenomai-program/kernel        modules
make[1]: Entering directory `/usr/src/xenomai/linux-2.6.31.8'
  CC [M]  /home/zhengyi/xenomai-program/kernel/kernel-test.o
/home/zhengyi/xenomai-program/kernel/kernel-test.c:1:25: native/task.h: No such file or directory
/home/zhengyi/xenomai-program/kernel/kernel-test.c:5: error: parse error before "task_desc"
/home/zhengyi/xenomai-program/kernel/kernel-test.c:5: warning: type defaults to `int' in declaration of `task_desc'
/home/zhengyi/xenomai-program/kernel/kernel-test.c:5: warning: data definition has no type or storage class
/home/zhengyi/xenomai-program/kernel/kernel-test.c: In function `task_body':
/home/zhengyi/xenomai-program/kernel/kernel-test.c:9: error: implicit declaration of function `printk'
/home/zhengyi/xenomai-program/kernel/kernel-test.c: In function `init_module':
/home/zhengyi/xenomai-program/kernel/kernel-test.c:17: error: implicit declaration of function `rt_task_create'
/home/zhengyi/xenomai-program/kernel/kernel-test.c:21: error: `T_FPU' undeclared (first use in this function)
/home/zhengyi/xenomai-program/kernel/kernel-test.c:21: error: (Each undeclared identifier is reported only once
/home/zhengyi/xenomai-program/kernel/kernel-test.c:21: error: for each function it appears in.)
/home/zhengyi/xenomai-program/kernel/kernel-test.c:21: error: implicit declaration of function `T_CPU'
/home/zhengyi/xenomai-program/kernel/kernel-test.c:23: error: implicit declaration of function `rt_task_start'
/home/zhengyi/xenomai-program/kernel/kernel-test.c:23: error: `NULL' undeclared (first use in this function)
/home/zhengyi/xenomai-program/kernel/kernel-test.c:24: error: implicit declaration of function `pause'
/home/zhengyi/xenomai-program/kernel/kernel-test.c: In function `cleanup_module':
/home/zhengyi/xenomai-program/kernel/kernel-test.c:29: error: implicit declaration of function `rt_task_delete'
make[2]: *** [/home/zhengyi/xenomai-program/kernel/kernel-test.o] error 1
make[1]: *** [_module_/home/zhengyi/xenomai-program/kernel] error 2
make[1]: Leaving directory `/usr/src/xenomai/linux-2.6.31.8'
make: *** [default] error 2

It seems that my problem is caused by  Xenomai head file directory.How to solve my proble?Thank you.
regards
yizheng
_______________________________________________
Xenomai-help mailing list
Xenomai-help <at> gna.org
https://mail.gna.org/listinfo/xenomai-help
Sambasiva Rao Manchili | 1 Sep 12:23 2011

taskDelete(tid) on VxWorks Skin ?

Hallo,
During cleanup routines we call taskDelete(tid)   but for some reasons we see that taskDelete is not working as expected though status returned by taskDelete call is 0(OK) and
further leads to crash as the task still exists(not deleted as assumed to be deleted with taskDelete) and trying to do something....which is not valid any more.
We use options as 0 while creating task.
 
Also tried taskDeleteForce, but did not help.   Any hints please.
 
To my knowledge,  Xenomai does not support any Hooks adding and deleing calls of Vxworks, we did not use them either.
 
But I got some info from  the following URL.
 
 
Thank you,
samba.
 
Sambasiva Rao Manchili
Software Development Engineer
________________________________
 
NEXUS TELECOM AG
Network and Service Investigation
Feldbachstrasse 80
8634 Hombrechtikon
Switzerland

Direct/mobile: +41 78 750 6808
Main: +41 44 355 6611
Email: sambasiva.manchili <at> nexustelecom.com
Website: www.nexustelecom.com

 

 

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.
_______________________________________________
Xenomai-help mailing list
Xenomai-help <at> gna.org
https://mail.gna.org/listinfo/xenomai-help
Sambasiva Rao Manchili | 1 Sep 12:32 2011

Re: taskDelete(tid) on VxWorks Skin ?

Hallo,
Additional info,  the task that is trying to delete is spawned at priority 97. 
The task that has to be deleted is running at Priority 142.
 
If you need more information that I missed, please let me know.
Samba.

From: Sambasiva Rao Manchili
Sent: Thursday, 01. September, 2011 12:23
To: Xenomai-help <at> gna.org
Subject: taskDelete(tid) on VxWorks Skin ?

Hallo,
During cleanup routines we call taskDelete(tid)   but for some reasons we see that taskDelete is not working as expected though status returned by taskDelete call is 0(OK) and
further leads to crash as the task still exists(not deleted as assumed to be deleted with taskDelete) and trying to do something....which is not valid any more.
We use options as 0 while creating task.
 
Also tried taskDeleteForce, but did not help.   Any hints please.
 
To my knowledge,  Xenomai does not support any Hooks adding and deleing calls of Vxworks, we did not use them either.
 
But I got some info from  the following URL.
 
 
Thank you,
samba.
 
Sambasiva Rao Manchili
Software Development Engineer
________________________________
 
NEXUS TELECOM AG
Network and Service Investigation
Feldbachstrasse 80
8634 Hombrechtikon
Switzerland

Direct/mobile: +41 78 750 6808
Main: +41 44 355 6611
Email: sambasiva.manchili <at> nexustelecom.com
Website: www.nexustelecom.com

 

 

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.
_______________________________________________
Xenomai-help mailing list
Xenomai-help <at> gna.org
https://mail.gna.org/listinfo/xenomai-help
Gilles Chanteperdrix | 1 Sep 13:36 2011

Re: taskDelete(tid) on VxWorks Skin ?

On 09/01/2011 12:32 PM, Sambasiva Rao Manchili wrote:
> If you need more information that I missed, please let me know.

See:
http://www.xenomai.org/index.php/Request_for_information

--

-- 
                                                                Gilles.
Sambasiva Rao Manchili | 1 Sep 14:01 2011

Re: taskDelete(tid) on VxWorks Skin ?

 Hi,

Version info is as follows
Linux eup1 2.6.37.6_xenomai-2.5.6 #2 PREEMPT Mon Jul 18 21:08:17 CEST 2011 i686 i686 i386 GNU/Linux

Kernel Configuraiton attached.

Actually the task that was deleted was "do_forth" task(running at priority 143)  by Terminator
task(priority 97).
Terminator task also exited.

Crash log
-----------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb4dc4b90 (LWP 26490)]
dorxevent (dt=0xb4dc5030) at foexd2.c:724
724     foexd2.c: No such file or directory.
        in foexd2.c
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) where
#0  dorxevent (dt=0xb4dc5030) at foexd2.c:724
#1  0xb7f59212 in doinner (dt=0xb4dc5030) at f_kernel.c:413
#2  0xb7f59633 in docommand (dt=0xb4dc5030) at f_kernel.c:483
#3  0xb7f54d95 in state_machine (dt=0xb4dc5030) at f_extn.c:607
#4  0xb7f6428b in start_forth (config=0x80506f8) at f_lib.c:192
#5  0xb7ff266b in do_forth (confp=0x80506f8, dptr=0xb4dc5030, termNo=1) at tesarm.c:561
#6  0xb7ea0cbe in wind_task_trampoline () from /usr/xenomai/lib/libvxworks.so.1
#7  0x4b1e0832 in start_thread () from /lib/libpthread.so.0
#8  0x4b14b45e in clone () from /lib/libc.so.6
(gdb)

Please let me know if I can still give you more information
Samba.
-----Original Message-----
From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix <at> xenomai.org]
Sent: Thursday, 01. September, 2011 13:37
To: Sambasiva Rao Manchili
Cc: Xenomai-help <at> gna.org
Subject: Re: [Xenomai-help] taskDelete(tid) on VxWorks Skin ?

On 09/01/2011 12:32 PM, Sambasiva Rao Manchili wrote:
> If you need more information that I missed, please let me know.

See:
http://www.xenomai.org/index.php/Request_for_information

--
                                                                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.
Attachment (ATT38011.config): application/octet-stream, 121 KiB
_______________________________________________
Xenomai-help mailing list
Xenomai-help <at> gna.org
https://mail.gna.org/listinfo/xenomai-help
Gilles Chanteperdrix | 1 Sep 14:06 2011

Re: taskDelete(tid) on VxWorks Skin ?

On 09/01/2011 02:01 PM, Sambasiva Rao Manchili wrote:
>  Hi,
> 
> Version info is as follows
> Linux eup1 2.6.37.6_xenomai-2.5.6 #2 PREEMPT Mon Jul 18 21:08:17 CEST 2011 i686 i686 i386 GNU/Linux
> 
> Kernel Configuraiton attached.
> 
> Actually the task that was deleted was "do_forth" task(running at priority 143)  by Terminator
task(priority 97).
> Terminator task also exited.

You missed section 4 in the page I sent you. This is the most important
item.

--

-- 
					    Gilles.
Sambasiva Rao Manchili | 1 Sep 16:51 2011

Re: taskDelete(tid) on VxWorks Skin ?

 Hi,
The reason that I have not given this piece of code was because it is not written by me oflate but  was code that
exists since several years which is running on VxWorks  on  different versions.
I just ported this with very very minimal effort to Linux over Xenomai.  It is also huge code base and several dependencies.

In VxWorks  we ran our code in Kernel space and not in user space we used lot of global data as well.
So therefore on Linux, I tied the several tasks that are being spawned into single process on Linux because
of dependency and data being shared.

What ever I can explain, I explained over the last email about those tasks  in gist.
I can also give bit more information after you look at the code snippet.
Please just search for string "README"  in these files  where I gave my observations.

I hope this is one last issue on my table to solve it in whole porting and running our legacy VxWorks code  on Linux.
Samba

-----Original Message-----
From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix <at> xenomai.org]
Sent: Thursday, 01. September, 2011 14:06
To: Sambasiva Rao Manchili
Cc: Xenomai-help <at> gna.org
Subject: Re: [Xenomai-help] taskDelete(tid) on VxWorks Skin ?

On 09/01/2011 02:01 PM, Sambasiva Rao Manchili wrote:
>  Hi,
>
> Version info is as follows
> Linux eup1 2.6.37.6_xenomai-2.5.6 #2 PREEMPT Mon Jul 18 21:08:17 CEST
> 2011 i686 i686 i386 GNU/Linux
>
> Kernel Configuraiton attached.
>
> Actually the task that was deleted was "do_forth" task(running at priority 143)  by Terminator
task(priority 97).
> Terminator task also exited.

You missed section 4 in the page I sent you. This is the most important item.

--
                                            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.
extern int create_forth_task(SCENTABLE_ENTRY_TYPE *entry,
                             int                   priority,
                             int                   special_stack_size)
{
  char name[40];
  int  used_stack_size;
  pthread_t  doForthTaskId;
  int        task_id;
  used_stack_size = (special_stack_size != 0) ? special_stack_size : (160 * 1024) ;
  sprintf(name,"tForth%d",entry->toffset);

  task_id = taskSpawn(name,
		   priority,
		   0,
		   used_stack_size,
		   (FUNCPTR)do_forth,
		   (int) entry->config_ptr,
		   (int) entry->dict_ptr,
                   (int)entry->toffset,0,0,0,0,0,0,0);
                   
 if (task_id == ERROR) 
  {
    serr_log(SERR_ERROR,"cannot spawn tForth (%s)",
	     strerror(errnoGet()));
    return 1;
  }
 return task_id;   /* README:- Usually I see here Xenomai returns task_id as two or three digit number*/

}
static void terminator_task(TASK_TAB_TYPE *task_listp, int termNo)
{
  UINT_16               i, number;
  SCENTABLE_ENTRY_TYPE *entry;
  TESA_CNTRL_TYPE       msg;
  STATUS                status;
  TOffset               toffset;
  char                  name[40];
  struct timespec       ts;
  
  
  sprintf(name,"tTerminator%d",termNo);
  logOpen(name);
  serr_open2("tesa",SERR_LDF,0,&tesa_data_fieldp->tesa_ldf_vals);

  ts.tv_sec  = 0;
  ts.tv_nsec = 50000; /* 50 ms */

  msg.msgtype = TESA_FORTH_CNTRL;
  msg.data = (task_listp->control == KILL_FORTH) ? FS_KILLED : FS_RELEASED;

  number = task_listp->anzahl;
  printf("%s: Number---><%d>\n",__FUNCTION__, number);
  while (number) {
  
    for (i = 0; i < task_listp->anzahl; i++) {
      
      if ((toffset = task_listp->toffset[i])) {
	
	entry = &tesa_scentablep[toffset];
	taskSuspend(task_listp->token[i]);  /* README  Tried with suspend did not help */
       
        /* README , as taskDelete did not work, I tried with force but did not help either.
         * The value of TaskID that I pass here as parameter to taskDelete is taskDeleteForce
         * is same as what I got from taskSpawn from Xenomai.
         */
	status = taskDeleteForce(task_listp->token[i]); 

	serr_log(SERR_INFO,"task %x deleted status %d",task_listp->token[i],
		status);
	if (status == OK) {

           /* README  XENOMAI Retrusn STATUS OK */
	  number--;
	  task_listp->toffset[i] = 0;	  
	  msg.termoffset = toffset; /* set terminaloffset in message */
	  (void) tesa_tx_message(&msg,sizeof(TESA_CNTRL_TYPE));

	} else {

           /* README  NEVER ENTERS HERE */ 
           serrLog( serrWarn, "terminator_task: deletion of tForth%d failed! %s",
             toffset, strerror(errnoGet()) );


	  /* if errno equal S_objLib_OBJ_UNAVAILABLE: the interpreter is in 
	     a critical region ( taskSave is set ) --> try to delete it later 
	     
	     else we assume that the task is already deleted
	     
	  */
	  if (errnoGet() != S_objLib_OBJ_UNAVAILABLE) {
	    number--;
	    task_listp->toffset[i] = 0;
	    msg.termoffset = toffset; /* set terminaloffset in message */
	    (void) tesa_tx_message(&msg,sizeof(TESA_CNTRL_TYPE));
	  }
	}
      } /* if (toffset) */
    } /* for */
    taskDelay( 10 );
  } /* while (number) */
  free(task_listp);

  printf("%s: Not Calling Exit\n", __FUNCTION__);
  
  /*pthread_exit(0);
  exit(0); Original VxWorks code */
}


static void* thread_TesaItask(void *arg)
{
  arg=arg;
  logMsg(INFO_0,"Exectuting tesa_itask....");

  /* README tesa_itask Should spawn 3 tasks (and one of those 3 tasks spawned  will spawn 
   * do_forthTask on some event) 
   * do_forthTask is for ever and will be deleted by terminatorTask which is spawned by one of those 3 tasks
   * during cleanup event.
   * 
   */
  tesa_itask();  
  
  printf("%s: Going to sleep INFINITE", __FUNCTION__);
  while(1)
  {
    sleep(3600);
  } 
  return 0;
}

int main(int argc, char **argv)
{
...
...
tesaITask = osCreateDetachedThread(thread_TesaItask,NULL);
   logMsg(INFO_0, "%s: Returned from osCreateDetachedThread tesaItask<%ld>",
   		__FUNCTION__, tesaITask);

....
}
_______________________________________________
Xenomai-help mailing list
Xenomai-help <at> gna.org
https://mail.gna.org/listinfo/xenomai-help
Gilles Chanteperdrix | 1 Sep 17:08 2011

Re: taskDelete(tid) on VxWorks Skin ?

On 09/01/2011 04:51 PM, Sambasiva Rao Manchili wrote:
>  Hi,
> The reason that I have not given this piece of code was because it is not written by me oflate but  was code that
exists since several years which is running on VxWorks  on  different versions.
> I just ported this with very very minimal effort to Linux over Xenomai.
> 

I do not ask you to send your code, I ask you to send a reduced,
self-contained test case, which demonstrates the issue you have, for
reasons explained on the page I directed you to.

--

-- 
					    Gilles.
Sambasiva Rao Manchili | 1 Sep 17:25 2011

Re: taskDelete(tid) on VxWorks Skin ?

Hi,
It is reduced piece which explains the problem.
If it is much more then I will see what I can do.
Samba.

-----Original Message-----
From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix <at> xenomai.org]
Sent: Thursday, 01. September, 2011 17:08
To: Sambasiva Rao Manchili
Cc: Xenomai-help <at> gna.org
Subject: Re: [Xenomai-help] taskDelete(tid) on VxWorks Skin ?

On 09/01/2011 04:51 PM, Sambasiva Rao Manchili wrote:
>  Hi,
> The reason that I have not given this piece of code was because it is not written by me oflate but  was code that
exists since several years which is running on VxWorks  on  different versions.
> I just ported this with very very minimal effort to Linux over Xenomai.
>

I do not ask you to send your code, I ask you to send a reduced, self-contained test case, which demonstrates
the issue you have, for reasons explained on the page I directed you to.

--
                                            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.

Gmane