hotspot/src/os_cpu/linux_aarch64/vm/prefetch_linux_aarch64.inline.hpp
author kzhaldyb
Wed, 28 Sep 2016 17:18:45 +0300
changeset 42018 921e8769926b
parent 29182 78af2a4d1ec3
permissions -rw-r--r--
8166563: Convert GuardedMemory_test to Gtest Reviewed-by: iignatyev
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29182
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     1
/*
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
     2
 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
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
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    26
#ifndef OS_CPU_LINUX_AARCH64_VM_PREFETCH_LINUX_AARCH64_INLINE_HPP
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    27
#define OS_CPU_LINUX_AARCH64_VM_PREFETCH_LINUX_AARCH64_INLINE_HPP
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    28
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    29
#include "runtime/prefetch.hpp"
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    30
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    31
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    32
inline void Prefetch::read (void *loc, intx interval) {
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    33
#ifndef BUILTIN_SIM
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    34
  if (interval >= 0)
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    35
    asm("prfm PLDL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval));
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    36
#endif
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    37
}
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    38
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    39
inline void Prefetch::write(void *loc, intx interval) {
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    40
#ifndef BUILTIN_SIM
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    41
  if (interval >= 0)
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    42
    asm("prfm PSTL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval));
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    43
#endif
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    44
}
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    45
78af2a4d1ec3 8068055: AARCH64: os_cpu
aph
parents:
diff changeset
    46
#endif // OS_CPU_LINUX_AARCH64_VM_PREFETCH_LINUX_AARCH64_INLINE_HPP