2018-04-07 23:43:54 +02:00
|
|
|
#ifndef FUSEE_LOADER_H
|
|
|
|
#define FUSEE_LOADER_H
|
|
|
|
|
2018-04-09 23:34:23 +02:00
|
|
|
#include "utils.h"
|
|
|
|
|
2018-04-08 06:51:24 +02:00
|
|
|
typedef void (*entrypoint_t)(int argc, void **argv);
|
2018-04-07 23:43:54 +02:00
|
|
|
|
2018-04-08 13:51:57 +02:00
|
|
|
typedef struct {
|
|
|
|
char path[0x300];
|
|
|
|
const char *key;
|
|
|
|
uintptr_t load_address;
|
2018-04-26 12:47:22 +02:00
|
|
|
size_t load_size;
|
2018-04-08 13:51:57 +02:00
|
|
|
} load_file_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2018-04-09 23:34:23 +02:00
|
|
|
const char *bct0;
|
|
|
|
entrypoint_t chainload_entrypoint;
|
|
|
|
load_file_t package2_loadfile;
|
|
|
|
load_file_t exosphere_loadfile;
|
|
|
|
load_file_t tsecfw_loadfile;
|
|
|
|
load_file_t warmboot_loadfile;
|
2018-04-11 00:09:00 +02:00
|
|
|
char custom_splash_path[0x300];
|
2018-04-08 13:51:57 +02:00
|
|
|
} loader_ctx_t;
|
|
|
|
|
|
|
|
#define LOADER_ENTRYPOINT_KEY "entrypoint"
|
|
|
|
#define LOADER_LOADLIST_KEY "loadlist"
|
2018-04-11 00:09:00 +02:00
|
|
|
#define LOADER_CUSTOMSPLASH_KEY "custom_splash"
|
2018-04-08 13:51:57 +02:00
|
|
|
|
2018-04-09 23:34:23 +02:00
|
|
|
#define LOADER_PACKAGE2_KEY "package2"
|
|
|
|
#define LOADER_EXOSPHERE_KEY "exosphere"
|
|
|
|
#define LOADER_TSECFW_KEY "tsecfw"
|
|
|
|
#define LOADER_WARMBOOT_KEY "warmboot"
|
|
|
|
|
2018-04-08 13:51:57 +02:00
|
|
|
/* TODO: Should we allow files bigger than 16 MB? */
|
|
|
|
#define LOADER_FILESIZE_MAX 0x01000000
|
|
|
|
|
2018-04-09 23:34:23 +02:00
|
|
|
loader_ctx_t *get_loader_ctx(void);
|
|
|
|
|
|
|
|
void load_payload(const char *bct0);
|
2018-04-07 23:43:54 +02:00
|
|
|
|
|
|
|
#endif
|