diff --git a/build/premake/premake4.lua b/build/premake/premake4.lua
index 72422e8..851c4b5 100644
a
|
b
|
rootdir = "../.."
|
26 | 26 | |
27 | 27 | dofile("extern_libs4.lua") |
28 | 28 | |
29 | | -- detect CPU architecture (simplistic, currently only supports x86 and amd64) |
| 29 | -- detect CPU architecture (simplistic, currently only supports x86, amd64 and ARM) |
30 | 30 | arch = "x86" |
31 | 31 | if _OPTIONS["android"] then |
32 | 32 | arch = "arm" |
… |
… |
else
|
47 | 47 | arch = "amd64" |
48 | 48 | elseif string.find(machine, "i.86") == 1 then |
49 | 49 | arch = "x86" |
| 50 | elseif string.find(machine, "arm") == 1 then |
| 51 | arch = "arm" |
50 | 52 | else |
51 | 53 | print("WARNING: Cannot determine architecture from GCC, assuming x86") |
52 | 54 | end |
… |
… |
function project_set_build_flags()
|
262 | 264 | if arch == "arm" then |
263 | 265 | -- disable warnings about va_list ABI change |
264 | 266 | buildoptions { "-Wno-psabi" } |
265 | | |
266 | | -- target Cortex-A9 CPUs with NEON |
267 | | buildoptions { "-mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp" } |
| 267 | if _OPTIONS["android"] then |
| 268 | -- target generic arm CPUs with NEON |
| 269 | buildoptions { "-mtune=generic-arm -mfpu=neon -mfloat-abi=softfp" } |
| 270 | else |
| 271 | -- target Cortex-A15 CPUs with NEON |
| 272 | buildoptions { "-mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard" } |
| 273 | end |
268 | 274 | end |
269 | 275 | |
270 | 276 | if _OPTIONS["coverage"] then |
diff --git a/libraries/source/fcollada/src/FCollada/FUtils/FUAssert.cpp b/libraries/source/fcollada/src/FCollada/FUtils/FUAssert.cpp
index 9e7651e..12770a9 100644
a
|
b
|
bool FUAssertion::OnAssertionFailed(const char* file, uint32 line)
|
44 | 44 | #elif defined (__APPLE__) |
45 | 45 | Debugger(); |
46 | 46 | //SysBreak(); |
| 47 | #elif defined (__arm__) |
| 48 | __asm__("bkpt 0"); |
47 | 49 | #else |
48 | 50 | // AFAIK This is available on all X86 platforms |
49 | 51 | __asm__("int $0x03"); |
diff --git a/libraries/source/fcollada/src/Makefile b/libraries/source/fcollada/src/Makefile
index 90d6d1b..2c49ff9 100644
a
|
b
|
|
1 | 1 | OS_ARCH := $(shell uname -s) |
| 2 | OS_CPU := $(shell uname -p) |
2 | 3 | |
3 | 4 | ifeq ($(OS_ARCH),Darwin) |
4 | 5 | PIC_FLAGS ?= -fPIC |
… |
… |
endif
|
9 | 10 | |
10 | 11 | CXX ?= g++ |
11 | 12 | CXXFLAGS += -fvisibility=hidden -W -Wall -Wno-unused-parameter -Wno-unused-function $(OS_DEFINE) $(PIC_FLAGS) $(CPPFLAGS) |
| 13 | # If we're compiling on *nix ARM, target Cortex-A15 CPUs with NEON ***mfloat-abi setting must be the same on everything linked to FCollada*** |
| 14 | ifeq ($(OS_CPU),armv7l) |
| 15 | CXXFLAGS += -mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard |
| 16 | endif |
12 | 17 | CXXFLAGS_DEBUG := -O0 -g -D_DEBUG -DRETAIL |
13 | 18 | CXXFLAGS_RELEASE := -O1 -DNDEBUG -DRETAIL |
14 | | # (-O2 with gcc 4.3 causes linker errors when using this library, for unknown reasons, so stick with -O1) |
| 19 | # (-O2 with gcc 4.3 causes linker errors when using this library, for unknown reasons, so stick with -O1 until gcc >4.3 is typical.) |
15 | 20 | CXXFLAGS_TEST := -O0 -g -D_DEBUG |
16 | 21 | LIBS += `pkg-config libxml-2.0 --libs` |
17 | 22 | INCLUDES += -IFCollada `pkg-config libxml-2.0 --cflags` |
diff --git a/libraries/source/nvtt/src/src/nvcore/nvcore.h b/libraries/source/nvtt/src/src/nvcore/nvcore.h
index 5de942d..21bf202 100644
a
|
b
|
|
67 | 67 | // NV_CPU_X86 |
68 | 68 | // NV_CPU_X86_64 |
69 | 69 | // NV_CPU_PPC |
| 70 | // NV_CPU_ARM |
70 | 71 | |
71 | 72 | #define NV_CPU_STRING POSH_CPU_STRING |
72 | 73 | |
… |
… |
|
76 | 77 | # define NV_CPU_X86 1 |
77 | 78 | #elif defined POSH_CPU_PPC |
78 | 79 | # define NV_CPU_PPC 1 |
| 80 | #elif defined POSH_CPU_STRONGARM |
| 81 | # define NV_CPU_ARM 1 |
79 | 82 | #else |
80 | 83 | # error "Unsupported CPU" |
81 | 84 | #endif |
diff --git a/source/lib/sysdep/arch/arm/arm.cpp b/source/lib/sysdep/arch/arm/arm.cpp
index 867e80c..b9b85d5 100644
a
|
b
|
|
28 | 28 | |
29 | 29 | #include "lib/sysdep/cpu.h" |
30 | 30 | |
31 | | #include <android/log.h> |
32 | 31 | intptr_t cpu_AtomicAdd(volatile intptr_t* location, intptr_t increment) |
33 | 32 | { |
34 | 33 | return __sync_fetch_and_add(location, increment); |
… |
… |
bool cpu_CAS(volatile intptr_t* location, intptr_t expected, intptr_t newValue)
|
41 | 40 | |
42 | 41 | bool cpu_CAS64(volatile i64* location, i64 expected, i64 newValue) |
43 | 42 | { |
44 | | // Current versions of GCC don't implement this on ARM: |
45 | | // return __sync_bool_compare_and_swap(location, expected, newValue); |
46 | | |
47 | | // http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40fb79c8a88625504857d44de1bc89dc0341e618 |
48 | | // adds support for |
49 | | // return __kernel_cmpxchg64(&expected, &newValue, (long long*)location) == 0; |
50 | | // but only for Linux kernel 3.1 |
51 | | |
52 | | // Maybe we can do it with user-space assembly assuming a modern-enough CPU? |
53 | | // That sounds non-trivial so let's just cheat |
54 | | #warning TODO: atomic cpu_CAS64 on ARM |
55 | | if (*location != expected) |
56 | | return false; |
57 | | *location = newValue; |
58 | | return true; |
| 43 | return __sync_bool_compare_and_swap(location, expected, newValue); |
59 | 44 | } |
60 | 45 | |
61 | 46 | const char* cpu_IdentifierString() |