diff --git a/ipc.c b/ipc.c index 9d46f21..d32a766 100644 --- a/ipc.c +++ b/ipc.c @@ -90,7 +90,7 @@ void ipc_post(u32 code, u32 tag, u32 num_args, ...) } va_end(ap); } - dc_flushrange((void*)&out_queue[out_tail], 32); + dc_flush_block_fast((void*)&out_queue[out_tail]); out_tail = (out_tail+1)&(IPC_OUT_SIZE-1); poke_outtail(out_tail); write32(HW_IPC_ARMCTRL, IPC_CTRL_IRQ_IN | IPC_CTRL_OUT); @@ -148,7 +148,7 @@ static void process_in(void) //gecko_printf("IPC: process in %d @ %p\n",in_head,req); - dc_invalidaterange((void*)req, 32); + dc_inval_block_fast((void*)req); //gecko_printf("IPC: req %08x %08x [%08x %08x %08x %08x %08x %08x]\n", req->code, req->tag, // req->args[0], req->args[1], req->args[2], req->args[3], req->args[4], req->args[5]); diff --git a/memory.c b/memory.c index 253df35..9bff321 100644 --- a/memory.c +++ b/memory.c @@ -138,7 +138,7 @@ void ahb_flush_to(enum AHBDEV type) { u32 cookie = irq_kill(); _ahb_flush_to(type); - if(type != 0) + if(type != AHB_STARLET) _ahb_flush_to(AHB_STARLET); irq_restore(cookie); } diff --git a/memory.h b/memory.h index 60e3ffe..4446e09 100644 --- a/memory.h +++ b/memory.h @@ -82,5 +82,19 @@ static inline u32 get_far(void) return data; } +void _ahb_flush_to(enum AHBDEV dev); + +static inline void dc_inval_block_fast(void *block) +{ + __asm__ volatile ( "mcr\tp15, 0, %0, c7, c6, 1" :: "r" (block) ); + _ahb_flush_to(AHB_STARLET); //TODO: check if really needed and if not, remove +} + +static inline void dc_flush_block_fast(void *block) +{ + __asm__ volatile ( "mcr\tp15, 0, %0, c7, c10, 1" :: "r" (block) ); + __asm__ volatile ( "mcr\tp15, 0, %0, c7, c10, 4" :: "r" (0) ); + ahb_flush_from(AHB_1); //TODO: check if really needed and if not, remove +} #endif