Re: Using proplist ioctl's from within the kernel
On Thu, 25 Mar 2010, Paul Goyette wrote: So would it be appropriate for me to expose sysmon_envsys's global mutex and its device list in order for acpi_apm to scan for battery sensors and A/C adapters? I think better to not expose subsystem internals.. but can you split the sysmon_envsys API into functionality and userland interface so that a kernel module can call the functionality directly? Vaguely (ie without examining your needs at all) I'm thinking of something like sys_bind() and do_sys_bind() from uipc_syscalls.c though that doesn't handle plists. I used a plist wrapper in bthub.c as its easier to write a function that handles a dictionary, perhaps that method would be useful? iain
Re: Using proplist ioctl's from within the kernel
On Fri, 26 Mar 2010, haad wrote: I think it should be avoided at all costs. With proplists, you give up type safety and you create a lot of overhead. This is acceptable for kernel-user interfaces in some cases but not within the kernel. So would it be appropriate for me to expose sysmon_envsys's global mutex and its device list in order for acpi_apm to scan for battery sensors and A/C adapters? This is wrong and should be avoided IMHO. Well, as it turns out, both the global mutex and the device list are already exposed, so it is a rather trivial task for acpi_apm.c to scan the device list. - | Paul Goyette | PGP DSS Key fingerprint: | E-mail addresses: | | Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com | | Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net | | Kernel Developer | | pgoyette at netbsd.org | -
Re: Using proplist ioctl's from within the kernel
jeanyves.mig...@free.fr said: 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 :/ I think it should be avoided at all costs. With proplists, you give up type safety and you create a lot of overhead. This is acceptable for kernel-user interfaces in some cases but not within the kernel. best regards Matthias Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt
Re: Using proplist ioctl's from within the kernel
On Thu, 25 Mar 2010, Matthias Drochner wrote: jeanyves.mig...@free.fr said: 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 :/ I think it should be avoided at all costs. With proplists, you give up type safety and you create a lot of overhead. This is acceptable for kernel-user interfaces in some cases but not within the kernel. So would it be appropriate for me to expose sysmon_envsys's global mutex and its device list in order for acpi_apm to scan for battery sensors and A/C adapters? - | Paul Goyette | PGP DSS Key fingerprint: | E-mail addresses: | | Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com | | Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net | | Kernel Developer | | pgoyette at netbsd.org | -