summaryrefslogtreecommitdiff
path: root/include/boot.h
blob: a28b47cff4d214c462181499adad131ecee83034 (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
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __BOOT_H
#define __BOOT_H

#include <sys/types.h>
#include <stdint.h>

/*
 * payload loading and the arm64 boot protocol. See Documentation/
 * arch/arm64/booting.rst in the kernel tree for the contract this
 * implements.
 */

/*
 * where an image landed after the loader placed it. ep is the first
 * instruction executed, the whole image including its 64 byte header
 * sits at load.
 */
struct tb_image {
	uintptr_t load;		/* image start in memory */
	uintptr_t ep;		/* entry point */
	size_t size;		/* total image size */
};

/* common/image.c, the arm64 Image header math */
int tb_image_setup(uintptr_t image, struct tb_image *img);

/* common/load.c */
int tb_load_raw(const char *fname, uintptr_t load_addr);
int tb_load_semihosting(const char *fname, uintptr_t load_addr,
			struct tb_image *img);

#endif