1212 * more details.
1313 */
1414
15- #ifndef _TILE_BACKTRACE_H
16- #define _TILE_BACKTRACE_H
17-
18-
15+ #ifndef _ASM_TILE_BACKTRACE_H
16+ #define _ASM_TILE_BACKTRACE_H
1917
2018#include <linux/types.h>
2119
22- #include <arch/chip.h>
23-
24- #if defined(__tile__ )
25- typedef unsigned long VirtualAddress ;
26- #elif CHIP_VA_WIDTH () > 32
27- typedef unsigned long long VirtualAddress ;
28- #else
29- typedef unsigned int VirtualAddress ;
30- #endif
31-
32-
33- /** Reads 'size' bytes from 'address' and writes the data to 'result'.
20+ /* Reads 'size' bytes from 'address' and writes the data to 'result'.
3421 * Returns true if successful, else false (e.g. memory not readable).
3522 */
3623typedef bool (* BacktraceMemoryReader )(void * result ,
37- VirtualAddress address ,
24+ unsigned long address ,
3825 unsigned int size ,
3926 void * extra );
4027
4128typedef struct {
42- /** Current PC. */
43- VirtualAddress pc ;
29+ /* Current PC. */
30+ unsigned long pc ;
4431
45- /** Current stack pointer value. */
46- VirtualAddress sp ;
32+ /* Current stack pointer value. */
33+ unsigned long sp ;
4734
48- /** Current frame pointer value (i.e. caller's stack pointer) */
49- VirtualAddress fp ;
35+ /* Current frame pointer value (i.e. caller's stack pointer) */
36+ unsigned long fp ;
5037
51- /** Internal use only: caller's PC for first frame. */
52- VirtualAddress initial_frame_caller_pc ;
38+ /* Internal use only: caller's PC for first frame. */
39+ unsigned long initial_frame_caller_pc ;
5340
54- /** Internal use only: callback to read memory. */
41+ /* Internal use only: callback to read memory. */
5542 BacktraceMemoryReader read_memory_func ;
5643
57- /** Internal use only: arbitrary argument to read_memory_func. */
44+ /* Internal use only: arbitrary argument to read_memory_func. */
5845 void * read_memory_func_extra ;
5946
6047} BacktraceIterator ;
6148
6249
63- /** Initializes a backtracer to start from the given location.
64- *
65- * If the frame pointer cannot be determined it is set to -1.
66- *
67- * @param state The state to be filled in.
68- * @param read_memory_func A callback that reads memory. If NULL, a default
69- * value is provided.
70- * @param read_memory_func_extra An arbitrary argument to read_memory_func.
71- * @param pc The current PC.
72- * @param lr The current value of the 'lr' register.
73- * @param sp The current value of the 'sp' register.
74- * @param r52 The current value of the 'r52' register.
75- */
76- extern void backtrace_init (BacktraceIterator * state ,
77- BacktraceMemoryReader read_memory_func ,
78- void * read_memory_func_extra ,
79- VirtualAddress pc , VirtualAddress lr ,
80- VirtualAddress sp , VirtualAddress r52 );
81-
82-
83- /** Advances the backtracing state to the calling frame, returning
84- * true iff successful.
85- */
86- extern bool backtrace_next (BacktraceIterator * state );
87-
88-
8950typedef enum {
9051
9152 /* We have no idea what the caller's pc is. */
@@ -138,7 +99,7 @@ enum {
13899};
139100
140101
141- /** Internal constants used to define 'info' operands. */
102+ /* Internal constants used to define 'info' operands. */
142103enum {
143104 /* 0 and 1 are reserved, as are all negative numbers. */
144105
@@ -147,13 +108,10 @@ enum {
147108 CALLER_SP_IN_R52_BASE = 4 ,
148109
149110 CALLER_SP_OFFSET_BASE = 8 ,
150-
151- /* Marks the entry point of certain functions. */
152- ENTRY_POINT_INFO_OP = 16
153111};
154112
155113
156- /** Current backtracer state describing where it thinks the caller is. */
114+ /* Current backtracer state describing where it thinks the caller is. */
157115typedef struct {
158116 /*
159117 * Public fields
@@ -192,7 +150,13 @@ typedef struct {
192150
193151} CallerLocation ;
194152
153+ extern void backtrace_init (BacktraceIterator * state ,
154+ BacktraceMemoryReader read_memory_func ,
155+ void * read_memory_func_extra ,
156+ unsigned long pc , unsigned long lr ,
157+ unsigned long sp , unsigned long r52 );
195158
196159
160+ extern bool backtrace_next (BacktraceIterator * state );
197161
198- #endif /* _TILE_BACKTRACE_H */
162+ #endif /* _ASM_TILE_BACKTRACE_H */
0 commit comments