Commit cb85b22c authored by Bruno Gomes's avatar Bruno Gomes

LIBIOP: Correct alignment of each wrapper buffer and alocation of memory to...

LIBIOP: Correct alignment of each wrapper buffer and alocation of memory to only the required size for that alignment

refs #112663
parent e56b8ea2
......@@ -79,13 +79,13 @@ static void iop_init_queues(void){
size = config.sport->max_message_size;
}
}
/* setup Remote Ports buffers */
for (i = 0; i < usr_configuration.wrappers_count; ++i) {
/* get virtual and physical addresses for this buffer, align to doubleword */
usr_configuration.iop_buffers[i].v_addr = (void *)(((air_uptr_t) &usr_configuration.iop_buffers_storage[i * (size+94)] + 0x08) & ~(0x08-1)); //add max total space needed eth header (TCP) = 14+20+60 TODO remove 94 and use something proper
usr_configuration.iop_buffers[i].v_addr = (void *)(((air_uptr_t) &usr_configuration.iop_buffers_storage[i * (size+94+(0x08-1))] + (0x08-1)) & ~(0x08-1)); //add max //add max total space needed eth header (TCP) = 14+20+60 TODO remove 94 and use something proper
usr_configuration.iop_buffers[i].p_addr = (void *)air_syscall_get_physical_addr((air_uptr_t) usr_configuration.iop_buffers[i].v_addr);
}
/* append buffers to the wrappers */
......
......@@ -51,7 +51,7 @@ static iop_wrapper_t requests_storage[${iop_configuration.requests}];
* @brief IOP buffers
*/
static iop_buffer_t iop_buffers[${iop_configuration.requests}];
static uint8_t iop_buffers_storage[${iop_configuration.requests} * (${maxsize} + 94)];
static uint8_t iop_buffers_storage[${iop_configuration.requests} * (${maxsize + 7})];
static iop_fragment_t fragments[${iop_configuration.requests}];
/**
......
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