Re: SMP Safe Drivers on Mac OS X
On Jun 2, 2004, at 3:36 AM, Sam Hart wrote: Lalit wrote: Is there an equivalent for smp_processor_id() on Mac OS X? What feature(s) are you looking for any why, not familiar with what smp_processor_id does. Is there any documentation available for making drivers SMP safe on Mac OS X? this question is probably best asked on the SMP list Actually if it is about driver development it is better to ask on the darwin drivers list. <http://www.lists.apple.com/mailman/listinfo/darwin-drivers> I don't think ( because of funneling ) that you should rely on the CPU id to be able ensure safety. No one should not regardless of funneling. Mac OS X will schedule threads on any available CPU and you generally should not attempt to bind to a certain CPU. You make your driver thread safe as needed and use appropriate hardware / memory access methods and you will be SMP safe (high level hand waving without knowing what he is doing). But I can not find a reference which explains what leads me to believe that at the moment, sorry. It depends on the driver he is trying to write. Apples website has a wealth of information, starting at the top... <http://developer.apple.com/documentation/DeviceDrivers/ DeviceDrivers.html> Note the "Device Drivers Resources" section at the top (getting started, fundamentals, API reference), I would review these and then jump into appropriate topics below on that page. In general if you are IOKit based, which you should try to be, you use IOWorkLoop [1], IOLocks [2], IOCommandGate [3], and friends for synchronization/critical sections and you use IOMemoryDescriptor [4] and friends to prepare, access, complete memory operations. If you are cannot use IOKit then you are walking into the realm of unstable APIs but you have a large mix of options to synchronization, etc. it just depends on what you are doing. -Shawn [1] <http://developer.apple.com/documentation/Darwin/Reference/Kernel/ IOWorkLoop/Classes/IOWorkLoop/index.html> [2] <http://developer.apple.com/documentation/Darwin/Reference/Kernel/ IOLocks/index.html> [3] <http://developer.apple.com/documentation/Darwin/Reference/Kernel/ IOCommandGate/Classes/IOCommandGate/index.html> [4] <http://developer.apple.com/documentation/Darwin/Reference/Kernel/ IOMemoryDescriptor/Classes/IOMemoryDescriptor/index.html> _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Shawn Erickson