9
0
Fork 0
barebox/include/debug_ll.h

51 lines
1.3 KiB
C
Raw Normal View History

2007-07-05 16:01:28 +00:00
/* debug_ll.h
*
* written by Marc Singer
* 12 Feb 2005
*
* Copyright (C) 2005 Marc Singer
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef __INCLUDE_DEBUG_LL_H__
#define __INCLUDE_DEBUG_LL_H__
2007-07-12 07:25:47 +00:00
#if defined (CONFIG_DEBUG_LL)
# include <mach/debug_ll.h>
2007-07-05 16:01:28 +00:00
# define PUTHEX_LL(value) ({ unsigned long v = (unsigned long) (value); \
int i; unsigned char ch; \
for (i = 8; i--; ) {\
ch = ((v >> (i*4)) & 0xf);\
ch += (ch >= 10) ? 'a' - 10 : '0';\
2007-07-12 07:25:47 +00:00
PUTC_LL (ch); }})
static __inline__ void PUTS_LL(const char * str)
{
while (*str) {
if (*str == '\n') {
PUTC_LL('\r');
}
PUTC_LL(*str);
str++;
}
}
2007-07-12 07:25:47 +00:00
#else
# define PUTC_LL(c) do {} while (0)
# define PUTHEX_LL(v) do {} while (0)
# define PUTS_LL(c) do {} while (0)
2007-07-05 16:01:28 +00:00
2007-07-12 07:25:47 +00:00
#endif
2007-07-05 16:01:28 +00:00
#endif /* __INCLUDE_DEBUG_LL_H__ */