All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <ogabbay@advaoptical.com>
To: xenomai@xenomai.org
Subject: [Xenomai] Problem with rtdm_mmap_to_user
Date: Thu, 25 Oct 2012 21:58:44 +0200	[thread overview]
Message-ID: <508999F4.6060802@advaoptical.com> (raw)

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



                 reply	other threads:[~2012-10-25 19:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=508999F4.6060802@advaoptical.com \
    --to=ogabbay@advaoptical.com \
    --cc=xenomai@xenomai.org \
    /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.