src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.hpp
author michaelm
Thu, 22 Aug 2019 14:36:10 +0100
changeset 57838 78844dceede6
parent 54323 846bc643f4ef
child 58947 d5156218928d
permissions -rw-r--r--
8199849: Add support for UTF-8 encoded credentials in HTTP Basic Authentication Reviewed-by: chegar, dfuchs
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
54323
846bc643f4ef 8220351: Cross-modifying code
rehn
parents: 53244
diff changeset
    52
inline void OrderAccess::cross_modify_fence() { }
846bc643f4ef 8220351: Cross-modifying code
rehn
parents: 53244
diff changeset
    53
47609
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    54
template<size_t byte_size>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    55
struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    56
{
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    57
  template <typename T>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    58
  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
    59
};
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    60
47609
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    61
template<size_t byte_size>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    62
struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    63
{
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    64
  template <typename T>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    65
  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
    66
};
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    67
47609
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    68
template<size_t byte_size>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    69
struct OrderAccess::PlatformOrderedStore<byte_size, RELEASE_X_FENCE>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    70
{
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    71
  template <typename T>
a1f68e415b48 8188813: Generalize OrderAccess to use templates
eosterlund
parents: 47216
diff changeset
    72
  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
    73
};
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    74
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50429
diff changeset
    75
#endif // OS_CPU_LINUX_AARCH64_ORDERACCESS_LINUX_AARCH64_HPP