From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 1 21:14:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64189106564A; Wed, 1 Feb 2012 21:14:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37B798FC14; Wed, 1 Feb 2012 21:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LE5kq005189; Wed, 1 Feb 2012 21:14:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LE5Cg005186; Wed, 1 Feb 2012 21:14:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012114.q11LE5Cg005186@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230886 - in stable/9/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:14:05 -0000 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 #include #include +#include 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) {