⛏️ index : haiku.git

SubDir HAIKU_TOP src system kernel arch x86 ;

SubDirHdrs [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
	system kernel ] ;
	# for syscall_numbers.h
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers ps2 ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers acpi acpica include ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers acpi acpica include
	platform ;
SubDirHdrs $(SUBDIR) timers ;

UsePrivateKernelHeaders ;
UsePrivateHeaders shared ;
UsePrivateHeaders [ FDirName system arch x86 ] ;

SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) paging ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) timers ] ;

local archSpecificSources ;
if $(TARGET_ARCH) = x86_64 {
	SEARCH_SOURCE += [ FDirName $(SUBDIR) 64 ] ;
	SEARCH_SOURCE += [ FDirName $(SUBDIR) paging 64bit ] ;

	archSpecificSources =
		arch.S
		cpuid.cpp
		descriptors.cpp
		errata.cpp
		interrupts.S
		signals.cpp
		syscalls.cpp
		thread.cpp

		# paging
		x86_physical_page_mapper_mapped.cpp

		# paging/64bit
		X86PagingMethod64Bit.cpp
		X86PagingStructures64Bit.cpp
		X86VMTranslationMap64Bit.cpp
	;
} else {
	SEARCH_SOURCE += [ FDirName $(SUBDIR) 32 ] ;
	SEARCH_SOURCE += [ FDirName $(SUBDIR) paging 32bit ] ;
	SEARCH_SOURCE += [ FDirName $(SUBDIR) paging pae ] ;

	archSpecificSources =
		apm.cpp
		arch.S
		bios.cpp
		cpuid.S
		descriptors.cpp
		errata.cpp
		interrupts.S
		signals.cpp
		signals_asm.S
		syscalls.cpp
		syscalls_asm.S
		thread.cpp

		# paging
		x86_physical_page_mapper_large_memory.cpp

		# paging/32bit
		X86PagingMethod32Bit.cpp
		X86PagingStructures32Bit.cpp
		X86VMTranslationMap32Bit.cpp

		# paging/pae
		X86PagingMethodPAE.cpp
		X86PagingStructuresPAE.cpp
		X86VMTranslationMapPAE.cpp
	;
}

local archGenericSources =
	arch_altcodepatch.cpp
	arch_cpu.cpp
	arch_commpage.cpp
	arch_debug.cpp
	arch_debug_console.cpp
	arch_elf.cpp
	arch_int.cpp
	arch_platform.cpp
	arch_real_time_clock.cpp
	arch_smp.cpp
	arch_system_info.cpp
	arch_thread.cpp
	arch_timer.cpp
	arch_user_debugger.cpp
	arch_vm.cpp
	arch_vm_translation_map.cpp
	apic.cpp
	ioapic.cpp
	acpi_irq_routing_table.cpp
	msi.cpp
	pic.cpp

	# serial
	debug_uart.cpp
	debug_uart_8250.cpp

	# paging
	X86PagingMethod.cpp
	X86PagingStructures.cpp
	X86VMTranslationMap.cpp

	# timers
	x86_apic.cpp
	x86_hpet.cpp
	x86_pit.cpp
;

KernelMergeObject kernel_arch_$(TARGET_KERNEL_ARCH).o :
	$(archSpecificSources)
	$(archGenericSources)
	:
	$(TARGET_KERNEL_PIC_CCFLAGS)
;

CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp : $(TARGET_KERNEL_ARCH) ;

# We need to specify the dependency on the generated syscalls file explicitly.
Includes [ FGristFiles interrupts.S arch.S signals.cpp signals_asm.S ]
	: <syscalls!$(TARGET_PACKAGING_ARCH)>syscall_numbers.h ;
Includes [ FGristFiles interrupts.S ]
	: <syscalls!$(TARGET_PACKAGING_ARCH)>syscall_table.h ;