From: François Tigeot Date: Mon, 6 Aug 2012 07:04:58 +0000 (+0200) Subject: kernel: Move MPASS and MPASS4 definitions around X-Git-Tag: v3.4.0rc~716 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/99e4df4ea63647b09cf4d722ad4123024b04bb29 kernel: Move MPASS and MPASS4 definitions around They are generic enough to be used in the entire kernel, no need to keep them in an acpica-specific file. --- diff --git a/sys/dev/acpica5/acpi_pci_link.c b/sys/dev/acpica5/acpi_pci_link.c index 1541fc4750..a02d842f28 100644 --- a/sys/dev/acpica5/acpi_pci_link.c +++ b/sys/dev/acpica5/acpi_pci_link.c @@ -26,10 +26,6 @@ * $FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.56.2.1.6.1 2009/04/15 03:14:26 kensmith Exp $ */ -#define MPASS(ex) MPASS4(ex, #ex, __FILE__, __LINE__) -#define MPASS4(ex, what, file, line) \ - KASSERT((ex), ("Assertion %s failed at %s:%d", what, file, line)) - #include "opt_acpi.h" #include #include diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 913441138a..f2dccc3c7a 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -36,7 +36,6 @@ * * @(#)lock.h 8.12 (Berkeley) 5/19/95 * $FreeBSD: src/sys/sys/lock.h,v 1.17.2.3 2001/12/25 01:44:44 dillon Exp $ - * $DragonFly: src/sys/sys/lock.h,v 1.19 2007/08/20 05:44:58 dillon Exp $ */ #ifndef _SYS_LOCK_H_ @@ -228,6 +227,14 @@ int lockcountnb (struct lock *); SYSUNINIT(name##_lock_sysuninit, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, \ lockuninit, (lock)) +/* + * Helpful macros for quickly coming up with assertions with informative + * panic messages. + */ +#define MPASS(ex) MPASS4(ex, #ex, __FILE__, __LINE__) +#define MPASS4(ex, what, file, line) \ + KASSERT((ex), ("Assertion %s failed at %s:%d", what, file, line)) + #endif /* _KERNEL */ #endif /* _KERNEL || _KERNEL_STRUCTURES */ #endif /* _SYS_LOCK_H_ */