"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libsysinfo-0.2.2/Linux/cpuinfo_cris.c" between
linux_logo-5.11.tar.gz and linux_logo-6.0.tar.gz

About: Linux_Logo - an ANSI Color Penguin Logo that can be run at bootup. Also shows some system info.

cpuinfo_cris.c  (linux_logo-5.11):cpuinfo_cris.c  (linux_logo-6.0)
skipping to change at line 14 skipping to change at line 14
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> /* atof */ #include <stdlib.h> /* atof */
#include "../sysinfo.h" #include "../sysinfo.h"
#include "../include/generic.h" #include "../include/generic.h"
int get_cpu_info(struct cpu_info_type *cpu_info) { int get_cpu_info(struct cpu_info_type *cpu_info) {
FILE *fff; FILE *fff;
char temp_string[BUFSIZ]; char temp_string[BUFSIZ];
char vendor_string[BUFSIZ],model_string[BUFSIZ]; char model_string[BUFSIZ];
int cpu_count=0; int cpu_count=0;
float bogomips=0.0; float bogomips=0.0;
vendor_string[0]=model_string[0]=0; model_string[0]=0;
/* We get all of our info here from /proc/cpuinfo */ /* We get all of our info here from /proc/cpuinfo */
if ((fff=fopen(get_cpuinfo_file(),"r") )!=NULL) { if ((fff=fopen(get_cpuinfo_file(),"r") )!=NULL) {
while ( (fgets(temp_string,BUFSIZ,fff)!=NULL) ) { while ( (fgets(temp_string,BUFSIZ,fff)!=NULL) ) {
if ( !(strncmp(temp_string,"cpu model",9))) { if ( !(strncmp(temp_string,"cpu model",9))) {
strncpy(model_string,parse_line(temp_string),BUFSIZ); strncpy(model_string,parse_line(temp_string),BUFS
clip_lf(model_string,BUFSIZ); IZ-1);
} clip_lf(model_string,BUFSIZ);
}
/* Ugh why must people play with capitalization */ /* Ugh why must people play with capitalization */
if ( !(strncmp(temp_string,"bogomips",8)) || if ( !(strncmp(temp_string,"bogomips",8)) ||
!(strncmp(temp_string,"BogoMips",8)) || !(strncmp(temp_string,"BogoMips",8)) ||
!(strncmp(temp_string,"BogoMIPS",8))) { !(strncmp(temp_string,"BogoMIPS",8))) {
bogomips+=atof(parse_line(temp_string));
cpu_count++; /* Cheating way to detect number of intel CPU's */ bogomips+=atof(parse_line(temp_string));
} /* Cheating way to detect number of intel CPUs */
} cpu_count++;
} }
}
strncpy(cpu_info->chip_vendor,"CRIS",SYSINFO_CHIP_VENDOR_SIZE); }
strncpy(cpu_info->chip_type,model_string,SYSINFO_CHIP_TYPE_SIZE);
strncpy(cpu_info->chip_vendor,"CRIS",SYSINFO_CHIP_VENDOR_SIZE);
cpu_info->num_cpus=cpu_count; strncpy_truncate(cpu_info->chip_type,model_string,SYSINFO_CHIP_TYPE_SIZE)
cpu_info->megahertz=0.0; ;
cpu_info->bogomips=bogomips;
cpu_info->num_cpus=cpu_count;
cpu_info->megahertz=0.0;
cpu_info->bogomips=bogomips;
return 0; return 0;
} }
int get_hardware(char *hardware_string) { int get_hardware(char *hardware_string) {
return -1; return -1;
} }
/* Some architectures might have better ways of detecting RAM size */ /* Some architectures might have better ways of detecting RAM size */
long long get_arch_specific_mem_size(void) { long long get_arch_specific_mem_size(void) {
/* We have no special way of detecting RAM */ /* We have no special way of detecting RAM */
return 0; return 0;
} }
 End of changes. 5 change blocks. 
39 lines changed or deleted 42 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)