Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IOUserClient size limit?



--- At Mon, 10 Nov 2008 16:53:42 -0800, Chris Sarcone wrote:

>Duane --
>
>I am seeing a kIOReturnIPCError form an IOUserClient down call (i.e.
>from my app into the kernel) when I have a structure that is over 4K
>(4096) bytes in size.
>
>Is this a hard limit? Can I change this limit? I have some I/O through
>the user client that I would like to take a larger buffer (16K).
>
>Yes, it's a hard limit for IPC.
>
>Typically, you solve this by:
>
>1) Save the task_t passed to your user client in initWithTask().
>2) Pass a pointer to the large buffer and use IOMD::withAddressRange()
>(which takes the task_t parameter)
>3) prepare() it
>4) Use it for DMA in conjunction with an IODMACommand or use readBytes()/
>writeBytes()
>5) complete() it
>6) release the IOMD


Thanks Chris! I would have completely missed the prepare() and
complete() methods.

On a follow up question. My user client APIs map to kernel functions
that expect to get a buffer that they can write into.
IOMemoryDescriptors are setup to use readBytes() and writeBytes() rather
than direct memory access (e.g. a pointer).

Is there a way of getting "buffer" access? Some way of writing directly
to the underlying memory by address? Is that what map() and IOMemoryMap
is for?

Otherwise, it seems I'll have to allocate an additional buffer in the
kernel to handle the API then copy back into the IOM. Seems like a waste
of time and space.

Thanks for the help!

 ...Duane


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >IOUserClient size limit? (From: "Duane Murphy" <email@hidden>)
 >Re: IOUserClient size limit? (From: Chris Sarcone <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.