2016-07-08 11:26:26 -07:00
|
|
|
#ifndef __PROGRAM_H__
|
|
|
|
|
#define __PROGRAM_H__
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2018-11-09 17:33:51 -08:00
|
|
|
#include "qdl.h"
|
2016-07-08 11:26:26 -07:00
|
|
|
|
|
|
|
|
struct program {
|
2021-04-15 14:22:15 -05:00
|
|
|
unsigned pages_per_block;
|
2016-07-08 11:26:26 -07:00
|
|
|
unsigned sector_size;
|
|
|
|
|
unsigned file_offset;
|
|
|
|
|
const char *filename;
|
|
|
|
|
const char *label;
|
|
|
|
|
unsigned num_sectors;
|
|
|
|
|
unsigned partition;
|
2021-04-29 10:25:55 -05:00
|
|
|
const char *start_sector;
|
2021-04-15 14:22:15 -05:00
|
|
|
unsigned last_sector;
|
|
|
|
|
|
|
|
|
|
bool is_nand;
|
|
|
|
|
bool is_erase;
|
2016-07-08 11:26:26 -07:00
|
|
|
|
|
|
|
|
struct program *next;
|
|
|
|
|
};
|
|
|
|
|
|
2021-04-15 14:22:15 -05:00
|
|
|
int program_load(const char *program_file, bool is_nand);
|
2018-11-09 17:33:51 -08:00
|
|
|
int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program, int fd),
|
2024-09-12 12:18:18 +01:00
|
|
|
const char *incdir, bool allow_missing);
|
2021-04-15 14:22:15 -05:00
|
|
|
int erase_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program));
|
2024-12-17 09:53:36 -06:00
|
|
|
int program_find_bootable_partition(bool *multiple_found);
|
2024-12-13 13:05:57 -06:00
|
|
|
void free_programs(void);
|
2016-07-08 11:26:26 -07:00
|
|
|
|
|
|
|
|
#endif
|