View | Details | Raw Unified | Return to bug 253924 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-build_premake_premake5.lua (-1 / +19 lines)
Lines 1-5 Link Here
1
--- build/premake/premake5.lua.orig	2021-02-06 00:32:37 UTC
1
--- build/premake/premake5.lua.orig	2021-02-28 23:45:14 UTC
2
+++ build/premake/premake5.lua
2
+++ build/premake/premake5.lua
3
@@ -87,6 +87,8 @@ else
4
 			arch = "aarch64"
5
 		elseif string.find(machine, "e2k") == 1 then
6
 			arch = "e2k"
7
+		elseif string.find(machine, "ppc64") == 1 or string.find(machine, "powerpc64") == 1 then
8
+			arch = "ppc64"
9
 		else
10
 			print("WARNING: Cannot determine architecture from GCC, assuming x86")
11
 		end
3
@@ -365,7 +365,7 @@ function project_set_build_flags()
12
@@ -365,7 +365,7 @@ function project_set_build_flags()
4
 
13
 
5
 		if os.istarget("linux") or os.istarget("bsd") then
14
 		if os.istarget("linux") or os.istarget("bsd") then
Lines 9-11 Link Here
9
 			end
18
 			end
10
 
19
 
11
 			-- To use our local shared libraries, they need to be found in the
20
 			-- To use our local shared libraries, they need to be found in the
21
@@ -865,6 +867,8 @@ function setup_all_libs ()
22
 		table.insert(source_dirs, "lib/sysdep/arch/aarch64");
23
 	elseif arch == "e2k" then
24
 		table.insert(source_dirs, "lib/sysdep/arch/e2k");
25
+	elseif arch == "ppc64" then
26
+		table.insert(source_dirs, "lib/sysdep/arch/ppc64");
27
 	end
28
29
 	-- OS-specific
(-)files/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp (+12 lines)
Line 0 Link Here
1
--- libraries/source/nvtt/src/src/nvcore/Debug.cpp.orig	2021-02-28 23:45:14 UTC
2
+++ libraries/source/nvtt/src/src/nvcore/Debug.cpp
3
@@ -628,6 +628,9 @@ namespace 
4
 #  elif NV_CPU_X86
5
         ucontext_t * ucp = (ucontext_t *)secret;
6
         return (void *)ucp->uc_mcontext.mc_eip;
7
+#  elif NV_CPU_PPC
8
+        ucontext_t * ucp = (ucontext_t *)secret;
9
+        return (void *)ucp->uc_mcontext.mc_srr0;
10
 #    else
11
 #      error "Unknown CPU"
12
 #    endif
(-)files/patch-source_lib_byte__order.h (+11 lines)
Line 0 Link Here
1
--- source/lib/byte_order.h.orig	2021-02-28 23:45:13 UTC
2
+++ source/lib/byte_order.h
3
@@ -33,7 +33,7 @@
4
 #ifndef BYTE_ORDER
5
 # define LITTLE_ENDIAN 0x4321
6
 # define BIG_ENDIAN    0x1234
7
-# if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_MIPS || ARCH_E2K || defined(__LITTLE_ENDIAN__)
8
+# if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_MIPS || ARCH_E2K || ARCH_PPC64 || defined(__LITTLE_ENDIAN__)
9
 #  define BYTE_ORDER LITTLE_ENDIAN
10
 # else
11
 #  define BYTE_ORDER BIG_ENDIAN
(-)files/patch-source_lib_sysdep_arch.h (+18 lines)
Line 0 Link Here
1
--- source/lib/sysdep/arch.h.orig	2021-02-28 23:45:13 UTC
2
+++ source/lib/sysdep/arch.h
3
@@ -76,9 +76,14 @@
4
 #else
5
 # define ARCH_E2K 0
6
 #endif
7
+#if defined(__PPC64__)
8
+# define ARCH_PPC64 1
9
+#else
10
+# define ARCH_PPC64 0
11
+#endif
12
 
13
 // ensure exactly one architecture has been detected
14
-#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS+ARCH_E2K) != 1
15
+#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS+ARCH_E2K+ARCH_PPC64) != 1
16
 # error "architecture not correctly detected (either none or multiple ARCH_* defined)"
17
 #endif
18
 
(-)files/patch-source_lib_sysdep_arch_ppc64_ppc64.cpp (+53 lines)
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
+}
(-)files/patch-source_ps_GameSetup_HWDetect.cpp (+10 lines)
Line 0 Link Here
1
--- source/ps/GameSetup/HWDetect.cpp.orig	2021-02-28 23:45:13 UTC
2
+++ source/ps/GameSetup/HWDetect.cpp
3
@@ -124,6 +124,7 @@ void RunHardwareDetection()
4
 	scriptInterface.SetProperty(settings, "arch_arm", ARCH_ARM);
5
 	scriptInterface.SetProperty(settings, "arch_aarch64", ARCH_AARCH64);
6
 	scriptInterface.SetProperty(settings, "arch_e2k", ARCH_E2K);
7
+	scriptInterface.SetProperty(settings, "arch_ppc64", ARCH_PPC64);
8
 
9
 #ifdef NDEBUG
10
 	scriptInterface.SetProperty(settings, "build_debug", 0);

Return to bug 253924