Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2012 21:14:04 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r230886 - in stable/9/sys/sparc64: include sparc64
Message-ID:  <201202012114.q11LE5Cg005186@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Wed Feb  1 21:14:04 2012
New Revision: 230886
URL: http://svn.freebsd.org/changeset/base/230886

Log:
  MFC: r230632
  
  - Now that we have a working OF_printf() since r230631 (MFC'ed to stable/9
    in r230884), use it for implementing a simple OF_panic() that may be used
    during the early cycles when panic() isn't available, yet.
  - Mark cpu_{exit,shutdown}() as __dead2 as appropriate.

Modified:
  stable/9/sys/sparc64/include/ofw_machdep.h
  stable/9/sys/sparc64/sparc64/ofw_machdep.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/sparc64/include/ofw_machdep.h
==============================================================================
--- stable/9/sys/sparc64/include/ofw_machdep.h	Wed Feb  1 21:11:09 2012	(r230885)
+++ stable/9/sys/sparc64/include/ofw_machdep.h	Wed Feb  1 21:14:04 2012	(r230886)
@@ -37,8 +37,9 @@ typedef uint64_t cell_t;
 int  OF_decode_addr(phandle_t, int, int *, bus_addr_t *);
 void OF_getetheraddr(device_t, u_char *);
 u_int OF_getscsinitid(device_t);
-void cpu_shutdown(void *);
+void OF_panic(const char *fmt, ...) __dead2 __printflike(1, 2);
+void cpu_shutdown(void *) __dead2;
 int  ofw_entry(void *);
-void ofw_exit(void *);
+void ofw_exit(void *) __dead2;
 
 #endif /* _MACHINE_OFW_MACHDEP_H_ */

Modified: stable/9/sys/sparc64/sparc64/ofw_machdep.c
==============================================================================
--- stable/9/sys/sparc64/sparc64/ofw_machdep.c	Wed Feb  1 21:11:09 2012	(r230885)
+++ stable/9/sys/sparc64/sparc64/ofw_machdep.c	Wed Feb  1 21:14:04 2012	(r230886)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/bus.h>
 #include <machine/idprom.h>
 #include <machine/ofw_machdep.h>
+#include <machine/stdarg.h>
 
 void
 OF_getetheraddr(device_t dev, u_char *addr)
@@ -81,6 +82,19 @@ OF_getscsinitid(device_t dev)
 	return (7);
 }
 
+void
+OF_panic(const char *fmt, ...)
+{
+	char buf[256];
+	va_list ap;
+
+	va_start(ap, fmt);
+	(void)vsnprintf(buf, sizeof(buf), fmt, ap);
+	OF_printf("OF_panic: %s\n", buf);
+	va_end(ap);
+	OF_exit();
+}
+
 static __inline uint32_t
 phys_hi_mask_space(const char *bus, uint32_t phys_hi)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202012114.q11LE5Cg005186>