From 7fa48faeb55fb43b6a4e727d0abd104b267c89a4 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 7 Mar 2022 11:53:40 +0000 Subject: multiboot: Refactor duplicated functions to a separate file The implementation of write_bootdata() and get_redirect_dir() was copied verbatim in two different places, obviously a bad thing for maintainability. This moves them to a new file multiboot.c as they are only used for multiboot. Change-Id: Id0279216e4dd019f8bf612a81d3835eff010e506 --- firmware/rolo.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'firmware/rolo.c') diff --git a/firmware/rolo.c b/firmware/rolo.c index f95fc4bd4d..24488e5934 100644 --- a/firmware/rolo.c +++ b/firmware/rolo.c @@ -41,23 +41,19 @@ #include "loader_strerror.h" #if defined(MI4_FORMAT) #include "mi4-loader.h" -#if defined(HAVE_BOOTDATA) && !defined(SIMULATOR) -#include "bootdata.h" -#include "crc32.h" -extern int write_bootdata(unsigned char* buf, int len, unsigned int boot_volume); /*mi4-loader.c*/ -#endif #define LOAD_FIRMWARE(a,b,c) load_mi4(a,b,c) #elif defined(RKW_FORMAT) #include "rkw-loader.h" #define LOAD_FIRMWARE(a,b,c) load_rkw(a,b,c) #else #include "rb-loader.h" +#define LOAD_FIRMWARE(a,b,c) load_firmware(a,b,c) +#endif + #if defined(HAVE_BOOTDATA) && !defined(SIMULATOR) +#include "multiboot.h" #include "bootdata.h" #include "crc32.h" -extern int write_bootdata(unsigned char* buf, int len, unsigned int boot_volume); /*rb-loader.c*/ -#endif -#define LOAD_FIRMWARE(a,b,c) load_firmware(a,b,c) #endif #if CONFIG_CPU == AS3525v2 -- cgit v1.2.3