1
/* Re-written from scratch 14 July 2002 */
2
/* Handles s390 on Linux architecture */
3
/* by Vince Weaver <vince@deater.net> */
7
#include <stdlib.h> /* atof */
9
#include "../sysinfo.h"
10
#include "../include/generic.h"
12
int get_cpu_info(struct cpu_info_type *cpu_info) {
15
char temp_string[BUFSIZ];
16
char vendor_string[BUFSIZ],model_string[BUFSIZ];
18
float bogomips=0.0,megahertz=0.0;
20
vendor_string[0]=model_string[0]=0;
22
/* We get all of our info here from /proc/cpuinfo */
23
if ((fff=fopen(get_cpuinfo_file(),"r") )!=NULL) {
25
while ( (fgets(temp_string,BUFSIZ,fff)!=NULL) ) {
27
if ( !(strncmp(temp_string,"# processors",6))) {
28
cpu_count=atoi(parse_line(temp_string));
31
/* Ugh why must people play with capitalization */
32
if ( !(strncmp(temp_string,"bogomips",8)) ||
33
!(strncmp(temp_string,"BogoMips",8)) ||
34
!(strncmp(temp_string,"BogoMIPS",8))) {
35
bogomips+=atof(parse_line(temp_string));
40
/* Hackish, granted */
41
strncpy(vendor_string,"IBM",7);
42
strncpy(model_string,"S390",4);
43
strncpy(cpu_info->chip_vendor,vendor_string,SYSINFO_CHIP_VENDOR_SIZE);
44
strncpy(cpu_info->chip_type,model_string,SYSINFO_CHIP_TYPE_SIZE);
46
cpu_info->num_cpus=cpu_count;
47
cpu_info->megahertz=megahertz;
48
cpu_info->bogomips=bogomips*cpu_count;
54
int get_hardware(char *hardware_string) {
59
/* Some architectures might have better ways of detecting RAM size */
60
long int get_arch_specific_mem_size(void) {
61
/* We have no special way of detecting RAM */