File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 10
10
(DMI type 4).
11
11
* dmidecode.c: Decode the MIDR register on ARM processors
12
12
(DMI type 4).
13
+ * dmidecode.c: Add support for large cache sizes (DMI type 7).
13
14
14
15
2017-04-11 Jean Delvare <jdelvare@suse.de>
15
16
Original file line number Diff line number Diff line change @@ -1536,6 +1536,21 @@ static void dmi_cache_size(u16 code)
1536
1536
printf (" %u kB" , code );
1537
1537
}
1538
1538
1539
+ static void dmi_cache_size_2 (u32 code )
1540
+ {
1541
+ if (code & 0x80000000 )
1542
+ {
1543
+ code &= 0x7FFFFFFFLU ;
1544
+ /* Use a more convenient unit for large cache size */
1545
+ if (code >= 0x8000 )
1546
+ printf (" %u MB" , code >> 4 );
1547
+ else
1548
+ printf (" %u kB" , code << 6 );
1549
+ }
1550
+ else
1551
+ printf (" %u kB" , code );
1552
+ }
1553
+
1539
1554
static void dmi_cache_types (u16 code , const char * sep )
1540
1555
{
1541
1556
/* 7.8.2 */
@@ -3576,10 +3591,16 @@ static void dmi_decode(const struct dmi_header *h, u16 ver)
3576
3591
printf ("\tLocation: %s\n" ,
3577
3592
dmi_cache_location ((WORD (data + 0x05 ) >> 5 ) & 0x0003 ));
3578
3593
printf ("\tInstalled Size:" );
3579
- dmi_cache_size (WORD (data + 0x09 ));
3594
+ if (h -> length >= 0x1B )
3595
+ dmi_cache_size_2 (DWORD (data + 0x17 ));
3596
+ else
3597
+ dmi_cache_size (WORD (data + 0x09 ));
3580
3598
printf ("\n" );
3581
3599
printf ("\tMaximum Size:" );
3582
- dmi_cache_size (WORD (data + 0x07 ));
3600
+ if (h -> length >= 0x17 )
3601
+ dmi_cache_size_2 (DWORD (data + 0x13 ));
3602
+ else
3603
+ dmi_cache_size (WORD (data + 0x07 ));
3583
3604
printf ("\n" );
3584
3605
printf ("\tSupported SRAM Types:" );
3585
3606
dmi_cache_types (WORD (data + 0x0B ), "\n\t\t" );
You can’t perform that action at this time.
0 commit comments