tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using proplist ioctl's from within the kernel



On 03/25/10 19:08, Paul Goyette wrote:
I have a situation where I would like to invoke sysmonioctl_envsys()
from within some other kernel code. But I'm not quite sure what variable
type should be used for the 3rd argument. The call requires a 'void
*data' which gets cast to a 'struct plistref *' and is eventually used
as the argument to prop_dictionary_copyout_ioctl().

1. If I use a 'struct plistref *' in the calling code, how do I "deref"
it to get to the proplist itself? And do I need to release the
reference when I'm done with it?

2. Will prop_dictionary_copyout_ioctl() even work when the destination
is in kernel space? Or should I not be doing this?

Thanks in advance!

I got the exact same problem a few weeks back, to implement ioctl() for DIOCGDISKINFO inside the xbd driver of Xen.

1: never found a solution.

2: a priori, not safe. On my part, calling the proplist externalize functions (to make a prop_object out of a plistref) in kernel context ended in panic() when querying for a particular element within the property list.

There should be some way to serialize/deserialize prop/plistref objects within the kernel, but I never found a solution. I suppose you will have to dig deeper than I did :/

--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index