[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: Flushing the data cache
From: |
David Mosberger |
Subject: |
[Gcl-devel] Re: Flushing the data cache |
Date: |
Wed, 13 Nov 2002 16:46:32 -0800 |
>>>>> On Wed, 13 Nov 2002 19:04:44 -0500, Camm Maguire <address@hidden> said:
Camm> Greetings! GCL loads binary modules into its data section,
Camm> and then attempts executing the code thus loaded. On some
Camm> RISC machines, it needs to flush the data cache after writing
Camm> and before executing. Some samples are included at the end of
Camm> this post.
Camm> What I'm looking for is the analog on ia64, which does appear
Camm> to be necessary after all. Can anyone help?
I attached the GNU C routine which flushes the cache in the address
range [ADDR,ADDR+LEN). Hope that helps.
--david
static void
flush_cache (void *addr, unsigned long len)
{
void *end = (char *) addr + len;
while (addr < end)
{
asm volatile ("fc %0" :: "r"(addr));
addr = (char *) addr + 32;
}
asm volatile (";;sync.i;;srlz.i;;");
}