]> git.ozlabs.org Git - yaboot.git/blob - include/debug.h
Allocate tftp temporary buffer from top of address space
[yaboot.git] / include / debug.h
1 /*
2  *  Debug defines
3  *
4  *  Copyright (C) 2001 Ethan Benson
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #if DEBUG
22 # define DEBUG_ENTER prom_printf( "--> %s\n", __PRETTY_FUNCTION__ )
23 # define DEBUG_LEAVE(str) \
24     prom_printf( "<-- %s - %s\n", __PRETTY_FUNCTION__, #str )
25 # define DEBUG_LEAVE_F(args...)\
26 {\
27     prom_printf( "<-- %s - %d\n", __PRETTY_FUNCTION__, ## args );\
28 }
29 # define DEBUG_F(fmt, args...)\
30 {\
31     prom_printf( "    %s - ", __PRETTY_FUNCTION__ );\
32     prom_printf( fmt, ## args );\
33 }
34 # define DEBUG_OPEN DEBUG_F( "dev=%s, part=0x%p (%d), file_name=%s\n",\
35                              fspec->dev, part, part ? part->part_number : -1,\
36                              fspec->file)
37 # define DEBUG_SLEEP prom_sleep(3)
38 #else
39 #define DEBUG_ENTER
40 #define DEBUG_LEAVE(x)
41 #define DEBUG_LEAVE_F(args...)
42 #define DEBUG_F(fmt, args...)
43 #define DEBUG_OPEN
44 #define DEBUG_SLEEP
45 #endif
46
47 /*
48  * Local variables:
49  * c-file-style: "k&r"
50  * c-basic-offset: 5
51  * End:
52  */