aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/syslinux/fdt.c
blob: 1bcd90b9a136dd9663fd012a1c08bc4ffee98dfc (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
#include <stdlib.h>
#include <syslinux/linux.h>
#include <syslinux/loadfile.h>

struct fdt *fdt_init(void)
{
	struct fdt *fdt;

	fdt = calloc(1, sizeof(*fdt));
	if (!fdt)
		return NULL;

	return fdt;
}

int fdt_load(struct fdt *fdt, const char *filename)
{
	void *data;
	size_t len;

	if (loadfile(filename, &data, &len))
		return -1;

	fdt->data = data;
	fdt->len = len;

	return 0;
}