Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Sep 2012 10:24:57 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240303 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/sys
Message-ID:  <201209101024.q8AAOvqJ035341@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <jb@FreeBSD.org>. All rights reserved.
+ * Copyright 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
  */
 
+#include <sys/assfail.h>
 #include <sys/cmn_err.h>
 
 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 <mm@FreeBSD.org>
+ * 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 <sys/types.h>
+
+#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 <mm@FreeBSD.org>. All rights reserved.
  */
 
 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
@@ -31,6 +32,9 @@
 
 #include <sys/types.h>
 #include <sys/note.h>
+#ifdef _KERNEL
+#include <sys/systm.h>
+#endif
 
 #ifdef	__cplusplus
 extern "C" {



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