how to use rtems_task_variable_add ?

Alan Cudmore Alan.P.Cudmore at
Wed Apr 7 20:48:55 UTC 2004

I want to add a variable to my task context using 

The variable is a global unsigned integer:
uint32 os_task_key;

I want to set this to a unique value in each task and have the OS save 
and restore it for me.

How do I pass this in to the void **ptr type in the call?

calling it like this:
    rtems_status =  rtems_task_variable_add ( rtems_task_id, 
&os_task_key, NULL );
gives me a warning. Do I need to do something like the following?

void *task_var_ptr;

task_var_ptr = (void *)&os_task_key;

rtems_status = rtems_task_variable_add(rtems_task_id, &task_var_ptr, 


More information about the users mailing list