I'm making a small kernel module to provide user-space access to some kernel-mode only features of an ARMv7 chip (specifically, cache control). I'm reading through Linux Device Drivers by Corbet, Rubini, and Hartman. In it they describe how to make a full driver+device+bus. I don't want to create a bus driver at all. In fact the 'driver' that I'm making doesn't really need to match against a device definition at all - it is implicitly matched to the platform's CPU. Can anyone explain to me:
- Where in sysfs should my attributes go? Should it be in my module entry under
/sysfs/modules/mymodule
?/sys/devices/platform
seems promising too, and so does/sys/devices/system/cpu
. - If there is an existing place where I should put my
kobject
/attributes, how do I plug it into it? How do I get the necessarykset
? All the examples I've seen create akset
and then link to it from thekobject
- I haven't seen an API for requesting an existing namedkset
?
Sorry if this is just impossibly obvious, or if there's some really straightforward and easily discovered example somewhere that I haven't discovered for some reason. Can anyone shed any light on this?