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 <
kos/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
/* Completely disable debug logging at compile time if defined. */
46
/* #define DBGLOG_DISABLED */
47
48
/* Set the maximum allowed dbglog level. Normally the level is adjustable at
49
runtime, but that means keeping all debug information even in release builds. */
50
#ifdef DBGLOG_DISABLED
51
#define DBGLOG_LEVEL_SUPPORT -1
52
#endif
53
54
/* This retains the old behavior of all debugging being retained for runtime */
55
#ifndef DBGLOG_LEVEL_SUPPORT
56
#define DBGLOG_LEVEL_SUPPORT 127
57
#endif
58
59
/* Enable debugging in fs_vmu. */
60
/* #define VMUFS_DEBUG 1 */
61
62
/* Enable to allow extra debugging checks in the malloc code itself. This
63
sometimes catches corrupted blocks. Recommended during debugging phases. */
64
/* #define MALLOC_DEBUG 1 */
65
66
/* Enable this define if you want costly malloc debugging (buffer sentinel
67
checking, block leak checking, etc). Recommended during debugging phases, but
68
you should probably take it out before you start your final testing. */
69
/* #define KM_DBG 1 */
70
71
/* Enable this define if you want REALLY verbose malloc debugging (print every
72
time a block is allocated or freed). Only enable this if you are having some
73
serious issues. */
74
/* #define KM_DBG_VERBOSE 1 */
75
76
77
/* The following three macros are similar to the ones above, but for the PVR
78
memory pool malloc. */
79
/* #define PVR_MALLOC_DEBUG 1 */
80
/* #define PVR_KM_DBG 1 */
81
/* #define PVR_KM_DBG_VERBOSE 1 */
82
83
/* Enable this define to enable PVR error interrupts and to have the interrupt
84
handler print them when they occur. */
85
/* #define PVR_RENDER_DBG */
86
87
/* Aggregate debugging levels. It's probably best to enable these with your
88
KOS_CFLAGS when compiling KOS itself, but they're all documented here and
89
can be enabled here, if you really want to. */
90
91
/* Enable all recommended options for normal debugging use. This enables the
92
first level of malloc debugging for the main pool, as well as the internal
93
dlmalloc debugging code for the main pool. This is essentially the set that
94
was normally enabled in the repository tree. */
95
/* #define KOS_DEBUG 1 */
96
97
/* Enable verbose debugging support. Basically, if your code is crashing and the
98
stuff in the first level doesn't help, then use this one instead. This adds
99
in verbose malloc debugging in the main pool, as well as basic PVR malloc
100
debugging. */
101
/* #define KOS_DEBUG 2 */
102
103
/* Enable verbose debugging support, plus additional debugging options that
104
normally wouldn't be needed. Once again, try lighter levels before this one,
105
as there's not much reason this one should ever be needed. This level
106
includes the internal debugging stuff in fs_vmu, verbose debugging in the PVR
107
malloc, as well as everything in level 2. */
108
/* #define KOS_DEBUG 3 */
109
110
#ifndef KOS_DEBUG
111
#define KOS_DEBUG 0
112
#endif
113
114
#if KOS_DEBUG >= 1
115
#define MALLOC_DEBUG 1
116
#define KM_DBG 1
117
#endif
118
119
#if KOS_DEBUG >= 2
120
#define KM_DBG_VERBOSE 1
121
#define PVR_MALLOC_DEBUG 1
122
#define PVR_KM_DBG 1
123
#endif
124
125
#if KOS_DEBUG >= 3
126
#define PVR_KM_DBG_VERBOSE 1
127
#define VMUFS_DEBUG 1
128
#endif
129
130
/** \brief The maximum number of ramdisk files that can be open at a time. */
131
#ifndef FS_RAMDISK_MAX_FILES
132
#define FS_RAMDISK_MAX_FILES 8
133
#endif
134
135
/** \brief The number of distinct file descriptors, including files and
136
network sockets, that can be in use at a time. Decreasing this
137
value can reduce memory usage. */
138
#ifndef FD_SETSIZE
139
#define FD_SETSIZE 1024
140
#endif
141
142
/** @} */
143
144
__END_DECLS
145
146
#endif
/* !__KOS_OPTS_H */
cdefs.h
Various common macros used throughout the codebase.
include
kos
opts.h
Generated by
1.12.0