1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _EXTERNS_H 28 #define _EXTERNS_H 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 #include <sys/types.h> 37 #include <fps_ereport.h> 38 39 /* Register handling routines */ 40 extern uint32_t register_test(int, uint32_t); 41 extern uint64_t get_gsr(void); 42 extern uint64_t move_regs_dp(uint64_t); 43 extern uint64_t register_test_dp(int, uint64_t); 44 extern unsigned long get_fsr(void); 45 extern unsigned long move_regs(unsigned long); 46 extern void init_regs(uint32_t); 47 extern void init_regs_dp(uint64_t); 48 extern void set_fsr(unsigned long); 49 extern void set_gsr(uint64_t); 50 51 /* FP arithmetic routines */ 52 extern uint64_t absolute_value_dp(uint64_t); 53 extern uint64_t add_dp(uint64_t, uint64_t); 54 extern uint64_t div_dp(uint64_t, uint64_t); 55 extern uint64_t fcmps_fcc(unsigned int, unsigned int, 56 unsigned int); 57 extern uint64_t fcmpd_fcc(uint64_t, uint64_t, unsigned int); 58 extern uint64_t mult_dp(uint64_t, uint64_t); 59 extern uint64_t negate_value_dp(uint64_t); 60 extern uint64_t sqrt_sp(unsigned long); 61 extern uint64_t sqrt_dp(uint64_t); 62 extern uint64_t sub_dp(uint64_t, uint64_t); 63 extern uint64_t wadd_sp(unsigned long, unsigned long); 64 extern uint64_t wadd_dp(unsigned long, unsigned long, 65 unsigned long, unsigned long); 66 extern uint64_t wdiv_sp(unsigned long, unsigned long); 67 extern uint64_t wdiv_dp(unsigned long, unsigned long, 68 unsigned long, unsigned long); 69 extern uint64_t wmult_sp(unsigned long, unsigned long); 70 extern uint64_t wmult_dp(unsigned long, unsigned long, 71 unsigned long, unsigned long); 72 extern uint64_t wsqrt_sp(unsigned long); 73 extern uint64_t wsqrt_dp(uint64_t); 74 extern unsigned long absolute_value_sp(unsigned long); 75 extern unsigned long add_sp(unsigned long, unsigned long); 76 extern unsigned long div_sp(unsigned long, unsigned long); 77 extern unsigned long mult_sp(unsigned long, unsigned long); 78 extern unsigned long negate_value_sp(unsigned long); 79 extern unsigned long sub_sp(unsigned long, unsigned long); 80 81 /* Compare routines */ 82 extern unsigned long cmp_d_ex(unsigned long, unsigned long); 83 extern unsigned long cmp_s_ex(unsigned long, unsigned long); 84 85 /* Conversion routines */ 86 extern int fsr_test(struct fps_test_ereport *report); 87 extern int restore_signals(); 88 extern int winitfp(void); 89 extern uint64_t convert_sp_dp(unsigned long); 90 extern uint64_t float_long_d(uint64_t); 91 extern uint64_t float_long_s(unsigned long); 92 extern uint64_t long_float_d(uint64_t); 93 extern uint64_t timing_add_dp(void); 94 extern uint64_t timing_mult_dp(void); 95 extern unsigned long branches(unsigned long, unsigned long, unsigned long); 96 extern unsigned long chain_dp(int); 97 extern unsigned long chain_sp(int); 98 extern unsigned long convert_dp_sp(uint64_t); 99 extern unsigned long datap_add(unsigned long); 100 extern unsigned long datap_add_dp(unsigned long, unsigned long); 101 extern unsigned long datap_mult(unsigned long); 102 extern unsigned long datap_mult_dp(unsigned long, unsigned long); 103 extern unsigned long float_int_d(uint64_t); 104 extern unsigned long float_int_s(unsigned long); 105 extern unsigned long int_float_d(int); 106 extern unsigned long int_float_s(int); 107 extern unsigned long long_float_s(uint64_t); 108 extern unsigned long timing_add_sp(void); 109 extern unsigned long timing_mult_sp(void); 110 extern void read_fpreg(unsigned int *, int); 111 extern void read_fpreg_dp(unsigned long *, int); 112 extern void write_fpreg(unsigned int *, int); 113 114 /* verbose messaging */ 115 extern void fps_msg(int msg_enable, const char *fmt, ...); 116 117 /* benchmarks */ 118 extern int align_data(int loop, 119 struct fps_test_ereport *report); 120 extern int fpu_fdivd(int rloop, 121 struct fps_test_ereport *report); 122 extern int fpu_fmuld(int rloop, 123 struct fps_test_ereport *report); 124 extern int fpu_fmulx(int rloop, 125 struct fps_test_ereport *report); 126 extern int vis_test(struct fps_test_ereport *report); 127 128 /* cbbcopy */ 129 extern int cbbcopy(struct fps_test_ereport *report); 130 131 /* cheetah sdc */ 132 extern int cheetah_sdc_test(int limit, 133 struct fps_test_ereport *report); 134 135 /* fpu sys diag */ 136 extern int fpu_sysdiag(struct fps_test_ereport *report); 137 138 /* linpack */ 139 extern int dlinpack_test(int, int, struct fps_test_ereport *report, 140 int fps_verbose_msg); 141 extern int slinpack_test(int, int, struct fps_test_ereport *report, 142 int fps_verbose_msg); 143 144 145 /* Global traps */ 146 extern uint_t trap_flag; 147 extern uint64_t fsr_at_trap; 148 149 #ifdef __cplusplus 150 } 151 #endif 152 153 #endif /* _EXTERNS_H */ 154