libsel4bench: Separate ARM sources by CPU.
This commit restructures the build such that only the files for the current
target CPU are picked up. This was not causing problems previously as the
irrelevant sections were ifdefed out, but by selecting files in the build
system itself we avoid unnecessary compiler invocations and potentially
confusing output.
diff --git a/libsel4bench/Makefile b/libsel4bench/Makefile
index 84fcd25..49752a5 100644
--- a/libsel4bench/Makefile
+++ b/libsel4bench/Makefile
@@ -15,7 +15,8 @@
CFILES := \
$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) \
$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/arch-$(ARCH)/*.c)) \
- $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/arch-$(ARCH)/armv/$(ARMV)/*.c))
+ $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/arch-$(ARCH)/armv/$(ARMV)/*.c)) \
+ $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/arch-$(ARCH)/cpu/$(CPU)/*.c))
# Header files/directories this library provides
# Note: sel4_client.h may not have been built at the time this is evaluated.
diff --git a/libsel4bench/src/arch-arm/event_counters_arm1136.c b/libsel4bench/src/arch-arm/cpu/arm1136jf-s/event_counters_arm1136.c
similarity index 93%
rename from libsel4bench/src/arch-arm/event_counters_arm1136.c
rename to libsel4bench/src/arch-arm/cpu/arm1136jf-s/event_counters_arm1136.c
index 44a9870..0ef3948 100644
--- a/libsel4bench/src/arch-arm/event_counters_arm1136.c
+++ b/libsel4bench/src/arch-arm/cpu/arm1136jf-s/event_counters_arm1136.c
@@ -8,11 +8,9 @@
* @TAG(NICTA_BSD)
*/
-#if defined(ARM1136J_S) || defined(ARM1136JF_S)
-
#include <utils/util.h>
-#include "event_counters.h"
+#include "../../event_counters.h"
#define NAME_EVENT(id, name) EVENT_COUNTER_FORMAT(SEL4BENCH_ARM1136_EVENT_##id, name)
@@ -54,5 +52,3 @@
{
return ARRAY_SIZE(sel4bench_cpu_event_counter_data);
}
-
-#endif /* defined(ARM1136J_S) || defined(ARM1136JF_S) */
diff --git a/libsel4bench/src/arch-arm/event_counters_cortexa15.c b/libsel4bench/src/arch-arm/cpu/cortex-a15/event_counters_cortexa15.c
similarity index 96%
rename from libsel4bench/src/arch-arm/event_counters_cortexa15.c
rename to libsel4bench/src/arch-arm/cpu/cortex-a15/event_counters_cortexa15.c
index 396625c..565daf5 100644
--- a/libsel4bench/src/arch-arm/event_counters_cortexa15.c
+++ b/libsel4bench/src/arch-arm/cpu/cortex-a15/event_counters_cortexa15.c
@@ -8,11 +8,7 @@
* @TAG(NICTA_BSD)
*/
-#include <autoconf.h>
-
-#if defined(CONFIG_ARM_CORTEX_A15)
-
-#include "event_counters.h"
+#include "../../event_counters.h"
#define NAME_EVENT(id, name) EVENT_COUNTER_FORMAT(SEL4BENCH_CORTEXA15_EVENT_##id, name)
@@ -67,5 +63,3 @@
{
return ARRAY_SIZE(sel4bench_cpu_event_counter_data);
}
-
-#endif /* defined(CONFIG_ARM_CORTEX_A15) */
diff --git a/libsel4bench/src/arch-arm/event_counters_cortexa8.c b/libsel4bench/src/arch-arm/cpu/cortex-a8/event_counters_cortexa8.c
similarity index 94%
rename from libsel4bench/src/arch-arm/event_counters_cortexa8.c
rename to libsel4bench/src/arch-arm/cpu/cortex-a8/event_counters_cortexa8.c
index 58bfa26..2b0f53c 100644
--- a/libsel4bench/src/arch-arm/event_counters_cortexa8.c
+++ b/libsel4bench/src/arch-arm/cpu/cortex-a8/event_counters_cortexa8.c
@@ -8,11 +8,7 @@
* @TAG(NICTA_BSD)
*/
-#include <autoconf.h>
-
-#if defined(CONFIG_ARM_CORTEX_A8)
-
-#include "event_counters.h"
+#include "../../event_counters.h"
#define NAME_EVENT(id, name) EVENT_COUNTER_FORMAT(SEL4BENCH_CORTEXA8_EVENT_##id, name)
@@ -54,5 +50,3 @@
{
return ARRAY_SIZE(sel4bench_cpu_event_counter_data);
}
-
-#endif /* defined(CONFIG_ARM_CORTEX_A8) */
diff --git a/libsel4bench/src/arch-arm/event_counters_cortexa9.c b/libsel4bench/src/arch-arm/cpu/cortex-a9/event_counters_cortexa9.c
similarity index 95%
rename from libsel4bench/src/arch-arm/event_counters_cortexa9.c
rename to libsel4bench/src/arch-arm/cpu/cortex-a9/event_counters_cortexa9.c
index d8e3a41..c25db15 100644
--- a/libsel4bench/src/arch-arm/event_counters_cortexa9.c
+++ b/libsel4bench/src/arch-arm/cpu/cortex-a9/event_counters_cortexa9.c
@@ -8,11 +8,7 @@
* @TAG(NICTA_BSD)
*/
-#include <autoconf.h>
-
-#if defined(CONFIG_ARM_CORTEX_A9)
-
-#include "event_counters.h"
+#include "../../event_counters.h"
#define NAME_EVENT(id, name) EVENT_COUNTER_FORMAT(SEL4BENCH_CORTEXA9_EVENT_##id, name)
@@ -63,5 +59,3 @@
{
return ARRAY_SIZE(sel4bench_cpu_event_counter_data);
}
-
-#endif /* defined(CONFIG_ARM_CORTEX_A9) */