0

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?

ThunderHorn
  • 1,975
  • 1
  • 20
  • 42
  • You will achieve more answers if the question is in English – ThunderHorn Aug 03 '18 at 08:20
  • ok, I am writing a kernel module with rtai, I have a data structure defined in the .h file as shown above. This module must allow me to write the data structure values and then these values must be read by another appropriately written module. I used this as shown in the shared memory code with rtai_kmalloc, but the fundamental problem is that in that way I can only initialize the values, how do I actually pass the values and store them for multiple tasks? – Teresa Suppa Aug 03 '18 at 08:52

0 Answers0