summaryrefslogtreecommitdiff
path: root/include/boot.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/boot.h')
-rw-r--r--include/boot.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/boot.h b/include/boot.h
new file mode 100644
index 0000000..06b05d7
--- /dev/null
+++ b/include/boot.h
@@ -0,0 +1,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, size_t *sizep);
+int tb_load_semihosting(const char *fname, uintptr_t load_addr,
+ struct tb_image *img);
+
+#endif