]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
51533b61 MS |
2 | #ifndef _ASM_CRIS_ARCH_SYSTEM_H |
3 | #define _ASM_CRIS_ARCH_SYSTEM_H | |
4 | ||
51533b61 MS |
5 | |
6 | /* Read the CPU version register. */ | |
d9b5444e | 7 | static inline unsigned long rdvr(void) |
51533b61 MS |
8 | { |
9 | unsigned char vr; | |
10 | ||
11 | __asm__ __volatile__ ("move $vr, %0" : "=rm" (vr)); | |
12 | return vr; | |
13 | } | |
14 | ||
15 | #define cris_machine_name "crisv32" | |
16 | ||
17 | /* Read the user-mode stack pointer. */ | |
d9b5444e | 18 | static inline unsigned long rdusp(void) |
51533b61 MS |
19 | { |
20 | unsigned long usp; | |
21 | ||
22 | __asm__ __volatile__ ("move $usp, %0" : "=rm" (usp)); | |
23 | return usp; | |
24 | } | |
25 | ||
26 | /* Read the current stack pointer. */ | |
d9b5444e | 27 | static inline unsigned long rdsp(void) |
51533b61 MS |
28 | { |
29 | unsigned long sp; | |
30 | ||
31 | __asm__ __volatile__ ("move.d $sp, %0" : "=rm" (sp)); | |
32 | return sp; | |
33 | } | |
34 | ||
35 | /* Write the user-mode stack pointer. */ | |
36 | #define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp)) | |
37 | ||
51533b61 | 38 | #endif /* _ASM_CRIS_ARCH_SYSTEM_H */ |