Pregunta

I am implementing my first driver on OS X (10.8.4). My driver should read MSR (0x198) on each processor every second and print the values to system.log.

I am using IOWorkLoop and IOTimerEventSource to wake up every second and call a function that prints MSR value, but I can't find any guide/documentation about how do I call the function on all processors.

What mechanism would you recommend to use in this case?

¿Fue útil?

Solución

Found the solution:

void mp_rendezvous_no_intrs(void (*action_func)(void *), void *arg)

This will run function action_func with argument arg on all cores.

You can find the source code of this function here: http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/osfmk/i386/mp.c

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top