Commit 9ffedde3 authored by Zihao Yu's avatar Zihao Yu Committed by Andrew Waterman
Browse files

machine,minit: initialize emulated FCSR in enter_supervisor_mode() (#106)

* If BBL emulates the FPU, the trap handler will load emulated FCSR from
  x0's save slot into tp. The emulated FCSR should be initialized, else
  the field of rounding mode will contain garbage codes. This will
  lead to raising SIGABRT for a user mode program which tries to print a
  floating point variable. In glibc, __printf_fp_l() (defined in
  riscv-glibc/stdio-common/printf_fp.c) will call round_away() (defined
  in riscv-glibc/include/rounding-mode.h). With a garbage rounding mode
  in emulated FCSR, round_away() may call abort().
parent 94bcafff
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment