pspsdk-1.0+beta2
Main Page
Modules
Data Structures
Files
File List
Globals
pspdebug.h
Go to the documentation of this file.
1
/*
2
* PSP Software Development Kit - http://www.pspdev.org
3
* -----------------------------------------------------------------------
4
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5
*
6
* pspdebug.h - Prototypes for the pspDebug library
7
*
8
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11
*
12
* $Id: pspdebug.h 2487 2009-11-01 17:02:17Z jim $
13
*/
14
#ifndef __DEBUG_H__
15
#define __DEBUG_H__
16
17
#include <
psptypes.h
>
18
#include <
pspmoduleinfo.h
>
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
28
32
void
pspDebugScreenInit
(
void
);
33
41
void
pspDebugScreenInitEx
(
void
*vram_base,
int
mode,
int
setup);
42
49
void
pspDebugScreenPrintf
(
const
char
*fmt, ...)
__attribute__
((format(
printf
,1,2)));
50
60
void
pspDebugScreenKprintf
(const
char
*format, ...)
__attribute__
((format(printf,1,2)));
61
67
void
pspDebugScreenEnableBackColor
(
int
enable);
68
75
void
pspDebugScreenSetBackColor
(
u32
color);
76
82
void
pspDebugScreenSetTextColor
(
u32
color);
83
89
void
pspDebugScreenSetColorMode
(
int
mode);
90
99
void
pspDebugScreenPutChar
(
int
x
,
int
y
,
u32
color,
u8
ch
);
100
104
void
pspDebugScreenSetXY
(
int
x,
int
y);
105
111
void
pspDebugScreenSetOffset
(
int
offset
);
112
118
void
pspDebugScreenSetBase
(
u32
* base);
119
126
void
pspDebugScreenSetMaxX
(
unsigned
int
maxx);
127
133
void
pspDebugScreenSetMaxY
(
unsigned
int
maxy);
134
140
int
pspDebugScreenGetX
(
void
);
141
147
int
pspDebugScreenGetY
(
void
);
148
152
void
pspDebugScreenClear
(
void
);
153
162
int
pspDebugScreenPrintData
(const
char
*buff,
int
size
);
163
171
int
pspDebugScreenPuts
(const
char
*str);
172
181
int
pspDebugGetStackTrace
(
unsigned
int
* results,
int
max);
182
186
void
pspDebugScreenClearLineEnable
(
void
);
187
191
void
pspDebugScreenClearLineDisable
(
void
);
192
194
typedef struct
_PspDebugRegBlock
195
{
196
u32
frame[6];
198
u32
r
[32];
200
u32
status
;
202
u32
lo
;
203
u32
hi
;
204
u32
badvaddr
;
205
u32
cause
;
206
u32
epc
;
207
float
fpr[32];
208
u32
fsr
;
209
u32
fir
;
210
u32
frame_ptr
;
211
u32
unused
;
212
/* Unused on PSP */
213
u32
index
;
214
u32
random
;
215
u32
entrylo0
;
216
u32
entrylo1
;
217
u32
context
;
218
u32
pagemask
;
219
u32
wired
;
220
u32
cop0_7
;
221
u32
cop0_8
;
222
u32
cop0_9
;
223
u32
entryhi
;
224
u32
cop0_11
;
225
u32
cop0_12
;
226
u32
cop0_13
;
227
u32
cop0_14
;
228
/* PRId should still be okay */
229
u32
prid
;
230
u32
padding[100];
231
}
PspDebugRegBlock
;
232
234
typedef
void (*
PspDebugErrorHandler
)(
PspDebugRegBlock
*regs);
235
243
int
pspDebugInstallErrorHandler
(
PspDebugErrorHandler
handler);
244
253
void
pspDebugDumpException
(
PspDebugRegBlock
*regs);
254
256
typedef
int (*
PspDebugKprintfHandler
)(
const
char
*format,
u32
*args);
257
264
int
pspDebugInstallKprintfHandler
(
PspDebugKprintfHandler
handler);
265
267
typedef
struct
_PspDebugStackTrace
268
{
270
u32
call_addr
;
272
u32
func_addr
;
273
}
PspDebugStackTrace
;
274
287
int
pspDebugGetStackTrace2
(
PspDebugRegBlock
*regs,
PspDebugStackTrace
*trace,
int
max);
288
290
typedef
struct
_PspDebugProfilerRegs
291
{
292
volatile
u32
enable
;
293
volatile
u32
systemck
;
294
volatile
u32
cpuck
;
295
volatile
u32
internal
;
296
volatile
u32
memory
;
297
volatile
u32
copz
;
298
volatile
u32
vfpu
;
299
volatile
u32
sleep
;
300
volatile
u32
bus_access
;
301
volatile
u32
uncached_load
;
302
volatile
u32
uncached_store
;
303
volatile
u32
cached_load
;
304
volatile
u32
cached_store
;
305
volatile
u32
i_miss
;
306
volatile
u32
d_miss
;
307
volatile
u32
d_writeback
;
308
volatile
u32
cop0_inst
;
309
volatile
u32
fpu_inst
;
310
volatile
u32
vfpu_inst
;
311
volatile
u32
local_bus
;
312
}
PspDebugProfilerRegs
;
313
315
void
pspDebugProfilerEnable
(
void
);
316
318
void
pspDebugProfilerDisable
(
void
);
319
321
void
pspDebugProfilerClear
(
void
);
322
327
void
pspDebugProfilerGetRegs
(
PspDebugProfilerRegs
*regs);
328
330
void
pspDebugProfilerPrint
(
void
);
331
333
typedef
int (*
PspDebugPrintHandler
)(
const
char
*data,
int
len);
334
336
typedef
int (*
PspDebugInputHandler
)(
char
*data,
int
len);
337
345
int
pspDebugInstallStdinHandler
(
PspDebugInputHandler
handler);
346
354
int
pspDebugInstallStdoutHandler
(
PspDebugPrintHandler
handler);
355
363
int
pspDebugInstallStderrHandler
(
PspDebugPrintHandler
handler);
364
370
void
pspDebugSioPutchar
(
int
ch
);
371
377
int
pspDebugSioGetchar
(
void
);
378
384
void
pspDebugSioPuts
(
const
char
*str);
385
394
int
pspDebugSioPutData
(
const
char
*data,
int
len);
395
405
int
pspDebugSioPutText
(
const
char
*data,
int
len);
406
411
void
pspDebugSioInit
(
void
);
412
417
void
pspDebugSioSetBaud
(
int
baud);
418
423
void
pspDebugEnablePutchar
(
void
);
424
430
void
pspDebugSioInstallKprintf
(
void
);
431
435
void
pspDebugGdbStubInit
(
void
);
436
440
void
pspDebugBreakpoint
(
void
);
441
445
void
pspDebugSioEnableKprintf
(
void
);
446
450
void
pspDebugSioDisableKprintf
(
void
);
451
454
#ifdef __cplusplus
455
}
456
#endif
457
458
#endif
src
debug
pspdebug.h
Generated on Sat Apr 9 2016 07:00:25 for pspsdk-1.0+beta2 by
1.8.1.2