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