Skip to content

Solve issue 33 and pymap.xml missing chunk.#47

Merged
licliu merged 3 commits intonima:masterfrom
HuO50:master
Nov 17, 2022
Merged

Solve issue 33 and pymap.xml missing chunk.#47
licliu merged 3 commits intonima:masterfrom
HuO50:master

Conversation

@HuO50
Copy link
Collaborator

@HuO50 HuO50 commented Nov 16, 2022

Hello All:
I am solving the issue 33 WORD and DWORD problem. This problem may cause by mistake, WORD and DWORD have different byte sizes, it may cause wrong memory device capcity in some devices. I also redefine them in types.h file, because after SMBIOS-2.8.0, the structure of data assume to be little-endian order. I tested DWORD and WORD in unit-tests/private/files, the DWORD result is correct and same as dmidecode result. @licliu please help to test this patches, thanks.

The bus address should be added to pymap.xml, otherwise the python
interface will not know about it.

Signed-off-by: Zhongze Hu <joshuahu@tencent.com>
In case 17:
  dmi_memory_device_extended_size(sect_n, WORD(data + 0x1C)); may cause memory capcity read error. This because WORD and DWORD have different byte size, the DWORD is double long of WORD.
  After SMBIOS v2.8.0, the structures assume to be little-endian order. So redefine the WORD and DWORD in types.h.

Signed-off-by: Zhongze Hu <joshuahu@tencent.com>
Copy link
Collaborator

@licliu licliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since ALIGNMENT_WORKAROUND and BIGENDIAN are merged into one if macro in the new line 76, BIGENDIAN should also be added in line 60's ifdef macro, otherwise U64 will be undefined when only BIGENDIAN is defined.

Since ALIGNMENT_WORKAROUND and BIGENDIAN are merged into one if macro in the new line 76, BIGENDIAN should also be added in line 60's ifdef macro, otherwise U64 will be undefined when only BIGENDIAN is defined.

Signed-off-by: Zhongze Hu <joshuahu@tencent.com>
Copy link
Collaborator

@licliu licliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@licliu licliu merged commit bee24bc into nima:master Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants