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