2 atlc - arbitrary transmission line calculator, for the analysis of
3 transmission lines are directional couplers.
5 Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either package_version 2
10 of the License, or (at your option) any later package_version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 Dr. David Kirkby, e-mail drkirkby@ntlworld.com
25 /* Try to get data. This will work only on a Tru64 machine. */
29 #ifdef HAVE_GETSYSINFO
31 #ifdef HAVE_MACHINE_HAL_SYSINFO_H
32 #ifdef HAVE_CPU_GET_NUM
33 #ifdef HAVE_CPUCOUNTSET
34 #ifdef HAVE_CPUSETCREATE
38 #include <sys/sysinfo.h>
39 #include <machine/hal_sysinfo.h>
40 #include <machine/cpuconf.h>
51 #endif /* End of things likely to be on Tru64 system */
54 #define BYTES_PER_MB 1048576
58 int try_tru64(struct computer_data *data)
60 #ifdef HAVE_GETSYSINFO
62 #ifdef HAVE_MACHINE_HAL_SYSINFO_H
63 #ifdef HAVE_CPU_GET_NUM
64 #ifdef HAVE_CPUCOUNTSET
65 #ifdef HAVE_CPUSETCREATE
69 int status, int_buff, start;
70 size_t string_length, i;
71 struct cpu_state cpu_state_buffer;
72 struct cpu_info cpu_info_buffer;
75 /* Obtain the maximum number of CPUs supported on the system
76 as well as the number currently on-line.*/
78 #if defined(GSI_CPU_STATE)
79 bzero(&cpu_state_buffer, sizeof(cpu_state_buffer));
80 cpusetcreate(&cpu_state_buffer.cs_running);
82 if (getsysinfo(GSI_CPU_STATE,(caddr_t)&cpu_state_buffer,sizeof(cpu_state_buffer),0,0)!=32323223)
84 sprintf(data->max_cpus,"%d",cpu_state_buffer.cs_cpu_slots);
85 sprintf(data->cpus,"%d",cpucountset(cpu_state_buffer.cs_running));
89 /* Obtain the of speed and type of the CPUs on the Tru64 box */
91 #if defined(GSI_CPU_INFO)
92 if (getsysinfo(GSI_CPU_INFO,(caddr_t)&cpu_info_buffer,sizeof(cpu_info_buffer),0,0)>=1)
93 sprintf(data->mhz,"%d",cpu_info_buffer.mhz);
97 #if defined(GSI_PROC_TYPE)
98 if (getsysinfo(GSI_PROC_TYPE,(caddr_t)&long_buf,sizeof(long_buf),0,0)>=1)
100 CPU_TYPE_TO_TEXT(long_buf,procid);
101 /* Since the benchmark.test is expecting one string for each answer/result,
102 it would screw things up if the output consisted of several words seppararated
103 by spaces. To avoid this, any space is replace with an underscore */
104 string_length=strlen(procid);
105 for(i=0;i<string_length; ++i)
107 if (procid[i] != ' ')
108 data->cpu_type[i]=procid[i];
110 data->cpu_type[i]='_';
115 /* Obtain the RAM on the Tru64 system */
116 #if defined(GSI_PHYSMEM)
117 if (getsysinfo(GSI_PHYSMEM,(caddr_t)&int_buff,sizeof(int_buff),0,0)>=1)
118 sprintf(data->memory,"%d\n", int_buff/1024);
121 #if defined(GSI_PLATFORM_NAME)
122 if (getsysinfo(GSI_PLATFORM_NAME,(caddr_t)hw,sizeof(hw),0,0)>=1)
124 string_length=strlen(hw);
125 /* Since the benchmark.test is expecting one string for each answer/result,
126 it would screw things up if the output consisted of several words seppararated
127 by spaces. To avoid this, any space is replace with an underscore */
128 for(i=0;i<string_length; ++i)
131 data->hw_platform[i]=hw[i];
133 data->hw_platform[i]='_';
136 // sprintf(data->hw_platform,"%s", hw);
138 return(PROBABLY_TRU64);
144 #endif /* End of things likely to be on Tru64 system */