1 --------------------------------------------------------------------------
2 -- Copyright (c) 2007-2010, 2012, 2013, ETH Zurich.
3 -- Copyright (c) 2014, HP Labs.
4 -- All rights reserved.
6 -- This file is distributed under the terms in the attached LICENSE file.
7 -- If you do not find this file, copies can be found by writing to:
8 -- ETH Zurich D-INFK, CAB F.78, Universitaetstr. 6, CH-8092 Zurich,
9 -- Attn: Systems Group.
11 -- Configuration options for Hake
13 --------------------------------------------------------------------------
22 -- path to source and install directories; these are automatically set by hake.sh at setup time
24 -- source_dir = undefined -- (set by hake.sh, see end of file)
27 -- install_dir = undefined -- (set by hake.sh, see end of file)
29 -- Set of architectures for which to generate rules
30 architectures :: [String]
31 -- architectures = undefined -- (set by hake.sh, see end of file)
33 -- Optimisation flags (-Ox -g etc.) passed to compiler
37 -- Selects which libc to compile with, "oldc" or "newlib"
42 newlib_malloc :: String
43 --newlib_malloc = "sbrk" -- use sbrk and newlib's malloc()
44 --newlib_malloc = "dlmalloc" -- use dlmalloc
45 newlib_malloc = "oldmalloc"
47 -- Configure pagesize for libbarrelfish's morecore implementation
48 -- x86_64 accepts "small", "large", and "huge" for 4kB, 2MB and 1GB pages
49 -- respectively. x86_32 accepts "small" and "large" for 4kB and 2MB/4MB pages
50 -- respectively. All other architectures default to their default page size.
51 morecore_pagesize :: String
52 morecore_pagesize = "large"
54 -- Use a frame pointer
58 -- Default timeslice duration in milliseconds
62 -- Put kernel into microbenchmarks mode
63 microbenchmarks :: Bool
64 microbenchmarks = False
70 -- Enable QEMU networking. (ie. make network work in small memory)
71 support_qemu_networking :: Bool
72 support_qemu_networking = False
74 -- armv7 platform to build for
75 -- Currently available: gem5, pandaboard
76 armv7_platform :: String
77 --armv7_platform = "gem5"
78 armv7_platform = "pandaboard"
80 -- on pandaboard, build a heterogenous image and let the cortex-A9 set up and start the
81 -- cortex-M3 processor (build targets "heteropanda_slave" and "heteropanda_master_image")
85 -- enable network tracing
86 trace_network_subsystem :: Bool
87 trace_network_subsystem = False
89 -- May want to disable LRPC to improve trace visuals
90 trace_disable_lrpc :: Bool
91 trace_disable_lrpc = False
94 use_kaluga_dvm :: Bool
97 -- Domain and driver debugging
107 rtl8029_debug :: Bool
108 rtl8029_debug = False
113 libahci_debug :: Bool
114 libahci_debug = False
119 ethersrv_debug :: Bool
120 ethersrv_debug = False
125 libacpi_debug :: Bool
126 libacpi_debug = False
128 acpi_interface_debug :: Bool
129 acpi_interface_debug = False
131 lpc_timer_debug :: Bool
132 lpc_timer_debug = False
146 eclipse_kernel_debug :: Bool
147 eclipse_kernel_debug = False
152 skb_client_debug :: Bool
153 skb_client_debug = False
155 flounder_debug :: Bool
156 flounder_debug = False
158 flounder_failed_debug :: Bool
159 flounder_failed_debug = False
161 webserver_debug :: Bool
162 webserver_debug = False
164 sqlclient_debug :: Bool
165 sqlclient_debug = False
170 sqlite_backend_debug :: Bool
171 sqlite_backend_debug = False
179 loopback_debug :: Bool
180 loopback_debug = False
182 octopus_debug :: Bool
183 octopus_debug = False
191 -- Deadlock debugging
192 debug_deadlocks :: Bool
193 debug_deadlocks = False
195 -- Partitioned memory server
196 memserv_percore :: Bool
197 memserv_percore = False
199 -- Lazy THC implementation (requires use_fp = True)
201 lazy_thc | elem "armv7" architectures = False
202 | elem "armv5" architectures = False
203 | elem "xscale" architectures = False
206 -- Enable capability tracing debug facility
210 -- Mapping Database configuration options (this affects lib/mdb/)
211 -- enable extensive tracing of mapping db implementation
215 -- enable tracing of top level mdb_insert, mdb_remove calls
216 mdb_trace_no_recursive :: Bool
217 mdb_trace_no_recursive = False
219 -- fail on invariant violations
220 mdb_fail_invariants :: Bool
221 mdb_fail_invariants = True
223 -- check invariants before/after mdb_insert/mdb_remove.
224 mdb_check_invariants :: Bool
225 mdb_check_invariants = False
227 -- recheck invariants at each tracing point
228 mdb_recheck_invariants :: Bool
229 mdb_recheck_invariants = False
231 -- enable extensive tracing of mapping db implementation (userspace version)
232 mdb_trace_user :: Bool
233 mdb_trace_user = False
235 -- fail on invariant violations
236 mdb_fail_invariants_user :: Bool
237 mdb_fail_invariants_user = True
239 -- recheck invariants at each tracing point
240 mdb_recheck_invariants_user :: Bool
241 mdb_recheck_invariants_user = True
243 -- check invariants before/after mdb_insert/mdb_remove.
244 mdb_check_invariants_user :: Bool
245 mdb_check_invariants_user = True
248 data Scheduler = RBED | RR deriving (Show,Eq)
249 scheduler :: Scheduler
252 -- Physical Address Extensions (PAE)-enabled paging on x86-32
256 -- Page Size Extensions (PSE)-enabled paging on x86-32
257 -- Always enabled when pae_paging == True, regardless of value
261 -- No Execute Extensions (NXE)-enabled paging on x86-32
262 -- May not be True when pae_paging == False
266 oneshot_timer :: Bool
267 oneshot_timer = False
269 defines :: [RuleToken]
270 defines = [ Str ("-D" ++ d) | d <- [
271 if microbenchmarks then "CONFIG_MICROBENCHMARKS" else "",
272 if trace then "CONFIG_TRACE" else "",
273 if support_qemu_networking then "CONFIG_QEMU_NETWORK" else "",
274 if trace_network_subsystem then "NETWORK_STACK_TRACE" else "",
275 if trace_disable_lrpc then "TRACE_DISABLE_LRPC" else "",
276 if global_debug then "GLOBAL_DEBUG" else "",
277 if e1000n_debug then "E1000N_SERVICE_DEBUG" else "",
278 if ahcid_debug then "AHCI_SERVICE_DEBUG" else "",
279 if libahci_debug then "AHCI_LIB_DEBUG" else "",
280 if vfs_debug then "VFS_DEBUG" else "",
281 if eMAC_debug then "EMAC_SERVICE_DEBUG" else "",
282 if rtl8029_debug then "RTL8029_SERVICE_DEBUG" else "",
283 if ethersrv_debug then "ETHERSRV_SERVICE_DEBUG" else "",
284 if netd_debug then "NETD_SERVICE_DEBUG" else "",
285 if libacpi_debug then "ACPI_DEBUG_OUTPUT" else "",
286 if acpi_interface_debug then "ACPI_BF_DEBUG" else "",
287 if lpc_timer_debug then "LPC_TIMER_DEBUG" else "",
288 if lwip_debug then "LWIP_BARRELFISH_DEBUG" else "",
289 if libpci_debug then "PCI_CLIENT_DEBUG" else "",
290 if usrpci_debug then "PCI_SERVICE_DEBUG" else "",
291 if timer_debug then "TIMER_CLIENT_DEBUG" else "",
292 if eclipse_kernel_debug then "ECLIPSE_KERNEL_DEBUG" else "",
293 if skb_debug then "SKB_SERVICE_DEBUG" else "",
294 if skb_client_debug then "SKB_CLIENT_DEBUG" else "",
295 if flounder_debug then "FLOUNDER_DEBUG" else "",
296 if flounder_failed_debug then "FLOUNDER_FAILED_DEBUG" else "",
297 if webserver_debug then "WEBSERVER_DEBUG" else "",
298 if sqlclient_debug then "SQL_CLIENT_DEBUG" else "",
299 if sqlite_debug then "SQL_SERVICE_DEBUG" else "",
300 if sqlite_backend_debug then "SQL_BACKEND_DEBUG" else "",
301 if nfs_debug then "NFS_CLIENT_DEBUG" else "",
302 if rpc_debug then "RPC_DEBUG" else "",
303 if loopback_debug then "LOOPBACK_DEBUG" else "",
304 if octopus_debug then "DIST_SERVICE_DEBUG" else "",
305 if term_debug then "TERMINAL_LIBRARY_DEBUG" else "",
306 if serial_debug then "SERIAL_DRIVER_DEBUG" else "",
307 if debug_deadlocks then "CONFIG_DEBUG_DEADLOCKS" else "",
308 if memserv_percore then "CONFIG_MEMSERV_PERCORE" else "",
309 if lazy_thc then "CONFIG_LAZY_THC" else "",
310 if pae_paging then "CONFIG_PAE" else "",
311 if pse_paging then "CONFIG_PSE" else "",
312 if nxe_paging then "CONFIG_NXE" else "",
313 if libc == "oldc" then "CONFIG_OLDC" else "CONFIG_NEWLIB",
314 if oneshot_timer then "CONFIG_ONESHOT_TIMER" else "",
315 if use_kaluga_dvm then "USE_KALUGA_DVM" else "",
316 if heteropanda then "HETEROPANDA" else "",
317 if caps_trace then "TRACE_PMEM_CAPS" else ""
320 -- Sets the include path for the libc
322 libcInc = if libc == "oldc" then "/include/oldc"
323 else "/lib/newlib/newlib/libc/include"
325 -- Sets the include path for lwIP
327 lwipInc = "/lib/lwip/src/include"
329 lwipxxxInc = "/lib/lwip/src/include/ipv4"
331 -- some defines depend on the architecture/compile options
332 arch_defines :: Options -> [RuleToken]
334 -- enable config flags for interconnect drivers in use for this arch
336 | d <- ["CONFIG_INTERCONNECT_DRIVER_" ++ (map toUpper n)
337 | n <- optInterconnectDrivers opts]
339 -- enable config flags for flounder backends in use for this arch
341 | d <- ["CONFIG_FLOUNDER_BACKEND_" ++ (map toUpper n)
342 | n <- optFlounderBackends opts]
345 -- newlib common compile flags (maybe put these in a config.h file?)
346 newlibAddCFlags :: [String]
347 newlibAddCFlags = [ "-DPACKAGE_NAME=\"newlib\"" ,
348 "-DPACKAGE_TARNAME=\"newlib\"",
349 "-DPACKAGE_VERSION=\"1.19.0\"",
350 "-DPACKAGE_BUGREPORT=\"\"",
351 "-DPACKAGE_URL=\"\"",
352 "-D_I386MACH_ALLOW_HW_INTERRUPTS",
353 "-DMISSING_SYSCALL_NAMES",
354 "-D_WANT_IO_C99_FORMATS",
355 "-D_COMPILING_NEWLIB",
356 "-D_WANT_IO_LONG_LONG",
357 "-D_WANT_IO_LONG_DOUBLE",