1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Graeme Russ, <graeme.russ@gmail.com>
11 #include <asm/global_data.h>
13 DECLARE_GLOBAL_DATA_PTR;
17 * copy_uboot_to_ram() - Copy U-Boot to its new relocated position
19 * Return: 0 if OK, -ve on error
21 int copy_uboot_to_ram(void);
24 * clear_bss() - Clear the BSS (Blocked Start by Symbol) segment
26 * This clears the memory used by global variables
28 * Return: 0 if OK, -ve on error
33 * do_elf_reloc_fixups() - Fix up ELF relocations in the relocated code
35 * This processes the relocation tables to ensure that the code can run in its
38 * Return: 0 if OK, -ve on error
40 int do_elf_reloc_fixups(void);
43 * manual_reloc() - Manually relocate a pointer if needed
45 * This is a nop in almost all cases, except for the systems with a broken gcc
46 * which need to manually relocate some things.
48 * @ptr: Pointer to relocate
49 * Return: new pointer value
51 static inline void *manual_reloc(void *ptr)
54 if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC))
55 return ptr + gd->reloc_off;
60 #if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
61 #define MANUAL_RELOC(ptr) (ptr) = manual_reloc(ptr)
63 #define MANUAL_RELOC(ptr) (void)(ptr)
66 #endif /* _RELOCATE_H_ */