diff options
author | mm <mm@FreeBSD.org> | 2012-09-10 10:24:57 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2012-09-10 10:24:57 +0000 |
commit | 732e623063e898acb15e1526337c4186a02c10d7 (patch) | |
tree | c82fa8469ff4e4f83ef248552775bc59cdea3cfa /sys/cddl/compat | |
parent | 620b7df9b9b2717de869120b41362e3a789b3aac (diff) | |
download | FreeBSD-src-732e623063e898acb15e1526337c4186a02c10d7.zip FreeBSD-src-732e623063e898acb15e1526337c4186a02c10d7.tar.gz |
Add assfail() and assfail3() to the opensolaris module.
Remove obsoleted intermediate cddl/compat/opensolaris/sys/debug.h.
MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/compat')
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c | 22 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/assfail.h (renamed from sys/cddl/compat/opensolaris/sys/debug.h) | 26 |
2 files changed, 33 insertions, 15 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c b/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c index abde30d..1e065ea 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c @@ -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); +} diff --git a/sys/cddl/compat/opensolaris/sys/debug.h b/sys/cddl/compat/opensolaris/sys/assfail.h index 3480462..2397880 100644 --- a/sys/cddl/compat/opensolaris/sys/debug.h +++ b/sys/cddl/compat/opensolaris/sys/assfail.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> + * Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,23 +26,21 @@ * $FreeBSD$ */ -#ifndef _OPENSOLARIS_SYS_DEBUG_H_ -#define _OPENSOLARIS_SYS_DEBUG_H_ +#ifndef _OPENSOLARIS_SYS_ASSFAIL_H_ +#define _OPENSOLARIS_SYS_ASSFAIL_H_ -#ifdef _KERNEL #include <sys/types.h> -#include <sys/systm.h> -#include_next <sys/debug.h> +#ifdef __cplusplus +extern "C" { +#endif -#define assfail(a, f, l) \ - (panic("solaris assert: %s, file: %s, line: %d", (a), (f), (l)), 0) +int assfail(const char *, const char *, int); +void assfail3(const char *, uintmax_t, const char *, uintmax_t, const char *, + int); -#define assfail3(a, lv, op, rv, f, l) \ - panic("solaris assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", \ - (a), (uintmax_t)(lv), (op), (uintmax_t)(rv), (f), (l)) -#else /* !_KERNEL */ -#include_next <sys/debug.h> +#ifdef __cplusplus +} #endif -#endif /* _OPENSOLARIS_SYS_DEBUG_H_ */ +#endif /* _OPENSOLARIS_SYS_ASSFAIL_H_ */ |