2020-01-18 00:00:41 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 Synopsys, Inc. (www.synopsys.com)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASM_ARC_FPU_H
|
|
|
|
#define _ASM_ARC_FPU_H
|
|
|
|
|
|
|
|
#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
|
|
|
|
|
|
|
|
#include <asm/ptrace.h>
|
|
|
|
|
2020-01-17 23:04:03 +00:00
|
|
|
#ifdef CONFIG_ISA_ARCOMPACT
|
|
|
|
|
2020-01-18 00:00:41 +00:00
|
|
|
/* These DPFP regs need to be saved/restored across ctx-sw */
|
|
|
|
struct arc_fpu {
|
|
|
|
struct {
|
|
|
|
unsigned int l, h;
|
|
|
|
} aux_dpfp[2];
|
|
|
|
};
|
|
|
|
|
2020-01-17 23:04:03 +00:00
|
|
|
#define fpu_init_task(regs)
|
2020-01-18 00:00:41 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2020-01-17 23:04:03 +00:00
|
|
|
/*
|
|
|
|
* ARCv2 FPU Control aux register
|
|
|
|
* - bits to enable Traps on Exceptions
|
|
|
|
* - Rounding mode
|
|
|
|
*
|
|
|
|
* ARCv2 FPU Status aux register
|
|
|
|
* - FPU exceptions flags (Inv, Div-by-Zero, overflow, underflow, inexact)
|
|
|
|
* - Flag Write Enable to clear flags explicitly (vs. by fpu instructions
|
|
|
|
* only
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct arc_fpu {
|
|
|
|
unsigned int ctrl, status;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern void fpu_init_task(struct pt_regs *regs);
|
|
|
|
|
|
|
|
#endif /* !CONFIG_ISA_ARCOMPACT */
|
|
|
|
|
2020-02-08 01:05:10 +00:00
|
|
|
struct task_struct;
|
|
|
|
|
2020-01-17 23:04:03 +00:00
|
|
|
extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
|
|
|
|
|
|
|
|
#else /* !CONFIG_ARC_FPU_SAVE_RESTORE */
|
|
|
|
|
2020-01-18 00:00:41 +00:00
|
|
|
#define fpu_save_restore(p, n)
|
2020-01-17 23:04:03 +00:00
|
|
|
#define fpu_init_task(regs)
|
2020-01-18 00:00:41 +00:00
|
|
|
|
|
|
|
#endif /* CONFIG_ARC_FPU_SAVE_RESTORE */
|
|
|
|
|
|
|
|
#endif /* _ASM_ARC_FPU_H */
|