summaryrefslogtreecommitdiff
path: root/absl/base/internal
diff options
context:
space:
mode:
authorGravatar Milad Fa <46688537+miladfarca@users.noreply.github.com>2021-09-23 16:23:02 -0400
committerGravatar GitHub <noreply@github.com>2021-09-23 16:23:02 -0400
commitf3a42743db4df4c98e1df690045577c775daf20b (patch)
treee63f48001f0d1e339d9c1b95fcdbf2c6da4edcd5 /absl/base/internal
parent020619c4aa68d13dfbdd6107a373912bb5ea85af (diff)
Initial support for AIX (#1021)
* Init support of AIX * make sysinfo change AIX specific * Relocate TBF * Add comments for .csect psudo op.
Diffstat (limited to 'absl/base/internal')
-rw-r--r--absl/base/internal/sysinfo.cc2
-rw-r--r--absl/base/internal/unscaledcycleclock.cc4
2 files changed, 6 insertions, 0 deletions
diff --git a/absl/base/internal/sysinfo.cc b/absl/base/internal/sysinfo.cc
index 08a1e288..a7cfb461 100644
--- a/absl/base/internal/sysinfo.cc
+++ b/absl/base/internal/sysinfo.cc
@@ -131,6 +131,8 @@ static int GetNumCPUs() {
#elif defined(_WIN32)
const unsigned hardware_concurrency = Win32NumCPUs();
return hardware_concurrency ? hardware_concurrency : 1;
+#elif defined(_AIX)
+ return sysconf(_SC_NPROCESSORS_ONLN);
#else
// Other possibilities:
// - Read /sys/devices/system/cpu/online and use cpumask_parse()
diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
index fc07e300..4d352bd1 100644
--- a/absl/base/internal/unscaledcycleclock.cc
+++ b/absl/base/internal/unscaledcycleclock.cc
@@ -87,6 +87,10 @@ int64_t UnscaledCycleClock::Now() {
double UnscaledCycleClock::Frequency() {
#ifdef __GLIBC__
return __ppc_get_timebase_freq();
+#elif defined(_AIX)
+ // This is the same constant value as returned by
+ // __ppc_get_timebase_freq().
+ return static_cast<double>(512000000);
#elif defined(__FreeBSD__)
static once_flag init_timebase_frequency_once;
static double timebase_frequency = 0.0;