xref: /haiku/headers/private/system/arch/riscv64/arch_cpu_defs.h (revision 21258e2674226d6aa732321b6f8494841895af5f)
1 /*
2  * Copyright 2018-2019, Haiku, Inc. All rights reserved
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  * 	Alexander von Gluck IV <kallisti5@unixzen.com>
7  */
8 #ifndef _SYSTEM_ARCH_RISCV64_DEFS_H
9 #define _SYSTEM_ARCH_RISCV64_DEFS_H
10 
11 
12 #define SPINLOCK_PAUSE()	do {} while (false)
13 
14 // Status register flags
15 #define ARCH_SR_SIE		0x00000002 // Supervisor Interrupt Enable
16 #define ARCH_SR_SPIE		0x00000020 // Previous Supervisor Interrupt En
17 #define ARCH_SR_SPP		0x00000100 // Previously Supervisor
18 #define ARCH_SR_SUM		0x00040000 // Supervisor may access user memory
19 
20 #define ARCH_SR_FS		0x00006000 // Floating Point Status
21 #define ARCH_SR_FS_OFF		0x00000000
22 #define ARCH_SR_FS_INITIAL	0x00002000
23 #define ARCH_SR_FS_CLEAN	0x00004000
24 #define ARCH_SR_FS_DIRTY	0x00006000
25 
26 #define ARCH_SR_XS		0x00018000 // Extension Status
27 #define ARCH_SR_XS_OFF		0x00000000
28 #define ARCH_SR_XS_INITIAL	0x00008000
29 #define ARCH_SR_XS_CLEAN	0x00010000
30 #define ARCH_SR_XS_DIRTY	0x00018000
31 
32 #define ARCH_SR_SD		0x8000000000000000 // FS/XS dirty
33 
34 // Interrupt Enable and Interrupt Pending
35 #define ARCH_SIE_SSIE		0x00000002 // Software Interrupt Enable
36 #define ARCH_SIE_STIE		0x00000020 // Timer Interrupt Enable
37 #define ARCH_SIE_SEIE		0x00000200 // External Interrupt Enable
38 
39 
40 #endif	/* _SYSTEM_ARCH_RISCV64_DEFS_H */
41 
42