Skip to content

Commit

Permalink
Add unratified Ssdbltrp and Smdbltrp fields (#238)
Browse files Browse the repository at this point in the history
* Add Ssdbltrp, Smdbltrp, and Sddbltrp fields

* Add Ssdbltrp, Smdbltrp, and Sddbltrp fields

* renasme pcerr to cetrig; fix fields of dcsr to match 1.0 spec
  • Loading branch information
ved-rivos authored May 5, 2024
1 parent 638198c commit a50bc1f
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define MSTATUS_TW 0x00200000
#define MSTATUS_TSR 0x00400000
#define MSTATUS_SPELP 0x00800000
#define MSTATUS_SDT 0x01000000
#define MSTATUS32_SD 0x80000000
#define MSTATUS_UXL 0x0000000300000000
#define MSTATUS_SXL 0x0000000C00000000
Expand All @@ -29,12 +30,14 @@
#define MSTATUS_GVA 0x0000004000000000
#define MSTATUS_MPV 0x0000008000000000
#define MSTATUS_MPELP 0x0000020000000000
#define MSTATUS_MDT 0x0000040000000000
#define MSTATUS64_SD 0x8000000000000000

#define MSTATUSH_SBE 0x00000010
#define MSTATUSH_MBE 0x00000020
#define MSTATUSH_GVA 0x00000040
#define MSTATUSH_MPV 0x00000080
#define MSTATUSH_MDT 0x00000400

#define SSTATUS_UIE 0x00000001
#define SSTATUS_SIE 0x00000002
Expand All @@ -48,6 +51,7 @@
#define SSTATUS_SUM 0x00040000
#define SSTATUS_MXR 0x00080000
#define SSTATUS_SPELP 0x00800000
#define SSTATUS_SDT 0x01000000
#define SSTATUS32_SD 0x80000000
#define SSTATUS_UXL 0x0000000300000000
#define SSTATUS64_SD 0x8000000000000000
Expand All @@ -70,19 +74,22 @@
#define MNSTATUS_MNPP 0x00001800
#define MNSTATUS_MNPV 0x00000080

#define DCSR_XDEBUGVER (3U<<30)
#define DCSR_NDRESET (1<<29)
#define DCSR_FULLRESET (1<<28)
#define DCSR_XDEBUGVER (15U<<28)
#define DCSR_EXTCAUSE (7<<24)
#define DCSR_CETRIG (1<<19)
#define DCSR_PELP (1<<18)
#define DCSR_EBREAKVS (1<<17)
#define DCSR_EBREAKVU (1<<16)
#define DCSR_EBREAKM (1<<15)
#define DCSR_EBREAKH (1<<14)
#define DCSR_EBREAKS (1<<13)
#define DCSR_EBREAKU (1<<12)
#define DCSR_STOPCYCLE (1<<10)
#define DCSR_STEPIE (1<<11)
#define DCSR_STOPCOUNT (1<<10)
#define DCSR_STOPTIME (1<<9)
#define DCSR_CAUSE (7<<6)
#define DCSR_DEBUGINT (1<<5)
#define DCSR_HALT (1<<3)
#define DCSR_V (1<<5)
#define DCSR_MPRVEN (1<<4)
#define DCSR_NMIP (1<<3)
#define DCSR_STEP (1<<2)
#define DCSR_PRV (3<<0)

Expand Down Expand Up @@ -159,10 +166,12 @@
#define MENVCFG_CBIE 0x00000030
#define MENVCFG_CBCFE 0x00000040
#define MENVCFG_CBZE 0x00000080
#define MENVCFG_DTE 0x0800000000000000
#define MENVCFG_ADUE 0x2000000000000000
#define MENVCFG_PBMTE 0x4000000000000000
#define MENVCFG_STCE 0x8000000000000000

#define MENVCFGH_DTE 0x08000000
#define MENVCFGH_ADUE 0x20000000
#define MENVCFGH_PBMTE 0x40000000
#define MENVCFGH_STCE 0x80000000
Expand Down Expand Up @@ -204,10 +213,12 @@
#define HENVCFG_CBIE 0x00000030
#define HENVCFG_CBCFE 0x00000040
#define HENVCFG_CBZE 0x00000080
#define HENVCFG_DTE 0x0800000000000000
#define HENVCFG_ADUE 0x2000000000000000
#define HENVCFG_PBMTE 0x4000000000000000
#define HENVCFG_STCE 0x8000000000000000

#define HENVCFGH_DTE 0x08000000
#define HENVCFGH_ADUE 0x20000000
#define HENVCFGH_PBMTE 0x40000000
#define HENVCFGH_STCE 0x80000000
Expand Down

0 comments on commit a50bc1f

Please sign in to comment.