aboutsummaryrefslogtreecommitdiff
path: root/resources/utilities/ich9deblob
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-12-23 22:08:37 +0000
committerFrancis Rowe <info@gluglug.org.uk>2014-12-23 22:08:37 +0000
commita8605043c58cb0afd157d11431125b988f7af455 (patch)
tree058571183197ed38b94af1276726439b79cb0d40 /resources/utilities/ich9deblob
parent1b5c10a8c08a5c5d5c43c02dddbedd6961fbf2e4 (diff)
downloadlibrebootfr-a8605043c58cb0afd157d11431125b988f7af455.tar.gz
librebootfr-a8605043c58cb0afd157d11431125b988f7af455.zip
ich9deblob: rename GBEREGIONSIZE to GBEREGIONSIZE_8K
Diffstat (limited to 'resources/utilities/ich9deblob')
-rw-r--r--resources/utilities/ich9deblob/gbe/gbe.h10
-rw-r--r--resources/utilities/ich9deblob/ich9deblob.c16
-rw-r--r--resources/utilities/ich9deblob/x86compatibility.c4
3 files changed, 15 insertions, 15 deletions
diff --git a/resources/utilities/ich9deblob/gbe/gbe.h b/resources/utilities/ich9deblob/gbe/gbe.h
index de3b27d7..3b25ddf6 100644
--- a/resources/utilities/ich9deblob/gbe/gbe.h
+++ b/resources/utilities/ich9deblob/gbe/gbe.h
@@ -37,7 +37,7 @@
#include <string.h>
/* Size of gbe region in bytes */
-#define GBEREGIONSIZE 0x2000
+#define GBEREGIONSIZE_8K 0x2000
/*
* These will have a modified descriptor+gbe based on what's in the factory.rom
@@ -112,8 +112,8 @@ unsigned short gbeGetChecksumFrom8kBuffer(char* regionData, unsigned short desir
/* checksum calculation for 4k gbe struct (algorithm based on datasheet) */
unsigned short gbeGetChecksumFrom4kStruct(struct GBEREGIONRECORD_4K gbeStruct4k, unsigned short desiredValue)
{
- char gbeBuffer4k[GBEREGIONSIZE>>1];
- memcpy(&gbeBuffer4k, &gbeStruct4k, GBEREGIONSIZE>>1);
+ char gbeBuffer4k[GBEREGIONSIZE_8K>>1];
+ memcpy(&gbeBuffer4k, &gbeStruct4k, GBEREGIONSIZE_8K>>1);
return gbeGetChecksumFrom8kBuffer(gbeBuffer4k, desiredValue, 0);
}
@@ -127,10 +127,10 @@ struct GBEREGIONRECORD_8K deblobbedGbeStructFromFactory(struct GBEREGIONRECORD_8
*/
struct GBEREGIONRECORD_8K deblobbedGbeStruct8k;
- memcpy(&deblobbedGbeStruct8k, &factoryGbeStruct8k, GBEREGIONSIZE);
+ memcpy(&deblobbedGbeStruct8k, &factoryGbeStruct8k, GBEREGIONSIZE_8K);
deblobbedGbeStruct8k.backup.checkSum = gbeGetChecksumFrom4kStruct(deblobbedGbeStruct8k.backup, 0xBABA);
- memcpy(&deblobbedGbeStruct8k.main, &deblobbedGbeStruct8k.backup, GBEREGIONSIZE>>1);
+ memcpy(&deblobbedGbeStruct8k.main, &deblobbedGbeStruct8k.backup, GBEREGIONSIZE_8K>>1);
/*
* Debugging:
diff --git a/resources/utilities/ich9deblob/ich9deblob.c b/resources/utilities/ich9deblob/ich9deblob.c
index 94bc2c25..f223d44e 100644
--- a/resources/utilities/ich9deblob/ich9deblob.c
+++ b/resources/utilities/ich9deblob/ich9deblob.c
@@ -65,9 +65,9 @@ int main(int argc, char *argv[])
* gbe region. Well have actual gbe buffer mapped to it (from the factory.rom dump)
* and then it will be modified to correct the main region
*/
- char factoryGbeBuffer8k[GBEREGIONSIZE];
+ char factoryGbeBuffer8k[GBEREGIONSIZE_8K];
struct GBEREGIONRECORD_8K factoryGbeStruct8k;
- char deblobbedGbeBuffer8k[GBEREGIONSIZE];
+ char deblobbedGbeBuffer8k[GBEREGIONSIZE_8K];
struct GBEREGIONRECORD_8K deblobbedGbeStruct8k;
/*
@@ -152,8 +152,8 @@ int main(int argc, char *argv[])
*/
fseek(fileStream, factoryGbeRegionStart, SEEK_SET);
/* Read the gbe data from the factory.rom and put it in factoryGbeBuffer8k */
- bufferLength = fread(factoryGbeBuffer8k, sizeof(char), GBEREGIONSIZE, fileStream);
- if (GBEREGIONSIZE != bufferLength)
+ bufferLength = fread(factoryGbeBuffer8k, sizeof(char), GBEREGIONSIZE_8K, fileStream);
+ if (GBEREGIONSIZE_8K != bufferLength)
{
printf("\nerror: could not read GBe region from factory.rom (%i) bytes read\n", bufferLength);
return 1;
@@ -167,11 +167,11 @@ int main(int argc, char *argv[])
* gbe over the struct so that it can then be modified
* for libreboot's purpose
*/
- memcpy(&factoryGbeStruct8k, &factoryGbeBuffer8k, GBEREGIONSIZE);
+ memcpy(&factoryGbeStruct8k, &factoryGbeBuffer8k, GBEREGIONSIZE_8K);
/*
* the original factoryGbeStruct8k is only reference. Changes go here:
*/
- memcpy(&deblobbedGbeStruct8k, &factoryGbeBuffer8k, GBEREGIONSIZE);
+ memcpy(&deblobbedGbeStruct8k, &factoryGbeBuffer8k, GBEREGIONSIZE_8K);
/*
* Get size of ROM image
@@ -213,7 +213,7 @@ int main(int argc, char *argv[])
* deblobbed descriptor region
*/
memcpy(&deblobbedDescriptorBuffer, &deblobbedDescriptorStruct, DESCRIPTORREGIONSIZE); /* descriptor */
- memcpy(&deblobbedGbeBuffer8k, &deblobbedGbeStruct8k, GBEREGIONSIZE); /* gbe */
+ memcpy(&deblobbedGbeBuffer8k, &deblobbedGbeStruct8k, GBEREGIONSIZE_8K); /* gbe */
/* delete old file before continuing */
remove(deblobbedDescriptorFilename);
@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
}
/* add gbe to the end of the file */
- if (GBEREGIONSIZE != fwrite(deblobbedGbeBuffer8k, sizeof(char), GBEREGIONSIZE, fileStream))
+ if (GBEREGIONSIZE_8K != fwrite(deblobbedGbeBuffer8k, sizeof(char), GBEREGIONSIZE_8K, fileStream))
{
printf("\nerror: writing GBe region failed\n");
return 1;
diff --git a/resources/utilities/ich9deblob/x86compatibility.c b/resources/utilities/ich9deblob/x86compatibility.c
index 6ee3fec7..fb0bb73a 100644
--- a/resources/utilities/ich9deblob/x86compatibility.c
+++ b/resources/utilities/ich9deblob/x86compatibility.c
@@ -44,8 +44,8 @@ int structSizesIncorrect(struct DESCRIPTORREGIONRECORD descriptorDummy, struct G
printf("\nerror: compiler incompatibility: descriptor struct length is %i bytes (should be %i)\n", descriptorRegionStructSize, DESCRIPTORREGIONSIZE);
return 1;
}
- if (GBEREGIONSIZE != gbeRegion8kStructSize){
- printf("\nerror: compiler incompatibility: gbe struct length is %i bytes (should be %i)\n", gbeRegion8kStructSize, GBEREGIONSIZE);
+ if (GBEREGIONSIZE_8K != gbeRegion8kStructSize){
+ printf("\nerror: compiler incompatibility: gbe struct length is %i bytes (should be %i)\n", gbeRegion8kStructSize, GBEREGIONSIZE_8K);
return 1;
}