Sprinkle #ifdef FPE for now

This commit is contained in:
skrll 2021-05-01 06:53:08 +00:00
parent 43a3ad6d87
commit 433a060bf4
2 changed files with 20 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.h,v 1.7 2020/11/04 07:09:45 skrll Exp $ */
/* $NetBSD: locore.h,v 1.8 2021/05/01 06:53:08 skrll Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -118,7 +118,10 @@ struct mainbus_attach_args {
#ifdef _KERNEL
extern int cpu_printfataltraps;
#ifdef FPE
extern const pcu_ops_t pcu_fpu_ops;
#endif
static inline vaddr_t
stack_align(vaddr_t sp)
@ -135,31 +138,43 @@ userret(struct lwp *l)
static inline void
fpu_load(void)
{
#ifdef FPE
pcu_load(&pcu_fpu_ops);
#endif
}
static inline void
fpu_save(lwp_t *l)
{
#ifdef FPE
pcu_save(&pcu_fpu_ops, l);
#endif
}
static inline void
fpu_discard(lwp_t *l)
{
#ifdef FPE
pcu_discard(&pcu_fpu_ops, l, false);
#endif
}
static inline void
fpu_replace(lwp_t *l)
{
#ifdef FPE
pcu_discard(&pcu_fpu_ops, l, true);
#endif
}
static inline bool
fpu_valid_p(lwp_t *l)
{
#ifdef FPE
return pcu_valid_p(&pcu_fpu_ops, l);
#else
return false;
#endif
}
void __syncicache(const void *, size_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: riscv_machdep.c,v 1.13 2020/11/04 20:05:47 skrll Exp $ */
/* $NetBSD: riscv_machdep.c,v 1.14 2021/05/01 06:53:08 skrll Exp $ */
/*-
* Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
@ -33,7 +33,7 @@
#include "opt_modular.h"
__RCSID("$NetBSD: riscv_machdep.c,v 1.13 2020/11/04 20:05:47 skrll Exp $");
__RCSID("$NetBSD: riscv_machdep.c,v 1.14 2021/05/01 06:53:08 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -65,7 +65,9 @@ struct cpu_info cpu_info_store = {
};
const pcu_ops_t * const pcu_ops_md_defs[PCU_UNIT_COUNT] = {
#ifdef FPE
[PCU_FPU] = &pcu_fpu_ops,
#endif
};
void