forked from M-Labs/artiq
1
0
Fork 0

runtime: remove useless copy of flush_cpu_dcache().

ksupport used to not link to libbase, I think.
This commit is contained in:
whitequark 2016-10-01 06:12:30 +00:00
parent b3b1ea71c5
commit d3dcb4b8a2
1 changed files with 1 additions and 20 deletions

View File

@ -10,25 +10,6 @@
static unsigned int last_transmission;
static void _flush_cpu_dcache(void)
{
unsigned long dccfgr;
unsigned long cache_set_size;
unsigned long cache_ways;
unsigned long cache_block_size;
unsigned long cache_size;
int i;
dccfgr = mfspr(SPR_DCCFGR);
cache_ways = 1 << (dccfgr & SPR_ICCFGR_NCW);
cache_set_size = 1 << ((dccfgr & SPR_DCCFGR_NCS) >> 3);
cache_block_size = (dccfgr & SPR_DCCFGR_CBS) ? 32 : 16;
cache_size = cache_set_size * cache_ways * cache_block_size;
for (i = 0; i < cache_size; i += cache_block_size)
mtspr(SPR_DCBIR, i);
}
void mailbox_send(void *ptr)
{
last_transmission = (unsigned int)ptr;
@ -58,7 +39,7 @@ void *mailbox_receive(void)
return NULL;
else {
if(r) {
_flush_cpu_dcache();
flush_cpu_dcache();
}
return (void *)r;
}