ppsm_set_notify_handler()

int ppsm_set_notify_handler( void *handle,
                             FnNotifyCbck cbx,
                             void *clientinfo );

This function registers a notification handler that you want to be called whenever there's a state change. The arguments are:

handle
The handle returned by ppsm_init().
cbx
A pointer to the notification handler (see below).
clientinfo
A pointer to arbitrary data that you want to pass to the handler.

The ppsm_set_notify_handler() function returns -1 on error.

The prototype of the handler is as follows:

void my_handler ( void *handle,
                             int cpuid,
                             void *clientinfo );

Whenever the performance state changes, the library calls this function, passing the following:

handle
The handle returned by ppsm_init().
cpu
The ID of the CPU whose state has changed.
clientinfo
A pointer to the client data that you specified when you registered the handler.

The handler doesn't return anything.