summaryrefslogtreecommitdiff
path: root/arch/i386/include/asm
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:29 +1100
committerGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:29 +1100
commit161b3589ea19ad262a2eebbf7b4f10aeb6812f35 (patch)
tree0f25a9a4ded4cb28b5ee819f0fa403ee5bd95712 /arch/i386/include/asm
parent5a3876d2ac0aaaf16d50ce91b03c2030822da66f (diff)
x86: Place global data below stack before entering C
By reserving space for the Global Data immediately below the stack during assembly level initialisation, the C declaration of the static global data can be removed, along with the 'RAM Bootstrap' function. This results in cleaner code, and the ability to pass boot-up flags from assembler into C
Diffstat (limited to 'arch/i386/include/asm')
-rw-r--r--arch/i386/include/asm/global_data.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/arch/i386/include/asm/global_data.h b/arch/i386/include/asm/global_data.h
index 3a9adc9c66..456f606ec8 100644
--- a/arch/i386/include/asm/global_data.h
+++ b/arch/i386/include/asm/global_data.h
@@ -33,6 +33,8 @@
* Keep it *SMALL* and remember to set CONFIG_SYS_GBL_DATA_SIZE > sizeof(gd_t)
*/
+#ifndef __ASSEMBLY__
+
typedef struct {
bd_t *bd;
unsigned long flags;
@@ -49,6 +51,26 @@ typedef struct {
char env_buf[32]; /* buffer for getenv() before reloc. */
} gd_t;
+extern gd_t *gd;
+
+#endif
+
+/* Word Offsets into Global Data - MUST match struct gd_t */
+#define GD_BD 0
+#define GD_FLAGS 1
+#define GD_BAUDRATE 2
+#define GD_HAVE_CONSOLE 3
+#define GD_RELOC_OFF 4
+#define GD_ENV_ADDR 5
+#define GD_ENV_VALID 6
+#define GD_CPU_CLK 7
+#define GD_BUS_CLK 8
+#define GD_RAM_SIZE 9
+#define GD_RESET_STATUS 10
+#define GD_JT 11
+
+#define GD_SIZE 12
+
/*
* Global Data Flags
*/
@@ -61,8 +83,6 @@ typedef struct {
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
-extern gd_t *gd;
-
#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */