From owner-svn-src-all@FreeBSD.ORG Mon Sep 10 10:24:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B51181065672; Mon, 10 Sep 2012 10:24:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5438FC08; Mon, 10 Sep 2012 10:24:57 +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 q8AAOvkF035346; Mon, 10 Sep 2012 10:24:57 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8AAOvqJ035341; Mon, 10 Sep 2012 10:24:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201209101024.q8AAOvqJ035341@svn.freebsd.org> From: Martin Matuska Date: Mon, 10 Sep 2012 10:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240303 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2012 10:24:57 -0000 Author: mm Date: Mon Sep 10 10:24:57 2012 New Revision: 240303 URL: http://svn.freebsd.org/changeset/base/240303 Log: Add assfail() and assfail3() to the opensolaris module. Remove obsoleted intermediate cddl/compat/opensolaris/sys/debug.h. MFC after: 2 weeks Added: head/sys/cddl/compat/opensolaris/sys/assfail.h (contents, props changed) Deleted: head/sys/cddl/compat/opensolaris/sys/debug.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Sep 10 08:23:56 2012 (r240302) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Sep 10 10:24:57 2012 (r240303) @@ -19,9 +19,13 @@ * CDDL HEADER END * * $FreeBSD$ - * + */ +/* + * Copyright 2007 John Birrell . All rights reserved. + * Copyright 2012 Martin Matuska . All rights reserved. */ +#include #include void @@ -68,3 +72,19 @@ cmn_err(int type, const char *fmt, ...) vcmn_err(type, fmt, ap); va_end(ap); } + +int +assfail(const char *a, const char *f, int l) { + + panic("solaris assert: %s, file: %s, line: %d", a, f, l); + + return (0); +} + +void +assfail3(const char *a, uintmax_t lv, const char *op, uintmax_t rv, + const char *f, int l) { + + panic("solaris assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", + a, lv, op, rv, f, l); +} Added: head/sys/cddl/compat/opensolaris/sys/assfail.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/compat/opensolaris/sys/assfail.h Mon Sep 10 10:24:57 2012 (r240303) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2012 Martin Matuska + * 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 AUTHORS 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 AUTHORS 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. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_ASSFAIL_H_ +#define _OPENSOLARIS_SYS_ASSFAIL_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int assfail(const char *, const char *, int); +void assfail3(const char *, uintmax_t, const char *, uintmax_t, const char *, + int); + +#ifdef __cplusplus +} +#endif + +#endif /* _OPENSOLARIS_SYS_ASSFAIL_H_ */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Mon Sep 10 08:23:56 2012 (r240302) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Mon Sep 10 10:24:57 2012 (r240303) @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Martin Matuska . All rights reserved. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -31,6 +32,9 @@ #include #include +#ifdef _KERNEL +#include +#endif #ifdef __cplusplus extern "C" {