• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: about IOMemoryDescriptor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about IOMemoryDescriptor


  • Subject: Re: about IOMemoryDescriptor
  • From: Michael Smith <email@hidden>
  • Date: Wed, 8 Sep 2010 09:51:10 -0700


On Sep 8, 2010, at 2:23 AM, sheetal phirke wrote:

I have read about IOMemoryDescriptor:
Drivers can access user-space memory by creating an IOMemoryDescriptor instance based on a virtual address 
in a given task and then preparing and mapping the descriptor.

So is it possible to create semaphore object in user,  pass it to kernel & map that memory into kernel so that i can access same semaphore in kernel?
i try to do this, but IOMemoryDescriptor::map() failed.
i want to do this for synchronization between user & kernel...

You should not do this, as you have no mechanism for avoiding priority inversions if you invent your own blocking synchronisation primitives.

If you are trying to provide a form of mutual exclusion, look at some of the lockless strategies for sharing data and combine them with the OSAtomic operations.

 = Mike

--
The lyf so short, the craft so long to lerne -- Chaucer





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >about IOMemoryDescriptor (From: sheetal phirke <email@hidden>)

  • Prev by Date: about IOMemoryDescriptor
  • Next by Date: Building the 10.6.4 Kernel
  • Previous by thread: about IOMemoryDescriptor
  • Next by thread: Building the 10.6.4 Kernel
  • Index(es):
    • Date
    • Thread