diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index caa8ad6d9024fc80c09d55d1be5410411c2ae9da..b831e23ba38195d4cd2a47e10f0a4f8a3d3bf34a 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -336,10 +336,11 @@ int itti_send_broadcast_message(MessageDef *message_p) { if (thread_id != origin_thread_id) { /* Skip tasks which are not running */ if (itti_desc.threads[thread_id].task_state == TASK_STATE_READY) { - new_message_p = itti_malloc (origin_task_id, destination_task_id, sizeof(MessageDef)); + size_t size = sizeof(MessageHeader) + message_p->ittiMsgHeader.ittiMsgSize; + new_message_p = itti_malloc( origin_task_id, destination_task_id, size ); AssertFatal (new_message_p != NULL, "New message allocation failed!\n"); - memcpy (new_message_p, message_p, sizeof(MessageDef)); + memcpy( new_message_p, message_p, size ); result = itti_send_msg_to_task (destination_task_id, INSTANCE_DEFAULT, new_message_p); AssertFatal (result >= 0, "Failed to send message %d to thread %d (task %d)!\n", message_p->ittiMsgHeader.messageId, thread_id, destination_task_id); } diff --git a/common/utils/itti/intertask_interface_types.h b/common/utils/itti/intertask_interface_types.h index 185eb9b485d2c5bb5f16e3eca6e025094a4ab4a7..c1a0d02671f03031881a06e6b6097819eef00c2e 100644 --- a/common/utils/itti/intertask_interface_types.h +++ b/common/utils/itti/intertask_interface_types.h @@ -145,8 +145,10 @@ typedef struct MessageHeader_s /** @struct MessageDef * @brief Message structure for inter-task communication. + * \internal + * The attached attribute \c __packed__ is neccessary, because the memory allocation code expects \ref ittiMsg directly following \ref ittiMsgHeader. */ -typedef struct MessageDef_s +typedef struct __attribute__ ((__packed__)) MessageDef_s { MessageHeader ittiMsgHeader; /**< Message header */ msg_t ittiMsg; /**< Union of payloads as defined in x_messages_def.h headers */ diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 74851b692f3bde857d4a05a3e699760298138d5f..3c9605ead65c94a22394b11311ad351abb8b7035 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1319,7 +1319,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e start_meas(&phy_vars_eNB->phy_proc_tx); #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[%s %"PRIu8"] Frame %d subframe %d : Doing phy_procedures_eNB_TX(%d)\n", + LOG_D(PHY,"[%s %"PRIu8"] Frame %d subframe %d : Doing phy_procedures_eNB_TX\n", (r_type == multicast_relay) ? "RN/eNB" : "eNB", phy_vars_eNB->Mod_id, frame, subframe); #endif diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 257a709bf79befc811d7797826031b61a7f1b605..074be3f3542e450f1931d1a84b33c7ee1915901f 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1029,7 +1029,7 @@ static void * eNB_thread_tx(void *param) { (subframe_select(&PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms,proc->subframe_tx)==SF_DL))|| (PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms.frame_type == FDD))) { - phy_procedures_eNB_TX(proc->subframe,PHY_vars_eNB_g[0][proc->CC_id],0,no_relay,NULL); + phy_procedures_eNB_TX( proc->subframe, PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay, NULL ); } if ((subframe_select(&PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms,proc->subframe_tx)==SF_S)) {