diff options
author | Francis Rowe <info@gluglug.org.uk> | 2014-12-22 09:53:11 (EST) |
---|---|---|
committer | Francis Rowe <info@gluglug.org.uk> | 2014-12-22 09:53:39 (EST) |
commit | 2ef2a35be436b7b82e61a5329db08cad446b9532 (patch) | |
tree | d326b20d798d547e0be9b97c64510cd2b5006aae /resources/utilities | |
parent | 1e1b97cb39bcdc8da38cbc8fc63d2f6494670aed (diff) | |
download | libreboot-2ef2a35be436b7b82e61a5329db08cad446b9532.zip libreboot-2ef2a35be436b7b82e61a5329db08cad446b9532.tar.gz libreboot-2ef2a35be436b7b82e61a5329db08cad446b9532.tar.bz2 |
ich9deblob: fail on big endian systems
Diffstat (limited to 'resources/utilities')
-rw-r--r-- | resources/utilities/ich9deblob/ich9deblob.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/resources/utilities/ich9deblob/ich9deblob.c b/resources/utilities/ich9deblob/ich9deblob.c index 3fb7240..c12f758 100644 --- a/resources/utilities/ich9deblob/ich9deblob.c +++ b/resources/utilities/ich9deblob/ich9deblob.c @@ -87,6 +87,14 @@ int main(int argc, char *argv[]) return 1; } + // endianness check. big endian forced to fail + unsigned short steak = 0xBEEF; + unsigned char *grill = (char*)&steak; + if (*grill==0xBE) { + 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; + } + // ----------------------------------------------------------------------------------------------- // files that this utility will handle |