1
/* Re-written from scratch 14 July 2002 */
2
/* Handles CRIS chips 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(cpu_info_t *cpu_info) {
15
char temp_string[256];
16
char vendor_string[256],model_string[256],hardware_string[256];
20
vendor_string[0]=model_string[0]=hardware_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,255,fff)!=NULL) ) {
27
if ( !(strncmp(temp_string,"cpu model",9))) {
28
strncpy(model_string,parse_line(temp_string),256);
29
clip_lf(model_string,255);
33
/* Ugh why must people play with capitalization */
34
if ( !(strncmp(temp_string,"bogomips",8)) ||
35
!(strncmp(temp_string,"BogoMips",8)) ||
36
!(strncmp(temp_string,"BogoMIPS",8))) {
37
bogomips+=atof(parse_line(temp_string));
38
cpu_count++; /* Cheating way to detect number of intel CPU's */
43
strncpy(cpu_info->chip_vendor,"CRIS",32);
44
strncpy(cpu_info->chip_type,model_string,63);
46
cpu_info->num_cpus=cpu_count;
47
cpu_info->megahertz=0.0;
48
cpu_info->bogomips=bogomips;
54
int get_hardware(char hardware_string[65]) {
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 */