Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/bouyer-socketcan]: src/sys/arch/i386/stand/efiboot 1673339



details:   https://anonhg.NetBSD.org/src/rev/584d270335b3
branches:  bouyer-socketcan
changeset: 820835:584d270335b3
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Sat Feb 11 10:15:56 2017 +0000

description:
1673339

diffstat:

 sys/arch/i386/stand/efiboot/panic.c |  71 +++++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

diffs (75 lines):

diff -r ca91d40c3235 -r 584d270335b3 sys/arch/i386/stand/efiboot/panic.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/panic.c       Sat Feb 11 10:15:56 2017 +0000
@@ -0,0 +1,71 @@
+/*     $NetBSD: panic.c,v 1.4.6.2 2017/02/11 10:15:56 nonaka Exp $     */
+
+/*-
+ * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "efiboot.h"
+
+#include <efistdarg.h>
+
+/* from sys/external/bsd/gnu-efi/dist/lib/print.c */
+UINTN VPrint (IN CHAR16 *, va_list);
+
+__dead VOID
+Panic(
+    IN CHAR16 *fmt,
+    ...
+    )
+{
+       va_list args;
+
+       va_start(args, fmt);
+       VPrint(fmt, args);
+       Print(L"\n");
+       va_end(args);
+       reboot();
+       /*NOTREACHED*/
+       __unreachable();
+}
+
+__dead void
+reboot(void)
+{
+
+       if (!efi_cleanuped)
+               WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
+
+       uefi_call_wrapper(RT->ResetSystem, 4, EfiResetCold, EFI_SUCCESS,
+           0, NULL);
+       for (;;)
+               continue;
+}
+
+__dead void
+_rtt(void)
+{
+
+       reboot();
+}



Home | Main Index | Thread Index | Old Index