2 * (C) Copyright 2011, Julius Baxter <julius@opencores.org>
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __ASM_OPENRISC_SYSTEM_H
8 #define __ASM_OPENRISC_SYSTEM_H
10 #include <asm/spr-defs.h>
12 static inline unsigned long mfspr(unsigned long add)
16 __asm__ __volatile__ ("l.mfspr %0,r0,%1" : "=r" (ret) : "K" (add));
21 static inline void mtspr(unsigned long add, unsigned long val)
23 __asm__ __volatile__ ("l.mtspr r0,%1,%0" : : "K" (add), "r" (val));
26 #endif /* __ASM_OPENRISC_SYSTEM_H */