From 473f46135c3fd77dad5614215cc279b1164e9a74 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 29 May 2018 17:06:45 -0400 Subject: Configure or deduce CLIB_LOG2_CACHE_LINE_BYTES (VPP-1064) Added configure argument "--with-log2-cache-line-bytes=5|6|7|auto" AKA 32, 64, or 128 bytes, or use the inferred value from the build host. produces build-xxx/vpp/vppinfra/config.h, which .../src/vppinfra/cache.h Kernels which implement the following pseudo-file (aka x86_64) are easy: /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size Otherwise, extract the cpuid from /proc/cpuinfo and map it to the cache line size. Change-Id: I7ff861e042faf82c3901fa1db98864fbdea95b74 Signed-off-by: Dave Barach Signed-off-by: Nitin Saxena --- src/vppinfra.am | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/vppinfra.am') diff --git a/src/vppinfra.am b/src/vppinfra.am index ec271e6dc63..d138a26d8cf 100644 --- a/src/vppinfra.am +++ b/src/vppinfra.am @@ -13,6 +13,17 @@ lib_LTLIBRARIES += libvppinfra.la +BUILT_SOURCES += vppinfra/config.h + +vppinfra/config.h: + @echo "/** Autogenerated by Autotools **/" > $@ + @echo "#ifndef included_clib_config_h" >> $@ + @echo "#define included_clib_config_h" >> $@ + @echo "#ifndef CLIB_LOG2_CACHE_LINE_BYTES " >> $@ + @echo "#define CLIB_LOG2_CACHE_LINE_BYTES " @LOG2_CACHE_LINE_BYTES@ >> $@ + @echo "#endif " >> $@ + @echo "#endif " >> $@ + TESTS = if ENABLE_TESTS @@ -197,6 +208,7 @@ nobase_include_HEADERS = \ vppinfra/bitops.h \ vppinfra/byte_order.h \ vppinfra/cache.h \ + vppinfra/config.h \ vppinfra/clib.h \ vppinfra/clib_error.h \ vppinfra/cpu.h \ -- cgit 1.2.3-korg