Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/stand/efiboot Add a hook for MD specific info to print i...
details: https://anonhg.NetBSD.org/src/rev/d3238efc7669
branches: trunk
changeset: 957422:d3238efc7669
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Nov 28 14:02:09 2020 +0000
description:
Add a hook for MD specific info to print in the "ver" command. Use this
to print the value of the current execution level in bootaa64.
diffstat:
sys/stand/efiboot/boot.c | 3 ++-
sys/stand/efiboot/bootaa64/efibootaa64.c | 19 ++++++++++++++++++-
sys/stand/efiboot/bootarm/efibootarm.c | 7 ++++++-
sys/stand/efiboot/efiboot_machdep.h | 3 ++-
4 files changed, 28 insertions(+), 4 deletions(-)
diffs (79 lines):
diff -r 723368172a09 -r d3238efc7669 sys/stand/efiboot/boot.c
--- a/sys/stand/efiboot/boot.c Sat Nov 28 13:05:58 2020 +0000
+++ b/sys/stand/efiboot/boot.c Sat Nov 28 14:02:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.28 2020/10/11 14:03:33 jmcneill Exp $ */
+/* $NetBSD: boot.c,v 1.29 2020/11/28 14:02:09 jmcneill Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -347,6 +347,7 @@
efi_fdt_show();
efi_acpi_show();
efi_rng_show();
+ efi_md_show();
}
void
diff -r 723368172a09 -r d3238efc7669 sys/stand/efiboot/bootaa64/efibootaa64.c
--- a/sys/stand/efiboot/bootaa64/efibootaa64.c Sat Nov 28 13:05:58 2020 +0000
+++ b/sys/stand/efiboot/bootaa64/efibootaa64.c Sat Nov 28 14:02:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efibootaa64.c,v 1.2 2018/09/07 17:30:32 jmcneill Exp $ */
+/* $NetBSD: efibootaa64.c,v 1.3 2020/11/28 14:02:09 jmcneill Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -60,3 +60,20 @@
aarch64_exec_kernel((paddr_t)marks[MARK_ENTRY], (paddr_t)efi_fdt_data());
}
+
+/*
+ * Returns the current exception level.
+ */
+static u_int
+efi_aarch64_current_el(void)
+{
+ uint64_t el;
+ __asm __volatile ("mrs %0, CurrentEL" : "=r" (el));
+ return (el >> 2) & 0x3;
+}
+
+void
+efi_md_show(void)
+{
+ printf("Current Exception Level: EL%u\n", efi_aarch64_current_el());
+}
diff -r 723368172a09 -r d3238efc7669 sys/stand/efiboot/bootarm/efibootarm.c
--- a/sys/stand/efiboot/bootarm/efibootarm.c Sat Nov 28 13:05:58 2020 +0000
+++ b/sys/stand/efiboot/bootarm/efibootarm.c Sat Nov 28 14:02:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efibootarm.c,v 1.2 2019/03/30 17:41:13 jmcneill Exp $ */
+/* $NetBSD: efibootarm.c,v 1.3 2020/11/28 14:02:09 jmcneill Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -58,3 +58,8 @@
armv7_exec_kernel((register_t)marks[MARK_ENTRY], (register_t)efi_fdt_data());
}
+
+void
+efi_md_show(void)
+{
+}
diff -r 723368172a09 -r d3238efc7669 sys/stand/efiboot/efiboot_machdep.h
--- a/sys/stand/efiboot/efiboot_machdep.h Sat Nov 28 13:05:58 2020 +0000
+++ b/sys/stand/efiboot/efiboot_machdep.h Sat Nov 28 14:02:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot_machdep.h,v 1.2 2018/09/07 17:30:32 jmcneill Exp $ */
+/* $NetBSD: efiboot_machdep.h,v 1.3 2020/11/28 14:02:09 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -32,3 +32,4 @@
void efi_dcache_flush(u_long, u_long);
void efi_boot_kernel(u_long[]);
+void efi_md_show(void);
Home |
Main Index |
Thread Index |
Old Index