/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FPU_FPU_SIMULATOR_H
#define _SYS_FPU_FPU_SIMULATOR_H
/* SunOS-4.0 1.10 */
/*
* sparc floating-point simulator definitions.
*/
#ifndef _ASM
#endif /* _ASM */
#ifdef __cplusplus
extern "C" {
#endif
/*
*/
#define FITOS_RS2_SHIFT 0
#ifndef _ASM
/* PUBLIC TYPES */
fcc_equal = 0,
};
fcc_0 = 0,
};
/* FSR types. */
ftt_none = 0,
};
typedef struct { /* sparc V9 FSR. */
unsigned int : 26;
/* enum fp_direction_type */
unsigned int : 5;
/* enum ftt_type */
/* enum fcc_type */
} fsr_types;
/*
* The C compiler and the C spec do not support bitfields in a long long,
* as per fsr_types above, so don't hold your breath waiting for this
* workaround cruft to disappear.
*/
typedef union {
} fsr_type;
typedef /* FPU register viewed as single components. */
struct {
} single_type;
typedef /* FPU register viewed as double components. */
struct {
} double_type;
typedef /* FPU register viewed as extended components. */
struct {
typedef /* FPU register with multiple data views. */
union {
float float_reg;
} freg_type;
};
};
typedef /* FPU instruction. */
struct {
} fp_inst_type;
fmadd = 0,
};
typedef /* IMPDEP2B FPU FMA-fused instruction. */
struct {
typedef /* Integer condition code. */
struct {
} ccr_type;
typedef /* FPU data used by simulator. */
struct {
void (*fp_current_read_freg) ();
void (*fp_current_write_freg) ();
void (*fp_current_read_dreg) ();
void (*fp_current_write_dreg) ();
int fp_trapcode;
char *fp_trapaddr;
} fp_simd_type;
/*
* FPU related kstat structures
*/
struct fpustat_kstat {
};
struct fpuinfo_kstat {
};
struct visinfo_kstat {
};
}
/* PUBLIC FUNCTIONS */
#ifdef __STDC__
/*
* fpu_vis_sim simulates FPU VIS Partial load store instructions; reads and
* writes FPU data registers directly or works with the PCB image if fpu_exists
* is 0.
*/
/*
* fpu_simulator simulates FPU instructions only; reads and writes FPU data
* registers directly.
*/
/*
* fp_emulator simulates FPU and CPU-FPU instructions; reads and writes FPU
* data registers from image in pfpu.
*/
/*
* fp_traps handles passing exception conditions to the kernel.
* It is called after fp_simulator or fp_emulator fail (return a non-zero ftt).
*/
/*
* fp_kstat_update tracks fpu exception conditions.
* It is called after a hardware trap returns a non-zero ftt.
*/
/*
* fp_precise handles floating point unimplemented and unfinished traps,
* for sparc V9 hardware. These traps are normally passed along to the
* fpu_simulator, to see if it can run the unimplemented instruction or
* finish the unfinished instruction. Needless to say, this takes time.
*/
/*
* fpu_trap handles V9 floating point ieee and other floating point traps.
* It is called after fp_simulator or fp_emulator fail (return a non-zero ftt),
* and from the _fp_ieee_exception trap handler.
*/
#else /* ! __STDC__ */
/*
* fpu_simulator simulates FPU instructions only; reads and writes FPU data
* registers directly.
*/
extern enum ftt_type fpu_simulator(
int instr); /* Instruction to emulate. */
/*
* fp_emulator simulates FPU and CPU-FPU instructions; reads and writes FPU
* data registers from image in pfpu.
*/
extern enum ftt_type fp_emulator(
/*
* fp_traps handles passing exception conditions to the kernel.
* It is called after fp_simulator or fp_emulator fail (return a non-zero ftt).
*/
extern void fp_traps(
/*
* fp_kstat_update tracks fpu exception conditions.
* It is called after a hardware trap returns a non-zero ftt.
*/
/*
* fp_precise handles floating point unimplemented and unfinished traps,
* for sparc V9 hardware. These traps are normally passed along to the
* fpu_simulator, to see if it can run the unimplemented instruction or
* finish the unfinished instruction. Needless to say, this takes time.
*/
extern void fp_precise(
/*
* fpu_trap handles V9 floating point ieee and other floating point traps.
* It is called after fp_simulator or fp_emulator fail (return a non-zero ftt),
* and from the _fp_ieee_exception trap handler.
*/
extern void fpu_trap(
#endif /* __STDC__ */
#endif /* _ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FPU_FPU_SIMULATOR_H */