svn commit: r230886 - in stable/9/sys/sparc64: include sparc64
Marius Strobl
marius at FreeBSD.org
Wed Feb 1 21:14:05 UTC 2012
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)
{
More information about the svn-src-stable-9
mailing list