KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
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 #ifndef __KOS_OPTS_H
8 #define __KOS_OPTS_H
9 
10 #include <sys/cdefs.h>
11 __BEGIN_DECLS
12 
13 /** \file kos/opts.h
14  \brief Compile-time options regarding debugging and other topics.
15 
16  This file is meant to be a kind of Grand Central Station for all of the
17  various compile-time options that can be set when building KOS. Each of the
18  various compile-time macros that control things like additional debugging
19  checks and such should be documented in this particular file. In addition,
20  groups of related macros are provided here to make it easier to set these
21  options at compile time.
22 
23  Basically, this is here to make it easier to customize your copy of KOS. In
24  the past, you would have had to search through all the various files to find
25  potential options, which was both annoying and error-prone. In addition,
26  often various debugging flags would end up being set in the main repository
27  as people debugged individual pieces of code, leaving them set for everyone
28  else, even if they aren't necessarily useful/helpful all the time (KM_DBG,
29  I'm looking at you).
30 
31  \author Lawrence Sebald
32 */
33 
34 /* Various debug options. Uncomment the #define line to enable the specific
35  option described. */
36 /* Enable debugging in fs_dclnative. This filesystem is deprecated, so there
37  probably won't be any good reason to enable these two. The first prints a bit
38  of debugging data, whereas the second prints out all packets received and
39  transmitted as well. You must uncomment the first in order for the second to
40  have any effect. */
41 /* #define DCLN_DEBUG 1 */
42 /* #define DCLN_DEBUG_VERBOSE 1 */
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 
71 /* Aggregate debugging levels. It's probably best to enable these with your
72  KOS_CFLAGS when compiling KOS itself, but they're all documented here and
73  can be enabled here, if you really want to. */
74 
75 /* Enable all recommended options for normal debugging use. This enables the
76  first level of malloc debugging for the main pool, as well as the internal
77  dlmalloc debugging code for the main pool. This is essentially the set that
78  was normally enabled in the repository tree. */
79 /* #define KOS_DEBUG 1 */
80 
81 /* Enable verbose debugging support. Basically, if your code is crashing and the
82  stuff in the first level doesn't help, then use this one instead. This adds
83  in verbose malloc debugging in the main pool, as well as basic PVR malloc
84  debugging. */
85 /* #define KOS_DEBUG 2 */
86 
87 /* Enable verbose debugging support, plus additional debugging options that
88  normally wouldn't be needed. Once again, try lighter levels before this one,
89  as there's not much reason this one should ever be needed. This level
90  includes the internal debugging stuff in fs_vmu, verbose debugging in the PVR
91  malloc, as well as everything in level 2. */
92 /* #define KOS_DEBUG 3 */
93 
94 
95 #if KOS_DEBUG >= 1
96 #define MALLOC_DEBUG 1
97 #define KM_DBG 1
98 #endif
99 
100 #if KOS_DEBUG >= 2
101 #define KM_DBG_VERBOSE 1
102 #define PVR_MALLOC_DEBUG 1
103 #define PVR_KM_DBG 1
104 #endif
105 
106 #if KOS_DEBUG >= 3
107 #define PVR_KM_DBG_VERBOSE 1
108 #define VMUFS_DEBUG 1
109 #endif
110 
111 __END_DECLS
112 
113 #endif /* !__KOS_OPTS_H */