3 SUBSYSTEMS = JABI ABI DRIVERS KERNEL LIBK LIBAMM CXXLIB \
4 TCBOFFSET SYMBOLS VERSION GBLCFG MINILIBC
6 ifeq ("$(CONFIG_GSTABS)","y")
10 PREPROCESS_PARTS += arch $(CONFIG_ABI) 32bit $(CONFIG_XARCH) \
11 fpu jdb_thread_names iofp \
12 obj_space_phys abs_syscalls auto_map_kip \
15 PREPROCESS_PARTS-$(CONFIG_MP) += mp
16 PREPROCESS_PARTS-$(CONFIG_LIST_ALLOC_SANITY) += list_alloc_debug
17 PREPROCESS_PARTS-$(CONFIG_JDB) += debug log
18 PREPROCESS_PARTS-$(CONFIG_PERF_CNT) += perf_cnt
19 PREPROCESS_PARTS-$(CONFIG_CONTEXT_4K) += context_4k
20 PREPROCESS_PARTS-$(CONFIG_SCHED_FIXED_PRIO) += sched_fixed_prio
21 PREPROCESS_PARTS-$(CONFIG_SCHED_WFQ) += sched_wfq
22 PREPROCESS_PARTS-$(CONFIG_SCHED_FP_WFQ) += sched_fp_wfq
24 PREPROCESS_PARTS += $(PREPROCESS_PARTS-y)
29 PRIVATE_INCDIR += types/$(CONFIG_XARCH) types
36 INTERFACES_ABI := l4_fpage l4_msg_item l4_buf_desc kip l4_types \
39 kip_IMPL := kip kip-ia32 kip-debug kip-ia32-debug
40 l4_types_IMPL := l4_types l4_types-debug
46 VPATH += jabi/$(CONFIG_XARCH) jabi
47 INTERFACES_JABI := jdb_ktrace
52 DRIVERS := libdrivers.a
53 VPATH += drivers/ux drivers/ia32 drivers
54 PRIVATE_INCDIR += drivers/ux drivers/ia32 drivers
55 INTERFACES_DRIVERS := mux_console console filter_console processor \
58 processor_IMPL := processor processor-ux
59 mem_IMPL := mem mem-ia32
64 KERNEL := fiasco.image
66 VPATH += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
67 VPATH += jdb/ia32 jdb/ia32/32 jdb/ux jdb
68 PRIVATE_INCDIR += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
70 KERNEL_EXTRA-$(CONFIG_UX_CON)) += ux_con
71 KERNEL_EXTRA-$(CONFIG_UX_NET) += ux_net
72 KERNEL_EXTRA += $(KERNEL_EXTRA-y)
76 # Important: The following list must be roughly sorted according to
77 # link dependencies. The Unit test for a module M links against all
78 # modules that precede M in this list, minus sibling modules (those
79 # modules that _directly_ precede M and that M does not include).
81 INTERFACES_KERNEL := mem_region simpleio kernel_console panic warn \
82 bitmap buddy_alloc irq_pin pages \
83 mem_layout per_cpu_data globals loader vhw \
84 kip_init ipi queue_item queue cpu_mask rcupdate \
85 boot_info cmdline config jdb_symbol jdb_util \
86 tb_entry perf_cnt jdb_tbuf x86desc \
87 emulation pic usermode cpu trampoline cpu_lock \
89 region entry_frame continuation \
90 kmem mapped_alloc mem_unit \
91 ram_quota kmem_alloc ptab_base per_cpu_data_alloc \
93 slab_cache_anon kmem_slab_simple dbg_page_info \
94 vmem_alloc paging kmem_slab fpu_state fpu \
95 ready_queue_wfq ready_queue_fp \
96 sched_context switch_lock timer timeout \
97 obj_space kobject_dbg kobject kobject_iface \
99 mem_space mem_space_sigma0 space vcpu context \
101 mp_lock ipc_gate irq_controller \
102 mapping mapping_tree mappable \
103 mapdb kobject_mapdb map_util \
104 hostproc task kernel_task prio_list \
105 thread_lock timeslice_timeout \
106 ipc_timeout thread_state \
107 sender receiver ipc_sender thread thread_object \
110 kernel_thread virq dirq dirq_pic_pin \
111 banner fpu_alloc irq icu_helper main \
112 startup irq_chip libc_support \
113 jdb_dbinfo jdb fb net utcb_init \
114 jdb_core jdb_module jdb_table \
115 jdb_thread_list jdb_input jdb_dump jdb_thread \
116 jdb_lines jdb_tcb jdb_prompt_module jdb_bt \
117 jdb_mapdb jdb_ptab jdb_kern_info jdb_counters \
118 glibc_getchar jdb_trace jdb_trace_set \
119 tb_entry_output jdb_tbuf_init kern_cnt \
120 jdb_tbuf_output jdb_tbuf_show \
121 jdb_misc checksum watchdog terminate \
122 jdb_screen push_console jdb_bp \
123 jdb_attach_irq sys_call_page \
124 jdb_timeout gdt factory \
125 idt tss trap_state jdb_prompt_ext \
126 jdb_handler_queue jdb_exit_module \
127 jdb_halt_thread jdb_tetris \
128 jdb_kern_info_kip jdb_kern_info_region \
129 jdb_kern_info_kmem_alloc jdb_kern_info_config \
130 jdb_space jdb_trap_state \
132 jdb_entry_frame kdb_ke jdb_ipi app_cpu_thread \
133 jdb_rcupdate jdb_kobject jdb_kobject_names \
134 jdb_list jdb_ipc_gate jdb_obj_space \
135 jdb_log jdb_factory jdb_semaphore scheduler \
136 jdb_scheduler clock jdb_sender_list \
139 #ifeq ("$(CONFIG_USER_LOCKS)","y")
140 PREPROCESS_PARTS += ulock
141 INTERFACES_KERNEL += u_semaphore
145 boot_info_IMPL := boot_info boot_info-ia32 boot_info-ux
146 clock_IMPL := clock clock-ia32
147 config_IMPL := config config-ia32-32 config-ux
148 context_IMPL := context context-ia32 context-ia32-32 context-ux \
150 continuation_IMPL := continuation-ia32-32-ux
151 cpu_IMPL := cpu cpu-ia32 cpu-ux cpu-32
152 cpu_lock_IMPL := cpu_lock cpu_lock-generic
153 dirq_IMPL := dirq dirq-ia32-ux
154 dirq_pic_pin_IMPL := dirq_pic_pin dirq_pic_pin-ia32-ux
155 entry_frame_IMPL := entry_frame entry_frame-ia32-ux \
156 entry_frame-abs-timeout-hack
157 fpu_IMPL := fpu fpu-ia32-ux fpu-ux
158 irq_IMPL := irq irq-ux
159 ipi_IMPL := ipi ipi-ux
160 jdb_IMPL := jdb jdb-ux jdb-ansi jdb-ia32-ux jdb-thread \
161 jdb-int3 jdb-int3-ia32-ux
162 jdb_tcb_IMPL := jdb_tcb jdb_tcb-ia32-ux
163 jdb_bp_IMPL := jdb_bp-ia32-ux jdb_bp-ux
164 jdb_bt_IMPL := jdb_bt-ia32-ux
165 jdb_entry_frame_IMPL := jdb_entry_frame-ia32
166 jdb_kern_info_IMPL := jdb_kern_info jdb_kern_info-ux \
167 jdb_kern_info-ia32-ux jdb_kern_info-ia32-amd64
168 jdb_misc_IMPL := jdb_misc-ia32-amd64
169 jdb_ptab_IMPL := jdb_ptab jdb_ptab-ia32-ux-arm
170 jdb_screen_IMPL := jdb_screen jdb_screen-ia32
171 jdb_trace_set_IMPL := jdb_trace_set jdb_trace_set-ia32-ux
172 kdb_ke_IMPL := kdb_ke kdb_ke-ia32
173 kernel_thread_IMPL := kernel_thread kernel_thread-std kernel_thread-ux
174 kip_init_IMPL := kip_init-ia32
175 kmem_IMPL := kmem-ia32 kmem-ux
176 kmem_alloc_IMPL := kmem_alloc kmem_alloc-ia32
177 main_IMPL := main-ia32-32 main-ux
178 mapping_IMPL := mapping-ia32-32 mapping
179 map_util_IMPL := map_util map_util-mem map_util-objs
180 mem_layout_IMPL := mem_layout mem_layout-ia32 mem_layout-ux
181 mem_space_IMPL := mem_space mem_space-user mem_space-ia32 \
183 mem_unit_IMPL := mem_unit-ux
184 obj_space_IMPL := obj_space obj_space-phys
185 paging_IMPL := paging-ia32-32 paging-ia32 paging
186 perf_cnt_IMPL := perf_cnt perf_cnt-ia32
187 pic_IMPL := pic pic-ux
188 pmem_alloc_IMPL := pmem_alloc pmem_alloc-ia32-ux
189 sched_context_IMPL := sched_context-wfq sched_context-fixed_prio \
190 sched_context-fp_wfq sched_context
191 space_IMPL := space space-ux
192 syscalls_IMPL := syscalls syscalls-log
193 sys_call_page_IMPL := sys_call_page sys_call_page-abs-ux
194 task_IMPL := task task-ux
195 tb_entry_IMPL := tb_entry tb_entry-ia32-32
196 terminate_IMPL := terminate-ux
197 thread_IMPL := thread thread-ia32 thread-ia32-32 thread-ux \
199 thread-pagefault thread-list thread-log \
200 thread-debug thread-io thread-ulock thread-vcpu
201 timer_IMPL := timer timer-ia32-amd64-ux timer-ux
202 utcb_init_IMPL := utcb_init utcb_init-ux
203 vmem_alloc_IMPL := vmem_alloc vmem_alloc-ia32 vmem_alloc-ux
204 spin_lock_IMPL := spin_lock spin_lock-ia32
206 CXXSRC_KERNEL := libc_backend_nolock.cc glue_libc_ux.cc
207 ASSRC_KERNEL := entry-ux.S entry.S sighandler.S \
210 ifeq ($(CONFIG_MP),y)
211 ASSRC_KERNEL += tramp-mp.S entry-mp.S
215 NOOPT += $(filter jdb%,\
216 $(foreach in,$(INTERFACES_KERNEL), \
217 $(if $($(in)_IMPL),$($(in)_IMPL),$(in))))
218 NOOPT += tb_entry tb_entry_output
221 # TCBOFFSET subsystem
223 TCBOFFSET := tcboffset.h
224 CXXSRC_TCBOFFSET := tcboffset.cc dump_tcboffsets.cc
235 PROG_LINES := genlines
246 OBJ_KERNEL += gblcfg.o
253 INTERFACES_CXXLIB := s_cruft paranoia
259 VPATH += lib/libk/$(CONFIG_XARCH) lib/libk
260 PRIVATE_INCDIR += lib/libk/$(CONFIG_XARCH) lib/libk
261 INTERFACES_LIBK := atomic lock_guard auto_ptr std_macros dlist
268 PRIVATE_INCDIR += lib/amm
269 CSRC_LIBAMM := amm_alloc_entry.c amm_allocate.c amm_deallocate.c \
270 amm_destroy.c amm_dump.c amm_find_addr.c amm_find_gen.c \
271 amm_free_entry.c amm_init.c amm_init_gen.c amm_iterate.c \
272 amm_iterate_gen.c amm_join.c amm_modify.c amm_protect.c \
273 amm_reserve.c amm_select.c amm_split.c
275 ifneq ($(CONFIG_JDB_GZIP),)
276 ifneq ($(wildcard $(srcdir)/lib/gzip),)
277 SUBSYSTEMS += LIBGZIP
278 KERNEL_EXTRA_LIBS += $(LIBGZIP)
279 INTERFACES_KERNEL += jdb_gzip
283 PRIVATE_INCDIR += lib/gzip
284 CSRC_LIBGZIP := adler32.c crc32.c gzip.c trees.c deflate.c zutil.c
285 NOOPT += $(patsubst %.o, %, $(OBJ_LIBGZIP))
290 # LIBDISASM subsystem (only for Jdb)
292 ifeq ("$(CONFIG_JDB_DISASM)","y")
293 # $(srcdir)/lib/disasm may be removed
294 ifeq ($(wildcard $(srcdir)/lib/disasm),)
295 $(error $(srcdir)/lib/disasm is missing, disable CONFIG_JDB_DISASM)
298 SUBSYSTEMS += LIBDISASM
299 KERNEL_EXTRA_LIBS += $(LIBDISASM)
300 PREPROCESS_PARTS += jdb_disasm
302 LIBDISASM := libdisasm.a
303 VPATH += lib/disasm lib/disasm/elf lib/disasm/include \
304 lib/disasm/include/opcode lib/disasm/opcodes \
305 lib/disasm/libiberty lib/disasm/bfd
306 PRIVATE_INCDIR += lib/disasm lib/disasm/elf lib/disasm/include \
307 lib/disasm/include/opcode lib/disasm/opcodes \
308 lib/disasm/libiberty lib/disasm/bfd
309 PRIVATE_INCDIR += lib/disasm
310 CSRC_LIBDISASM := disasm.c dis-init.c i386-dis.c dis-buf.c
311 NOOPT += $(patsubst %.o, %, $(OBJ_LIBDISASM))
316 # LIBPERFCTR subsystem (only for Jdb)
318 LIBPERFCTR := libperfctr.a
320 PRIVATE_INCDIR += lib/perfctr
321 CSRC_LIBPERFCTR := event_set_p5.c event_set_p6.c event_set_amd.c \
322 event_set_p4.c event_set_x86.c perfctr.c \
324 NOOPT += $(patsubst %.o, %, $(OBJ_LIBPERFCTR))
327 # LIBREGEX subsystem (only for Jdb)
329 LIBREGEX := libregex.a
331 PRIVATE_INCDIR += lib/regex
332 CSRC_LIBREGEX := alloc.c rx.c
333 NOOPT += $(patsubst %.o, %, $(OBJ_LIBREGEX))
335 ifneq ($(wildcard $(srcdir)/lib/perfctr),)
336 SUBSYSTEMS += LIBPERFCTR
337 KERNEL_EXTRA_LIBS += $(LIBPERFCTR)
338 KERNEL_UNRES_SYMS += -u perfctr_set_cputype
341 ifneq ($(wildcard $(srcdir)/lib/regex),)
342 SUBSYSTEMS += LIBREGEX
343 KERNEL_EXTRA_LIBS += $(LIBREGEX)
344 PREPROCESS_PARTS += jdb_regex
350 # disabled until unittests fixed
351 SUBSYSTEMS += UNITTEST
354 INTERFACES_UNITTEST += mapdb_t map_util_t
356 # Compile all unit tests without -DNDEBUG.
357 NONDEBUG += $(patsubst %.o, %, $(OBJ_UNITTEST))
359 MODULES_FILES = $(MODULES_FILE) $(MODULES_FILE_BSP)
365 VPATH += lib/minilibc/ia32 lib/minilibc
366 CSRC_MINILIBC := printf.c __v_printf.c \
367 vprintf.c lltostr.c __ltostr.c \
368 putchar.c puts.c gets.c sprintf.c \
369 snprintf.c vsnprintf.c vsprintf.c fprintf.c \
370 memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \
371 strcpy.c strlen.c strstr.c \
372 strcmp.c strcspn.c strncmp.c strspn.c
374 # do not profile all of MINILIBC, because it is used in the BOOT subsystem
375 NOOPT += $(patsubst %.o, %, $(OBJ_MINILIBC))