aboutsummaryrefslogtreecommitdiff
path: root/libflash/ecc.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-02-24 08:58:50 +0800
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-02-26 16:32:02 +1100
commit8d2eacb522bbd2cfbc982b68d349d3257ba1e2f2 (patch)
treec9b75a89efa6a5e73426279ef34f4f6e0d240e61 /libflash/ecc.h
parent7c4cea4a1690489233a14c2df01ddcc8f8e9ff8b (diff)
downloadskiboot-8d2eacb522bbd2cfbc982b68d349d3257ba1e2f2.zip
skiboot-8d2eacb522bbd2cfbc982b68d349d3257ba1e2f2.tar.gz
skiboot-8d2eacb522bbd2cfbc982b68d349d3257ba1e2f2.tar.bz2
libflash: Remove dependencies on skiboot.h header
libflash should be compilable without the skiboot definitions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-By: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/ecc.h')
-rw-r--r--libflash/ecc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libflash/ecc.h b/libflash/ecc.h
index d5c30cb..581886f 100644
--- a/libflash/ecc.h
+++ b/libflash/ecc.h
@@ -20,7 +20,6 @@
#define __ECC_H
#include <stdint.h>
-#include <skiboot.h>
/* Bit field identifiers for syndrome calculations. */
enum eccbitfields
@@ -45,6 +44,10 @@ extern uint8_t eccmemcpy(uint64_t *dst, uint64_t *src, uint32_t len);
* We add 1 byte of ecc for every 8 bytes of data. So we need to round up to 8
* bytes length and then add 1/8
*/
+#ifndef ALIGN_UP
+#define ALIGN_UP(_v, _a) (((_v) + (_a) - 1) & ~((_a) - 1))
+#endif
+
#define ECC_SIZE(len) (ALIGN_UP((len), 8) >> 3)
#define ECC_BUFFER_SIZE(len) (ALIGN_UP((len), 8) + ECC_SIZE(len))
#define ECC_BUFFER_SIZE_CHECK(len) ((len) % 9)