Ticket #3345: 0ad-arm64-v2.patch
File 0ad-arm64-v2.patch, 4.8 KB (added by , 9 years ago) |
---|
-
build/premake/premake4.lua
86 86 arch = "x86" 87 87 elseif string.find(machine, "arm") == 1 then 88 88 arch = "arm" 89 elseif string.find(machine, "aarch64") == 1 then 90 arch = "aarch64" 89 91 else 90 92 print("WARNING: Cannot determine architecture from GCC, assuming x86") 91 93 end … … 828 830 table.insert(source_dirs, "lib/sysdep/arch/x86_x64"); 829 831 elseif arch == "arm" then 830 832 table.insert(source_dirs, "lib/sysdep/arch/arm"); 833 elseif arch == "aarch64" then 834 table.insert(source_dirs, "lib/sysdep/arch/aarch64"); 831 835 end 832 836 833 837 -- OS-specific -
source/lib/byte_order.h
Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
33 33 #ifndef BYTE_ORDER 34 34 # define LITTLE_ENDIAN 0x4321 35 35 # define BIG_ENDIAN 0x1234 36 # if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_ MIPS || defined(__LITTLE_ENDIAN__)36 # if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_MIPS || defined(__LITTLE_ENDIAN__) 37 37 # define BYTE_ORDER LITTLE_ENDIAN 38 38 # else 39 39 # define BYTE_ORDER BIG_ENDIAN -
source/lib/sysdep/arch/aarch64/aarch64.cpp
1 /* Copyright (c) 2012 Wildfire Games 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining 4 * a copy of this software and associated documentation files (the 5 * "Software"), to deal in the Software without restriction, including 6 * without limitation the rights to use, copy, modify, merge, publish, 7 * distribute, sublicense, and/or sell copies of the Software, and to 8 * permit persons to whom the Software is furnished to do so, subject to 9 * the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 */ 22 23 /* 24 * routines specific to ARM64 25 */ 26 27 #include "precompiled.h" 28 29 #include "lib/sysdep/cpu.h" 30 31 intptr_t cpu_AtomicAdd(volatile intptr_t* location, intptr_t increment) 32 { 33 return __sync_fetch_and_add(location, increment); 34 } 35 36 bool cpu_CAS(volatile intptr_t* location, intptr_t expected, intptr_t newValue) 37 { 38 return __sync_bool_compare_and_swap(location, expected, newValue); 39 } 40 41 bool cpu_CAS64(volatile i64* location, i64 expected, i64 newValue) 42 { 43 return __sync_bool_compare_and_swap(location, expected, newValue); 44 } 45 46 const char* cpu_IdentifierString() 47 { 48 return "unknown"; // TODO 49 } -
source/lib/sysdep/arch.h
58 58 #else 59 59 # define ARCH_ARM 0 60 60 #endif 61 // .. AArch64 (ARM64) 62 #if defined(__aarch64__) 63 # define ARCH_AARCH64 1 64 #else 65 # define ARCH_AARCH64 0 66 #endif 61 67 // .. MIPS 62 68 #if defined(__MIPS__) || defined(__mips__) || defined(__mips) 63 69 # define ARCH_MIPS 1 … … 66 72 #endif 67 73 68 74 // ensure exactly one architecture has been detected 69 #if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_ MIPS) != 175 #if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS) != 1 70 76 # error "architecture not correctly detected (either none or multiple ARCH_* defined)" 71 77 #endif 72 78 -
source/ps/GameSetup/HWDetect.cpp
223 223 scriptInterface.SetProperty(settings, "arch_ia32", ARCH_IA32); 224 224 scriptInterface.SetProperty(settings, "arch_amd64", ARCH_AMD64); 225 225 scriptInterface.SetProperty(settings, "arch_arm", ARCH_ARM); 226 scriptInterface.SetProperty(settings, "arch_aarch64", ARCH_AARCH64); 226 227 227 228 #ifdef NDEBUG 228 229 scriptInterface.SetProperty(settings, "build_debug", 0);