-
Notifications
You must be signed in to change notification settings - Fork 2
/
dbgio.h
63 lines (41 loc) · 1.49 KB
/
dbgio.h
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
/* KallistiOS 1.2.0
arch/dreamcast/include/dbgio.h
(c)2000 Dan Potter
$Id: dbgio.h,v 1.4 2002/04/06 23:40:32 bardtx Exp $
*/
// Ian micheal edit for system calls
#ifndef __ARCH_DBGIO_H
#define __ARCH_DBGIO_H
#include <sys/cdefs.h>
__BEGIN_DECLS
#include <arch/types.h>
/* Set another function to capture all debug output */
typedef void (*dbgio_printk_func)(const char *);
dbgio_printk_func dbgio_set_printk(dbgio_printk_func func);
extern dbgio_printk_func dbgio_printk;
/* Set serial parameters; this is not platform independent like I want
it to be, but it should be generic enough to be useful. */
void dbgio_set_parameters(int baud, int fifo);
/* Initialize the SCIF port */
void dbgio_init();
/* Write one char to the serial port (call serial_flush()!)*/
void dbgio_write(int c);
/* Flush all FIFO'd bytes out of the serial port buffer */
void dbgio_flush();
/* Send an entire buffer */
void dbgio_write_buffer(const uint8 *data, int len);
/* Read an entire buffer (block) */
void dbgio_read_buffer(uint8 *data, int len);
/* Send a string (null-terminated) */
void dbgio_write_str(const char *str);
/* Null write-string function for pre-init */
void dbgio_null_write(const char *str);
/* Read one char from the serial port (-1 if nothing to read) */
int dbgio_read();
/* Enable / Disable debug I/O globally */
void dbgio_disable();
void dbgio_enable();
/* Printf functionality */
int dbgio_printf(const char *fmt, ...) __printflike(1, 2);
__END_DECLS
#endif /* __ARCH_DBGIO_H */