mirror of
https://github.com/ipxe/ipxe
synced 2026-02-02 19:57:34 +03:00
[riscv] Avoid potentially overwriting the scratch area during relocation
We do not currently describe the temporary page table or the temporary stack as areas to be avoided during relocation of the iPXE image to a new physical address. Perform the copy of the iPXE image and zeroing of the .bss within libprefix.S, after we have no futher use for the temporary page table or the temporary initial stack. Perform the copy and registration of the system device tree in C code after relocation is complete and the new stack (within .bss) has been set up. This provides a clean separation of responsibilities between the RISC-V libprefix.S and the architecture-independent fdtmem.c. The prefix is responsible only for relocating iPXE to the new physical address returned from fdtmem_relocate(), and doesn't need to know or care where fdtmem.c is planning to place the copy of the device tree. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -13,5 +13,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#include <ipxe/fdt.h>
|
||||
|
||||
extern physaddr_t fdtmem_relocate ( struct fdt_header *hdr, size_t limit );
|
||||
extern int fdtmem_register ( struct fdt_header *hdr );
|
||||
|
||||
#endif /* _IPXE_FDTMEM_H */
|
||||
|
||||
Reference in New Issue
Block a user