summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2011-12-23 17:22:05 -0700
committerPatrick Georgi <patrick@georgi-clan.de>2011-12-24 11:51:14 +0100
commitfe2f6b075ec0159b5308c90b69213d8c4543fbb6 (patch)
tree395216837b9c275564cbb9118800ac6b56438aca /payloads/libpayload/include
parent46404d75e4dc106268e1027a4828d8ea4f17f389 (diff)
Use convenience function to checksum
That coreboot uses the IP checksum is an artifact, not a deliberate requirement to be compatible with the Internet Protocole suite. Use a wrapper to abstract the computation of coreboot's checksum. Change-Id: I6491b9ba5efb9ffe5cb12a6172653a6ac80a1370 Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Reviewed-on: http://review.coreboot.org/497 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/coreboot_tables.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index 3b3b7d2299..574469a6ed 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -223,6 +223,11 @@ static inline u64 cb_unpack64(struct cbuint64 val)
return (((u64) val.hi) << 32) | val.lo;
}
+static inline u16 cb_checksum(const void *ptr, unsigned len)
+{
+ return ipchksum(ptr, len);
+}
+
/* Helpful macros */
#define MEM_RANGE_COUNT(_rec) \