URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
1325 |
phoenix |
/****************************************************************************
|
2 |
|
|
**
|
3 |
|
|
** NAME:
|
4 |
|
|
** debug.h
|
5 |
|
|
**
|
6 |
|
|
** DESCRIPTION:
|
7 |
|
|
** This header file defines the debug macros used in pthreads. To turn
|
8 |
|
|
** debugging on, add -DDEBUG_PT to CFLAGS. It was added to the original
|
9 |
|
|
** distribution of linuxthreads.
|
10 |
|
|
**
|
11 |
|
|
** This program is free software; you can redistribute it and/or
|
12 |
|
|
** modify it under the terms of the GNU Library General Public License
|
13 |
|
|
** as published by the Free Software Foundation; either version 2
|
14 |
|
|
** of the License, or (at your option) any later version.
|
15 |
|
|
**
|
16 |
|
|
** This program is distributed in the hope that it will be useful,
|
17 |
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
|
|
** GNU Library General Public License for more details.
|
20 |
|
|
**
|
21 |
|
|
****************************************************************************/
|
22 |
|
|
|
23 |
|
|
#ifndef _PT_DEBUG_H
|
24 |
|
|
#define _PT_DEBUG_H
|
25 |
|
|
|
26 |
|
|
/* include asserts for now */
|
27 |
|
|
#define DO_ASSERT
|
28 |
|
|
|
29 |
|
|
/* define the PDEBUG macro here */
|
30 |
|
|
#undef PDEBUG
|
31 |
|
|
#ifdef DEBUG_PT
|
32 |
|
|
# define PDEBUG(fmt, args...) __pthread_message(__FUNCTION__": " fmt, ## args)
|
33 |
|
|
#else
|
34 |
|
|
# define PDEBUG(fmt, args...) /* debug switched off */
|
35 |
|
|
#endif
|
36 |
|
|
|
37 |
|
|
/* nothing; placeholder to disable a PDEBUG message but don't delete it */
|
38 |
|
|
#undef PDEBUGG
|
39 |
|
|
#define PDEBUGG(fmt, args...)
|
40 |
|
|
|
41 |
|
|
/* Define ASSERT to stop/warn. Should be void in production code */
|
42 |
|
|
#undef ASSERT
|
43 |
|
|
#ifdef DO_ASSERT
|
44 |
|
|
# define ASSERT(x) if (!(x)) fprintf(stderr, "pt: assertion failed in %s:%i.\n",\
|
45 |
|
|
__FILE__, __LINE__)
|
46 |
|
|
#else
|
47 |
|
|
# define ASSERT(x)
|
48 |
|
|
#endif
|
49 |
|
|
|
50 |
|
|
#endif /* _PT_DEBUG_H */
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.