60
60
#include "config.h"
61
61
#include "types.h"
62
62
#include "util.h"
63
+ #include "dmidecode.h"
63
64
#include "dmiopt.h"
64
65
65
66
static const char * out_of_spec = "<OUT OF SPEC>" ;
@@ -314,7 +315,7 @@ static void dmi_bios_characteristics_x2(u8 code, const char *prefix)
314
315
* 3.3.2 System Information (Type 1)
315
316
*/
316
317
317
- static void dmi_system_uuid (u8 * p )
318
+ void dmi_system_uuid (u8 * p )
318
319
{
319
320
int only0xFF = 1 , only0x00 = 1 ;
320
321
int i ;
@@ -327,16 +328,16 @@ static void dmi_system_uuid(u8 *p)
327
328
328
329
if (only0xFF )
329
330
{
330
- printf (" Not Present" );
331
+ printf ("Not Present" );
331
332
return ;
332
333
}
333
334
if (only0x00 )
334
335
{
335
- printf (" Not Settable" );
336
+ printf ("Not Settable" );
336
337
return ;
337
338
}
338
339
339
- printf (" %02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X" ,
340
+ printf ("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X" ,
340
341
p [0 ], p [1 ], p [2 ], p [3 ], p [4 ], p [5 ], p [6 ], p [7 ],
341
342
p [8 ], p [9 ], p [10 ], p [11 ], p [12 ], p [13 ], p [14 ], p [15 ]);
342
343
}
@@ -429,7 +430,7 @@ static void dmi_base_board_handles(u8 count, u8 *p, const char *prefix)
429
430
* 3.3.4 Chassis Information (Type 3)
430
431
*/
431
432
432
- static const char * dmi_chassis_type (u8 code )
433
+ const char * dmi_chassis_type (u8 code )
433
434
{
434
435
/* 3.3.4.1 */
435
436
static const char * type []= {
@@ -568,7 +569,7 @@ static const char *dmi_processor_type(u8 code)
568
569
return out_of_spec ;
569
570
}
570
571
571
- static const char * dmi_processor_family (u8 code )
572
+ const char * dmi_processor_family (u8 code )
572
573
{
573
574
/* 3.3.5.2 */
574
575
static const char * family [256 ]= {
@@ -1002,12 +1003,14 @@ static void dmi_processor_voltage(u8 code)
1002
1003
}
1003
1004
}
1004
1005
1005
- static void dmi_processor_frequency (u16 code )
1006
+ void dmi_processor_frequency (u8 * p )
1006
1007
{
1008
+ u16 code = WORD (p );
1009
+
1007
1010
if (code )
1008
- printf (" %u MHz" , code );
1011
+ printf ("%u MHz" , code );
1009
1012
else
1010
- printf (" Unknown" );
1013
+ printf ("Unknown" );
1011
1014
}
1012
1015
1013
1016
static const char * dmi_processor_status (u8 code )
@@ -2878,7 +2881,7 @@ static void dmi_decode(u8 *data, u16 ver)
2878
2881
printf ("\tSerial Number: %s\n" ,
2879
2882
dmi_string (h , data [0x07 ]));
2880
2883
if (h -> length < 0x19 ) break ;
2881
- printf ("\tUUID:" );
2884
+ printf ("\tUUID: " );
2882
2885
dmi_system_uuid (data + 0x08 );
2883
2886
printf ("\n" );
2884
2887
printf ("\tWake-up Type: %s\n" ,
@@ -2973,14 +2976,14 @@ static void dmi_decode(u8 *data, u16 ver)
2973
2976
printf ("\tVoltage:" );
2974
2977
dmi_processor_voltage (data [0x11 ]);
2975
2978
printf ("\n" );
2976
- printf ("\tExternal Clock:" );
2977
- dmi_processor_frequency (WORD ( data + 0x12 ) );
2979
+ printf ("\tExternal Clock: " );
2980
+ dmi_processor_frequency (data + 0x12 );
2978
2981
printf ("\n" );
2979
- printf ("\tMax Speed:" );
2980
- dmi_processor_frequency (WORD ( data + 0x14 ) );
2982
+ printf ("\tMax Speed: " );
2983
+ dmi_processor_frequency (data + 0x14 );
2981
2984
printf ("\n" );
2982
- printf ("\tCurrent Speed:" );
2983
- dmi_processor_frequency (WORD ( data + 0x16 ) );
2985
+ printf ("\tCurrent Speed: " );
2986
+ dmi_processor_frequency (data + 0x16 );
2984
2987
printf ("\n" );
2985
2988
if (data [0x18 ]& (1 <<6 ))
2986
2989
printf ("\tStatus: Populated, %s\n" ,
0 commit comments