2 * Copyright (c) 2003 Hewlett-Packard Development Company, L.P.
3 * Copyright (c) 2009-2017 Ivan Maidanski
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 #ifndef AO_ASSUME_WINDOWS98
25 /* CAS is always available */
26 # define AO_ASSUME_WINDOWS98
28 #include "common32_defs.h"
30 #include "../test_and_set_t_is_ao_t.h"
31 /* AO_test_and_set_full() is emulated using CAS. */
33 /* Some ARM slide set, if it has been read correctly, claims that Loads */
34 /* followed by either a Load or a Store are ordered, but nothing else. */
35 /* It is assumed that Windows interrupt handlers clear the LL/SC flag. */
36 /* Unaligned accesses are not guaranteed to be atomic. */
37 #include "../all_aligned_atomic_load_store.h"
39 /* If only a single processor is used, we can define AO_UNIPROCESSOR. */
40 #ifdef AO_UNIPROCESSOR
41 AO_INLINE void AO_nop_full(void)
43 AO_compiler_barrier();
45 # define AO_HAVE_nop_full
47 /* AO_nop_full() is emulated using AO_test_and_set_full(). */
51 /* ARMv6 is the first architecture providing support for simple LL/SC. */
53 /* #include "../standard_ao_double_t.h" */
54 /* TODO: implement double-wide operations (similar to x86). */
56 #else /* _M_ARM < 6 */
58 /* TODO: implement AO_test_and_set_full using SWP. */
60 #endif /* _M_ARM < 6 */