diff mbox

[U-Boot,04/12] x86: Change to use start/end address pair in write_tables()

Message ID 1456642686-18887-5-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit a5221b52064013137109e7aa659b661747f47e98
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng Feb. 28, 2016, 6:57 a.m. UTC
Add a new variable rom_table_start and pass it to ROM table write
routines. This reads better than previous single rom_table_end.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/lib/tables.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

Comments

Simon Glass Feb. 29, 2016, 4:19 a.m. UTC | #1
On 27 February 2016 at 23:57, Bin Meng <bmeng.cn@gmail.com> wrote:
> Add a new variable rom_table_start and pass it to ROM table write
> routines. This reads better than previous single rom_table_end.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/lib/tables.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng Feb. 29, 2016, 7:31 a.m. UTC | #2
On Mon, Feb 29, 2016 at 12:19 PM, Simon Glass <sjg@chromium.org> wrote:
> On 27 February 2016 at 23:57, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Add a new variable rom_table_start and pass it to ROM table write
>> routines. This reads better than previous single rom_table_end.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  arch/x86/lib/tables.c | 18 ++++++++++++------
>>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86/next, thanks!
diff mbox

Patch

diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c
index 14b15cf..fc6c0d8 100644
--- a/arch/x86/lib/tables.c
+++ b/arch/x86/lib/tables.c
@@ -39,26 +39,32 @@  void table_fill_string(char *dest, const char *src, size_t n, char pad)
 
 void write_tables(void)
 {
-	u32 __maybe_unused rom_table_end = ROM_TABLE_ADDR;
+	u32 __maybe_unused rom_table_start = ROM_TABLE_ADDR;
+	u32 __maybe_unused rom_table_end;
 
 #ifdef CONFIG_GENERATE_PIRQ_TABLE
-	rom_table_end = write_pirq_routing_table(rom_table_end);
+	rom_table_end = write_pirq_routing_table(rom_table_start);
 	rom_table_end = ALIGN(rom_table_end, 1024);
+	rom_table_start = rom_table_end;
 #endif
 #ifdef CONFIG_GENERATE_SFI_TABLE
-	rom_table_end = write_sfi_table(rom_table_end);
+	rom_table_end = write_sfi_table(rom_table_start);
 	rom_table_end = ALIGN(rom_table_end, 1024);
+	rom_table_start = rom_table_end;
 #endif
 #ifdef CONFIG_GENERATE_MP_TABLE
-	rom_table_end = write_mp_table(rom_table_end);
+	rom_table_end = write_mp_table(rom_table_start);
 	rom_table_end = ALIGN(rom_table_end, 1024);
+	rom_table_start = rom_table_end;
 #endif
 #ifdef CONFIG_GENERATE_ACPI_TABLE
-	rom_table_end = write_acpi_tables(rom_table_end);
+	rom_table_end = write_acpi_tables(rom_table_start);
 	rom_table_end = ALIGN(rom_table_end, 1024);
+	rom_table_start = rom_table_end;
 #endif
 #ifdef CONFIG_GENERATE_SMBIOS_TABLE
-	rom_table_end = write_smbios_table(rom_table_end);
+	rom_table_end = write_smbios_table(rom_table_start);
 	rom_table_end = ALIGN(rom_table_end, 1024);
+	rom_table_start = rom_table_end;
 #endif
 }