Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13878
-gerrit
commit 0b7b74ed73125eff6e01f68156d6c2cd391ab4e5
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 2 13:42:57 2016 -0600
cpu/x86/16bit/reset16: remove stale 32-bit jump
Patrick at least indicated this jump after the reset
vector jump was a remnant from some construct used long
ago in the project. It's not longer used (nor could I find
where it was). Therefore, remove it.
Change-Id: I31512c66a9144267739b08d5f9659c4fcde1b794
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/cpu/x86/16bit/reset16.inc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/cpu/x86/16bit/reset16.inc b/src/cpu/x86/16bit/reset16.inc
index 33712d1..2220aab 100644
--- a/src/cpu/x86/16bit/reset16.inc
+++ b/src/cpu/x86/16bit/reset16.inc
@@ -10,7 +10,4 @@ reset_vector:
* instead of the weird 16 bit relocations that binutils does not
* handle consistenly between versions because they are used so rarely.
*/
- .org 0x8;
- .code32
- jmp protected_start
.previous
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13861
-gerrit
commit 79f57861731776ca7444350f9d87451e3bb260a5
Author: Andrey Petrov <andrey.petrov(a)intel.com>
Date: Sun Feb 28 22:37:15 2016 -0800
arch/x86: Add common assembly code for stages that run in CAR
This adds a few assembly lines that are generic enough to be shared
between romstage and verstage that are ran in CAR. The GDT reload
is bypassed and the stack is reloaded with the CAR stack defined
in car.ld. The entry point for all those stages is car_stage_entry().
Change-Id: Ie7ef6a02f62627f29a109126d08c68176075bd67
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/assembly_entry.S | 45 ++++++++++++++++++++++++++++++++++++++++-
src/arch/x86/include/arch/cpu.h | 7 +++++++
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index 01e91b0..8a13189 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -1,7 +1,8 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
+ * Copyright 2016 Google Inc.
+ * Copyright (C) 2016 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,6 +14,8 @@
* GNU General Public License for more details.
*/
+#if !IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
+
/* This file assembles the start of the romstage program by the order of the
* includes. Thus, it's extremely important that one pays very careful
* attention to the order of the includes. */
@@ -31,3 +34,43 @@
* cache-as-ram setup files would be here.
*/
#include <generated/assembly.inc>
+
+#else
+
+/*
+ * This path for stages that post bootblock when employing
+ * CONFIG_C_ENVIRONMENT_BOOTBLOCK. There's no need to re-load the gdt, etc
+ * as all those settings are cached within the processor. In order to
+ * continue with C code execution one needs to set stack pointer and clear
+ * CAR_GLOBAL variables that are stage specific.
+ */
+.section ".text._start", "ax", @progbits
+.global _start
+_start:
+
+ /*
+ * This code is meant to be used for stages that are ran in CAR.
+ * The assumption is that gdt is already loaded. So in order to
+ * continue with C code execution we needed to set stack pointer
+ * and clear CAR_GLOBAL variables that are stage-specific.
+ */
+
+ /* reset stack pointer to CAR stack */
+ mov $_car_stack_end, %esp
+
+ /* clear CAR_GLOBAL area as it is not shared */
+ cld
+ xor %eax, %eax
+ movl $(_car_global_end), %ecx
+ movl $(_car_global_start), %edi
+ sub %edi, %ecx
+ rep stosl
+
+ jmp car_stage_entry
+
+/* This is here for linking purposes. */
+.weak car_stage_entry
+car_stage_entry:
+1:
+ jmp 1b
+#endif
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 408fa15..c7f2d44 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -239,4 +239,11 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
#define asmlinkage __attribute__((regparm(0)))
#define alwaysinline inline __attribute__((always_inline))
+/*
+ * When using CONFIG_C_ENVIRONMENT_BOOTBLOCK the car_stage_entry()
+ * is the symbol jumped to for each stage after bootblock using
+ * cache-as-ram.
+ */
+void asmlinkage car_stage_entry(void);
+
#endif /* ARCH_CPU_H */
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13882
-gerrit
commit 161ac6e9a1df33c1797b65d1da862898ecfdafde
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 2 15:26:10 2016 -0600
arch/x86: always use _start as entry symbol for all stages
Instead of keeping track of all the combinations of entry points
depending on the stage and other options just use _start. That way,
there's no need to update the arch/header.ld for complicated cases
as _start is always the entry point for a stage.
Change-Id: I7795a5ee1caba92ab533bdb8c3ad80294901a48b
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/include/arch/header.ld | 23 -----------------------
src/cpu/x86/32bit/entry32.inc | 12 ++++++++++--
2 files changed, 10 insertions(+), 25 deletions(-)
diff --git a/src/arch/x86/include/arch/header.ld b/src/arch/x86/include/arch/header.ld
index d7fbf07..77eb187 100644
--- a/src/arch/x86/include/arch/header.ld
+++ b/src/arch/x86/include/arch/header.ld
@@ -20,27 +20,4 @@ PHDRS
to_load PT_LOAD;
}
-/*
- * For CONFIG_SEPARATE_VERSTAGE romstage doesn't have the cache-as-ram setup.
- * It only contains the teardown code. The verstage has the cache-as-ram setup
- * code. Therefore, it needs the protected_start symbol as its entry point.
- * The romstage entry will be named _start for consistency, but it's likely
- * to be implemented in the chipset code in order to control the logic flow.
- */
-#if IS_ENABLED(CONFIG_SEPARATE_VERSTAGE)
- #if ENV_RAMSTAGE || ENV_RMODULE || ENV_ROMSTAGE
- ENTRY(_start)
- #elif ENV_VERSTAGE
- ENTRY(protected_start)
- #endif
-#else
- #if ENV_RAMSTAGE || ENV_RMODULE
- ENTRY(_start)
- #elif ENV_ROMSTAGE
- ENTRY(protected_start)
- #endif
-#endif
-
-#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK) && ENV_BOOTBLOCK
ENTRY(_start)
-#endif
diff --git a/src/cpu/x86/32bit/entry32.inc b/src/cpu/x86/32bit/entry32.inc
index 9ef3bc1..8c39008 100644
--- a/src/cpu/x86/32bit/entry32.inc
+++ b/src/cpu/x86/32bit/entry32.inc
@@ -2,6 +2,7 @@
#include <arch/rom_segs.h>
#include <cpu/x86/post_code.h>
+#include <rules.h>
.code32
@@ -44,10 +45,17 @@ gdt_end:
*
* NOTE aligned to 4 so that we are sure that the prefetch
* cache will be reloaded.
+ *
+ * In the bootblock there is already a ljmp to __protected_start and
+ * the reset vector jumps to symbol _start16bit in entry16.inc from
+ * the reset vectors's symbol which is _start. Therefore, don't
+ * expose the _start symbol for bootblock.
*/
.align 4
-.globl protected_start
-protected_start:
+#if !ENV_BOOTBLOCK
+.globl _start
+_start:
+#endif
lgdt %cs:gdtptr
ljmp $ROM_CODE_SEG, $__protected_start
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13881
-gerrit
commit a971ee08d8f9259b81acebd9a70d0a9d8caf2a71
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 2 15:13:12 2016 -0600
arch/x86: rename reset_vector -> _start
In order to align the entry points for the various stages
on x86 to _start one needs to rename the reset_vector symbol.
The section is the same; it's just a symbol change.
Change-Id: I0e6bbf1da04a6e248781a9c222a146725c34268a
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/failover.ld | 2 +-
src/arch/x86/include/arch/header.ld | 2 +-
src/cpu/x86/16bit/reset16.inc | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/arch/x86/failover.ld b/src/arch/x86/failover.ld
index c8c00bb..e9613d9 100644
--- a/src/arch/x86/failover.ld
+++ b/src/arch/x86/failover.ld
@@ -14,7 +14,7 @@
* GNU General Public License for more details.
*/
-ENTRY(reset_vector)
+ENTRY(_start)
MEMORY {
rom : ORIGIN = 0xffff0000, LENGTH = 64K
diff --git a/src/arch/x86/include/arch/header.ld b/src/arch/x86/include/arch/header.ld
index 89cb6de..d7fbf07 100644
--- a/src/arch/x86/include/arch/header.ld
+++ b/src/arch/x86/include/arch/header.ld
@@ -42,5 +42,5 @@ PHDRS
#endif
#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK) && ENV_BOOTBLOCK
-ENTRY(reset_vector)
+ENTRY(_start)
#endif
diff --git a/src/cpu/x86/16bit/reset16.inc b/src/cpu/x86/16bit/reset16.inc
index d99f0b1..48cb275 100644
--- a/src/cpu/x86/16bit/reset16.inc
+++ b/src/cpu/x86/16bit/reset16.inc
@@ -1,7 +1,7 @@
.section ".reset", "ax", %progbits
.code16
-.globl reset_vector
-reset_vector:
+.globl _start
+_start:
.byte 0xe9
.int _start16bit - ( . + 2 )
/* Note: The above jump is hand coded to work around bugs in binutils.
Andrey Petrov (andrey.petrov(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13880
-gerrit
commit 7912d4c7d7061e838ec239c14fa019109745257d
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 2 14:47:37 2016 -0600
cpu/x86/16bit: rename _start -> _start16bit
In order to avoid collisions with other _start symbols while
grepping and future ones be explicit about which _start this
one is: the 16-bit one only used by the reset vector in the
bootblock.
Change-Id: I6d7580596c0e6602a87fb158633ce9d45910cec2
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/cpu/x86/16bit/entry16.inc | 16 ++++++++--------
src/cpu/x86/16bit/reset16.inc | 2 +-
src/cpu/x86/16bit/reset16.ld | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/cpu/x86/16bit/entry16.inc b/src/cpu/x86/16bit/entry16.inc
index abaf671..be5b730 100644
--- a/src/cpu/x86/16bit/entry16.inc
+++ b/src/cpu/x86/16bit/entry16.inc
@@ -29,10 +29,10 @@
#include <arch/rom_segs.h>
.code16
-.globl _start
-.type _start, @function
+.globl _start16bit
+.type _start16bit, @function
-_start:
+_start16bit:
cli
/* Save the BIST result */
movl %eax, %ebp
@@ -80,12 +80,12 @@ _start:
* The criteria for relocation have been relaxed to their
* utmost, so that we can use the same code for both
* our initial entry point and startup of the second cpu.
- * The code assumes when executing at _start that:
- * (((cs & 0xfff) == 0) and (ip == _start & 0xffff))
+ * The code assumes when executing at _start16bit that:
+ * (((cs & 0xfff) == 0) and (ip == _start16bit & 0xffff))
* or
* ((cs == anything) and (ip == 0)).
*
- * The restrictions in reset16.inc mean that _start initially
+ * The restrictions in reset16.inc mean that _start16bit initially
* must be loaded at or above 0xffff0000 or below 0x100000.
*
* The linker scripts computes gdtptr16_offset by simply returning
@@ -136,6 +136,6 @@ nullidt:
.long 0
.word 0
-.globl _estart
-_estart:
+.globl _estart16bit
+_estart16bit:
.code32
diff --git a/src/cpu/x86/16bit/reset16.inc b/src/cpu/x86/16bit/reset16.inc
index ebc3d4c..d99f0b1 100644
--- a/src/cpu/x86/16bit/reset16.inc
+++ b/src/cpu/x86/16bit/reset16.inc
@@ -3,7 +3,7 @@
.globl reset_vector
reset_vector:
.byte 0xe9
- .int _start - ( . + 2 )
+ .int _start16bit - ( . + 2 )
/* Note: The above jump is hand coded to work around bugs in binutils.
* 5 byte are used for a 3 byte instruction. This works because x86
* is little endian and allows us to use supported 32bit relocations
diff --git a/src/cpu/x86/16bit/reset16.ld b/src/cpu/x86/16bit/reset16.ld
index 1730992..d96755e 100644
--- a/src/cpu/x86/16bit/reset16.ld
+++ b/src/cpu/x86/16bit/reset16.ld
@@ -5,7 +5,7 @@
SECTIONS {
/* Trigger an error if I have an unuseable start address */
- _bogus = ASSERT(_start >= 0xffff0000, "_start too low. Please report.");
+ _bogus = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report.");
_ROMTOP = 0xfffffff0;
. = _ROMTOP;
.reset . : {
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13861
-gerrit
commit e58a2510f7a334974c9386cb0115bc8f4a398f99
Author: Andrey Petrov <andrey.petrov(a)intel.com>
Date: Sun Feb 28 22:37:15 2016 -0800
arch/x86: Add common assembly code for stages that run in CAR
This adds a few assembly lines that are generic enough to be shared
between romstage and verstage that are ran in CAR. The GDT reload
is bypassed and the stack is reloaded with the CAR stack defined
in car.ld. The entry point for all those stages is car_stage_entry().
Change-Id: Ie7ef6a02f62627f29a109126d08c68176075bd67
Signed-off-by: Andrey Petrov <andrey.petrov(a)intel.com>
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/assembly_entry.S | 45 ++++++++++++++++++++++++++++++++++++++++-
src/arch/x86/include/arch/cpu.h | 7 +++++++
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index 01e91b0..8a13189 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -1,7 +1,8 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
+ * Copyright 2016 Google Inc.
+ * Copyright (C) 2016 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,6 +14,8 @@
* GNU General Public License for more details.
*/
+#if !IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
+
/* This file assembles the start of the romstage program by the order of the
* includes. Thus, it's extremely important that one pays very careful
* attention to the order of the includes. */
@@ -31,3 +34,43 @@
* cache-as-ram setup files would be here.
*/
#include <generated/assembly.inc>
+
+#else
+
+/*
+ * This path for stages that post bootblock when employing
+ * CONFIG_C_ENVIRONMENT_BOOTBLOCK. There's no need to re-load the gdt, etc
+ * as all those settings are cached within the processor. In order to
+ * continue with C code execution one needs to set stack pointer and clear
+ * CAR_GLOBAL variables that are stage specific.
+ */
+.section ".text._start", "ax", @progbits
+.global _start
+_start:
+
+ /*
+ * This code is meant to be used for stages that are ran in CAR.
+ * The assumption is that gdt is already loaded. So in order to
+ * continue with C code execution we needed to set stack pointer
+ * and clear CAR_GLOBAL variables that are stage-specific.
+ */
+
+ /* reset stack pointer to CAR stack */
+ mov $_car_stack_end, %esp
+
+ /* clear CAR_GLOBAL area as it is not shared */
+ cld
+ xor %eax, %eax
+ movl $(_car_global_end), %ecx
+ movl $(_car_global_start), %edi
+ sub %edi, %ecx
+ rep stosl
+
+ jmp car_stage_entry
+
+/* This is here for linking purposes. */
+.weak car_stage_entry
+car_stage_entry:
+1:
+ jmp 1b
+#endif
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 408fa15..c7f2d44 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -239,4 +239,11 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
#define asmlinkage __attribute__((regparm(0)))
#define alwaysinline inline __attribute__((always_inline))
+/*
+ * When using CONFIG_C_ENVIRONMENT_BOOTBLOCK the car_stage_entry()
+ * is the symbol jumped to for each stage after bootblock using
+ * cache-as-ram.
+ */
+void asmlinkage car_stage_entry(void);
+
#endif /* ARCH_CPU_H */
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13882
-gerrit
commit b4f2e69b8f391e9c6e5e01b8909415027dd0c5c9
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 2 15:26:10 2016 -0600
arch/x86: always use _start as entry symbol for all stages
Instead of keeping track of all the combinations of entry points
depending on the stage and other options just use _start. That way,
there's no need to update the arch/header.ld for complicated cases
as _start is always the entry point for a stage.
Change-Id: I7795a5ee1caba92ab533bdb8c3ad80294901a48b
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/include/arch/header.ld | 23 -----------------------
src/cpu/x86/32bit/entry32.inc | 12 ++++++++++--
2 files changed, 10 insertions(+), 25 deletions(-)
diff --git a/src/arch/x86/include/arch/header.ld b/src/arch/x86/include/arch/header.ld
index d7fbf07..77eb187 100644
--- a/src/arch/x86/include/arch/header.ld
+++ b/src/arch/x86/include/arch/header.ld
@@ -20,27 +20,4 @@ PHDRS
to_load PT_LOAD;
}
-/*
- * For CONFIG_SEPARATE_VERSTAGE romstage doesn't have the cache-as-ram setup.
- * It only contains the teardown code. The verstage has the cache-as-ram setup
- * code. Therefore, it needs the protected_start symbol as its entry point.
- * The romstage entry will be named _start for consistency, but it's likely
- * to be implemented in the chipset code in order to control the logic flow.
- */
-#if IS_ENABLED(CONFIG_SEPARATE_VERSTAGE)
- #if ENV_RAMSTAGE || ENV_RMODULE || ENV_ROMSTAGE
- ENTRY(_start)
- #elif ENV_VERSTAGE
- ENTRY(protected_start)
- #endif
-#else
- #if ENV_RAMSTAGE || ENV_RMODULE
- ENTRY(_start)
- #elif ENV_ROMSTAGE
- ENTRY(protected_start)
- #endif
-#endif
-
-#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK) && ENV_BOOTBLOCK
ENTRY(_start)
-#endif
diff --git a/src/cpu/x86/32bit/entry32.inc b/src/cpu/x86/32bit/entry32.inc
index 9ef3bc1..8c39008 100644
--- a/src/cpu/x86/32bit/entry32.inc
+++ b/src/cpu/x86/32bit/entry32.inc
@@ -2,6 +2,7 @@
#include <arch/rom_segs.h>
#include <cpu/x86/post_code.h>
+#include <rules.h>
.code32
@@ -44,10 +45,17 @@ gdt_end:
*
* NOTE aligned to 4 so that we are sure that the prefetch
* cache will be reloaded.
+ *
+ * In the bootblock there is already a ljmp to __protected_start and
+ * the reset vector jumps to symbol _start16bit in entry16.inc from
+ * the reset vectors's symbol which is _start. Therefore, don't
+ * expose the _start symbol for bootblock.
*/
.align 4
-.globl protected_start
-protected_start:
+#if !ENV_BOOTBLOCK
+.globl _start
+_start:
+#endif
lgdt %cs:gdtptr
ljmp $ROM_CODE_SEG, $__protected_start
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13881
-gerrit
commit bdafc05cb2bf49897adeb86f69aa5e86e219b6fe
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 2 15:13:12 2016 -0600
arch/x86: rename reset_vector -> _start
In order to align the entry points for the various stages
on x86 to _start one needs to rename the reset_vector symbol.
The section is the same; it's just a symbol change.
Change-Id: I0e6bbf1da04a6e248781a9c222a146725c34268a
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/failover.ld | 2 +-
src/arch/x86/include/arch/header.ld | 2 +-
src/cpu/x86/16bit/reset16.inc | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/arch/x86/failover.ld b/src/arch/x86/failover.ld
index c8c00bb..e9613d9 100644
--- a/src/arch/x86/failover.ld
+++ b/src/arch/x86/failover.ld
@@ -14,7 +14,7 @@
* GNU General Public License for more details.
*/
-ENTRY(reset_vector)
+ENTRY(_start)
MEMORY {
rom : ORIGIN = 0xffff0000, LENGTH = 64K
diff --git a/src/arch/x86/include/arch/header.ld b/src/arch/x86/include/arch/header.ld
index 89cb6de..d7fbf07 100644
--- a/src/arch/x86/include/arch/header.ld
+++ b/src/arch/x86/include/arch/header.ld
@@ -42,5 +42,5 @@ PHDRS
#endif
#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK) && ENV_BOOTBLOCK
-ENTRY(reset_vector)
+ENTRY(_start)
#endif
diff --git a/src/cpu/x86/16bit/reset16.inc b/src/cpu/x86/16bit/reset16.inc
index d99f0b1..48cb275 100644
--- a/src/cpu/x86/16bit/reset16.inc
+++ b/src/cpu/x86/16bit/reset16.inc
@@ -1,7 +1,7 @@
.section ".reset", "ax", %progbits
.code16
-.globl reset_vector
-reset_vector:
+.globl _start
+_start:
.byte 0xe9
.int _start16bit - ( . + 2 )
/* Note: The above jump is hand coded to work around bugs in binutils.
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13880
-gerrit
commit 57e02e15c6b02687e18b6f6ab04d833ae64e2166
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 2 14:47:37 2016 -0600
cpu/x86/16bit: rename _start -> _start16bit
In order to avoid collisions with other _start symbols while
grepping and future ones be explicit about which _start this
one is: the 16-bit one only used by the reset vector in the
bootblock.
Change-Id: I6d7580596c0e6602a87fb158633ce9d45910cec2
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/cpu/x86/16bit/entry16.inc | 16 ++++++++--------
src/cpu/x86/16bit/reset16.inc | 2 +-
src/cpu/x86/16bit/reset16.ld | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/cpu/x86/16bit/entry16.inc b/src/cpu/x86/16bit/entry16.inc
index abaf671..be5b730 100644
--- a/src/cpu/x86/16bit/entry16.inc
+++ b/src/cpu/x86/16bit/entry16.inc
@@ -29,10 +29,10 @@
#include <arch/rom_segs.h>
.code16
-.globl _start
-.type _start, @function
+.globl _start16bit
+.type _start16bit, @function
-_start:
+_start16bit:
cli
/* Save the BIST result */
movl %eax, %ebp
@@ -80,12 +80,12 @@ _start:
* The criteria for relocation have been relaxed to their
* utmost, so that we can use the same code for both
* our initial entry point and startup of the second cpu.
- * The code assumes when executing at _start that:
- * (((cs & 0xfff) == 0) and (ip == _start & 0xffff))
+ * The code assumes when executing at _start16bit that:
+ * (((cs & 0xfff) == 0) and (ip == _start16bit & 0xffff))
* or
* ((cs == anything) and (ip == 0)).
*
- * The restrictions in reset16.inc mean that _start initially
+ * The restrictions in reset16.inc mean that _start16bit initially
* must be loaded at or above 0xffff0000 or below 0x100000.
*
* The linker scripts computes gdtptr16_offset by simply returning
@@ -136,6 +136,6 @@ nullidt:
.long 0
.word 0
-.globl _estart
-_estart:
+.globl _estart16bit
+_estart16bit:
.code32
diff --git a/src/cpu/x86/16bit/reset16.inc b/src/cpu/x86/16bit/reset16.inc
index ebc3d4c..d99f0b1 100644
--- a/src/cpu/x86/16bit/reset16.inc
+++ b/src/cpu/x86/16bit/reset16.inc
@@ -3,7 +3,7 @@
.globl reset_vector
reset_vector:
.byte 0xe9
- .int _start - ( . + 2 )
+ .int _start16bit - ( . + 2 )
/* Note: The above jump is hand coded to work around bugs in binutils.
* 5 byte are used for a 3 byte instruction. This works because x86
* is little endian and allows us to use supported 32bit relocations
diff --git a/src/cpu/x86/16bit/reset16.ld b/src/cpu/x86/16bit/reset16.ld
index 1730992..d96755e 100644
--- a/src/cpu/x86/16bit/reset16.ld
+++ b/src/cpu/x86/16bit/reset16.ld
@@ -5,7 +5,7 @@
SECTIONS {
/* Trigger an error if I have an unuseable start address */
- _bogus = ASSERT(_start >= 0xffff0000, "_start too low. Please report.");
+ _bogus = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report.");
_ROMTOP = 0xfffffff0;
. = _ROMTOP;
.reset . : {