From 1befb38b868248dda4e84a57aa779f7e8c0b85c0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 19 Aug 2016 01:23:21 +0200 Subject: x86: Move table csum into separate file We need the checksum function without all the other table functionality soon, so let's split it out into its own C file. Signed-off-by: Alexander Graf Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/lib/tables.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'arch/x86/lib/tables.c') diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c index f92111e4c8a..9ee6b5e9249 100644 --- a/arch/x86/lib/tables.c +++ b/arch/x86/lib/tables.c @@ -38,18 +38,6 @@ static table_write table_write_funcs[] = { #endif }; -u8 table_compute_checksum(void *v, int len) -{ - u8 *bytes = v; - u8 checksum = 0; - int i; - - for (i = 0; i < len; i++) - checksum -= bytes[i]; - - return checksum; -} - void table_fill_string(char *dest, const char *src, size_t n, char pad) { int start, len; -- cgit v1.2.3 From 4b6dddc294a58fd9010926719e5c907beebf9b4d Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 19 Aug 2016 01:23:23 +0200 Subject: x86: Move smbios generation into arch independent directory We will need the SMBIOS generation function on ARM as well going forward, so let's move it into a non arch specific location. Signed-off-by: Alexander Graf Reviewed-by: Bin Meng Reviewed-by: Simon Glass --- arch/x86/lib/tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/x86/lib/tables.c') diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c index 9ee6b5e9249..e62705af41c 100644 --- a/arch/x86/lib/tables.c +++ b/arch/x86/lib/tables.c @@ -5,9 +5,9 @@ */ #include +#include #include #include -#include #include #include #include -- cgit v1.2.3 From e824cf3fb5857ef452bb84018da854328d816514 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 19 Aug 2016 01:23:25 +0200 Subject: smbios: Allow compilation on 64bit systems The SMBIOS generation code passes pointers as u32. That causes the compiler to warn on casts to pointers. This patch moves all address pointers to uintptr_t instead. Technically u32 would be enough for the current SMBIOS2 style tables, but we may want to extend the code to SMBIOS3 in the future which is 64bit address capable. Signed-off-by: Alexander Graf Reviewed-by: Bin Meng Reviewed-by: Simon Glass --- arch/x86/lib/tables.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'arch/x86/lib/tables.c') diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c index e62705af41c..025b183d6bd 100644 --- a/arch/x86/lib/tables.c +++ b/arch/x86/lib/tables.c @@ -12,6 +12,11 @@ #include #include +static u32 write_smbios_table_wrapper(u32 addr) +{ + return write_smbios_table(addr); +} + /** * Function prototype to write a specific configuration table * @@ -34,7 +39,7 @@ static table_write table_write_funcs[] = { write_acpi_tables, #endif #ifdef CONFIG_GENERATE_SMBIOS_TABLE - write_smbios_table, + write_smbios_table_wrapper, #endif }; -- cgit v1.2.3