/src/openvswitch/lib/ovs-atomic-flag-gcc4.7+.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2013, 2014 Nicira, Inc. |
3 | | * |
4 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | * you may not use this file except in compliance with the License. |
6 | | * You may obtain a copy of the License at: |
7 | | * |
8 | | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | * |
10 | | * Unless required by applicable law or agreed to in writing, software |
11 | | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | * See the License for the specific language governing permissions and |
14 | | * limitations under the License. |
15 | | */ |
16 | | |
17 | | /* This header implements atomic_flag on Clang and on GCC 4.7 and later. */ |
18 | | #ifndef IN_OVS_ATOMIC_H |
19 | | #error "This header should only be included indirectly via ovs-atomic.h." |
20 | | #endif |
21 | | |
22 | | /* atomic_flag */ |
23 | | |
24 | | typedef struct { |
25 | | unsigned char b; |
26 | | } atomic_flag; |
27 | | #define ATOMIC_FLAG_INIT { .b = false } |
28 | | |
29 | | static inline bool |
30 | | atomic_flag_test_and_set_explicit(volatile atomic_flag *object, |
31 | | memory_order order) |
32 | 0 | { |
33 | 0 | return __atomic_test_and_set(&object->b, order); |
34 | 0 | } Unexecuted instantiation: jsonrpc.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: ovs-replay.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: ovs-thread.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: poll-loop.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: seq.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: socket-util.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: stream.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: timeval.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: unixctl.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: util.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: vlog.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: stream-unix.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: async-append-aio.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: stream-ssl.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: dirs.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: command-line.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: coverage.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: fatal-signal.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: hmap.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: ovs-rcu.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: packets.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: random.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: stream-replay.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: daemon-unix.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: daemon.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: dp-packet.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: guarded-list.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: lockfile.c:atomic_flag_test_and_set_explicit Unexecuted instantiation: process.c:atomic_flag_test_and_set_explicit |
35 | | |
36 | | static inline bool |
37 | | atomic_flag_test_and_set(volatile atomic_flag *object) |
38 | 0 | { |
39 | 0 | return atomic_flag_test_and_set_explicit(object, memory_order_seq_cst); |
40 | 0 | } Unexecuted instantiation: jsonrpc.c:atomic_flag_test_and_set Unexecuted instantiation: ovs-replay.c:atomic_flag_test_and_set Unexecuted instantiation: ovs-thread.c:atomic_flag_test_and_set Unexecuted instantiation: poll-loop.c:atomic_flag_test_and_set Unexecuted instantiation: seq.c:atomic_flag_test_and_set Unexecuted instantiation: socket-util.c:atomic_flag_test_and_set Unexecuted instantiation: stream.c:atomic_flag_test_and_set Unexecuted instantiation: timeval.c:atomic_flag_test_and_set Unexecuted instantiation: unixctl.c:atomic_flag_test_and_set Unexecuted instantiation: util.c:atomic_flag_test_and_set Unexecuted instantiation: vlog.c:atomic_flag_test_and_set Unexecuted instantiation: stream-unix.c:atomic_flag_test_and_set Unexecuted instantiation: async-append-aio.c:atomic_flag_test_and_set Unexecuted instantiation: stream-ssl.c:atomic_flag_test_and_set Unexecuted instantiation: dirs.c:atomic_flag_test_and_set Unexecuted instantiation: command-line.c:atomic_flag_test_and_set Unexecuted instantiation: coverage.c:atomic_flag_test_and_set Unexecuted instantiation: fatal-signal.c:atomic_flag_test_and_set Unexecuted instantiation: hmap.c:atomic_flag_test_and_set Unexecuted instantiation: ovs-rcu.c:atomic_flag_test_and_set Unexecuted instantiation: packets.c:atomic_flag_test_and_set Unexecuted instantiation: random.c:atomic_flag_test_and_set Unexecuted instantiation: stream-replay.c:atomic_flag_test_and_set Unexecuted instantiation: daemon-unix.c:atomic_flag_test_and_set Unexecuted instantiation: daemon.c:atomic_flag_test_and_set Unexecuted instantiation: dp-packet.c:atomic_flag_test_and_set Unexecuted instantiation: guarded-list.c:atomic_flag_test_and_set Unexecuted instantiation: lockfile.c:atomic_flag_test_and_set Unexecuted instantiation: process.c:atomic_flag_test_and_set |
41 | | |
42 | | static inline void |
43 | | atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order) |
44 | 0 | { |
45 | 0 | __atomic_clear(object, order); |
46 | 0 | } Unexecuted instantiation: jsonrpc.c:atomic_flag_clear_explicit Unexecuted instantiation: ovs-replay.c:atomic_flag_clear_explicit Unexecuted instantiation: ovs-thread.c:atomic_flag_clear_explicit Unexecuted instantiation: poll-loop.c:atomic_flag_clear_explicit Unexecuted instantiation: seq.c:atomic_flag_clear_explicit Unexecuted instantiation: socket-util.c:atomic_flag_clear_explicit Unexecuted instantiation: stream.c:atomic_flag_clear_explicit Unexecuted instantiation: timeval.c:atomic_flag_clear_explicit Unexecuted instantiation: unixctl.c:atomic_flag_clear_explicit Unexecuted instantiation: util.c:atomic_flag_clear_explicit Unexecuted instantiation: vlog.c:atomic_flag_clear_explicit Unexecuted instantiation: stream-unix.c:atomic_flag_clear_explicit Unexecuted instantiation: async-append-aio.c:atomic_flag_clear_explicit Unexecuted instantiation: stream-ssl.c:atomic_flag_clear_explicit Unexecuted instantiation: dirs.c:atomic_flag_clear_explicit Unexecuted instantiation: command-line.c:atomic_flag_clear_explicit Unexecuted instantiation: coverage.c:atomic_flag_clear_explicit Unexecuted instantiation: fatal-signal.c:atomic_flag_clear_explicit Unexecuted instantiation: hmap.c:atomic_flag_clear_explicit Unexecuted instantiation: ovs-rcu.c:atomic_flag_clear_explicit Unexecuted instantiation: packets.c:atomic_flag_clear_explicit Unexecuted instantiation: random.c:atomic_flag_clear_explicit Unexecuted instantiation: stream-replay.c:atomic_flag_clear_explicit Unexecuted instantiation: daemon-unix.c:atomic_flag_clear_explicit Unexecuted instantiation: daemon.c:atomic_flag_clear_explicit Unexecuted instantiation: dp-packet.c:atomic_flag_clear_explicit Unexecuted instantiation: guarded-list.c:atomic_flag_clear_explicit Unexecuted instantiation: lockfile.c:atomic_flag_clear_explicit Unexecuted instantiation: process.c:atomic_flag_clear_explicit |
47 | | |
48 | | static inline void |
49 | | atomic_flag_clear(volatile atomic_flag *object) |
50 | 0 | { |
51 | 0 | atomic_flag_clear_explicit(object, memory_order_seq_cst); |
52 | 0 | } Unexecuted instantiation: jsonrpc.c:atomic_flag_clear Unexecuted instantiation: ovs-replay.c:atomic_flag_clear Unexecuted instantiation: ovs-thread.c:atomic_flag_clear Unexecuted instantiation: poll-loop.c:atomic_flag_clear Unexecuted instantiation: seq.c:atomic_flag_clear Unexecuted instantiation: socket-util.c:atomic_flag_clear Unexecuted instantiation: stream.c:atomic_flag_clear Unexecuted instantiation: timeval.c:atomic_flag_clear Unexecuted instantiation: unixctl.c:atomic_flag_clear Unexecuted instantiation: util.c:atomic_flag_clear Unexecuted instantiation: vlog.c:atomic_flag_clear Unexecuted instantiation: stream-unix.c:atomic_flag_clear Unexecuted instantiation: async-append-aio.c:atomic_flag_clear Unexecuted instantiation: stream-ssl.c:atomic_flag_clear Unexecuted instantiation: dirs.c:atomic_flag_clear Unexecuted instantiation: command-line.c:atomic_flag_clear Unexecuted instantiation: coverage.c:atomic_flag_clear Unexecuted instantiation: fatal-signal.c:atomic_flag_clear Unexecuted instantiation: hmap.c:atomic_flag_clear Unexecuted instantiation: ovs-rcu.c:atomic_flag_clear Unexecuted instantiation: packets.c:atomic_flag_clear Unexecuted instantiation: random.c:atomic_flag_clear Unexecuted instantiation: stream-replay.c:atomic_flag_clear Unexecuted instantiation: daemon-unix.c:atomic_flag_clear Unexecuted instantiation: daemon.c:atomic_flag_clear Unexecuted instantiation: dp-packet.c:atomic_flag_clear Unexecuted instantiation: guarded-list.c:atomic_flag_clear Unexecuted instantiation: lockfile.c:atomic_flag_clear Unexecuted instantiation: process.c:atomic_flag_clear |