1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
/*
linuxinfo_m68k.c
Copyright (C) 1998-2000
All Rights Reserved.
Alex Buell <alex.buell@munted.org.uk>
Version Author Date Comments
----------------------------------------------------------------------
1.0.0 AIB 199803?? Initial development
1.0.1 AIB 20000405 Rework of code
1.0.2 AIB 20010909 Added getphysicalmemory() call
This is the m68k port of linuxinfo
*/
#include <stdio.h>
#include <stdlib.h>
#include "linuxinfo.h"
#ifdef system_m68k
void GetHardwareInfo(int fd, struct hw_stat *hw)
{
int processors = 0;
float bogomips = 0.0;
float tempbogo;
char temp_string[BUFSIZ], temp_string2[BUFSIZ];
char chip[BUFSIZ] = "Unknown";
FILE *procfile;
while (read_line(fd, temp_string, BUFSIZ) != 0)
{
splitstring(temp_string, temp_string2);
if (processors == 0)
if (!(strcmp(temp_string, "CP")))
strcpy(chip, temp_string2);
if (!(strcmp(temp_string, "ClockIn")))
strcpy(hw->hw_megahertz, temp_string2);
if (!(strcmp(temp_string, "BogoMip")))
{
processors++;
sscanf(temp_string2, "%f", &tempbogo);
bogomips += tempbogo;
}
}
sprintf(hw->hw_memory, LONGSPEC, getphysicalmemory());
hw->hw_processors = processors;
sprintf(hw->hw_cpuinfo, "%s", chip);
sprintf(hw->hw_bogomips, "%0.2f", bogomips);
}
#endif /* system_m68k */
|