All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Problem with rtdm_mmap_to_user
@ 2012-10-25 19:58 Oded Gabbay
  0 siblings, 0 replies; only message in thread
From: Oded Gabbay @ 2012-10-25 19:58 UTC (permalink / raw)
  To: xenomai

Hi,

I'm using Xenomai 2.6.1 and kernel 2.6.33 on mpc8309 (powerpc) processor.

I'm trying to map a kernel memory area to user space memory.

The call to rtdm_mmap_to_user inside the rt driver works but when I read 
the memory in the user space thread (rt thread), the contents of the 
memory area are wrong.

Here is the code in the driver:

         ret = rtdm_mmap_to_user(user_info, skb, sizeof(struct rtskb), 
PROT_READ|PROT_WRITE,
                                 (void **)&msg->msg_iov[1].iov_base, 
NULL, NULL);


msg->msg_iov[1].iov_base is a void* which points to NULL before the call 
to rtdm_mmap_to_user.

The result is in msg->msg_iov[1].iov_base. The address seems good, as it 
in the range of the addresses of other variables in my user space thread.

In the user-space thread I do:

             void *tmp;
             tmp = msg->msg_iov[1].iov_base;
             printf("tmp = %p:%x\n", tmp, *(int *)tmp);

The results is that tmp points to the same address I got at 
rtdm_mmap_to_user, but the contents of tmp are wrong.

Please help me...

Thanks,
Oded



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-25 19:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 19:58 [Xenomai] Problem with rtdm_mmap_to_user Oded Gabbay

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.