From ebe56d6778b2e1ef1d699a665dffcdaeed53af96 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Wed, 5 Mar 2014 12:24:03 +0200 Subject: [PATCH] Add mips support (woohoo makefiles are a mess nao) --- core/build.h | 4 ++++ core/core.mk | 6 +++++- core/linux/common.cpp | 4 ++++ core/linux/nixprof.cpp | 4 ++++ shell/android/jni/Android.mk | 4 ++++ shell/android/jni/Application.mk | 2 +- 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/core/build.h b/core/build.h index f1904285e..bfff0af60 100755 --- a/core/build.h +++ b/core/build.h @@ -65,6 +65,10 @@ #define HOST_OS OS_LINUX #define HOST_CPU CPU_X86 #define BUILD_COMPILER COMPILER_GCC +#elif TARGET_LINUX_MIPS + #define HOST_OS OS_LINUX + #define HOST_CPU CPU_MIPS + #define BUILD_COMPILER COMPILER_GCC #elif TARGET_GCW0 #define HOST_OS OS_LINUX #define HOST_CPU CPU_MIPS diff --git a/core/core.mk b/core/core.mk index 296b0b7f5..886b2cd16 100755 --- a/core/core.mk +++ b/core/core.mk @@ -59,7 +59,11 @@ RZDCY_CXXFLAGS := \ RZDCY_CXXFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 RZDCY_CXXFLAGS += -DTARGET_LINUX_ARMELv7 else - RZDCY_CXXFLAGS += -DTARGET_LINUX_x86 + ifndef ISMIPS + RZDCY_CXXFLAGS += -DTARGET_LINUX_x86 + else + RZDCY_CXXFLAGS += -DTARGET_LINUX_MIPS + endif endif endif diff --git a/core/linux/common.cpp b/core/linux/common.cpp index 697238f2b..5a098e919 100644 --- a/core/linux/common.cpp +++ b/core/linux/common.cpp @@ -35,7 +35,11 @@ struct sigcontext uc_mcontext; #if HOST_CPU == CPU_ARM #define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.arm_pc) #elif HOST_CPU == CPU_MIPS +#ifdef _ANDROID +#define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.sc_pc) +#else #define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.pc) +#endif #elif HOST_CPU == CPU_X86 #define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.eip) #else diff --git a/core/linux/nixprof.cpp b/core/linux/nixprof.cpp index 4d5b18bea..b6d53126a 100644 --- a/core/linux/nixprof.cpp +++ b/core/linux/nixprof.cpp @@ -59,7 +59,11 @@ typedef struct ucontext_t #if HOST_CPU == CPU_ARM #define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.arm_pc) #elif HOST_CPU == CPU_MIPS +#ifdef _ANDROID +#define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.sc_pc) +#else #define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.pc) +#endif #elif HOST_CPU == CPU_X86 #define GET_PC_FROM_CONTEXT(c) (((ucontext_t *)(c))->uc_mcontext.eip) #else diff --git a/shell/android/jni/Android.mk b/shell/android/jni/Android.mk index 6b39775ab..cce29a7a8 100644 --- a/shell/android/jni/Android.mk +++ b/shell/android/jni/Android.mk @@ -26,6 +26,10 @@ ifneq ($(TARGET_ARCH_ABI),armeabi-v7a) NO_REC := 1 endif +ifeq ($(TARGET_ARCH_ABI),mips) + ISMIPS := 1 +endif + include $(LOCAL_PATH)/../../core/core.mk LOCAL_SRC_FILES := $(RZDCY_FILES) diff --git a/shell/android/jni/Application.mk b/shell/android/jni/Application.mk index 9c0392427..76d2e5066 100644 --- a/shell/android/jni/Application.mk +++ b/shell/android/jni/Application.mk @@ -1,5 +1,5 @@ APP_STL := stlport_static -APP_ABI := armeabi-v7a x86 +APP_ABI := armeabi-v7a x86 mips #APP_ABI := armeabi-v7a APP_PLATFORM := android-19 NDK_TOOLCHAIN_VERSION := 4.8 \ No newline at end of file