summaryrefslogtreecommitdiffstats
path: root/include/uimagefs.h
blob: 81b32310ad4882025d5c156372a2b81833ff315d (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * Copyright (c) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 *
 * under GPLv2 only
 */

#ifndef __UIMAGEFS_H__
#define __UIMAGEFS_H__

#include <linux/types.h>
#include <linux/list.h>
#include <image.h>
#include <ioctl.h>

#define UIMAGEFS_METADATA	_IOR('U', 100, struct image_header)

enum uimagefs_type {
	UIMAGEFS_DATA,
	UIMAGEFS_DATA_CRC,
	UIMAGEFS_NAME,
	UIMAGEFS_TIME,
	UIMAGEFS_LOAD,
	UIMAGEFS_EP,
	UIMAGEFS_OS,
	UIMAGEFS_ARCH,
	UIMAGEFS_TYPE,
	UIMAGEFS_COMP,
};

struct uimagefs_handle_data {
	char *name;
	enum uimagefs_type type;
	uint64_t size;

	int fd;
	size_t offset; /* offset in the image */
	size_t pos; /* pos in the data */

	char *data;

	struct list_head list;
};

struct uimagefs_handle {
	struct image_header header;
	int nb_data_entries;
	char *filename;
	char *tmp;

	struct list_head list;
};

#endif /* __UIMAGEFS_H__ */