1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
20695f8bcSHarishinclude ../../../../../../scripts/Kbuild.include
30695f8bcSHarish
43752e453SMichael Ellermannoarg:
53752e453SMichael Ellerman	$(MAKE) -C ../../
63752e453SMichael Ellerman
73752e453SMichael Ellerman# The EBB handler is 64-bit code and everything links against it
83752e453SMichael EllermanCFLAGS += -m64
93752e453SMichael Ellerman
1098415da0SJoel Stanley# Toolchains may build PIE by default which breaks the assembly
110695f8bcSHarishno-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
120695f8bcSHarish        $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
130695f8bcSHarish
140695f8bcSHarishLDFLAGS += $(no-pie-option)
1598415da0SJoel Stanley
1688baa78dSbamvor.zhangjian@huawei.comTEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test	\
173752e453SMichael Ellerman	 cycles_with_freeze_test pmc56_overflow_test		\
183752e453SMichael Ellerman	 ebb_vs_cpu_event_test cpu_event_vs_ebb_test		\
193752e453SMichael Ellerman	 cpu_event_pinned_vs_ebb_test task_event_vs_ebb_test	\
203752e453SMichael Ellerman	 task_event_pinned_vs_ebb_test multi_ebb_procs_test	\
213752e453SMichael Ellerman	 multi_counter_test pmae_handling_test			\
223752e453SMichael Ellerman	 close_clears_pmcc_test instruction_count_test		\
233752e453SMichael Ellerman	 fork_cleanup_test ebb_on_child_test			\
243752e453SMichael Ellerman	 ebb_on_willing_child_test back_to_back_ebbs_test	\
25985ac68eSMichael Ellerman	 lost_exception_test no_handler_test			\
267c65856bSMichael Neuling	 cycles_with_mmcr2_test
273752e453SMichael Ellerman
287e0cf1c9SMichael Ellermantop_srcdir = ../../../../../..
2988baa78dSbamvor.zhangjian@huawei.cominclude ../../../lib.mk
303752e453SMichael Ellerman
3188baa78dSbamvor.zhangjian@huawei.com$(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \
32fcb45ec0SMichael Ellerman	       ebb.c ebb_handler.S trace.c busy_loop.S
333752e453SMichael Ellerman
34a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/instruction_count_test: ../loop.S
353752e453SMichael Ellerman
36a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/lost_exception_test: ../lib.c
37