Files
qdl/program.h
T

47 lines
1.2 KiB
C
Raw Permalink Normal View History

2025-06-24 06:49:51 +02:00
/* SPDX-License-Identifier: BSD-3-Clause */
2016-07-08 11:26:26 -07:00
#ifndef __PROGRAM_H__
#define __PROGRAM_H__
#include <sys/types.h>
2016-07-08 11:26:26 -07:00
#include <stdbool.h>
#include <stdint.h>
2025-08-28 11:26:11 -05:00
#include "list.h"
2016-07-08 11:26:26 -07:00
struct program {
2025-06-18 09:39:54 +02:00
unsigned int pages_per_block;
unsigned int sector_size;
unsigned int file_offset;
2016-07-08 11:26:26 -07:00
const char *filename;
const char *label;
2025-06-18 09:39:54 +02:00
unsigned int num_sectors;
int partition;
2025-03-27 15:41:03 +01:00
bool sparse;
const char *start_sector;
2025-06-18 09:39:54 +02:00
unsigned int last_sector;
2021-04-15 14:22:15 -05:00
bool is_nand;
bool is_erase;
2016-07-08 11:26:26 -07:00
2025-03-27 15:41:04 +01:00
unsigned int sparse_chunk_type;
uint32_t sparse_fill_value;
off_t sparse_offset;
2025-03-27 15:41:04 +01:00
const char *gpt_partition;
2025-08-28 11:26:11 -05:00
struct list_head node;
2016-07-08 11:26:26 -07:00
};
2025-08-28 11:26:11 -05:00
struct qdl_device;
2025-08-28 13:49:24 -05:00
int program_load(const char *program_file, bool is_nand, bool allow_missing, const char *incdir);
int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program, int fd));
2021-04-15 14:22:15 -05:00
int erase_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program));
int program_find_bootable_partition(bool *multiple_found);
2025-04-22 16:01:21 +02:00
int program_is_sec_partition_flashed(void);
2025-09-07 20:56:44 -05:00
int program_cmd_add(const char *address, const char *filename);
2026-02-25 10:33:12 -08:00
int erase_cmd_add(const char *address);
int program_resolve_gpt_deferrals(struct qdl_device *qdl);
2025-04-22 16:01:21 +02:00
void free_programs(void);
2016-07-08 11:26:26 -07:00
#endif