summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-10-09 12:00:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-10-09 12:00:43 +0200
commit51b6c199f3d26a027249724c11b4c15e848c3adb (patch)
tree4cf58847337ce7e5cd169388531b18823562be0d /include
parent8a8f9455e2120910b0f97cd7487f8b46ea714ac1 (diff)
parentdd2132e72bceb57ad1781668dc7d9c87dc1f826d (diff)
downloadbarebox-51b6c199f3d26a027249724c11b4c15e848c3adb.tar.gz
barebox-51b6c199f3d26a027249724c11b4c15e848c3adb.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'include')
-rw-r--r--include/common.h10
-rw-r--r--include/digest.h8
2 files changed, 17 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h
index abbe73fd36..f52c7e430c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -157,4 +157,14 @@ static inline bool region_overlap(unsigned long starta, unsigned long lena,
return 1;
}
+static inline bool lregion_overlap(loff_t starta, loff_t lena,
+ loff_t startb, loff_t lenb)
+{
+ if (starta + lena <= startb)
+ return 0;
+ if (startb + lenb <= starta)
+ return 0;
+ return 1;
+}
+
#endif /* __COMMON_H_ */
diff --git a/include/digest.h b/include/digest.h
index 4552e58255..a1cdbb2d7a 100644
--- a/include/digest.h
+++ b/include/digest.h
@@ -28,10 +28,10 @@ enum hash_algo {
HASH_ALGO_MD5,
HASH_ALGO_SHA1,
HASH_ALGO_RIPE_MD_160,
- HASH_ALGO_SHA224,
HASH_ALGO_SHA256,
HASH_ALGO_SHA384,
HASH_ALGO_SHA512,
+ HASH_ALGO_SHA224,
HASH_ALGO_RIPE_MD_128,
HASH_ALGO_RIPE_MD_256,
HASH_ALGO_RIPE_MD_320,
@@ -41,6 +41,12 @@ enum hash_algo {
HASH_ALGO_TGR_128,
HASH_ALGO_TGR_160,
HASH_ALGO_TGR_192,
+ HASH_ALGO_SM3_256,
+ /*
+ * The above are exported from the Kernel as
+ * /usr/include/linux/hash_info.h and thus have a fixed number, do not
+ * change it. Below are barebox specific, subject to renumbering.
+ */
HASH_ALGO_CRC32,
HASH_ALGO__LAST
};