1/*
2 * Copyright (c) 2014 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef IOAT_DEBUG_H_
11#define IOAT_DEBUG_H_
12
13
14/*
15 * Debug output switches
16 */
17#define DEBUG_ENABLED   0
18#define DEBUG_DEVICE    1
19#define DEBUG_INTR      1
20#define DEBUG_DMA_SVC   1
21#define DEBUG_MGR_SVC   1
22
23
24/*
25 * --------------------------------------------------------------------------
26 * Debug output generation
27 */
28#if DEBUG_ENABLED
29#define DEBUGPRINT(x...) debug_printf(x)
30#else
31#define DEBUGPRINT(x... )
32#endif
33#if DEBUG_DEVICE
34#define DEV_DEBUG(x...) DEBUGPRINT("device | " x)
35#else
36#define DEV_DEBUG(x...)
37#endif
38#if DEBUG_INTR
39#define INTR_DEBUG(x...) DEBUGPRINT("intr  | " x)
40#else
41#define INTR_DEBUG(x...)
42#endif
43#if DEBUG_DMA_SVC
44#define DMA_DEBUG(x...) DEBUGPRINT("dmasvc | " x)
45#else
46#define DMA_DEBUG(x...)
47#endif
48#if DEBUG_MGR_SVC
49#define MGR_DEBUG(x...) DEBUGPRINT("mgrsvc | " x)
50#else
51#define MGR_DEBUG(x...)
52#endif
53
54#define ERRPRINT(x...) debug_printf(x)
55
56#define DEV_ERR(x...) ERRPRINT("device | ERROR: " x)
57#define DMA_ERR(x...) ERRPRINT("dmasvc | ERROR: " x)
58#define DMA_MGR(x...) ERRPRINT("mgrsvc | ERROR: " x)
59
60#endif /* IOAT_DEBUG_H_ */
61