1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
;
; RTEMS Trace Linker Printf and Prink configuration.
;
; Copyright 2014 Chris Johns <chrisj@rtems.org>
;
;
; A printf generator prints to stdout the trace functions.
;
[printf-generator]
headers = printf-generator-headers
entry-trace = "rtld_pg_printf_entry(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
arg-trace = "rtld_pg_printf_arg(@ARG_NUM@, @ARG_TYPE@, @ARG_SIZE@, (void*) &@ARG_LABEL@);"
exit-trace = "rtld_pg_printf_exit(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
ret-trace = "rtld_pg_printf_ret(@RET_TYPE@, @RET_SIZE@, (void*) &@RET_LABEL@);"
code = <<<CODE
static inline void rtld_pg_printf_entry(const char* func_name,
void* func_addr)
{
printf (">>> %s (0x%08x)\n", func_name, func_addr);
}
static inline void rtld_pg_printf_arg(int arg_num,
const char* arg_type,
int arg_size,
void* arg)
{
const unsigned char* p = arg;
int i;
printf (" %2d] %s(%d) = ", arg_num, arg_type, arg_size);
for (i = 0; i < arg_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
printf ("\n");
}
static inline void rtld_pg_printf_exit(const char* func_name,
void* func_addr)
{
printf ("<<< %s (0x%08x)\n", func_name, func_addr);
}
static inline void rtld_pg_printf_ret(const char* ret_type,
int ret_size,
void* ret)
{
const unsigned char* p = ret;
int i;
printf (" rt] %s(%d) = ", ret_type, ret_size);
for (i = 0; i < ret_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
printf ("\n");
}
CODE
[printf-generator-headers]
header = "#include <stdio.h>"
[printk-generator]
headers = printk-generator-headers
entry-trace = "rtld_pg_printk_entry(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
arg-trace = "rtld_pg_printk_arg(@ARG_NUM@, @ARG_TYPE@, @ARG_SIZE@, (void*) &@ARG_LABEL@);"
exit-trace = "rtld_pg_printk_exit(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
ret-trace = "rtld_pg_printk_ret(@RET_TYPE@, @RET_SIZE@, (void*) &@RET_LABEL@);"
code = <<<CODE
static inline void rtld_pg_printk_entry(const char* func_name,
void* func_addr)
{
printk (">>> %s (0x%08x)\n", func_name, func_addr);
}
static inline void rtld_pg_printk_arg(int arg_num,
const char* arg_type,
int arg_size,
void* arg)
{
const unsigned char* p = arg;
int i;
printk (" %2d] %s(%d) = ", arg_num, arg_type, arg_size);
for (i = 0; i < arg_size; ++i, ++p) printk ("%02x", (unsigned int) *p);
printk ("\n");
}
static inline void rtld_pg_printk_exit(const char* func_name,
void* func_addr)
{
printk ("<<< %s (0x%08x)\n", func_name, func_addr);
}
static inline void rtld_pg_printk_ret(const char* ret_type,
int ret_size,
void* ret)
{
const unsigned char* p = ret;
int i;
printk (" rt] %s(%d) = ", ret_type, ret_size);
for (i = 0; i < ret_size; ++i, ++p) printk ("%02x", (unsigned int) *p);
printk ("\n");
}
CODE
[printk-generator-headers]
header = "#include <rtems/bspIo.h>"
|