intmbox_bounds[20]={8,16,24,30,38,46,54,60,68,76,84,90,98,106,114,120,128,136,144,0};///boundaries of slots in terms ob mbox counter rounded up to even numbers
//int mbox_bounds[20] = {6,14,22,28,36,44,52,58,66,74,82,88,96,104,112,118,126,134,142, 148}; ///boundaries of slots in terms ob mbox counter rounded up to even numbers
intinit_dlsch_threads(void);
intinit_dlsch_threads(void);
voidcleanup_dlsch_threads(void);
voidcleanup_dlsch_threads(void);
s32init_rx_pdsch_thread(void);
voidcleanup_rx_pdsch_thread(void);
intinit_ulsch_threads(void);
voidcleanup_ulsch_threads(void);
LTE_DL_FRAME_PARMS*frame_parms;
//void setup_ue_buffers(PHY_VARS_UE *phy_vars_ue, LTE_DL_FRAME_PARMS *frame_parms, int carrier);
#ifdef EXMIMO
//void setup_eNB_buffers(PHY_VARS_eNB *phy_vars_eNB, LTE_DL_FRAME_PARMS *frame_parms, int carrier);
rt_printk("fun0: finished, ran %d times.\n",slot);
free(fifo2file_buffer);
fclose(dumpfile_id);
close(fifo);
#ifdef HARD_RT
pthread_exit((void*)arg);
rt_make_soft_real_time();
#endif
// clean task
rt_task_delete(task);
rt_printk("Task deleted. returning\n");
return0;
}
}
#endif
/* This is the main UE thread. Initially it is doing a periodic get_frame. One synchronized it gets woken up by the kernel driver using the RTAI message mechanism (rt_send and rt_receive). */
/* This is the main eNB thread. It gets woken up by the kernel driver using the RTAI message mechanism (rt_send and rt_receive). */
printf("started RTAI timer with period %llu ns\n",count2nano(period));
#endif
printf("Init mutex\n");
printf("Init mutex\n");
//mutex = rt_get_adr(nam2num("MUTEX"));
//mutex = rt_get_adr(nam2num("MUTEX"));
...
@@ -1591,154 +999,287 @@ int main(int argc, char **argv) {
...
@@ -1591,154 +999,287 @@ int main(int argc, char **argv) {
}
}
else
else
printf("mutex=%p\n",mutex);
printf("mutex=%p\n",mutex);
/*
cond = rt_cond_init(nam2num("CONDITION"));
//cond = rt_get_adr(nam2num("CONDITION"));
if (cond==0)
printf("Error init cond\n");
*/
// initialize the instance cnt before starting the thread
instance_cnt_ptr_user=&instance_cnt;
// signal the driver to set up for user-space operation
// this will initialize the semaphore and the task pointers in the kernel
// further we receive back the pointer to the shared instance counter which is used to signal if the thread is busy or not. This pointer needs to be mapped to user space.