Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a8a2ade

Browse files
committed
dmidecode: Decode the MIDR register on ARM processors
Version 3.1.0 of the SMBIOS specification says that the Processor ID field maps to the MIDR register on ARM processors, decode it. Signed-off-by: Jean Delvare <jdelvare@suse.de>
1 parent 9d369c6 commit a8a2ade

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

‎CHANGELOG‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* dmidecode.c: Add new enumerated values for processors (DMI type 4).
99
* dmidecode.c: Don't assume 8-bit processor family in dmi_processor_id
1010
(DMI type 4).
11+
* dmidecode.c: Decode the MIDR register on ARM processors
12+
(DMI type 4).
1113

1214
2017年04月11日 Jean Delvare <jdelvare@suse.de>
1315

‎dmidecode.c‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,22 @@ static void dmi_processor_id(const struct dmi_header *h, const char *prefix)
10561056
return;
10571057
}
10581058
}
1059+
else if ((type >= 0x100 && type <= 0x101) /* ARM */
1060+
|| (type >= 0x118 && type <= 0x119)) /* ARM */
1061+
{
1062+
u32 midr = DWORD(p);
1063+
/*
1064+
* The format of this field was not defined for ARM processors
1065+
* before version 3.1.0 of the SMBIOS specification, so we
1066+
* silently skip it if it reads all zeroes.
1067+
*/
1068+
if (midr == 0)
1069+
return;
1070+
printf("%sSignature: Implementor 0x%02x, Variant 0x%x, Architecture %u, Part 0x%03x, Revision %u\n",
1071+
prefix, midr >> 24, (midr >> 20) & 0xF,
1072+
(midr >> 16) & 0xF, (midr >> 4) & 0xFFF, midr & 0xF);
1073+
return;
1074+
}
10591075
else if ((type >= 0x0B && type <= 0x15) /* Intel, Cyrix */
10601076
|| (type >= 0x28 && type <= 0x2F) /* Intel */
10611077
|| (type >= 0xA1 && type <= 0xB3) /* Intel */
@@ -1094,7 +1110,7 @@ static void dmi_processor_id(const struct dmi_header *h, const char *prefix)
10941110
else
10951111
return;
10961112
}
1097-
else /* not X86-class */
1113+
else /* neither X86 nor ARM */
10981114
return;
10991115

11001116
/*

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /