[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing Parameter(s) to tasks/threads

I need to pass from 0 to 10 integer parameters to my tasks when they are started with rtems_task_start(). The third argument to rtems_task_start() is a integer "argument" value. The manual states "this argument can be a single value or used as an index into an array of parameter blocks." I assume this means I will have to modify my pre-existing vxworks tasks that have more than one integer parameter. For example, I have a task prototype with 3 parameters like this:

void intHandlerTask( int sema, VOIDFUNCPTR func, int parameter );

I think it would have to be changed to have just one parameter, probably the address of a array of 3 integers containing the 3 actual parameters for correct use by rtems, e.g.,

void intHandlerTask( int**  parameter_array )
	int sema = parameter_array[0];
	VOIDFUNCPTR func = parameter_array[1];
	int parameter = parameter_array[2];

Luckly most of my preexisting tasks have just 1 parameter which is perfectly compatible as-is with rtems, I think.

Does this sound reasonable?