• 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: User-space to kernel communication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User-space to kernel communication


  • Subject: Re: User-space to kernel communication
  • From: Michael Smith <email@hidden>
  • Date: Tue, 9 Jan 2007 19:59:30 -0800


On Jan 9, 2007, at 7:40 PM, Greg wrote:

On Jan 9, 2007, at 8:32 PM, Michael Smith wrote:

Also, as I asked in the other email, can you pass a pointer to a user-land allocated buffer as a parameter to a method call for the kernel to use?

You can, although the kernel can't access it directly. As I pointed out previously, if the data is small (you mentioned 50 bytes, which is very small) you're better off just copying it. If you need to pass it to hardware, or to map it, you need to construct an IOMemoryDescriptor referencing it.

By "just copying it" do you mean, as Brian pointed out, passing a structure of this sort:


typedef struct {
	unsigned char buffer[256];
	unsigned char bufferSize;
} MyIOUserClientArg;

Yes, although I would put the size member at the front of the structure so that you don't waste another cache line accessing it.


 = Mike


_______________________________________________ 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: 
 >User-space to kernel communication (From: Greg <email@hidden>)
 >Re: User-space to kernel communication (From: Josh Graessley <email@hidden>)
 >Re: User-space to kernel communication (From: Greg <email@hidden>)
 >Re: User-space to kernel communication (From: "Greg Miller" <email@hidden>)
 >Re: User-space to kernel communication (From: Greg <email@hidden>)
 >Re: User-space to kernel communication (From: Brian Bergstrand <email@hidden>)
 >Re: User-space to kernel communication (From: Greg <email@hidden>)
 >Re: User-space to kernel communication (From: Brian Bergstrand <email@hidden>)
 >Re: User-space to kernel communication (From: Quinn <email@hidden>)
 >Re: User-space to kernel communication (From: Greg <email@hidden>)
 >Re: User-space to kernel communication (From: Michael Smith <email@hidden>)
 >Re: User-space to kernel communication (From: Greg <email@hidden>)
 >Re: User-space to kernel communication (From: Michael Smith <email@hidden>)
 >Re: User-space to kernel communication (From: Greg <email@hidden>)

  • Prev by Date: Re: User-space to kernel communication
  • Next by Date: ifnet_output_raw() causes crash on Mac PowerBook G4
  • Previous by thread: Re: User-space to kernel communication
  • Next by thread: Re: User-space to kernel communication
  • Index(es):
    • Date
    • Thread