LIBVIRT_CHECK_ACL
LIBVIRT_CHECK_APPARMOR
-LIBVIRT_CHECK_ATOMIC
LIBVIRT_CHECK_ATTR
LIBVIRT_CHECK_AUDIT
LIBVIRT_CHECK_BASH_COMPLETION
+++ /dev/null
-dnl The atomic implementation check
-dnl
-dnl Copyright (C) 2016 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library. If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_CHECK_ATOMIC], [
- AC_REQUIRE([LIBVIRT_CHECK_PTHREAD])
-
- dnl We need to decide at configure time if libvirt will use real atomic
- dnl operations ("lock free") or emulated ones with a mutex.
- dnl
- dnl Note that the atomic ops are only available with GCC on x86 when
- dnl using -march=i486 or higher. If we detect that the atomic ops are
- dnl not available but would be available given the right flags, we want
- dnl to abort and advise the user to fix their CFLAGS. It's better to do
- dnl that then to silently fall back on emulated atomic ops just because
- dnl the user had the wrong build environment.
-
- atomic_ops=
-
- AC_MSG_CHECKING([for atomic ops implementation])
-
- AC_TRY_COMPILE([], [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],[
- atomic_ops=gcc
- ],[])
-
- if test "$atomic_ops" = "" ; then
- SAVE_CFLAGS="${CFLAGS}"
- CFLAGS="-march=i486"
- AC_TRY_COMPILE([],
- [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
- [AC_MSG_ERROR([Libvirt must be built with -march=i486 or later.])],
- [])
- CFLAGS="${SAVE_CFLAGS}"
-
- case "$host" in
- *-*-mingw* | *-*-msvc* )
- atomic_ops=win32
- ;;
- *)
- if test "$ac_cv_header_pthread_h" = "yes" ; then
- atomic_ops=pthread
- else
- AC_MSG_ERROR([Libvirt must be built with GCC or have pthread.h on non-Win32 platforms])
- fi
- ;;
- esac
- fi
-
- case "$atomic_ops" in
- gcc)
- AC_DEFINE([VIR_ATOMIC_OPS_GCC],[1],[Use GCC atomic ops])
- ;;
- win32)
- AC_DEFINE([VIR_ATOMIC_OPS_WIN32],[1],[Use Win32 atomic ops])
- ;;
- pthread)
- AC_DEFINE([VIR_ATOMIC_OPS_PTHREAD],[1],[Use pthread atomic ops emulation])
- ;;
- esac
- AM_CONDITIONAL([WITH_ATOMIC_OPS_PTHREAD],[test "$atomic_ops" = "pthread"])
- AC_MSG_RESULT([$atomic_ops])
-])
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
endif ! WITH_SSH2
-if WITH_ATOMIC_OPS_PTHREAD
-USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
-else ! WITH_ATOMIC_OPS_PTHREAD
-SYM_FILES += $(srcdir)/libvirt_atomic.syms
-endif ! WITH_ATOMIC_OPS_PTHREAD
-
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
+++ /dev/null
-#
-# These symbols are dependent upon !VIR_ATOMIC_OPS_GCC.
-#
-
-# util/viratomic.h
-virAtomicLock;
-
-# Let emacs know we want case-insensitive sorting
-# Local Variables:
-# sort-fold-case: t
-# End:
#include "libxl_capabilities.h"
#include "viralloc.h"
-#include "viratomic.h"
#include "virfile.h"
#include "virerror.h"
#include "virhook.h"
#include "virstring.h"
#include "virsysinfo.h"
#include "viraccessapicheck.h"
-#include "viratomic.h"
#include "virhostdev.h"
#include "virpidfile.h"
#include "locking/domain_lock.h"
#include "lxc_hostdev.h"
#include "virhook.h"
#include "virstring.h"
-#include "viratomic.h"
#include "virprocess.h"
#include "virsystemd.h"
#include "netdev_bandwidth_conf.h"
#include "nwfilter_ipaddrmap.h"
#include "virnetdev.h"
#include "virfile.h"
-#include "viratomic.h"
#include "virsocketaddr.h"
#include "virthreadpool.h"
#include "configmake.h"
#include "virfile.h"
#include "virsocket.h"
#include "virstring.h"
-#include "viratomic.h"
#include "storage_conf.h"
#include "configmake.h"
#include "virstoragefile.h"
#include "virstring.h"
#include "virthreadjob.h"
-#include "viratomic.h"
#include "virprocess.h"
#include "vircrypto.h"
#include "virrandom.h"
#include "virnetdevopenvswitch.h"
#include "virnetdevmidonet.h"
#include "virbitmap.h"
-#include "viratomic.h"
#include "virnuma.h"
#include "virstring.h"
#include "virhostdev.h"
#include "virstring.h"
#include "cpu/cpu.h"
#include "virauth.h"
-#include "viratomic.h"
#include "virdomainobjlist.h"
#include "virinterfaceobj.h"
#include "virhostcpu.h"
util/virarch.h \
util/virarptable.c \
util/virarptable.h \
- util/viratomic.c \
- util/viratomic.h \
util/viraudit.c \
util/viraudit.h \
util/virauth.c \
+++ /dev/null
-/*
- * viratomic.c: atomic integer operations
- *
- * Copyright (C) 2012 Red Hat, Inc.
- *
- * Based on code taken from GLib 2.32, under the LGPLv2+
- *
- * Copyright (C) 2011 Ryan Lortie
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <config.h>
-
-#include "viratomic.h"
-
-
-#ifdef VIR_ATOMIC_OPS_PTHREAD
-
-pthread_mutex_t virAtomicLock = PTHREAD_MUTEX_INITIALIZER;
-
-#endif
+++ /dev/null
-/*
- * viratomic.h: atomic integer operations
- *
- * Copyright (C) 2012-2020 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * APIs in this header should no longer be used. Direct
- * use of the g_atomic APIs is preferred & existing code
- * should be converted as needed.
- */
-
-#pragma once
-
-#include "internal.h"
-
-/**
- * virAtomicIntCompareExchange:
- * Compares atomic to oldval and, if equal, sets it to newval. If
- * atomic was not equal to oldval then no change occurs.
- *
- * This compare and exchange is done atomically.
- *
- * Think of this operation as an atomic version of
- * { if (*atomic == oldval) { *atomic = newval; return true; }
- * else return false; }
- *
- * This call acts as a full compiler and hardware memory barrier.
- */
-#define virAtomicIntCompareExchange(i, oldi, newi) \
- (!!g_atomic_int_compare_and_exchange(i, oldi, newi))
-
-/**
- * virAtomicIntAdd:
- * Atomically adds val to the value of atomic.
- *
- * Think of this operation as an atomic version of
- * { tmp = *atomic; *atomic += val; return tmp; }
- *
- * This call acts as a full compiler and hardware memory barrier.
- */
-#define virAtomicIntAdd(i, v) g_atomic_int_add(i, v)
-
-/**
- * virAtomicIntAnd:
- * Performs an atomic bitwise 'and' of the value of atomic
- * and val, storing the result back in atomic.
- *
- * This call acts as a full compiler and hardware memory barrier.
- *
- * Think of this operation as an atomic version of
- * { tmp = *atomic; *atomic &= val; return tmp; }
- */
-#define virAtomicIntAnd(i, v) g_atomic_int_and(i, v)
-
-/**
- * virAtomicIntOr:
- * Performs an atomic bitwise 'or' of the value of atomic
- * and val, storing the result back in atomic.
- *
- * Think of this operation as an atomic version of
- * { tmp = *atomic; *atomic |= val; return tmp; }
- *
- * This call acts as a full compiler and hardware memory barrier.
- */
-#define virAtomicIntOr(i, v) g_atomic_int_or(i, v)
-
-/**
- * virAtomicIntXor:
- * Performs an atomic bitwise 'xor' of the value of atomic
- * and val, storing the result back in atomic.
- *
- * Think of this operation as an atomic version of
- * { tmp = *atomic; *atomic ^= val; return tmp; }
- *
- * This call acts as a full compiler and hardware memory barrier.
- */
-#define virAtomicIntXor(i, v) g_atomic_int_xor(i, v)
#include "virobject.h"
#include "virthread.h"
#include "viralloc.h"
-#include "viratomic.h"
#include "virerror.h"
#include "virlog.h"
#include "virprobe.h"
# include <windows.h>
#endif
-#include "viratomic.h"
#include "virprocess.h"
#include "virerror.h"
#include "viralloc.h"
#include "virsystemdpriv.h"
#include "virsystemd.h"
-#include "viratomic.h"
#include "virbuffer.h"
#include "virdbus.h"
#include "virstring.h"