I'm trying to write a kernel module with rtai that allows me to write a data structure. The data structure is contained in a .h file and contains information about the tasks, for example
file .h
struct control{
int priorirty;
unsigned long name_task, name_container;
int wcet;
}
I structured the form this way
static void info_task(long int i)
{
int priority, wcet;
unsigned long name_task, name_container;
struct control *data;
data=rtai_kamalloc(INFO_ID, sizeof(strcut control));
if(data){
data->priority=priorirty;
data->wcet=wcet;
data->name_task=name_task;
data->name_container=name_container;
}
else{
rt_printk("DATA NOT FOUND \n");
}
rt_task_wait_period();
}
int init module(void){
RTIME tick_period;
rt_set_periodic_mode();
printk("INIT MODULE \n");
data=rtai_kamalloc(INFO_ID,sizeof(struct control));
rt_task_init(&information_Task,info_task,1,STACK_SIZE,TASK_PRIORITY,1,0);
tick_peirod= start_rt_timer(nano2count(TICK_PERIOD));
rt_make_periodic(&informatio_Task, rt_get_time() + tick_period, tick_period);
return 0;
}
void cleanup_module(void){
stop_rt_timer();
rtai_kfre(INFO_ID);
rt_task_delete(&information_Task);
}
The problem I have is that in this way I initialize only the values of the data structure, how can I pass the values related to several tasks and make sure that these are read by another properly written kernel module?