1SubDir HAIKU_TOP src system kernel arch x86 ;
2
3SubDirHdrs [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
4	system kernel ] ;
5	# for syscall_numbers.h
6SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers ps2 ;
7SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers acpi acpica include ;
8SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers acpi acpica include
9	platform ;
10SubDirHdrs $(SUBDIR) timers ;
11
12UsePrivateKernelHeaders ;
13UsePrivateHeaders shared ;
14UsePrivateHeaders [ FDirName system arch x86 ] ;
15
16SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
17SEARCH_SOURCE += [ FDirName $(SUBDIR) paging ] ;
18SEARCH_SOURCE += [ FDirName $(SUBDIR) timers ] ;
19
20local archSpecificSources ;
21if $(TARGET_ARCH) = x86_64 {
22	SEARCH_SOURCE += [ FDirName $(SUBDIR) 64 ] ;
23	SEARCH_SOURCE += [ FDirName $(SUBDIR) paging 64bit ] ;
24
25	archSpecificSources =
26		arch.S
27		cpuid.cpp
28		descriptors.cpp
29		errata.cpp
30		interrupts.S
31		signals.cpp
32		syscalls.cpp
33		thread.cpp
34
35		# paging
36		x86_physical_page_mapper_mapped.cpp
37
38		# paging/64bit
39		X86PagingMethod64Bit.cpp
40		X86PagingStructures64Bit.cpp
41		X86VMTranslationMap64Bit.cpp
42	;
43} else {
44	SEARCH_SOURCE += [ FDirName $(SUBDIR) 32 ] ;
45	SEARCH_SOURCE += [ FDirName $(SUBDIR) paging 32bit ] ;
46	SEARCH_SOURCE += [ FDirName $(SUBDIR) paging pae ] ;
47
48	archSpecificSources =
49		apm.cpp
50		arch.S
51		bios.cpp
52		cpuid.S
53		descriptors.cpp
54		errata.cpp
55		interrupts.S
56		signals.cpp
57		signals_asm.S
58		syscalls.cpp
59		syscalls_asm.S
60		thread.cpp
61
62		# paging
63		x86_physical_page_mapper_large_memory.cpp
64
65		# paging/32bit
66		X86PagingMethod32Bit.cpp
67		X86PagingStructures32Bit.cpp
68		X86VMTranslationMap32Bit.cpp
69
70		# paging/pae
71		X86PagingMethodPAE.cpp
72		X86PagingStructuresPAE.cpp
73		X86VMTranslationMapPAE.cpp
74	;
75}
76
77local archGenericSources =
78	arch_altcodepatch.cpp
79	arch_cpu.cpp
80	arch_commpage.cpp
81	arch_debug.cpp
82	arch_debug_console.cpp
83	arch_elf.cpp
84	arch_int.cpp
85	arch_platform.cpp
86	arch_real_time_clock.cpp
87	arch_smp.cpp
88	arch_system_info.cpp
89	arch_thread.cpp
90	arch_timer.cpp
91	arch_user_debugger.cpp
92	arch_vm.cpp
93	arch_vm_translation_map.cpp
94	apic.cpp
95	ioapic.cpp
96	acpi_irq_routing_table.cpp
97	msi.cpp
98	pic.cpp
99
100	# serial
101	debug_uart.cpp
102	debug_uart_8250.cpp
103
104	# paging
105	X86PagingMethod.cpp
106	X86PagingStructures.cpp
107	X86VMTranslationMap.cpp
108
109	# timers
110	x86_apic.cpp
111	x86_hpet.cpp
112	x86_pit.cpp
113;
114
115KernelMergeObject kernel_arch_$(TARGET_KERNEL_ARCH).o :
116	$(archSpecificSources)
117	$(archGenericSources)
118	:
119	$(TARGET_KERNEL_PIC_CCFLAGS)
120;
121
122CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp : $(TARGET_KERNEL_ARCH) ;
123
124# We need to specify the dependency on the generated syscalls file explicitly.
125Includes [ FGristFiles interrupts.S arch.S signals.cpp signals_asm.S ]
126	: <syscalls!$(TARGET_PACKAGING_ARCH)>syscall_numbers.h ;
127Includes [ FGristFiles interrupts.S ]
128	: <syscalls!$(TARGET_PACKAGING_ARCH)>syscall_table.h ;
129