author | kbarrett |
Tue, 02 Jul 2019 18:24:47 -0400 | |
changeset 55569 | 8e3a0ebf3497 |
parent 54323 | 846bc643f4ef |
permissions | -rw-r--r-- |
4013 | 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. |
4013 | 3 |
* Copyright 2007, 2008, 2009 Red Hat, Inc. |
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 |
* |
|
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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
22 |
* questions. |
4013 | 23 |
* |
24 |
*/ |
|
25 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50429
diff
changeset
|
26 |
#ifndef OS_CPU_LINUX_ZERO_ORDERACCESS_LINUX_ZERO_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50429
diff
changeset
|
27 |
#define OS_CPU_LINUX_ZERO_ORDERACCESS_LINUX_ZERO_HPP |
7397 | 28 |
|
50429
83aec1d357d4
8204301: Make OrderAccess functions available to hpp rather than inline.hpp files
coleenp
parents:
47609
diff
changeset
|
29 |
// Included in orderAccess.hpp header file. |
7397 | 30 |
|
4013 | 31 |
#ifdef ARM |
32 |
||
33 |
/* |
|
34 |
* ARM Kernel helper for memory barrier. |
|
35 |
* Using __asm __volatile ("":::"memory") does not work reliable on ARM |
|
36 |
* and gcc __sync_synchronize(); implementation does not use the kernel |
|
37 |
* helper for all gcc versions so it is unreliable to use as well. |
|
38 |
*/ |
|
39 |
typedef void (__kernel_dmb_t) (void); |
|
40 |
#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) |
|
41 |
||
42 |
#define FULL_MEM_BARRIER __kernel_dmb() |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
43 |
#define LIGHT_MEM_BARRIER __kernel_dmb() |
4013 | 44 |
|
45 |
#else // ARM |
|
46 |
||
47 |
#define FULL_MEM_BARRIER __sync_synchronize() |
|
48 |
||
49 |
#ifdef PPC |
|
50 |
||
51 |
#ifdef __NO_LWSYNC__ |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
52 |
#define LIGHT_MEM_BARRIER __asm __volatile ("sync":::"memory") |
4013 | 53 |
#else |
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
54 |
#define LIGHT_MEM_BARRIER __asm __volatile ("lwsync":::"memory") |
4013 | 55 |
#endif |
56 |
||
57 |
#else // PPC |
|
58 |
||
47527
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
59 |
#ifdef ALPHA |
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
60 |
|
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
61 |
#define LIGHT_MEM_BARRIER __sync_synchronize() |
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
62 |
|
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
63 |
#else // ALPHA |
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
64 |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
65 |
#define LIGHT_MEM_BARRIER __asm __volatile ("":::"memory") |
4013 | 66 |
|
47527
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
67 |
#endif // ALPHA |
9c0137e5e37a
8187590: Zero runtime can lock-up on linux-alpha
glaubitz
parents:
47216
diff
changeset
|
68 |
|
4013 | 69 |
#endif // PPC |
70 |
||
71 |
#endif // ARM |
|
72 |
||
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
73 |
// Note: What is meant by LIGHT_MEM_BARRIER is a barrier which is sufficient |
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
74 |
// to provide TSO semantics, i.e. StoreStore | LoadLoad | LoadStore. |
4013 | 75 |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
76 |
inline void OrderAccess::loadload() { LIGHT_MEM_BARRIER; } |
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
77 |
inline void OrderAccess::storestore() { LIGHT_MEM_BARRIER; } |
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
78 |
inline void OrderAccess::loadstore() { LIGHT_MEM_BARRIER; } |
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
79 |
inline void OrderAccess::storeload() { FULL_MEM_BARRIER; } |
4013 | 80 |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
81 |
inline void OrderAccess::acquire() { LIGHT_MEM_BARRIER; } |
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
82 |
inline void OrderAccess::release() { LIGHT_MEM_BARRIER; } |
4013 | 83 |
|
29456
cc1c5203e60d
7143664: Clean up OrderAccess implementations and usage
dholmes
parents:
25715
diff
changeset
|
84 |
inline void OrderAccess::fence() { FULL_MEM_BARRIER; } |
54323 | 85 |
inline void OrderAccess::cross_modify_fence() { } |
4013 | 86 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50429
diff
changeset
|
87 |
#endif // OS_CPU_LINUX_ZERO_ORDERACCESS_LINUX_ZERO_HPP |