From 94d3b1b5d1fc30bd7b63af9d07cb8db89a5f4868 Mon Sep 17 00:00:00 2001 From: "kaihuan.pkh" Date: Mon, 18 Nov 2019 20:08:36 +0800 Subject: support smbios alloc buffer in fseg memory and fill it with smbios anchor and tables which read from the fw_cfg, then check type0 table and rebuild it if it's not exist. mainly inspired by the seabios, and borrowed some code from it. Reviewed-by: Ben Luo Signed-off-by: kaihuan.pkh --- string.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 8d1cb7a..e3ebfa7 100644 --- a/string.c +++ b/string.c @@ -132,3 +132,11 @@ long atol(const char *ptr) return acc; } + +uint8_t csum8(uint8_t *buf, uint32_t len) +{ + uint32_t s = 0; + while (len-- > 0) + s += *buf++; + return s; +} -- cgit v1.1