src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.hpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 50429 83aec1d357d4
child 54323 846bc643f4ef
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50429
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     3
 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     5
 *
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     8
 * published by the Free Software Foundation.
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     9
 *
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    14
 * accompanied this code).
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    15
 *
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    19
 *
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    22
 * questions.
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    23
 *
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    24
 */
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    25
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50429
diff changeset
    26
#ifndef OS_CPU_LINUX_AARCH64_ORDERACCESS_LINUX_AARCH64_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50429
diff changeset
    27
#define OS_CPU_LINUX_AARCH64_ORDERACCESS_LINUX_AARCH64_HPP
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    28
50429
83aec1d357d4 8204301: Make OrderAccess functions available to hpp rather than inline.hpp files
coleenp
parents: 49364
diff changeset
    29
// Included in orderAccess.hpp header file.
83aec1d357d4 8204301: Make OrderAccess functions available to hpp rather than inline.hpp files
coleenp
parents: 49364
diff changeset
    30
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    31
#include "vm_version_aarch64.hpp"
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    32
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    33
// Implementation of class OrderAccess.
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    34
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    35
inline void OrderAccess::loadload()   { acquire(); }
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    36
inline void OrderAccess::storestore() { release(); }
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    37
inline void OrderAccess::loadstore()  { acquire(); }
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    38
inline void OrderAccess::storeload()  { fence(); }
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    39
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    40
inline void OrderAccess::acquire() {
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    41
  READ_MEM_BARRIER;
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    42
}
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    43
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    44
inline void OrderAccess::release() {
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    45
  WRITE_MEM_BARRIER;
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    46
}
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    47
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    48
inline void OrderAccess::fence() {
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    49
  FULL_MEM_BARRIER;
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    50
}
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    51
47609
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    52
template<size_t byte_size>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    53
struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    54
{
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    55
  template <typename T>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    56
  T operator()(const volatile T* p) const { T data; __atomic_load(p, &data, __ATOMIC_ACQUIRE); return data; }
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    57
};
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    58
47609
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    59
template<size_t byte_size>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    60
struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    61
{
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    62
  template <typename T>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    63
  void operator()(T v, volatile T* p) const { __atomic_store(p, &v, __ATOMIC_RELEASE); }
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    64
};
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    65
47609
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    66
template<size_t byte_size>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    67
struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X_FENCE>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    68
{
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    69
  template <typename T>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    70
  void operator()(T v, volatile T* p) const { release_store(p, v); fence(); }
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    71
};
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    72
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50429
diff changeset
    73
#endif // OS_CPU_LINUX_AARCH64_ORDERACCESS_LINUX_AARCH64_HPP