added CACR define bits, added functions to set and retrieve current cache value and removed PC-relative compilation of cache.c

This commit is contained in:
Markus Fröschle
2013-08-12 17:38:39 +00:00
parent 66efc34bdb
commit 6ee9b72191
3 changed files with 49 additions and 1 deletions

View File

@@ -24,6 +24,24 @@
#include "cache.h"
void cacr_set(uint32_t value)
{
extern uint32_t rt_cacr[];
rt_cacr[0] = value;
__asm__ __volatile__("movec %0, cacr\n\t"
: /* output */
: "r" (rt_cacr[0])
: /* clobbers */);
}
uint32_t cacr_get(void)
{
extern uint32_t rt_cacr[];
return rt_cacr[0];
}
void flush_and_invalidate_caches(void)
{
__asm__ (