2 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/mpspec.h>
10 #include <asm/tables.h>
11 #include <asm/acpi_table.h>
13 u8 table_compute_checksum(void *v, int len)
19 for (i = 0; i < len; i++)
25 void table_fill_string(char *dest, const char *src, size_t n, char pad)
30 strncpy(dest, src, n);
32 /* Fill the remaining bytes with pad */
34 start = len < n ? len : n;
35 for (i = start; i < n; i++)
39 void write_tables(void)
41 u32 __maybe_unused rom_table_end = ROM_TABLE_ADDR;
43 #ifdef CONFIG_GENERATE_PIRQ_TABLE
44 rom_table_end = write_pirq_routing_table(rom_table_end);
45 rom_table_end = ALIGN(rom_table_end, 1024);
47 #ifdef CONFIG_GENERATE_SFI_TABLE
48 rom_table_end = write_sfi_table(rom_table_end);
49 rom_table_end = ALIGN(rom_table_end, 1024);
51 #ifdef CONFIG_GENERATE_MP_TABLE
52 rom_table_end = write_mp_table(rom_table_end);
53 rom_table_end = ALIGN(rom_table_end, 1024);
55 #ifdef CONFIG_GENERATE_ACPI_TABLE
56 rom_table_end = write_acpi_tables(rom_table_end);
57 rom_table_end = ALIGN(rom_table_end, 1024);