Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Commit

Permalink
Bring mstatus up-to-date with latest privspec. (#149)
Browse files Browse the repository at this point in the history
* Bring mstatus up-to-date with latest privspec.

Requested by riscv-collab/riscv-openocd#249

* Use tabs where possible, for consistency.
  • Loading branch information
timsifive authored May 17, 2018
1 parent f60a065 commit 635c14e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions gdb/riscv-tdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,26 +594,28 @@ riscv_print_register_formatted (struct ui_file *file, struct frame_info *frame,
else
internal_error (__FILE__, __LINE__, _("unknown size for mstatus"));
unsigned xlen = size * 4;
fprintf_filtered (file, "SD:%X", (int)((d >> (xlen-1)) & 0x1));
if (size > 4)
fprintf_filtered (file, " SXL:%X UXL:%X",
(int)((d >> 34) & 3), (int)((d >> 32) & 3));
fprintf_filtered (file,
"SD:%X VM:%02X MXR:%X PUM:%X MPRV:%X XS:%X "
"FS:%X MPP:%x HPP:%X SPP:%X MPIE:%X HPIE:%X "
"SPIE:%X UPIE:%X MIE:%X HIE:%X SIE:%X UIE:%X",
(int)((d >> (xlen-1)) & 0x1),
(int)((d >> 24) & 0x1f),
" TSR:%X TW:%X TVM:%X MXR:%X SUM:%X MPRV:%X XS:%X "
"FS:%X MPP:%X SPP:%X MPIE:%X SPIE:%X UPIE:%X MIE:%X "
"SIE:%X UIE:%X",
(int)((d >> 22) & 0x1f),
(int)((d >> 21) & 0x1),
(int)((d >> 20) & 0x1),
(int)((d >> 19) & 0x1),
(int)((d >> 18) & 0x1),
(int)((d >> 17) & 0x1),
(int)((d >> 15) & 0x3),
(int)((d >> 13) & 0x3),
(int)((d >> 11) & 0x3),
(int)((d >> 9) & 0x3),
(int)((d >> 8) & 0x1),
(int)((d >> 7) & 0x1),
(int)((d >> 6) & 0x1),
(int)((d >> 5) & 0x1),
(int)((d >> 4) & 0x1),
(int)((d >> 3) & 0x1),
(int)((d >> 2) & 0x1),
(int)((d >> 1) & 0x1),
(int)((d >> 0) & 0x1));
}
Expand Down

0 comments on commit 635c14e

Please sign in to comment.