2 * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
9 * As a special exception, you may use this file as part of a free software
10 * library without restriction. Specifically, if other files instantiate
11 * templates or use macros or inline functions from this file, or you compile
12 * this file and link it with other files to produce an executable, this
13 * file does not by itself cause the resulting executable to be covered by
14 * the GNU General Public License. This exception does not however
15 * invalidate any other reasons why the executable file might be covered by
16 * the GNU General Public License.
18 #ifndef __L4SYS__INCLUDE__ARCH_SPARC__KDEBUG_H__
19 #define __L4SYS__INCLUDE__ARCH_SPARC__KDEBUG_H__
21 #include <l4/sys/compiler.h>
22 #include <l4/sys/consts.h>
25 #ifndef L4_SYSCALL_MAGIC_OFFSET
26 # define L4_SYSCALL_MAGIC_OFFSET 8
28 #define L4_SYSCALL_ENTER_KDEBUG (-0x00000020-L4_SYSCALL_MAGIC_OFFSET)
31 #define enter_kdebug(text...) do { } while (1)
34 outnstring(const char* x, unsigned len);
37 outstring(const char *text);
61 kd_display(char *text);
76 l4_atomic_add(volatile long int* mem, long int offset) L4_NOTHROW;
79 l4_atomic_cmpxchg(volatile long int* mem, long int oldval, long int newval) L4_NOTHROW;
84 L4_INLINE void __touch_ro(const char *x, unsigned len);
86 L4_INLINE unsigned long
87 __kdebug_param(unsigned long nr, unsigned long p1, unsigned long p2);
89 L4_INLINE unsigned long
90 __kdebug_param_5(unsigned long nr, unsigned long p1, unsigned long p2,
91 unsigned long p3, unsigned long p4, unsigned long p5);
95 __kdebug_param(unsigned long nr, unsigned long p1, unsigned long p2)
105 __kdebug_param_5(unsigned long nr, unsigned long p1, unsigned long p2,
106 unsigned long p3, unsigned long p4, unsigned long p5)
118 __touch_ro(const char *x, unsigned len)
120 volatile const char *sptr, *eptr;
121 sptr = (const char*)((unsigned)x & L4_PAGEMASK);
122 eptr = (const char*)(((unsigned)x + len -1) & L4_PAGEMASK);
124 for(;sptr <= eptr; sptr += L4_PAGESIZE)
129 outnstring(const char* x, unsigned len)
132 __kdebug_param(3, (unsigned long)x, (unsigned long)len);
136 outstring(const char *text)
146 __kdebug_param(1, (unsigned long)c, 0);
152 __kdebug_param(4, (unsigned long)number, 0);
158 __kdebug_param(5, (unsigned long)number, 0);
164 __kdebug_param(6, (unsigned long)number, 0);
170 __kdebug_param(7, (unsigned long)number, 0);
176 __kdebug_param(8, (unsigned long)number, 0);
182 __kdebug_param(9, (unsigned long)number, 0);
186 kd_display(char *text)
194 return __kdebug_param(0xd, 0, 0);
200 __kdebug_param(0x32, 0, 0);
206 __kdebug_param(0x33, 0, 0);
212 // __KDEBUG_ARM_PARAM_0(0x3f);
217 return __kdebug_param(0x34, 0, 0);
221 #endif /* ! __L4SYS__INCLUDE__ARCH_SPARC__KDEBUG_H__ */