Re: kextload failure on 10.5
Re: kextload failure on 10.5
- Subject: Re: kextload failure on 10.5
- From: Terry Lambert <email@hidden>
- Date: Wed, 16 Jun 2010 17:18:23 -0700
On Jun 16, 2010, at 4:34 PM, Chris Suter wrote:
Hi Terry,
On Thu, Jun 17, 2010 at 8:15 AM, Terry Lambert <email@hidden>
wrote:
For example, if you needed to pass a pointer, you would declare the
field as
a uint64_t (unsigned long long), cat the pointer to a uintptr_t,
and then
Or user_addr_t and CAST_USER_ADDR_T perhaps?
That's not a user space visible type or cast macro. You'd treat it
like that in the kernel, however.
PS: This goes for things like ioctl(2) parameters, as well; if they
are size
variant, you will find yourself implementing separate 32 and 64 bit
versions
of the ioctl(2) command value in the kernel so that you can deal
with both
32 and 64 bit clients; otherwise, the ioctl(2) case statement
number will
not match, and it will look like it's an unrecognized ioctl(2) when
you call
it from a binary of the "wrong" bitness.
Is that right? The command value appears to be 32 bit regardless of
architecture. We use an ioctl in our code and don't use different
command values and it appears to work. (We obviously take care of the
parameters.) Or am I misunderstanding what you're saying?
You're misunderstanding. Here is how commands are assembled:
#define IOCPARM_MAX (IOCPARM_MASK + 1) /* max size of ioctl
args */
...
#define IOC_OUT (unsigned long)0x40000000
...
#define _IOC(inout,group,num,len) \
(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
...
#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
...
#define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */
So the size of the structure is a component of the manifest constant
used to make the ioctl. If the structure size is variant because an
element in the structure is variant, then the command code is variant.
-- Terry
_______________________________________________
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