pspsdk-1.0+beta2
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 
76 
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 
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 
187 
192 
194 typedef struct _PspDebugRegBlock
195 {
196  u32 frame[6];
198  u32 r[32];
207  float fpr[32];
212  /* Unused on PSP */
228  /* PRId should still be okay */
230  u32 padding[100];
232 
234 typedef void (*PspDebugErrorHandler)(PspDebugRegBlock *regs);
235 
244 
254 
256 typedef int (*PspDebugKprintfHandler)(const char *format, u32 *args);
257 
265 
267 typedef struct _PspDebugStackTrace
268 {
274 
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;
313 
315 void pspDebugProfilerEnable(void);
316 
318 void pspDebugProfilerDisable(void);
319 
321 void pspDebugProfilerClear(void);
322 
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 
346 
355 
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