Line 0
Link Here
|
|
|
1 |
--- source/lib/sysdep/arch/ppc64/ppc64.cpp.orig 2021-02-28 23:47:02 UTC |
2 |
+++ source/lib/sysdep/arch/ppc64/ppc64.cpp |
3 |
@@ -0,0 +1,50 @@ |
4 |
+/* Copyright (C) 2012 Wildfire Games |
5 |
+ * Copyright (C) 2018 Raptor Engineering, LLC |
6 |
+ * |
7 |
+ * Permission is hereby granted, free of charge, to any person obtaining |
8 |
+ * a copy of this software and associated documentation files (the |
9 |
+ * "Software"), to deal in the Software without restriction, including |
10 |
+ * without limitation the rights to use, copy, modify, merge, publish, |
11 |
+ * distribute, sublicense, and/or sell copies of the Software, and to |
12 |
+ * permit persons to whom the Software is furnished to do so, subject to |
13 |
+ * the following conditions: |
14 |
+ * |
15 |
+ * The above copyright notice and this permission notice shall be included |
16 |
+ * in all copies or substantial portions of the Software. |
17 |
+ * |
18 |
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
19 |
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
20 |
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
21 |
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
22 |
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
23 |
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
24 |
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
25 |
+ */ |
26 |
+ |
27 |
+/* |
28 |
+ * routines specific to POWER |
29 |
+ */ |
30 |
+ |
31 |
+#include "precompiled.h" |
32 |
+ |
33 |
+#include "lib/sysdep/cpu.h" |
34 |
+ |
35 |
+intptr_t cpu_AtomicAdd(volatile intptr_t* location, intptr_t increment) |
36 |
+{ |
37 |
+ return __sync_fetch_and_add(location, increment); |
38 |
+} |
39 |
+ |
40 |
+bool cpu_CAS(volatile intptr_t* location, intptr_t expected, intptr_t newValue) |
41 |
+{ |
42 |
+ return __sync_bool_compare_and_swap(location, expected, newValue); |
43 |
+} |
44 |
+ |
45 |
+bool cpu_CAS64(volatile i64* location, i64 expected, i64 newValue) |
46 |
+{ |
47 |
+ return __sync_bool_compare_and_swap(location, expected, newValue); |
48 |
+} |
49 |
+ |
50 |
+const char* cpu_IdentifierString() |
51 |
+{ |
52 |
+ return "IBM POWER"; // TODO |
53 |
+} |