aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-11-08 19:59:16 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-20 20:35:24 -0600
commit2ee9d0560f7d2ef6d3b88ff56384f72cf2ada583 (patch)
treec9089e876015485a644c2a120a2e6c896ed4cdc4 /libflash
parent6c83380260ce318a07b209d44df55cac3e0b912f (diff)
downloadskiboot-2ee9d0560f7d2ef6d3b88ff56384f72cf2ada583.zip
skiboot-2ee9d0560f7d2ef6d3b88ff56384f72cf2ada583.tar.gz
skiboot-2ee9d0560f7d2ef6d3b88ff56384f72cf2ada583.tar.bz2
libflash: Fix parity calculation on ARM
To calculate the ECC syndrome we need to calculate the parity of a 64bit number. On non-powerpc platforms we use the gcc builtin function __builtin_parityl() to do this calculation. This is broken on 32bit ARM where sizeof(unsigned long) is four bytes. Using __builtin_parityll() instead cures this. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/ecc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libflash/ecc.c b/libflash/ecc.c
index 0be80b1..0fbd30b 100644
--- a/libflash/ecc.c
+++ b/libflash/ecc.c
@@ -121,7 +121,7 @@ static uint8_t parity(uint64_t data)
return p;
#else
- return __builtin_parityl(data);
+ return __builtin_parityll(data);
#endif
}