summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommaso Marinelli <tommarin@ucm.es>2019-10-02 23:33:59 +0200
committerTommaso Marinelli <tommarin@ucm.es>2019-10-04 07:00:24 +0000
commit2dc4b9d95a156030e9b7ac44ffbdbf9bdacc5944 (patch)
treef01f1b95470c43851691327e1fbfb50df02038e7
parent14919c5e5d984690de2e65ac2aa82d7c129b573e (diff)
downloadgem5-2dc4b9d95a156030e9b7ac44ffbdbf9bdacc5944.tar.xz
kvm: Rename gettid() to build with glibc 2.30+
glibc 2.30 introduced the function gettid() in sys/types.h to return the caller's thread ID. In order to avoid conflicts, the already present gettid() functions have been renamed to sysGettid(). This fixes a compilation error with X86 arch. Change-Id: I76c971465fc4b50e4decde8303185439082b2378 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21379 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r--src/cpu/kvm/perfevent.cc2
-rw-r--r--src/cpu/kvm/perfevent.hh4
-rw-r--r--src/cpu/kvm/timer.cc4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cpu/kvm/perfevent.cc b/src/cpu/kvm/perfevent.cc
index 0b5960d51..5a1c6126d 100644
--- a/src/cpu/kvm/perfevent.cc
+++ b/src/cpu/kvm/perfevent.cc
@@ -186,7 +186,7 @@ PerfKvmCounter::attach(PerfKvmCounterConfig &config,
}
pid_t
-PerfKvmCounter::gettid()
+PerfKvmCounter::sysGettid()
{
return syscall(__NR_gettid);
}
diff --git a/src/cpu/kvm/perfevent.hh b/src/cpu/kvm/perfevent.hh
index b1b0da283..16a96864d 100644
--- a/src/cpu/kvm/perfevent.hh
+++ b/src/cpu/kvm/perfevent.hh
@@ -297,7 +297,7 @@ public:
*
* @param signal Signal to send upon overflow
*/
- void enableSignals(int signal) { enableSignals(gettid(), signal); }
+ void enableSignals(int signal) { enableSignals(sysGettid(), signal); }
private:
// Disallow copying
@@ -312,7 +312,7 @@ private:
*
* @return Current thread's TID
*/
- pid_t gettid();
+ pid_t sysGettid();
/**
* MMAP the PerfEvent file descriptor.
diff --git a/src/cpu/kvm/timer.cc b/src/cpu/kvm/timer.cc
index 8d3e69f42..22b19547d 100644
--- a/src/cpu/kvm/timer.cc
+++ b/src/cpu/kvm/timer.cc
@@ -61,7 +61,7 @@
#endif
static pid_t
-gettid()
+sysGettid()
{
return syscall(__NR_gettid);
}
@@ -84,7 +84,7 @@ PosixKvmTimer::PosixKvmTimer(int signo, clockid_t clockID,
sev.sigev_notify = SIGEV_THREAD_ID;
sev.sigev_signo = signo;
- sev.sigev_notify_thread_id = gettid();
+ sev.sigev_notify_thread_id = sysGettid();
sev.sigev_value.sival_ptr = NULL;
while (timer_create(clockID, &sev, &timer) == -1) {