summaryrefslogtreecommitdiffstats
path: root/resources/utilities/ich9deblob/src/common/x86compatibility.c
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-01-10 18:07:56 (EST)
committer Francis Rowe <info@gluglug.org.uk>2015-01-10 18:07:56 (EST)
commitf6da483213c5a9ad026c2740eeff120414492a40 (patch)
tree72c62f49cc617a15a023134c26679c30133aacab /resources/utilities/ich9deblob/src/common/x86compatibility.c
parent74adfa0f8c41754d1a74006b6ca5f923fd2af503 (diff)
downloadlibreboot-f6da483213c5a9ad026c2740eeff120414492a40.zip
libreboot-f6da483213c5a9ad026c2740eeff120414492a40.tar.gz
libreboot-f6da483213c5a9ad026c2740eeff120414492a40.tar.bz2
ich9deblob/ich9gen: use portable data types
For those integers that need to be a certain byte size.
Diffstat (limited to 'resources/utilities/ich9deblob/src/common/x86compatibility.c')
-rw-r--r--resources/utilities/ich9deblob/src/common/x86compatibility.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/resources/utilities/ich9deblob/src/common/x86compatibility.c b/resources/utilities/ich9deblob/src/common/x86compatibility.c
index 505a37d..aaf3173 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 */