freebsd-dev/sys/riscv/include
John Baldwin 232d0b87e0 Various fixes for floating point on RISC-V.
- Explicitly load an empty initial state into FP registers when taking
  the fault on the first FP instruction in a thread.  Setting
  SSTATE.FS to INITIAL is just a marker to let context switch restore
  code know that it can load FP registers with zeroes instead of
  memory loads.  It does not imply that the hardware will reset all
  registers to zero on first access.  In addition, set the state to
  CLEAN instead of INITIAL after the first FP instruction.
  cpu_switch() doesn't do anything for INITIAL and only restores from
  the pcb if the state is CLEAN.  We could perhaps change cpu_switch
  to call fpe_state_clear if the state was INITIAL and leave SSTATE.FS
  set to INITIAL instead of CLEAN after the first FP instruction.
  However, adding this complexity to cpu_switch() doesn't seem worth
  the supposed gain.
- Only save the current FPU registers in fill_fpregs() if the request
  is made to save the current thread's registers.  Previously if a
  debugger requested FP registers via ptrace() it was getting a copy
  of the debugger's FP registers rather than the debugee's.
- Zero the entire FP register set structure returned for ptrace() if a
  thread hasn't used FP registers rather than leaking garbage in the
  fp_fcsr field.
- If a debugger writes FP registers via ptrace(), always mark the pcb
  as having valid FP registers and set SSTATUS.FS_MASK to CLEAN so
  that the registers will be restored when the debugged thread
  resumes.
- Be more explicit about clearing the SSTATUS.FS field before setting
  it to CLEAN on the first FP instruction trap.

Submitted by:	br, markj
Approved by:	re (rgrimes)
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D17141
2018-09-19 23:45:18 +00:00
..
_align.h
_bus.h
_inttypes.h
_limits.h
_stdint.h
_types.h Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
asm.h Permit supervisor to access user VA space for certain functions only. 2018-09-05 11:34:58 +00:00
atomic.h Implement atomic_swap_{int,long,ptr}(9). 2018-08-07 18:56:51 +00:00
bus_dma.h
bus.h
clock.h
counter.h Back pcpu zone with domain correct pages 2018-07-06 02:06:03 +00:00
cpu.h Use SPP (Supervisor Previous Privilege) bit in the sstatus 2018-07-27 16:13:06 +00:00
cpufunc.h Export a breakpoint() function to userland for riscv. 2018-05-16 16:56:35 +00:00
db_machdep.h
dump.h
efi.h
elf.h
encoding.h Add RISC-V instructions encoding. 2018-08-13 16:07:18 +00:00
endian.h
exec.h
float.h
floatingpoint.h
fpe.h Various fixes for floating point on RISC-V. 2018-09-19 23:45:18 +00:00
frame.h
ieeefp.h
in_cksum.h
intr.h o Add driver for PLIC (Platform-Level Interrupt Controller) device. 2018-06-12 17:45:15 +00:00
kdb.h
machdep.h
md_var.h
memdev.h
minidump.h
ofw_machdep.h
param.h
pcb.h
pcpu.h
pmap.h
pmc_mdep.h
proc.h
profile.h
psl.h
pte.h
ptrace.h
reg.h
reloc.h
resource.h
riscvreg.h Add support for 'C'-compressed ISA extension to DTrace FBT provider. 2018-09-03 14:34:09 +00:00
runq.h
sbi.h
setjmp.h Fix setjmp for RISC-V: 2018-07-23 09:54:28 +00:00
sf_buf.h
signal.h
smp.h o Add driver for PLIC (Platform-Level Interrupt Controller) device. 2018-06-12 17:45:15 +00:00
stack.h
stdarg.h Use standard pattern for stdargs.h 2018-02-12 14:48:05 +00:00
sysarch.h
trap.h
ucontext.h
vdso.h
vm.h
vmparam.h Implement uma_small_alloc(), uma_small_free(). 2018-08-08 16:08:38 +00:00