x86: Remove usage of %ebp as a return pointer
Using %ebp as a return pointer prevents creating 'load anywhere' images
This commit is contained in:
parent
00940a229d
commit
88fa0a6eb9
@ -517,7 +517,7 @@ bad_ram:
|
|||||||
jmp bad_reint
|
jmp bad_reint
|
||||||
|
|
||||||
dram_done:
|
dram_done:
|
||||||
jmp *%ebp
|
jmp mem_init_ret
|
||||||
|
|
||||||
#if CONFIG_SYS_SDRAM_ECC_ENABLE
|
#if CONFIG_SYS_SDRAM_ECC_ENABLE
|
||||||
.globl init_ecc
|
.globl init_ecc
|
||||||
@ -562,7 +562,7 @@ set_ecc:
|
|||||||
movb %al,(%edi)
|
movb %al,(%edi)
|
||||||
|
|
||||||
out:
|
out:
|
||||||
jmp *%ebp
|
jmp init_ecc_ret
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -607,4 +607,4 @@ bank3: movl (%edi), %eax
|
|||||||
|
|
||||||
done:
|
done:
|
||||||
movl %ebx, %eax
|
movl %ebx, %eax
|
||||||
jmp *%ebp
|
jmp get_mem_size_ret
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* U-boot - i386 Startup Code
|
* U-boot - i386 Startup Code
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002 Omicron Ceti AB, Daniel Engström <denaiel@omicron.se>
|
* Copyright (c) 2002 Omicron Ceti AB, Daniel Engstr<EFBFBD>m <denaiel@omicron.se>
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* See file CREDITS for list of people who contributed to this
|
||||||
* project.
|
* project.
|
||||||
@ -79,18 +79,18 @@ _start:
|
|||||||
* to store the return address */
|
* to store the return address */
|
||||||
|
|
||||||
/* Early platform init (setup gpio, etc ) */
|
/* Early platform init (setup gpio, etc ) */
|
||||||
mov $early_board_init_ret, %ebp
|
|
||||||
jmp early_board_init
|
jmp early_board_init
|
||||||
|
.globl early_board_init_ret
|
||||||
early_board_init_ret:
|
early_board_init_ret:
|
||||||
|
|
||||||
/* size memory */
|
/* size memory */
|
||||||
mov $mem_init_ret, %ebp
|
|
||||||
jmp mem_init
|
jmp mem_init
|
||||||
|
.globl mem_init_ret
|
||||||
mem_init_ret:
|
mem_init_ret:
|
||||||
|
|
||||||
/* fetch memory size (into %eax) */
|
/* fetch memory size (into %eax) */
|
||||||
mov $get_mem_size_ret, %ebp
|
|
||||||
jmp get_mem_size
|
jmp get_mem_size
|
||||||
|
.globl get_mem_size_ret
|
||||||
get_mem_size_ret:
|
get_mem_size_ret:
|
||||||
|
|
||||||
#if CONFIG_SYS_SDRAM_ECC_ENABLE
|
#if CONFIG_SYS_SDRAM_ECC_ENABLE
|
||||||
@ -98,9 +98,9 @@ get_mem_size_ret:
|
|||||||
movl %ebx, %ecx
|
movl %ebx, %ecx
|
||||||
andl $GD_FLG_COLD_BOOT, %ecx
|
andl $GD_FLG_COLD_BOOT, %ecx
|
||||||
jz init_ecc_ret
|
jz init_ecc_ret
|
||||||
mov $init_ecc_ret, %ebp
|
|
||||||
jmp init_ecc
|
jmp init_ecc
|
||||||
|
|
||||||
|
.globl init_ecc_ret
|
||||||
init_ecc_ret:
|
init_ecc_ret:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ mem_ok:
|
|||||||
pushl $0
|
pushl $0
|
||||||
popl %eax
|
popl %eax
|
||||||
cmpl $0, %eax
|
cmpl $0, %eax
|
||||||
jne no_stack
|
jne die
|
||||||
push $0x55aa55aa
|
push $0x55aa55aa
|
||||||
popl %ebx
|
popl %ebx
|
||||||
cmpl $0x55aa55aa, %ebx
|
cmpl $0x55aa55aa, %ebx
|
||||||
|
@ -35,8 +35,8 @@ start16:
|
|||||||
* First we let the BSP do some early initialization
|
* First we let the BSP do some early initialization
|
||||||
* this code have to map the flash to its final position
|
* this code have to map the flash to its final position
|
||||||
*/
|
*/
|
||||||
mov $board_init16_ret, %bp
|
|
||||||
jmp board_init16
|
jmp board_init16
|
||||||
|
.globl board_init16_ret
|
||||||
board_init16_ret:
|
board_init16_ret:
|
||||||
|
|
||||||
/* Turn of cache (this might require a 486-class CPU) */
|
/* Turn of cache (this might require a 486-class CPU) */
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
.globl early_board_init
|
.globl early_board_init
|
||||||
early_board_init:
|
early_board_init:
|
||||||
/* No 32-bit board specific initialisation */
|
/* No 32-bit board specific initialisation */
|
||||||
jmp *%ebp /* return to caller */
|
jmp early_board_init_ret
|
||||||
|
|
||||||
.globl cpu_halt_asm
|
.globl cpu_halt_asm
|
||||||
cpu_halt_asm:
|
cpu_halt_asm:
|
||||||
|
@ -65,8 +65,7 @@ board_init16:
|
|||||||
movl $0x000000cb, %eax
|
movl $0x000000cb, %eax
|
||||||
outl %eax, %dx
|
outl %eax, %dx
|
||||||
|
|
||||||
/* the return address is stored in bp */
|
jmp board_init16_ret
|
||||||
jmp *%bp
|
|
||||||
|
|
||||||
.section .bios, "ax"
|
.section .bios, "ax"
|
||||||
.code16
|
.code16
|
||||||
|
Loading…
Reference in New Issue
Block a user