Commit f6e53ea4 authored by Federico Vaga's avatar Federico Vaga

rt: memcpy does not work on some mockturtle version, use a 32aligned

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 7cd1c032
......@@ -118,7 +118,14 @@ static inline struct trtl_proto_header *rt_proto_header_get(void *raw_msg)
static inline void rt_proto_header_set(void *raw_msg,
struct trtl_proto_header *header)
{
#if LIBMOCKTURTLE_32BIT_ALIGN
int i;
for (i = 0; i < sizeof(struct trtl_proto_header) / 4; ++i)
((uint32_t *)raw_msg)[i] = ((uint32_t *)header)[i];
#else
memcpy(raw_msg, header, sizeof(struct trtl_proto_header));
#endif
}
......
......@@ -38,6 +38,9 @@ endif
ifeq ($(LIBMOCKTURTLE_DEBUG_ENABLE), 1)
CFLAGS += -DLIBMOCKTURTLE_DEBUG_ENABLE
endif
ifeq ($(LIBMOCKTURTLE_32BIT_ALIGN), 1)
CFLAGS += -DLIBMOCKTURTLE_32BIT_ALIGN
endif
CFLAGS += $(EXTRA_CFLAGS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment