]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/l4util/include/macros.h
update
[l4.git] / l4 / pkg / l4util / include / macros.h
index b0c624d7fc3417b3da0a3888f9d294de0c33be45..170a67f26fe557727b5addbb6c780ee6678f0863 100644 (file)
@@ -3,7 +3,10 @@
  * \brief Utility macros.
  */
 /*
- * (c) 2000-2009 Technische Universität Dresden
+ * (c) 2000-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
+ *               Frank Mehnert <fm3@os.inf.tu-dresden.de>,
+ *               Lars Reuther <reuther@os.inf.tu-dresden.de>
+ *     economic rights: Technische Universität Dresden (Germany)
  * This file is part of TUD:OS and distributed under the terms of the
  * GNU Lesser General Public License 2.1.
  * Please see the COPYING-LGPL-2.1 file for details.
 #include <l4/sys/types.h>
 #include <l4/sys/kdebug.h>
 #include <l4/util/l4_macros.h>
-
-/*****************************************************************************
- *** generic macros
- *****************************************************************************/
-
-#ifdef ___________MOVED_TO_LOG_PKG
-
-/* print message and enter kernel debugger */
-#ifndef Panic
-
-// Don't include <stdlib.h> here, leads to trouble.
-// Don't use exit() here since we want to terminate ASAP.
-// We might be executed in context of the region manager.
-EXTERN_C_BEGIN
-void _exit(int status) __attribute__ ((__noreturn__));
-EXTERN_C_END
-
-# ifdef L4BID_RELEASE_MODE
-#  define Panic(args...) do                                      \
-                           {                                     \
-                            LOG(args);                          \
-                            LOG_flush();                        \
-                            _exit(-1);                          \
-                          }                                     \
-                         while (1)
-# else
-#  define Panic(args...) do                                      \
-                           {                                     \
-                             LOG(args);                          \
-                             LOG_flush();                        \
-                             enter_kdebug("PANIC, 'g' for exit");\
-                             _exit(-1);                          \
-                           }                                     \
-                         while (1)
-# endif
-#endif
-
-/* assertion */
-#ifndef Assert
-#  define Assert(expr) do                                        \
-                         {                                       \
-                           if (!(expr))                          \
-                             {                                   \
-                               LOG_printf(#expr "\n");           \
-                               Panic("Assertion failed");        \
-                             }                                   \
-                         }                                       \
-                       while (0)
-#endif
-
-/* enter kernel debugger */
-#ifndef Kdebug
-#  define Kdebug(args...)  do                                    \
-                             {                                   \
-                               LOG(args);                        \
-                               LOG_flush();                      \
-                               enter_kdebug("KD");               \
-                             }                                   \
-                           while (0)
-#endif
-#endif
+#include <l4/log/macros.h>
 
 /*****************************************************************************
  *** debug stuff (to be removed, use LOG* macros instead!)
@@ -94,7 +37,7 @@ EXTERN_C_END
 #  undef PANIC
 #endif
 
-#ifdef DEBUG
+#ifndef NDEBUG
 
 #define KDEBUG(args...) do                                   \
                           {                                  \
@@ -116,12 +59,12 @@ EXTERN_C_END
 #  define PANIC(args...)  do {} while (0)
 #endif
 
-#else /* !DEBUG */
+#else /* NDEBUG */
 
 #define KDEBUG(args...) do {} while (0)
 #define ASSERT(expr)    do {} while (0)
 #define PANIC(args...)  do {} while (0)
 
-#endif /* !DEBUG */
+#endif /* NDEBUG */
 
 #endif /* !_L4UTIL_MACROS_H */