Skip to content

Commit

Permalink
dmidecode: Decode the MIDR register on ARM processors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jdelvare committed Apr 27, 2017
1 parent 9d369c6 commit a8a2ade
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* dmidecode.c: Add new enumerated values for processors (DMI type 4).
* dmidecode.c: Don't assume 8-bit processor family in dmi_processor_id
(DMI type 4).
* dmidecode.c: Decode the MIDR register on ARM processors
(DMI type 4).

2017-04-11 Jean Delvare <jdelvare@suse.de>

Expand Down
18 changes: 17 additions & 1 deletion dmidecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,22 @@ static void dmi_processor_id(const struct dmi_header *h, const char *prefix)
return;
}
}
else if ((type >= 0x100 && type <= 0x101) /* ARM */
|| (type >= 0x118 && type <= 0x119)) /* ARM */
{
u32 midr = DWORD(p);
/*
* The format of this field was not defined for ARM processors
* before version 3.1.0 of the SMBIOS specification, so we
* silently skip it if it reads all zeroes.
*/
if (midr == 0)
return;
printf("%sSignature: Implementor 0x%02x, Variant 0x%x, Architecture %u, Part 0x%03x, Revision %u\n",
prefix, midr >> 24, (midr >> 20) & 0xF,
(midr >> 16) & 0xF, (midr >> 4) & 0xFFF, midr & 0xF);
return;
}
else if ((type >= 0x0B && type <= 0x15) /* Intel, Cyrix */
|| (type >= 0x28 && type <= 0x2F) /* Intel */
|| (type >= 0xA1 && type <= 0xB3) /* Intel */
Expand Down Expand Up @@ -1094,7 +1110,7 @@ static void dmi_processor_id(const struct dmi_header *h, const char *prefix)
else
return;
}
else /* not X86-class */
else /* neither X86 nor ARM */
return;

/*
Expand Down

0 comments on commit a8a2ade

Please sign in to comment.