2012-02-03 06:08:17 -05:00
|
|
|
#ifndef __SYSTEM_H
|
|
|
|
#define __SYSTEM_H
|
|
|
|
|
2013-03-25 09:38:58 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-02-03 06:08:17 -05:00
|
|
|
void flush_cpu_icache(void);
|
|
|
|
void flush_cpu_dcache(void);
|
2013-11-16 10:27:21 -05:00
|
|
|
void flush_l2_cache(void);
|
2013-03-25 09:38:58 -04:00
|
|
|
|
2014-05-14 04:24:56 -04:00
|
|
|
#ifdef __or1k__
|
|
|
|
#include <spr-defs.h>
|
|
|
|
static inline unsigned long mfspr(unsigned long add)
|
|
|
|
{
|
|
|
|
unsigned long ret;
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("l.mfspr %0,r0,%1" : "=r" (ret) : "K" (add));
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void mtspr(unsigned long add, unsigned long val)
|
|
|
|
{
|
|
|
|
__asm__ __volatile__ ("l.mtspr r0,%1,%0" : : "K" (add), "r" (val));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-03-25 09:38:58 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2012-02-03 06:08:17 -05:00
|
|
|
|
|
|
|
#endif /* __SYSTEM_H */
|