From: "Dr. Kiriakos Athanasas" Date: Fri, 15 May 2009 10:54:03 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_03E2_01C9D54B.75F95DB0" Message-Id: <0MKv5w-1M4tAX3kHn-0001tx@domain.hid> Subject: [Xenomai-help] problem with mutexes between kernel and user-space List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org This is a multi-part message in MIME format. ------=_NextPart_000_03E2_01C9D54B.75F95DB0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, I had an application which run under kernel 2.6.26 and xeno 2.4.6 without any problems. I tried now kernel 2.6.28.7 and xeno 2.5.1 and have the following problem: inside a kernel module I create a mutex for locking an shared memory. from an user-task I want now to communicate over the protected shm. Therefore I bind to the mutex of the kernel-space when I call rt_mutex_acquire I get the failure EIDRM. Why the mutex seems to be deleted? rt_mutex_release causes a segmentation fault. What is my mistake? Here the code description of user space (it is really simple): err = rt_mutex_create(&eca_mutex,"Mutex1"); . err = rt_mutex_bind(&eca_mutex," Mutex1",TM_INFINITE); . err = rt_mutex_acquire(&eca_mutex, TM_INFINITE); // lock mutex memcpy(.); err = rt_mutex_release(&eca_mutex); // unlock mutex . Best regards Kiriakos ------=_NextPart_000_03E2_01C9D54B.75F95DB0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

 

I had an application which run under kernel 2.6.26 and xeno = 2.4.6 without any problems.

 

I tried now kernel 2.6.28.7 and xeno 2.5.1 and have the = following problem:

 

inside a kernel module I create a mutex for locking an shared = memory. from an user-task I want now to

communicate over the protected shm. Therefore I bind to the = mutex of the kernel-space

 

when I call rt_mutex_acquire I get the failure EIDRM. Why the = mutex seems to be deleted?

 

rt_mutex_release causes a segmentation = fault.

 

What is my mistake?

 

 

Here the code description of user space (it is really = simple):

 

err =3D = rt_mutex_create(&eca_mutex,"Mutex1");

…

err =3D rt_mutex_bind(&eca_mutex," = Mutex1",TM_INFINITE); 

…

err =3D rt_mutex_acquire(&eca_mutex, = TM_INFINITE);   // lock mutex

memcpy(…);

err =3D = rt_mutex_release(&eca_mutex);      &nbs= p;        // unlock = mutex

…

 

Best regards

 

Kiriakos

 

------=_NextPart_000_03E2_01C9D54B.75F95DB0--