Re: SMP Safe Drivers on Mac OS X
Re: SMP Safe Drivers on Mac OS X
- Subject: Re: SMP Safe Drivers on Mac OS X
- From: Michael Cashwell <email@hidden>
- Date: Tue, 1 Jun 2004 09:54:06 -0400
On Jun 1, 2004, at 8:38 AM, Lalit Chandivade wrote:
Is there an equivalent for smp_processor_id() on Mac OS X?
I'm not familiar with this (Linux?) API. More info as to your goal
would be useful.
Is there any documentation available for making drivers SMP safe on
Mac OS X?
There's a wealth of info on on Apple's developer site. Since you are
asking about driver development you should explore (in particular the
IOKit and Multiprocessing links!):
http://developer.apple.com/hardware/
Kernel programming in general is covered here:
http://developer.apple.com/documentation/Darwin/Conceptual/
KernelProgramming/KernelProgramming.pdf
Your easiest path will be to write a new, IOKit-based driver using your
existing code as a reference. That path will have IOKit handle most of
the tedious details of dealing with SMP.
But if you _must_ port an existing driver and retain source
compatibility (perhaps it already runs on Linux and Solaris, for
example) then you will have a harder time. If your code already factors
platform specifics out and you need to implement certain platform
functions like memory allocation, DMA preparation, mutexes, interrupt
handling, etc. then this is possible. I've done ports this way but it
generally takes longer than using the existing code as a reference and
just writing a new, clean IOKit driver. (Of course the long term effort
to support a forked development would be more. That's the reason we
went that way.)
Info specific to porting a driver includes:
http://developer.apple.com/documentation/Porting/Conceptual/
PortingDrivers/PortingDrivers.pdf
Good Luck!
-Mike
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.