]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/Modules.ux
update
[l4.git] / kernel / fiasco / src / Modules.ux
1 # -*- makefile -*-
2
3 SUBSYSTEMS = JABI ABI DRIVERS KERNEL LIBK LIBAMM CXXLIB \
4              TCBOFFSET SYMBOLS VERSION GBLCFG MINILIBC
5
6 ifeq ("$(CONFIG_GSTABS)","y")     
7   SUBSYSTEMS            += LINES
8 endif
9
10 PREPROCESS_PARTS        += arch $(CONFIG_ABI) 32bit $(CONFIG_XARCH)    \
11                            fpu jdb_thread_names iofp \
12                            obj_space_phys abs_syscalls auto_map_kip \
13                            kernel_can_exit
14
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_HANDLE_SEGMENTS)   += segments
20 PREPROCESS_PARTS-$(CONFIG_CONTEXT_4K)        += context_4k
21 PREPROCESS_PARTS-$(CONFIG_SCHED_FIXED_PRIO)  += sched_fixed_prio
22 PREPROCESS_PARTS-$(CONFIG_SCHED_WFQ)         += sched_wfq
23 PREPROCESS_PARTS-$(CONFIG_SCHED_FP_WFQ)      += sched_fp_wfq
24
25 PREPROCESS_PARTS        += $(PREPROCESS_PARTS-y)
26
27 #
28 # TYPES subsystem
29 #
30 PRIVATE_INCDIR          += types/$(CONFIG_XARCH) types
31
32 #
33 # ABI Subsystem
34 #
35 ABI                     := libabi.a
36 VPATH                   += abi/ia32 abi
37 INTERFACES_ABI          := l4_fpage l4_msg_item l4_buf_desc kip l4_types \
38                            l4_error
39
40 kip_IMPL                := kip kip-ia32 kip-debug kip-ia32-debug
41 l4_types_IMPL           := l4_types l4_types-debug
42
43 #
44 # JABI Subsystem
45 #
46 JABI                    := libjabi.a
47 VPATH                   += jabi/$(CONFIG_XARCH) jabi
48 INTERFACES_JABI         := jdb_ktrace
49
50 #
51 # DRIVERS subsystem
52 #
53 DRIVERS                 := libdrivers.a
54 VPATH                   += drivers/ux drivers/ia32 drivers
55 PRIVATE_INCDIR          += drivers/ux drivers/ia32 drivers
56 INTERFACES_DRIVERS      := mux_console console filter_console processor \
57                            delayloop mem
58
59 processor_IMPL          := processor processor-ux
60 mem_IMPL                := mem mem-ia32
61
62 #
63 # KERNEL subsystem
64 #
65 KERNEL                  := fiasco.image
66 KERNEL_EXTRA            := irq0
67 VPATH                   += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
68 VPATH                   += jdb/ia32 jdb/ia32/32 jdb/ux jdb
69 PRIVATE_INCDIR          += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
70
71 KERNEL_EXTRA-$(CONFIG_UX_CON)) += ux_con
72 KERNEL_EXTRA-$(CONFIG_UX_NET)  += ux_net
73 KERNEL_EXTRA            += $(KERNEL_EXTRA-y)
74
75 # KERNEL modules.  
76
77 # Important: The following list must be roughly sorted according to
78 # link dependencies.  The Unit test for a module M links against all
79 # modules that precede M in this list, minus sibling modules (those
80 # modules that _directly_ precede M and that M does not include).
81
82 INTERFACES_KERNEL       := mem_region simpleio kernel_console panic warn \
83                            bitmap buddy_alloc irq_pin pages \
84                            mem_layout per_cpu_data globals loader vhw     \
85                            kip_init ipi queue_item queue cpu_mask rcupdate \
86                            boot_info cmdline config jdb_symbol jdb_util   \
87                            tb_entry perf_cnt jdb_tbuf x86desc             \
88                            emulation pic usermode cpu trampoline cpu_lock \
89                            spin_lock                                      \
90                            region entry_frame continuation                \
91                            kmem mapped_alloc mem_unit  \
92                            ram_quota kmem_alloc ptab_base per_cpu_data_alloc \
93                            ref_ptr ref_obj                                \
94                            slab_cache_anon kmem_slab_simple dbg_page_info   \
95                            vmem_alloc paging kmem_slab fpu_state fpu      \
96                            ready_queue_wfq ready_queue_fp \
97                            sched_context switch_lock timer timeout        \
98                            obj_space kobject_dbg kobject l4_buf_iter lock  \
99                            mem_space mem_space_sigma0 space vcpu context \
100                            helping_lock \
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 kobject_helper \
108                            syscalls                                       \
109                            kernel_thread virq dirq dirq_pic_pin           \
110                            banner fpu_alloc irq icu_helper main           \
111                            startup irq_chip libc_support                 \
112                            jdb_dbinfo jdb fb net utcb_init        \
113                            jdb_core jdb_module jdb_table                  \
114                            jdb_thread_list jdb_input jdb_dump jdb_thread  \
115                            jdb_lines jdb_tcb jdb_prompt_module jdb_bt     \
116                            jdb_mapdb jdb_ptab jdb_kern_info jdb_counters  \
117                            glibc_getchar jdb_trace jdb_trace_set          \
118                            tb_entry_output jdb_tbuf_init kern_cnt         \
119                            jdb_tbuf_output jdb_tbuf_show                  \
120                            jdb_misc checksum watchdog terminate           \
121                            jdb_screen push_console jdb_bp                 \
122                            jdb_attach_irq sys_call_page                   \
123                            jdb_timeout gdt factory                        \
124                            idt tss trap_state jdb_prompt_ext              \
125                            jdb_handler_queue jdb_exit_module              \
126                            jdb_halt_thread  jdb_tetris                    \
127                            jdb_kern_info_kip jdb_kern_info_region         \
128                            jdb_kern_info_kmem_alloc jdb_kern_info_config  \
129                            jdb_space jdb_trap_state                       \
130                            vkey jdb_utcb vlog                             \
131                            jdb_entry_frame kdb_ke jdb_ipi app_cpu_thread  \
132                            jdb_rcupdate jdb_kobject jdb_kobject_names     \
133                            jdb_list jdb_ipc_gate jdb_obj_space            \
134                            jdb_log jdb_factory jdb_semaphore scheduler    \
135                            jdb_scheduler clock jdb_sender_list            \
136                            jdb_disasm jdb_regex
137
138 #ifeq ("$(CONFIG_USER_LOCKS)","y")
139   PREPROCESS_PARTS      += ulock
140   INTERFACES_KERNEL     += u_semaphore
141 #endif
142
143
144 boot_info_IMPL          := boot_info boot_info-ia32 boot_info-ux
145 clock_IMPL              := clock clock-ia32
146 config_IMPL             := config config-ia32-32 config-ux
147 context_IMPL            := context context-ia32 context-ia32-32 context-ux \
148                            context-vcpu
149 continuation_IMPL       := continuation-ia32-32-ux
150 cpu_IMPL                := cpu cpu-ia32 cpu-ux cpu-32
151 cpu_lock_IMPL           := cpu_lock cpu_lock-generic
152 dirq_IMPL               := dirq dirq-ia32-ux
153 dirq_pic_pin_IMPL       := dirq_pic_pin dirq_pic_pin-ia32-ux
154 entry_frame_IMPL        := entry_frame entry_frame-ia32-ux                   \
155                            entry_frame-abs-timeout-hack
156 fpu_IMPL                := fpu fpu-ia32-ux fpu-ux
157 irq_IMPL                := irq irq-ux
158 ipi_IMPL                := ipi ipi-ux
159 jdb_IMPL                := jdb jdb-ux jdb-ansi jdb-ia32-ux jdb-thread        \
160                            jdb-int3 jdb-int3-ia32-ux
161 jdb_tcb_IMPL            := jdb_tcb jdb_tcb-ia32-ux
162 jdb_bp_IMPL             := jdb_bp-ia32-ux jdb_bp-ux
163 jdb_bt_IMPL             := jdb_bt-ia32-ux
164 jdb_entry_frame_IMPL    := jdb_entry_frame-ia32
165 jdb_kern_info_IMPL      := jdb_kern_info jdb_kern_info-ux                    \
166                            jdb_kern_info-ia32-ux jdb_kern_info-ia32-amd64
167 jdb_misc_IMPL           := jdb_misc-ia32-amd64
168 jdb_ptab_IMPL           := jdb_ptab jdb_ptab-ia32-ux-arm
169 jdb_screen_IMPL         := jdb_screen jdb_screen-ia32
170 jdb_trace_set_IMPL      := jdb_trace_set jdb_trace_set-ia32-ux
171 kdb_ke_IMPL             := kdb_ke kdb_ke-ia32
172 kernel_thread_IMPL      := kernel_thread kernel_thread-std kernel_thread-ux
173 kip_init_IMPL           := kip_init-ia32
174 kmem_IMPL               := kmem-ia32 kmem-ux
175 kmem_alloc_IMPL         := kmem_alloc kmem_alloc-ia32
176 main_IMPL               := main-ia32-32 main-ux
177 mapping_IMPL            := mapping-ia32-32 mapping
178 map_util_IMPL           := map_util map_util-mem map_util-objs
179 mem_layout_IMPL         := mem_layout mem_layout-ia32 mem_layout-ux
180 mem_space_IMPL          := mem_space mem_space-user mem_space-ia32 \
181                            mem_space-ux
182 mem_unit_IMPL           := mem_unit-ux
183 obj_space_IMPL          := obj_space obj_space-phys
184 paging_IMPL             := paging-ia32-32 paging-ia32 paging
185 perf_cnt_IMPL           := perf_cnt perf_cnt-ia32
186 pic_IMPL                := pic pic-ux
187 pmem_alloc_IMPL         := pmem_alloc pmem_alloc-ia32-ux
188 sched_context_IMPL      := sched_context-wfq sched_context-fixed_prio \
189                            sched_context-fp_wfq sched_context
190 space_IMPL              := space space-ux 
191 sys_call_page_IMPL      := sys_call_page sys_call_page-abs-ux
192 task_IMPL               := task task-ux
193 tb_entry_IMPL           := tb_entry tb_entry-ia32-32
194 terminate_IMPL          := terminate-ux
195 thread_IMPL             := thread thread-ia32 thread-ia32-32 thread-ux       \
196                            thread-ipc             \
197                            thread-pagefault thread-list thread-log           \
198                            thread-debug thread-io thread-ulock thread-vcpu
199 timer_IMPL              := timer timer-ia32-amd64-ux timer-ux
200 utcb_init_IMPL          := utcb_init utcb_init-ux
201 vmem_alloc_IMPL         := vmem_alloc vmem_alloc-ia32 vmem_alloc-ux
202 spin_lock_IMPL          := spin_lock spin_lock-ia32
203
204 CXXSRC_KERNEL           := libc_backend_nolock.cc glue_libc_ux.cc
205 ASSRC_KERNEL            := entry-ux.S entry.S sighandler.S \
206                            sys_call_page-asm.S 
207
208 ifeq ($(CONFIG_MP),y)
209 ASSRC_KERNEL            += tramp-mp.S entry-mp.S
210 endif
211
212
213 NOOPT                   += $(filter jdb%,\
214                              $(foreach in,$(INTERFACES_KERNEL), \
215                                $(if $($(in)_IMPL),$($(in)_IMPL),$(in))))
216 NOOPT                   += tb_entry tb_entry_output
217
218 #
219 # TCBOFFSET subsystem
220 #
221 TCBOFFSET               := tcboffset.h
222 CXXSRC_TCBOFFSET        := tcboffset.cc dump_tcboffsets.cc
223
224 #
225 # SYMBOLS subsystem
226 #
227 SYMBOLS                 := Symbols
228
229 #
230 # LINES subsystem
231 #
232 LINES                   := Lines
233 PROG_LINES              := genlines
234
235 #
236 # VERSION subsystem
237 #
238 VERSION                 := version.h
239
240 #
241 # GBLCFG subsystem
242 #
243 GBLCFG                  := gblcfg.o
244 OBJ_KERNEL              += gblcfg.o
245
246 #
247 # CXXLIB Subsystem
248 #
249 CXXLIB                  := libcxx.a
250 VPATH                   += lib/cxxlib
251 INTERFACES_CXXLIB       := s_cruft paranoia
252
253 #
254 # LIBK subsystem
255 #
256 LIBK            := libk.a
257 VPATH           += lib/libk/$(CONFIG_XARCH) lib/libk
258 PRIVATE_INCDIR  += lib/libk/$(CONFIG_XARCH) lib/libk
259 INTERFACES_LIBK := atomic lock_guard auto_ptr std_macros dlist
260
261 #
262 # LIBAMM subsystem
263 #
264 LIBAMM          := libamm.a
265 VPATH           += lib/amm
266 PRIVATE_INCDIR  += lib/amm
267 CSRC_LIBAMM     := amm_alloc_entry.c amm_allocate.c amm_deallocate.c \
268                    amm_destroy.c amm_dump.c amm_find_addr.c amm_find_gen.c \
269                    amm_free_entry.c amm_init.c amm_init_gen.c amm_iterate.c \
270                    amm_iterate_gen.c amm_join.c amm_modify.c amm_protect.c \
271                    amm_reserve.c amm_select.c amm_split.c
272
273 ifneq ($(CONFIG_JDB_GZIP),)
274  ifneq ($(wildcard $(srcdir)/lib/gzip),)
275   SUBSYSTEMS            += LIBGZIP
276   KERNEL_EXTRA_LIBS     += $(LIBGZIP)
277   INTERFACES_KERNEL     += jdb_gzip
278   LIBGZIP               := libgzip.a
279
280   VPATH                 += lib/gzip
281   PRIVATE_INCDIR        += lib/gzip
282   CSRC_LIBGZIP          := adler32.c crc32.c gzip.c trees.c deflate.c zutil.c
283   NOOPT                 += $(patsubst %.o, %, $(OBJ_LIBGZIP))
284  endif
285 endif
286
287 #
288 # LIBDISASM subsystem (only for Jdb)
289 #
290 ifeq ("$(CONFIG_JDB_DISASM)","y")
291   # $(srcdir)/lib/disasm may be removed
292   ifeq ($(wildcard $(srcdir)/lib/disasm),)
293     $(error $(srcdir)/lib/disasm is missing, disable CONFIG_JDB_DISASM)
294   endif
295
296   SUBSYSTEMS        += LIBDISASM
297   KERNEL_EXTRA_LIBS += $(LIBDISASM)
298   PREPROCESS_PARTS  += jdb_disasm
299
300   LIBDISASM         := libdisasm.a
301   VPATH             += lib/disasm lib/disasm/elf lib/disasm/include \
302                        lib/disasm/include/opcode lib/disasm/opcodes \
303                        lib/disasm/libiberty lib/disasm/bfd
304   PRIVATE_INCDIR    += lib/disasm lib/disasm/elf lib/disasm/include \
305                        lib/disasm/include/opcode lib/disasm/opcodes \
306                        lib/disasm/libiberty lib/disasm/bfd
307   PRIVATE_INCDIR    += lib/disasm
308   CSRC_LIBDISASM    := disasm.c dis-init.c i386-dis.c dis-buf.c
309   NOOPT             += $(patsubst %.o, %, $(OBJ_LIBDISASM))
310 endif
311
312
313 #
314 # LIBPERFCTR subsystem (only for Jdb)
315 #
316 LIBPERFCTR      := libperfctr.a
317 VPATH           += lib/perfctr
318 PRIVATE_INCDIR  += lib/perfctr
319 CSRC_LIBPERFCTR := event_set_p5.c event_set_p6.c event_set_amd.c \
320                    event_set_p4.c event_set_x86.c perfctr.c \
321                    event_set_centaur.c
322 NOOPT           += $(patsubst %.o, %, $(OBJ_LIBPERFCTR))
323
324 #
325 # LIBREGEX subsystem (only for Jdb)
326 #
327 LIBREGEX        := libregex.a
328 VPATH           += lib/regex
329 PRIVATE_INCDIR  += lib/regex
330 CSRC_LIBREGEX   := alloc.c rx.c
331 NOOPT           += $(patsubst %.o, %, $(OBJ_LIBREGEX))
332
333 ifneq ($(wildcard $(srcdir)/lib/perfctr),)
334   SUBSYSTEMS            += LIBPERFCTR
335   KERNEL_EXTRA_LIBS     += $(LIBPERFCTR)
336   KERNEL_UNRES_SYMS     += -u perfctr_set_cputype
337 endif
338
339 ifneq ($(wildcard $(srcdir)/lib/regex),)
340   SUBSYSTEMS            += LIBREGEX
341   KERNEL_EXTRA_LIBS     += $(LIBREGEX)
342   PREPROCESS_PARTS      += jdb_regex
343 endif
344
345 #
346 # UNITTEST subsystem
347 #
348 # disabled until unittests fixed
349 SUBSYSTEMS              += UNITTEST
350 VPATH                   += test/unit
351
352 INTERFACES_UNITTEST     += mapdb_t map_util_t
353
354 # Compile all unit tests without -DNDEBUG.
355 NONDEBUG += $(patsubst %.o, %, $(OBJ_UNITTEST))
356
357 MODULES_FILES = $(MODULES_FILE) $(MODULES_FILE_BSP)
358
359 #
360 # MINILIBC Subsystem
361 #
362 MINILIBC        := libc.a
363 VPATH           += lib/minilibc/ia32 lib/minilibc
364 CSRC_MINILIBC   := printf.c __v_printf.c \
365                    vprintf.c lltostr.c __ltostr.c \
366                    putchar.c puts.c gets.c sprintf.c \
367                    snprintf.c vsnprintf.c vsprintf.c fprintf.c \
368                    memccpy.c  memchr.c   memcmp.c   memcpy.c   memmove.c  memset.c \
369                    strcpy.c   strlen.c   strstr.c   \
370 strcmp.c   strcspn.c  strncmp.c  strspn.c  
371
372 # do not profile all of MINILIBC, because it is used in the BOOT subsystem
373 NOOPT           += $(patsubst %.o, %, $(OBJ_MINILIBC))