KallistiOS
git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
opts.h
Go to the documentation of this file.
1
/* KallistiOS ##version##
2
3
kos/opts.h
4
Copyright (C) 2014 Lawrence Sebald
5
*/
6
7
/** \file kos/opts.h
8
\brief Compile-time options regarding debugging and other topics.
9
\ingroup debugging_options
10
11
This file is meant to be a kind of Grand Central Station for all of the
12
various compile-time options that can be set when building KOS. Each of the
13
various compile-time macros that control things like additional debugging
14
checks and such should be documented in this particular file. In addition,
15
groups of related macros are provided here to make it easier to set these
16
options at compile time.
17
18
Basically, this is here to make it easier to customize your copy of KOS. In
19
the past, you would have had to search through all the various files to find
20
potential options, which was both annoying and error-prone. In addition,
21
often various debugging flags would end up being set in the main repository
22
as people debugged individual pieces of code, leaving them set for everyone
23
else, even if they aren't necessarily useful/helpful all the time (KM_DBG,
24
I'm looking at you).
25
26
\author Lawrence Sebald
27
*/
28
29
#ifndef __KOS_OPTS_H
30
#define __KOS_OPTS_H
31
32
#include <sys/cdefs.h>
33
__BEGIN_DECLS
34
35
/** \defgroup debugging_options Options
36
\brief Compile-time options for debugging KOS
37
\ingroup debugging
38
39
Various debug options. Uncomment the `#define` line to enable the specific
40
option described.
41
42
@{
43
*/
44
45
/* Enable debugging in fs_vmu. */
46
/* #define VMUFS_DEBUG 1 */
47
48
49
/* Enable to allow extra debugging checks in the malloc code itself. This
50
sometimes catches corrupted blocks. Recommended during debugging phases. */
51
/* #define MALLOC_DEBUG 1 */
52
53
/* Enable this define if you want costly malloc debugging (buffer sentinel
54
checking, block leak checking, etc). Recommended during debugging phases, but
55
you should probably take it out before you start your final testing. */
56
/* #define KM_DBG 1 */
57
58
/* Enable this define if you want REALLY verbose malloc debugging (print every
59
time a block is allocated or freed). Only enable this if you are having some
60
serious issues. */
61
/* #define KM_DBG_VERBOSE 1 */
62
63
64
/* The following three macros are similar to the ones above, but for the PVR
65
memory pool malloc. */
66
/* #define PVR_MALLOC_DEBUG 1 */
67
/* #define PVR_KM_DBG 1 */
68
/* #define PVR_KM_DBG_VERBOSE 1 */
69
70
/* Enable this define to enable PVR error interrupts and to have the interrupt
71
handler print them when they occur. */
72
/* #define PVR_RENDER_DBG */
73
74
/* Aggregate debugging levels. It's probably best to enable these with your
75
KOS_CFLAGS when compiling KOS itself, but they're all documented here and
76
can be enabled here, if you really want to. */
77
78
/* Enable all recommended options for normal debugging use. This enables the
79
first level of malloc debugging for the main pool, as well as the internal
80
dlmalloc debugging code for the main pool. This is essentially the set that
81
was normally enabled in the repository tree. */
82
/* #define KOS_DEBUG 1 */
83
84
/* Enable verbose debugging support. Basically, if your code is crashing and the
85
stuff in the first level doesn't help, then use this one instead. This adds
86
in verbose malloc debugging in the main pool, as well as basic PVR malloc
87
debugging. */
88
/* #define KOS_DEBUG 2 */
89
90
/* Enable verbose debugging support, plus additional debugging options that
91
normally wouldn't be needed. Once again, try lighter levels before this one,
92
as there's not much reason this one should ever be needed. This level
93
includes the internal debugging stuff in fs_vmu, verbose debugging in the PVR
94
malloc, as well as everything in level 2. */
95
/* #define KOS_DEBUG 3 */
96
97
#ifndef KOS_DEBUG
98
#define KOS_DEBUG 0
99
#endif
100
101
#if KOS_DEBUG >= 1
102
#define MALLOC_DEBUG 1
103
#define KM_DBG 1
104
#endif
105
106
#if KOS_DEBUG >= 2
107
#define KM_DBG_VERBOSE 1
108
#define PVR_MALLOC_DEBUG 1
109
#define PVR_KM_DBG 1
110
#endif
111
112
#if KOS_DEBUG >= 3
113
#define PVR_KM_DBG_VERBOSE 1
114
#define VMUFS_DEBUG 1
115
#endif
116
117
/** \brief The maximum number of cd files that can be open at a time. */
118
#ifndef FS_CD_MAX_FILES
119
#define FS_CD_MAX_FILES 8
120
#endif
121
122
/** \brief The maximum number of romdisk files that can be open at a time. */
123
#ifndef FS_ROMDISK_MAX_FILES
124
#define FS_ROMDISK_MAX_FILES 16
125
#endif
126
127
/** \brief The maximum number of ramdisk files that can be open at a time. */
128
#ifndef FS_RAMDISK_MAX_FILES
129
#define FS_RAMDISK_MAX_FILES 8
130
#endif
131
132
/** \brief The number of distinct file descriptors, including files and
133
network sockets, that can be in use at a time. Decreasing this
134
value can reduce memory usage. */
135
#ifndef FD_SETSIZE
136
#define FD_SETSIZE 1024
137
#endif
138
139
/** @} */
140
141
__END_DECLS
142
143
#endif
/* !__KOS_OPTS_H */
include
kos
opts.h
Generated by
1.12.0