Commit 90135345 authored by Bruno Gomes's avatar Bruno Gomes

LIBIOP: avoid libiop operations with air_uptr cast

refs #112663
parent 0dfbb14e
......@@ -393,8 +393,8 @@ auto_neg_done:
sc->rx_ptr = 0;
/* align the TX and RX descriptor tables */
sc->txdesc = (greth_rxtxdesc *)(((air_uptr_t)sc->txdesc + 1024) & ~(1024 - 1));
sc->rxdesc = (greth_rxtxdesc *)((((air_uptr_t)sc->rxdesc + 1024) & ~(1024 - 1)) + 1024);
sc->txdesc = (greth_rxtxdesc *)(((air_u32_t)sc->txdesc + 1024) & ~(1024 - 1));
sc->rxdesc = (greth_rxtxdesc *)((((air_u32_t)sc->rxdesc + 1024) & ~(1024 - 1)) + 1024);
/* insert the descriptor table address in the HW register*/
regs->txdesc = (uint32_t)air_syscall_get_physical_addr((air_uptr_t)sc->txdesc);
......
......@@ -206,7 +206,7 @@ static inline void iop_chain_initialize(
current = next;
/* update the next node */
next = (iop_chain_node *)((air_uptr_t)next + node_size);
next = (iop_chain_node *)((air_u32_t)next + node_size);
}
/* the last node next is the tail of the chain */
......
......@@ -84,7 +84,7 @@ static void iop_init_queues(void){
/* 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-1))] + (0x08-1)) & ~(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_u32_t) &usr_configuration.iop_buffers_storage[i * (size+94+(0x08-1))] + (0x08-1)) & ~(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].p_addr = (void *)air_syscall_get_physical_addr((air_uptr_t) usr_configuration.iop_buffers[i].v_addr);
}
......
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