diff options
Diffstat (limited to 'resources/utilities/ich9deblob/src/common')
4 files changed, 11 insertions, 9 deletions
diff --git a/resources/utilities/ich9deblob/src/common/descriptor_gbe.c b/resources/utilities/ich9deblob/src/common/descriptor_gbe.c index ca50ac04..581f755e 100644 --- a/resources/utilities/ich9deblob/src/common/descriptor_gbe.c +++ b/resources/utilities/ich9deblob/src/common/descriptor_gbe.c @@ -31,8 +31,8 @@ int notCreatedDescriptorGbeFile(struct DESCRIPTORREGIONRECORD descriptorStruct, FILE* fileStream = NULL; /* These will have the structs copied to them */ - char descriptorBuffer[DESCRIPTORREGIONSIZE]; - char gbeBuffer8k[GBEREGIONSIZE_8K]; + uint8_t descriptorBuffer[DESCRIPTORREGIONSIZE]; + uint8_t gbeBuffer8k[GBEREGIONSIZE_8K]; /* Copy the structs to buffers, to make writing them as files easier */ memcpy(&descriptorBuffer, &descriptorStruct, DESCRIPTORREGIONSIZE); /* descriptor */ @@ -45,14 +45,14 @@ int notCreatedDescriptorGbeFile(struct DESCRIPTORREGIONRECORD descriptorStruct, fileStream = fopen(fileName, "ab"); /* write the descriptor region into the first part */ - if (DESCRIPTORREGIONSIZE != fwrite(descriptorBuffer, sizeof(char), DESCRIPTORREGIONSIZE, fileStream)) + if (DESCRIPTORREGIONSIZE != fwrite(descriptorBuffer, 1, DESCRIPTORREGIONSIZE, fileStream)) { printf("\nerror: writing descriptor region failed\n"); return 1; } /* add gbe to the end of the file */ - if (GBEREGIONSIZE_8K != fwrite(gbeBuffer8k, sizeof(char), GBEREGIONSIZE_8K, fileStream)) + if (GBEREGIONSIZE_8K != fwrite(gbeBuffer8k, 1, GBEREGIONSIZE_8K, fileStream)) { printf("\nerror: writing GBe region failed\n"); return 1; diff --git a/resources/utilities/ich9deblob/src/common/descriptor_gbe.h b/resources/utilities/ich9deblob/src/common/descriptor_gbe.h index cc0cc42f..d3e8977e 100644 --- a/resources/utilities/ich9deblob/src/common/descriptor_gbe.h +++ b/resources/utilities/ich9deblob/src/common/descriptor_gbe.h @@ -26,6 +26,7 @@ #include <stdio.h> #include <string.h> +#include <stdint.h> #include "../descriptor/descriptor.h" /* structs describing what's in the descriptor region */ #include "../gbe/gbe.h" /* structs describing what's in the gbe region */ diff --git a/resources/utilities/ich9deblob/src/common/x86compatibility.c b/resources/utilities/ich9deblob/src/common/x86compatibility.c index 505a37d9..aaf31733 100644 --- a/resources/utilities/ich9deblob/src/common/x86compatibility.c +++ b/resources/utilities/ich9deblob/src/common/x86compatibility.c @@ -51,10 +51,10 @@ int structSizesIncorrect(struct DESCRIPTORREGIONRECORD descriptorDummy, struct G /* endianness check. big endian forced to fail */ int systemIsBigEndian() { - unsigned short steak = 0xBEEF; - unsigned char *grill = (unsigned char*)&steak; + uint16_t steak = 0xBEEF; + uint8_t *grill = (uint8_t*)&steak; - if (*grill==0xBE) { + if (*grill!=0xEF) { printf("\nunsigned short 0xBEEF: first byte should be EF, but it's BE. Your system is big endian, and unsupported (only little endian is tested)\n"); return 1; } @@ -66,7 +66,7 @@ int structMembersWrongOrder() { int i; struct DESCRIPTORREGIONRECORD descriptorDummy; - unsigned char *meVsccTablePtr = (unsigned char*)&descriptorDummy.meVsccTable; + uint8_t *meVsccTablePtr = (uint8_t*)&descriptorDummy.meVsccTable; /* These do not use bitfields. */ descriptorDummy.meVsccTable.jid0 = 0x01020304; /* unsigned int 32-bit */ @@ -124,7 +124,7 @@ int structBitfieldWrongOrder() { int i; struct DESCRIPTORREGIONRECORD descriptorDummy; - unsigned char *flMap0Ptr = (unsigned char*)&descriptorDummy.flMaps.flMap0; + uint8_t *flMap0Ptr = (uint8_t*)&descriptorDummy.flMaps.flMap0; descriptorDummy.flMaps.flMap0.FCBA = 0xA2; /* :8 --> 10100010 */ descriptorDummy.flMaps.flMap0.NC = 0x02; /* :2 --> 10 */ diff --git a/resources/utilities/ich9deblob/src/common/x86compatibility.h b/resources/utilities/ich9deblob/src/common/x86compatibility.h index d9d5bdb3..e5f02bee 100644 --- a/resources/utilities/ich9deblob/src/common/x86compatibility.h +++ b/resources/utilities/ich9deblob/src/common/x86compatibility.h @@ -26,6 +26,7 @@ #include <stdio.h> #include <string.h> +#include <stdint.h> #include "../descriptor/descriptor.h" /* structs describing what's in the descriptor region */ #include "../gbe/gbe.h" /* structs describing what's in the gbe region */ |