linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Brad Boyer <flar@allandria.com>
To: zhonglei <zhonglei@RCS-9000.COM>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: sys_shmat
Date: Mon, 26 Sep 2005 10:44:04 -0700	[thread overview]
Message-ID: <20050926174403.GA28765@pants.nu> (raw)
In-Reply-To: <200509261548.AA26280018@RCS-9000.COM>

On Mon, Sep 26, 2005 at 03:48:03PM +0800, zhonglei wrote:
>    I get a pointer shramptr from sys_shmat(shid,0,SHM_R|SHM_W,&shramptr) to use share RAM in my driver.
> But when I assign a value into this pointer in my interrupt routine,
> the system shows: oops: kernel access of bad area!
> what's the problem?

The problem is that sys_shmat is the implementation of the shmat() system
call and is therefore only intended to attach shared memory to a normal
user-space process. The memory is attached to whatever process is listed
as current at the time of the call. This is obviously not what you wanted,
since you apparently want something that is useful from kernel-space.

Perhaps you should tell the list what you are trying to do from a more
conceptual view? No matter what you are trying to do, I think you are
misunderstanding the services that are available to a driver in the kernel.
The key question you need to answer is where you need to be able to
access this memory. In particular, do you need it in a user-space program?

	Brad Boyer
	flar@allandria.com

      reply	other threads:[~2005-09-26 17:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-26  7:48 sys_shmat zhonglei
2005-09-26 17:44 ` Brad Boyer [this message]

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=20050926174403.GA28765@pants.nu \
    --to=flar@allandria.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=zhonglei@RCS-9000.COM \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).