aboutsummaryrefslogtreecommitdiffstats
path: root/sysload.h
blob: b6e2f360211173449498b78dd1a5cdbd97348d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Code to load data into a specific memory space
 */

#ifndef SYSLOAD_H
#define SYSLOAD_H

#include "compiler.h"

struct load_data;

/*
 * Note: if a load_op and a dump_op are provided, then "buf" is just
 * a private pointer for the operations to use.
 */

/* Memory space write operation (if not just memcpy) */
typedef void
(*load_op)(void *buf, uint32_t addr, uint8_t val);

/* Memory space read operation (if not just memcpy) */
struct dump_data {
    const void *data;
    size_t len;
};

typedef struct dump_data
(*dump_op)(void *buf, uint32_t addr);

void sysload_add_memspace(const char *name, load_op write_op, dump_op read_op,
			  void *buf, uint32_t mask, uint32_t limit);
int load_sysfile(const char *name);
void dump_memory(const char *name);

#endif /* SYSLOAD_H */