summaryrefslogtreecommitdiff
path: root/libartbase/base/utils.h
diff options
context:
space:
mode:
author Lokesh Gidra <lokeshgidra@google.com> 2022-04-20 01:39:28 +0000
committer Lokesh Gidra <lokeshgidra@google.com> 2022-08-10 18:06:05 +0000
commitca5ed9f281a5758814d2495da80178de56945720 (patch)
tree3633a7ace321b10dd2ae6ffadd69d525c7a530e5 /libartbase/base/utils.h
parent1325bb173c3160b8ff2ecfc2d1aefd185c773ee4 (diff)
Convert kUseReadBarrier to static const from constexpr
This CL would compile both CC and userfaultfd GC in the art library, enabling us to choose either of the two during boot time depending on whether the device has userfaultfd kernel feature or not. The CC GC is still chosen unless we use ART_USE_READ_BARRIER=false during build time. This behavior will later be changed to choosing CC *only* if ART_USE_READ_BARRIER=true is used. In other cases, if the device has userfaultfd support then that GC will be chosen. Bug: 160737021 Bug: 230021033 Test: art/test/testrunner/testrunner.py Change-Id: I370f1a9f6b8cdff8c2ce3cf7aa936bccd7ed675f
Diffstat (limited to 'libartbase/base/utils.h')
-rw-r--r--libartbase/base/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libartbase/base/utils.h b/libartbase/base/utils.h
index 0e8231a92c..90eb2daa4d 100644
--- a/libartbase/base/utils.h
+++ b/libartbase/base/utils.h
@@ -31,6 +31,10 @@
#include "globals.h"
#include "macros.h"
+#if defined(__linux__)
+#include <sys/utsname.h>
+#endif
+
namespace art {
static inline uint32_t PointerToLowMemUInt32(const void* p) {
@@ -125,6 +129,10 @@ NO_RETURN void SleepForever();
// Flush CPU caches. Returns true on success, false if flush failed.
WARN_UNUSED bool FlushCpuCaches(void* begin, void* end);
+#if defined(__linux__)
+bool IsKernelVersionAtLeast(int reqd_major, int reqd_minor);
+#endif
+
// On some old kernels, a cache operation may segfault.
WARN_UNUSED bool CacheOperationsMaySegFault();