MIPS: add support for pre-relocation malloc
Implement MIPS specific setup of the gd_t structure to support pre-relocation malloc. If CONFIG_SYS_MALLOC_F_LEN is specified, a memory area will be reserved after the initial stack area and the gd->malloc_base pointer will be initialized. After this patch the new driver model can be used on MIPS. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
This commit is contained in:
parent
dd82128ef5
commit
e520023882
|
@ -140,9 +140,31 @@ reset:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set up temporary stack */
|
/* Set up temporary stack */
|
||||||
li sp, CONFIG_SYS_INIT_SP_ADDR
|
li t0, -16
|
||||||
|
li t1, CONFIG_SYS_INIT_SP_ADDR
|
||||||
|
and sp, t1, t0 # force 16 byte alignment
|
||||||
|
sub sp, sp, GD_SIZE # reserve space for gd
|
||||||
|
and sp, sp, t0 # force 16 byte alignment
|
||||||
|
move k0, sp # save gd pointer
|
||||||
|
#ifdef CONFIG_SYS_MALLOC_F_LEN
|
||||||
|
li t2, CONFIG_SYS_MALLOC_F_LEN
|
||||||
|
sub sp, sp, t2 # reserve space for early malloc
|
||||||
|
and sp, sp, t0 # force 16 byte alignment
|
||||||
|
#endif
|
||||||
move fp, sp
|
move fp, sp
|
||||||
|
|
||||||
|
/* Clear gd */
|
||||||
|
move t0, k0
|
||||||
|
1:
|
||||||
|
sw zero, 0(t0)
|
||||||
|
blt t0, t1, 1b
|
||||||
|
addi t0, 4
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYS_MALLOC_F_LEN
|
||||||
|
addu t0, k0, GD_MALLOC_BASE # gd->malloc_base offset
|
||||||
|
sw sp, 0(t0)
|
||||||
|
#endif
|
||||||
|
|
||||||
la t9, board_init_f
|
la t9, board_init_f
|
||||||
jr t9
|
jr t9
|
||||||
move ra, zero
|
move ra, zero
|
||||||
|
|
|
@ -134,9 +134,31 @@ reset:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set up temporary stack */
|
/* Set up temporary stack */
|
||||||
dli sp, CONFIG_SYS_INIT_SP_ADDR
|
dli t0, -16
|
||||||
|
dli t1, CONFIG_SYS_INIT_SP_ADDR
|
||||||
|
and sp, t1, t0 # force 16 byte alignment
|
||||||
|
dsub sp, sp, GD_SIZE # reserve space for gd
|
||||||
|
and sp, sp, t0 # force 16 byte alignment
|
||||||
|
move k0, sp # save gd pointer
|
||||||
|
#ifdef CONFIG_SYS_MALLOC_F_LEN
|
||||||
|
dli t2, CONFIG_SYS_MALLOC_F_LEN
|
||||||
|
dsub sp, sp, t2 # reserve space for early malloc
|
||||||
|
and sp, sp, t0 # force 16 byte alignment
|
||||||
|
#endif
|
||||||
move fp, sp
|
move fp, sp
|
||||||
|
|
||||||
|
/* Clear gd */
|
||||||
|
move t0, k0
|
||||||
|
1:
|
||||||
|
sw zero, 0(t0)
|
||||||
|
blt t0, t1, 1b
|
||||||
|
daddi t0, 4
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYS_MALLOC_F_LEN
|
||||||
|
daddu t0, k0, GD_MALLOC_BASE # gd->malloc_base offset
|
||||||
|
sw sp, 0(t0)
|
||||||
|
#endif
|
||||||
|
|
||||||
dla t9, board_init_f
|
dla t9, board_init_f
|
||||||
jr t9
|
jr t9
|
||||||
move ra, zero
|
move ra, zero
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
#ifndef _ASM_CONFIG_H_
|
#ifndef _ASM_CONFIG_H_
|
||||||
#define _ASM_CONFIG_H_
|
#define _ASM_CONFIG_H_
|
||||||
|
|
||||||
#define CONFIG_SYS_GENERIC_GLOBAL_DATA
|
|
||||||
|
|
||||||
#define CONFIG_LMB
|
#define CONFIG_LMB
|
||||||
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
|
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue