Fix definition of SSTATUS_SD

The SD bit is defined as the MSB of the sstatus register, meaning its
position will vary depending on the CSR's length. Previously, there were
two (unused) defines for this, for the 32 and 64-bit cases, but their
definitions were swapped.

Consolidate these into one define: SSTATUS_SD, and make the definition
dependent on the value of __riscv_xlen.

Reviewed by:	br
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D23402
This commit is contained in:
Mitchell Horne 2020-01-29 15:50:48 +00:00
parent 9eea475074
commit 741ba007c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357255

View File

@ -72,8 +72,11 @@
#define SSTATUS_XS_SHIFT 15
#define SSTATUS_XS_MASK (0x3 << SSTATUS_XS_SHIFT)
#define SSTATUS_SUM (1 << 18)
#define SSTATUS32_SD (1 << 63)
#define SSTATUS64_SD (1 << 31)
#if __riscv_xlen == 64
#define SSTATUS_SD (1 << 63)
#else
#define SSTATUS_SD (1 << 31)
#endif
#define MSTATUS_UIE (1 << 0)
#define MSTATUS_SIE (1 << 1)