mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 23:06:15 +00:00
Change stub example to use asm-generic/sections.h
We can use the declarations of __bss_start and _end from this header instead of declaring them locally. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
e103b7ae90
commit
716cc8cc7f
4 changed files with 12 additions and 13 deletions
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
static inline unsigned long bss_start(void)
|
static inline unsigned long bss_start(void)
|
||||||
{
|
{
|
||||||
extern ulong __bss_start;
|
extern char __bss_start[];
|
||||||
return (unsigned long) &__bss_start;
|
return (unsigned long) &__bss_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ static inline unsigned long bss_end(void)
|
||||||
|
|
||||||
static inline unsigned long image_copy_end(void)
|
static inline unsigned long image_copy_end(void)
|
||||||
{
|
{
|
||||||
extern ulong __image_copy_end;
|
extern char __image_copy_end[];
|
||||||
return (unsigned long) &__image_copy_end;
|
return (unsigned long) &__image_copy_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
#define _U_BOOT_NDS32_H_ 1
|
#define _U_BOOT_NDS32_H_ 1
|
||||||
|
|
||||||
/* for the following variables, see start.S */
|
/* for the following variables, see start.S */
|
||||||
extern ulong __bss_start; /* BSS start relative to _start */
|
extern char __bss_start[]; /* BSS start relative to _start */
|
||||||
extern ulong __bss_end; /* BSS end relative to _start */
|
extern ulong __bss_end; /* BSS end relative to _start */
|
||||||
extern ulong _end; /* end of image relative to _start */
|
extern char _end[]; /* end of image relative to _start */
|
||||||
extern ulong _start; /* start of image relative to _start */
|
extern void _start(void); /* start of image relative to _start */
|
||||||
extern ulong _TEXT_BASE; /* code start */
|
extern ulong _TEXT_BASE; /* code start */
|
||||||
extern ulong IRQ_STACK_START; /* top of IRQ stack */
|
extern ulong IRQ_STACK_START; /* top of IRQ stack */
|
||||||
extern ulong FIQ_STACK_START; /* top of FIQ stack */
|
extern ulong FIQ_STACK_START; /* top of FIQ stack */
|
||||||
|
|
|
@ -25,13 +25,13 @@
|
||||||
#define _U_BOOT_I386_H_ 1
|
#define _U_BOOT_I386_H_ 1
|
||||||
|
|
||||||
/* Exports from the Linker Script */
|
/* Exports from the Linker Script */
|
||||||
extern ulong __text_start;
|
extern char __text_start[];
|
||||||
extern ulong __data_end;
|
extern ulong __data_end;
|
||||||
extern ulong __rel_dyn_start;
|
extern ulong __rel_dyn_start;
|
||||||
extern ulong __rel_dyn_end;
|
extern ulong __rel_dyn_end;
|
||||||
extern ulong __bss_start;
|
extern char __bss_start[];
|
||||||
extern ulong __bss_end;
|
extern ulong __bss_end;
|
||||||
extern ulong _end;
|
extern char _end[];
|
||||||
|
|
||||||
/* cpu/.../cpu.c */
|
/* cpu/.../cpu.c */
|
||||||
int x86_cpu_init_r(void);
|
int x86_cpu_init_r(void);
|
||||||
|
|
|
@ -217,16 +217,15 @@ void __attribute__((unused)) dummy(void)
|
||||||
#include <_exports.h>
|
#include <_exports.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
extern unsigned long __bss_start, _end;
|
#include <asm/sections.h>
|
||||||
|
|
||||||
void app_startup(char * const *argv)
|
void app_startup(char * const *argv)
|
||||||
{
|
{
|
||||||
unsigned char * cp = (unsigned char *) &__bss_start;
|
char *cp = __bss_start;
|
||||||
|
|
||||||
/* Zero out BSS */
|
/* Zero out BSS */
|
||||||
while (cp < (unsigned char *)&_end) {
|
while (cp < _end)
|
||||||
*cp++ = 0;
|
*cp++ = 0;
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(CONFIG_X86)
|
#if defined(CONFIG_X86)
|
||||||
/* x86 does not have a dedicated register for passing global_data */
|
/* x86 does not have a dedicated register for passing global_data */
|
||||||
|
|
Loading…
Add table
Reference in a new issue