]>
Commit | Line | Data |
---|---|---|
ca9d3ab5 SK |
1 | /* |
2 | * (C) Copyright 2011, Julius Baxter <julius@opencores.org> | |
3 | * | |
1a459660 | 4 | * SPDX-License-Identifier: GPL-2.0+ |
ca9d3ab5 SK |
5 | */ |
6 | ||
7 | #ifndef __ASM_OPENRISC_SYSTEM_H | |
8 | #define __ASM_OPENRISC_SYSTEM_H | |
9 | ||
10 | #include <asm/spr-defs.h> | |
11 | ||
12 | static inline unsigned long mfspr(unsigned long add) | |
13 | { | |
14 | unsigned long ret; | |
15 | ||
16 | __asm__ __volatile__ ("l.mfspr %0,r0,%1" : "=r" (ret) : "K" (add)); | |
17 | ||
18 | return ret; | |
19 | } | |
20 | ||
21 | static inline void mtspr(unsigned long add, unsigned long val) | |
22 | { | |
23 | __asm__ __volatile__ ("l.mtspr r0,%1,%0" : : "K" (add), "r" (val)); | |
24 | } | |
25 | ||
26 | #endif /* __ASM_OPENRISC_SYSTEM_H */ |