6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP
27 #define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP
28
29 #include "runtime/orderAccess.hpp"
30
31 #ifndef PPC64
32 #error "OrderAccess currently only implemented for PPC64"
33 #endif
34
35 // Compiler version last used for testing: gcc 4.1.2
36 // Please update this information when this file changes
37
38 // Implementation of class OrderAccess.
39
40 //
41 // Machine barrier instructions:
42 //
43 // - sync Two-way memory barrier, aka fence.
44 // - lwsync orders Store|Store,
45 // Load|Store,
46 // Load|Load,
47 // but not Store|Load
77 inline void OrderAccess::storeload() { inlasm_sync(); }
78
79 inline void OrderAccess::acquire() { inlasm_lwsync(); }
80 inline void OrderAccess::release() { inlasm_lwsync(); }
81 inline void OrderAccess::fence() { inlasm_sync(); }
82
83
84 template<size_t byte_size>
85 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
86 {
87 template <typename T>
88 T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
89 };
90
91 #undef inlasm_sync
92 #undef inlasm_lwsync
93 #undef inlasm_eieio
94 #undef inlasm_isync
95 #undef inlasm_acquire_reg
96
97 #endif // OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP
|
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_HPP
27 #define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_HPP
28
29 #include "runtime/orderAccess.hpp"
30
31 #ifndef PPC64
32 #error "OrderAccess currently only implemented for PPC64"
33 #endif
34
35 // Compiler version last used for testing: gcc 4.1.2
36 // Please update this information when this file changes
37
38 // Implementation of class OrderAccess.
39
40 //
41 // Machine barrier instructions:
42 //
43 // - sync Two-way memory barrier, aka fence.
44 // - lwsync orders Store|Store,
45 // Load|Store,
46 // Load|Load,
47 // but not Store|Load
77 inline void OrderAccess::storeload() { inlasm_sync(); }
78
79 inline void OrderAccess::acquire() { inlasm_lwsync(); }
80 inline void OrderAccess::release() { inlasm_lwsync(); }
81 inline void OrderAccess::fence() { inlasm_sync(); }
82
83
84 template<size_t byte_size>
85 struct OrderAccess::PlatformOrderedLoad<byte_size, X_ACQUIRE>
86 {
87 template <typename T>
88 T operator()(const volatile T* p) const { register T t = Atomic::load(p); inlasm_acquire_reg(t); return t; }
89 };
90
91 #undef inlasm_sync
92 #undef inlasm_lwsync
93 #undef inlasm_eieio
94 #undef inlasm_isync
95 #undef inlasm_acquire_reg
96
97 #endif // OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_HPP
|