Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/stand MI libsa provides panic() and exit() fun...



details:   https://anonhg.NetBSD.org/src/rev/bb478af77e61
branches:  trunk
changeset: 759910:bb478af77e61
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon Dec 20 01:12:44 2010 +0000

description:
MI libsa provides panic() and exit() functions, no need to provide our own.
As MI libsa exit() calls panic() with a "exit" message, don't use it if we
print our own farewell or have already panic()ed.

diffstat:

 sys/arch/i386/stand/boot/boot2.c            |   3 +-
 sys/arch/i386/stand/dosboot/main.c          |   4 +-
 sys/arch/i386/stand/lib/Makefile            |   4 +-
 sys/arch/i386/stand/lib/crt/dos/start_dos.S |   4 +-
 sys/arch/i386/stand/lib/panic.c             |  48 -----------------------------
 sys/arch/i386/stand/netboot/main.c          |   4 +-
 sys/arch/i386/stand/netboot/start_rom.S     |   5 +-
 sys/arch/i386/stand/pxeboot/main.c          |   3 +-
 sys/arch/i386/stand/pxeboot/start_pxe.S     |   5 +-
 9 files changed, 14 insertions(+), 66 deletions(-)

diffs (196 lines):

diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/boot/boot2.c
--- a/sys/arch/i386/stand/boot/boot2.c  Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/boot/boot2.c  Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot2.c,v 1.49 2010/11/06 23:07:46 jym Exp $   */
+/*     $NetBSD: boot2.c,v 1.50 2010/12/20 01:12:44 jakllsch Exp $      */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -414,7 +414,6 @@
        reboot();
        /* Note: we shouldn't get to this point! */
        panic("Could not reboot!");
-       exit(0);
 }
 
 void
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/dosboot/main.c
--- a/sys/arch/i386/stand/dosboot/main.c        Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/dosboot/main.c        Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.29 2009/03/21 15:01:56 ad Exp $      */
+/*     $NetBSD: main.c,v 1.30 2010/12/20 01:12:44 jakllsch Exp $        */
 
 /*
  * Copyright (c) 1996, 1997
@@ -337,7 +337,7 @@
 command_quit(char *arg)
 {
        printf("Exiting... goodbye...\n");
-       exit(0);
+       _rtt();
 }
 
 void
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/lib/Makefile
--- a/sys/arch/i386/stand/lib/Makefile  Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/lib/Makefile  Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.29 2009/11/19 22:13:17 dsl Exp $
+#      $NetBSD: Makefile,v 1.30 2010/12/20 01:12:44 jakllsch Exp $
 
 S?=    ${.CURDIR}/../../../..
 
@@ -21,7 +21,7 @@
 SRCS+= biosmem.S getextmemx.c biosmemx.S printmemlist.c
 SRCS+= pread.c menuutils.c parseutils.c
 SRCS+= bootinfo.c bootinfo_biosgeom.c bootinfo_memmap.c
-SRCS+= startprog.S multiboot.S panic.c
+SRCS+= startprog.S multiboot.S
 SRCS+= biosgetsystime.S cpufunc.S bootmenu.c
 SRCS+= realprot.S message.S message32.S dump_eax.S pvcopy.S putstr.S
 SRCS+= rasops.c vbe.c biosvbe.S
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/lib/crt/dos/start_dos.S
--- a/sys/arch/i386/stand/lib/crt/dos/start_dos.S       Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/lib/crt/dos/start_dos.S       Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: start_dos.S,v 1.9 2007/03/04 05:59:59 christos Exp $   */
+/*     $NetBSD: start_dos.S,v 1.10 2010/12/20 01:12:44 jakllsch Exp $  */
        
 /*
  * startup for DOS .COM programs
@@ -188,7 +188,7 @@
        stosb
 
        call    _C_LABEL(doscommain)
-ENTRY(exit)
+ENTRY(_rtt)
        call    _C_LABEL(prot_to_real)
        .code16
 ENTRY(exit16)
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/lib/panic.c
--- a/sys/arch/i386/stand/lib/panic.c   Mon Dec 20 00:55:10 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*     $NetBSD: panic.c,v 1.7 2005/12/11 12:17:48 christos Exp $        */
-
-/*
- * Copyright (c) 1996
- *     Matthias Drochner.  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 AUTHOR ``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 AUTHOR 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 <sys/cdefs.h>
-#include <sys/types.h>
-#include <machine/stdarg.h>
-
-#include <lib/libsa/stand.h>
-
-__dead void
-panic(const char *fmt,...)
-{
-       va_list         ap;
-
-       va_start(ap, fmt);
-
-       vprintf(fmt, ap);
-       printf("\n");
-       va_end(ap);
-
-       exit(0);
-}
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/netboot/main.c
--- a/sys/arch/i386/stand/netboot/main.c        Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/netboot/main.c        Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.17 2009/03/21 15:01:56 ad Exp $      */
+/*     $NetBSD: main.c,v 1.18 2010/12/20 01:12:44 jakllsch Exp $        */
 
 /*
  * Copyright (c) 1996
@@ -123,7 +123,7 @@
 command_quit(char *arg)
 {
        printf("Exiting... goodbye...\n");
-       exit(0);
+       _rtt();
 }
 
 void
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/netboot/start_rom.S
--- a/sys/arch/i386/stand/netboot/start_rom.S   Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/netboot/start_rom.S   Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: start_rom.S,v 1.2 2005/12/11 12:17:49 christos Exp $   */
+/*     $NetBSD: start_rom.S,v 1.3 2010/12/20 01:12:44 jakllsch Exp $   */
        
 /*
  * ROM startup
@@ -181,8 +181,7 @@
        .code32
        call    _C_LABEL(main)
 
-       .globl  _C_LABEL(exit)
-_C_LABEL(exit):
+ENTRY(_rtt)
        call    _C_LABEL(prot_to_real)
        .code16
 
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/pxeboot/main.c
--- a/sys/arch/i386/stand/pxeboot/main.c        Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/pxeboot/main.c        Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.26 2010/11/06 23:07:46 jym Exp $    */
+/*     $NetBSD: main.c,v 1.27 2010/12/20 01:12:45 jakllsch Exp $       */
 
 /*
  * Copyright (c) 1996
@@ -212,7 +212,6 @@
        reboot();
        /* Note: we shouldn't get to this point! */
        panic("Could not reboot!");
-       exit(0);
 }
 
 void
diff -r 0288e0cf02ec -r bb478af77e61 sys/arch/i386/stand/pxeboot/start_pxe.S
--- a/sys/arch/i386/stand/pxeboot/start_pxe.S   Mon Dec 20 00:55:10 2010 +0000
+++ b/sys/arch/i386/stand/pxeboot/start_pxe.S   Mon Dec 20 01:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: start_pxe.S,v 1.4 2005/11/11 21:42:13 dsl Exp $        */
+/*     $NetBSD: start_pxe.S,v 1.5 2010/12/20 01:12:45 jakllsch Exp $   */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -89,8 +89,7 @@
        /* ...and call main()! */
        call    _C_LABEL(main)
 
-       .globl  _C_LABEL(exit)
-_C_LABEL(exit):
+ENTRY(_rtt)
        call    _C_LABEL(prot_to_real)
        .code16
        movw    $efail, %si



Home | Main Index | Thread Index | Old Index