SubDir HAIKU_TOP src system kernel arch arm ;

SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers acpi acpica include ;
SubDirHdrs $(SUBDIR) $(DOTDOT) generic ;
UsePrivateKernelHeaders ;

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

KernelMergeObject kernel_arch_arm.o :
	acpi_irq_routing_table.cpp
	arch_commpage.cpp
	arch_cpu.cpp
	arch_debug_console.cpp
	arch_debug.cpp
	arch_elf.cpp
	arch_exceptions.S
	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
	arch_asm.S

	generic_msi.cpp

	# Serial UART and drivers
	debug_uart.cpp
	debug_uart_8250.cpp
	arch_uart_8250_omap.cpp
	arch_uart_pl011.cpp

	arch_atomic64.cpp
	arch_atomic32.cpp

	arch_int_gicv2.cpp
	arch_timer_generic.cpp

	# SoC minimal kernel-required support
	# (timers, interrupts, rtc?)
	soc.cpp
	soc_pxa.cpp
	soc_omap3.cpp
	soc_sun4i.cpp

	# paging
	arm_physical_page_mapper_large_memory.cpp
	ARMPagingMethod.cpp
	ARMPagingStructures.cpp
	ARMVMTranslationMap.cpp

	# paging/32bit
	ARMPagingMethod32Bit.cpp
	ARMPagingStructures32Bit.cpp
	ARMVMTranslationMap32Bit.cpp

	:
	$(TARGET_KERNEL_PIC_CCFLAGS) -Wno-unused
	:
	kernel_fdt.a
;

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

# syscall headers are generated on the fly, so we need a explicit dependency.
Includes [ FGristFiles arch_commpage.cpp arch_int.cpp arch_asm.S ]
	: <syscalls!$(TARGET_PACKAGING_ARCH)>syscall_numbers.h ;
