From db27b09b7cfb2bc1b3da88c4d6ebbf6eeb5a5388 Mon Sep 17 00:00:00 2001 From: brobert Date: Mon, 29 Jul 2024 10:00:34 +0200 Subject: [PATCH] enabling ARM and INTEL memory alignment --- radio/fhi_72/oran-init.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/radio/fhi_72/oran-init.c b/radio/fhi_72/oran-init.c index fd3fdaa5bf..38e766805a 100644 --- a/radio/fhi_72/oran-init.c +++ b/radio/fhi_72/oran-init.c @@ -306,7 +306,14 @@ static void oran_allocate_buffers(void *handle, uint32_t xran_max_antenna_nr = RTE_MAX(fh_config->neAxc, fh_config->neAxcUl); uint32_t xran_max_sections_per_slot = RTE_MAX(fh_config->max_sections_per_slot, XRAN_MIN_SECTIONS_PER_SLOT); - pi->buf_list = _mm_malloc(sizeof(*pi->buf_list), 256); +#if defined(__arm__) || defined(__aarch64__) + // ARM-specific memory allocation + int ret = posix_memalign((void**)&pi->buf_list, 256, sizeof(*pi->buf_list)); + AssertFatal(ret == 0, "out of memory\n"); +#else + // Intel-specific memory allocation + pi->buf_list = _mm_malloc(sizeof(*pi->buf_list), 256); +#endif AssertFatal(pi->buf_list != NULL, "out of memory\n"); oran_buf_list_t *bl = pi->buf_list;