From 2b965a6f03329b8387131cf34abbb46f186d3523 Mon Sep 17 00:00:00 2001 From: Aapo Rantalainen Date: Fri, 22 Mar 2013 09:15:00 +0200 Subject: [PATCH 1/3] Maemo5 support --- CMakeLists.txt | 15 +++++++++++++-- Common/Log.h | 4 ++++ Core/MIPS/ARM/ArmJit.h | 4 ++++ Core/MIPS/ARM/ArmRegCache.cpp | 4 ++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29ea8d8be5..23b7e41652 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,12 @@ if (IOS) set(ARM ON) endif() +if (MAEMO) + set(ARM ON) + #Maemo's gcc-4.7.2 is strickt + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") +endif() + if(BLACKBERRY) set(ARM ON) endif() @@ -26,7 +32,7 @@ else() # Assume x86 set(X86 ON) endif() -if(ANDROID OR BLACKBERRY OR IOS OR PANDORA) +if(ANDROID OR BLACKBERRY OR IOS OR PANDORA OR MAEMO) set(HEADLESS OFF) elseif(NOT DEFINED HEADLESS) set(HEADLESS ON) @@ -39,6 +45,7 @@ option(X86 "Set to ON if targeting an X86 processor" ${X86}) option(ANDROID "Set to ON if targeting an Android device" ${ANDROID}) option(BLACKBERRY "Set to ON if targeting a Blackberry device" ${BLACKBERRY}) option(PANDORA "Set to ON if targeting an OpenPandora device" ${PANDORA}) +option(MAEMO "Set to ON if targeting an Maemo (N900) device" ${MAEMO}) option(IOS "Set to ON if targeting an iOS device" ${IOS}) option(USING_GLES2 "Set to ON if target device uses OpenGL ES 2.0" ${USING_GLES2}) option(USING_QT_UI "Set to ON if you wish to use the Qt frontend wrapper" ${USING_QT_UI}) @@ -99,6 +106,10 @@ if(IOS) add_definitions(-DIOS) endif() +if(MAEMO) + add_definitions(-DMAEMO) +endif() + if(PANDORA) add_definitions(-DPANDORA) endif() @@ -453,7 +464,7 @@ elseif(SDL_FOUND) if(APPLE) set(nativeExtra ${nativeExtra} SDL/SDLMain.h SDL/SDLMain.mm) set(nativeExtraLibs ${nativeExtraLibs} ${COCOA_LIBRARY}) - elseif(PANDORA) + elseif(PANDORA OR MAEMO) set(nativeExtraLibs ${nativeExtraLibs} pthread EGL X11) endif() set(TargetBin PPSSPPSDL) diff --git a/Common/Log.h b/Common/Log.h index f0c87936e6..49e38a5457 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -31,6 +31,10 @@ #define VERBOSE_LEVEL 6 // Noisy debugging - sometimes needed but usually unimportant. #if !defined(_WIN32) && !defined(PANDORA) +#if defined(MAEMO) + //ucontext.h will be then skipped + #define _SYS_UCONTEXT_H 1 +#endif #include #endif diff --git a/Core/MIPS/ARM/ArmJit.h b/Core/MIPS/ARM/ArmJit.h index 1eecffa105..8eee4db9f1 100644 --- a/Core/MIPS/ARM/ArmJit.h +++ b/Core/MIPS/ARM/ArmJit.h @@ -24,6 +24,10 @@ #include "ArmRegCacheFPU.h" #include "ArmAsm.h" +#if defined(MAEMO) +#include "stddef.h" +#endif + namespace MIPSComp { diff --git a/Core/MIPS/ARM/ArmRegCache.cpp b/Core/MIPS/ARM/ArmRegCache.cpp index f3054a7c22..ce2fcaf6b5 100644 --- a/Core/MIPS/ARM/ArmRegCache.cpp +++ b/Core/MIPS/ARM/ArmRegCache.cpp @@ -18,6 +18,10 @@ #include "ArmRegCache.h" #include "ArmEmitter.h" +#if defined(MAEMO) +#include "stddef.h" +#endif + using namespace ArmGen; ArmRegCache::ArmRegCache(MIPSState *mips) : mips_(mips) { From 178891b57608a8df1541b3f7fc6ee83ad1b50989 Mon Sep 17 00:00:00 2001 From: Aapo Rantalainen Date: Fri, 22 Mar 2013 17:26:19 +0200 Subject: [PATCH 2/3] Maemo5: fix 'Bus error' caused by too small /tmp-filesystem (used /tmp/gc_mem.tmp) --- Common/MemArena.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Common/MemArena.cpp b/Common/MemArena.cpp index d2d03bd720..c2a7619685 100644 --- a/Common/MemArena.cpp +++ b/Common/MemArena.cpp @@ -98,8 +98,12 @@ int ashmem_unpin_region(int fd, size_t offset, size_t len) #ifndef _WIN32 // do not make this "static" +#ifdef MAEMO std::string ram_temp_file = "/tmp/gc_mem.tmp"; #else +std::string ram_temp_file = "/home/user/.ppsspp/tmp_gc_mem.tmp"; +#endif +#else SYSTEM_INFO sysInfo; #endif From b49729f7a91772b27b5b7a544b8cf87a1a7c16d8 Mon Sep 17 00:00:00 2001 From: Aapo Rantalainen Date: Fri, 22 Mar 2013 17:48:47 +0200 Subject: [PATCH 3/3] FIX for last commit ifdef wrong way --- Common/MemArena.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/MemArena.cpp b/Common/MemArena.cpp index c2a7619685..1bda3d5891 100644 --- a/Common/MemArena.cpp +++ b/Common/MemArena.cpp @@ -99,9 +99,9 @@ int ashmem_unpin_region(int fd, size_t offset, size_t len) #ifndef _WIN32 // do not make this "static" #ifdef MAEMO -std::string ram_temp_file = "/tmp/gc_mem.tmp"; -#else std::string ram_temp_file = "/home/user/.ppsspp/tmp_gc_mem.tmp"; +#else +std::string ram_temp_file = "/tmp/gc_mem.tmp"; #endif #else SYSTEM_INFO sysInfo;