summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/stand/efiboot/heap.h
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-05-14 17:55:16 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-05-14 17:55:16 +0000
commit22efdef3f23847dc5e4183184bb75c7e16626634 (patch)
treebe1aa6485b7c4d6f12f35c2f5d2e27fc7af2e166 /sys/arch/armv7/stand/efiboot/heap.h
parent5b3645912fac0d0b7a8eab07f7671dbffd312a3a (diff)
Initial stab at an EFI bootloader for armv7. Bits and pieces from FreeBSD
and our amd64 EFI bootloader. The current code works on a 2GB CuBox-i, but probably not on anything else. It needs a u-boot with EFI loader support.
Diffstat (limited to 'sys/arch/armv7/stand/efiboot/heap.h')
-rw-r--r--sys/arch/armv7/stand/efiboot/heap.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/arch/armv7/stand/efiboot/heap.h b/sys/arch/armv7/stand/efiboot/heap.h
new file mode 100644
index 00000000000..046a4db5433
--- /dev/null
+++ b/sys/arch/armv7/stand/efiboot/heap.h
@@ -0,0 +1,29 @@
+/* $OpenBSD: heap.h,v 1.1 2016/05/14 17:55:15 kettenis Exp $ */
+
+/*
+ * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#include <efi.h>
+
+static char *top = NULL;
+#define NEEDS_HEAP_INIT 1
+
+static void
+heap_init(void)
+{
+ extern EFI_PHYSICAL_ADDRESS heap;
+ if (top == NULL)
+ top = (char *)(uintptr_t)heap;
+}