xref: /OK3568_Linux_fs/u-boot/include/relocate.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * (C) Copyright 2011
3*4882a593Smuzhiyun  * Graeme Russ, <graeme.russ@gmail.com>
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * SPDX-License-Identifier:	GPL-2.0+
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef _RELOCATE_H_
9*4882a593Smuzhiyun #define _RELOCATE_H_
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <common.h>
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun /**
14*4882a593Smuzhiyun  * copy_uboot_to_ram() - Copy U-Boot to its new relocated position
15*4882a593Smuzhiyun  *
16*4882a593Smuzhiyun  * @return 0 if OK, -ve on error
17*4882a593Smuzhiyun  */
18*4882a593Smuzhiyun int copy_uboot_to_ram(void);
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun /**
21*4882a593Smuzhiyun  * clear_bss() - Clear the BSS (Blocked Start by Symbol) segment
22*4882a593Smuzhiyun  *
23*4882a593Smuzhiyun  * This clears the memory used by global variables
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  * @return 0 if OK, -ve on error
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun int clear_bss(void);
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun /**
30*4882a593Smuzhiyun  * do_elf_reloc_fixups() - Fix up ELF relocations in the relocated code
31*4882a593Smuzhiyun  *
32*4882a593Smuzhiyun  * This processes the relocation tables to ensure that the code can run in its
33*4882a593Smuzhiyun  * new location.
34*4882a593Smuzhiyun  *
35*4882a593Smuzhiyun  * @return 0 if OK, -ve on error
36*4882a593Smuzhiyun  */
37*4882a593Smuzhiyun int do_elf_reloc_fixups(void);
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun #endif	/* _RELOCATE_H_ */
40