aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/x86/assembly_entry.S26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index ec3888fa43..86dbba4668 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -14,21 +14,35 @@
* GNU General Public License for more details.
*/
-#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
+#include <rules.h>
/*
- * This path is 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.
+ *Take the path where CAR_GLOBAL variables just need to be cleared when
+ * verstage runs directly after bootblock.
+ */
+#define ROMSTAGE_AFTER_VERSTAGE \
+ (IS_ENABLED(CONFIG_SEPARATE_VERSTAGE) && \
+ IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK) && ENV_ROMSTAGE)
+
+#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK) || ROMSTAGE_AFTER_VERSTAGE
+
+/*
+ * This path is for stages that are post bootblock when employing
+ * CONFIG_C_ENVIRONMENT_BOOTBLOCK or any intermediate stage succeeding
+ * the first stage to initialize protected mode. 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:
+/* _car_stack_end symbol is only valid when bootblock does CAR setup. */
+#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
/* reset stack pointer to CAR stack */
mov $_car_stack_end, %esp
+#endif
/* clear CAR_GLOBAL area as it is not shared */
cld