linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* sys_shmat
@ 2005-09-26  7:48 zhonglei
  2005-09-26 17:44 ` sys_shmat Brad Boyer
  0 siblings, 1 reply; 2+ messages in thread
From: zhonglei @ 2005-09-26  7:48 UTC (permalink / raw)
  To: linuxppc-dev

hi:
   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?
thanks
zhonglei 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sys_shmat
  2005-09-26  7:48 sys_shmat zhonglei
@ 2005-09-26 17:44 ` Brad Boyer
  0 siblings, 0 replies; 2+ messages in thread
From: Brad Boyer @ 2005-09-26 17:44 UTC (permalink / raw)
  To: zhonglei; +Cc: linuxppc-dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-26 17:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-26  7:48 sys_shmat zhonglei
2005-09-26 17:44 ` sys_shmat Brad Boyer

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