Skip to content

Commit

Permalink
Merge pull request #9051 from Orphis/symbian_remove
Browse files Browse the repository at this point in the history
symbian: Remove!
  • Loading branch information
hrydgard committed Oct 11, 2016
2 parents ad71d27 + 4145b60 commit 4f655f8
Show file tree
Hide file tree
Showing 55 changed files with 44 additions and 818 deletions.
3 changes: 0 additions & 3 deletions Common/ArmCPUDetect.cpp
Expand Up @@ -207,9 +207,6 @@ void CPUInfo::Detect()
#endif
strcpy(brand_string, "Apple A");
num_cores = 2;
#elif defined(__SYMBIAN32__)
strcpy(brand_string, "Samsung ARMv6");
num_cores = 1;
#else
strcpy(brand_string, "Unknown");
num_cores = 1;
Expand Down
9 changes: 1 addition & 8 deletions Common/ArmEmitter.cpp
Expand Up @@ -24,11 +24,6 @@
#include <stdlib.h>
#include <string.h>

// For cache flushing on Symbian/iOS
#ifdef __SYMBIAN32__
#include <e32std.h>
#endif

#ifdef IOS
#include <libkern/OSCacheControl.h>
#include <sys/mman.h>
Expand Down Expand Up @@ -628,9 +623,7 @@ void ARMXEmitter::FlushIcache()

void ARMXEmitter::FlushIcacheSection(u8 *start, u8 *end)
{
#ifdef __SYMBIAN32__
User::IMB_Range(start, end);
#elif defined(IOS)
#if defined(IOS)
// Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
#elif !defined(_WIN32)
Expand Down
2 changes: 0 additions & 2 deletions Common/ArmEmitter.h
Expand Up @@ -25,8 +25,6 @@
#include "CodeBlock.h"
#include "MsgHandler.h"

// TODO: Check if Pandora still needs signal.h/kill here. Symbian doesn't.

// VCVT flags
#define TO_FLOAT 0
#define TO_INT 1 << 0
Expand Down
4 changes: 0 additions & 4 deletions Common/CodeBlock.h
Expand Up @@ -97,11 +97,7 @@ template<class T> class CodeBlock : public CodeBlockCommon, public T, NonCopyabl

// Call this when shutting down. Don't rely on the destructor, even though it'll do the job.
void FreeCodeSpace() {
#ifdef __SYMBIAN32__
ResetExecutableMemory(region);
#else
FreeMemoryPages(region, region_size);
#endif
region = nullptr;
region_size = 0;
}
Expand Down
2 changes: 0 additions & 2 deletions Common/FakeEmitter.h
Expand Up @@ -26,8 +26,6 @@
#include "Common.h"
#include "MsgHandler.h"

// TODO: Check if Pandora still needs signal.h/kill here. Symbian doesn't.

// VCVT flags
#define TO_FLOAT 0
#define TO_INT 1 << 0
Expand Down
18 changes: 0 additions & 18 deletions Common/FileUtil.cpp
Expand Up @@ -76,24 +76,6 @@
#define DIR_SEP_CHRS "/"
#endif

// Hack
#if defined(__SYMBIAN32__)
static inline int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
struct dirent *readdir_entry;

readdir_entry = readdir(dirp);
if (readdir_entry == NULL) {
*result = NULL;
return errno;
}

*entry = *readdir_entry;
*result = entry;
return 0;
}
#endif


// This namespace has various generic functions related to files and paths.
// The code still needs a ton of cleanup.
// REMEMBER: strdup considered harmful!
Expand Down
4 changes: 0 additions & 4 deletions Common/Log.h
Expand Up @@ -121,16 +121,12 @@ bool GenericLogEnabled(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type);
__LINE__, __FILE__); \
if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \
}
#ifdef __SYMBIAN32__
#define _dbg_assert_msg_(_t_, _a_, ...) if (!(_a_)) ERROR_LOG(_t_, __VA_ARGS__);
#else
#define _dbg_assert_msg_(_t_, _a_, ...)\
if (!(_a_)) {\
printf(__VA_ARGS__); \
ERROR_LOG(_t_, __VA_ARGS__); \
if (!PanicYesNo(__VA_ARGS__)) {Crash();} \
}
#endif
#define _dbg_update_() ; //Host_UpdateLogDisplay();

#else // not debug
Expand Down
7 changes: 0 additions & 7 deletions Common/LogManager.cpp
Expand Up @@ -23,9 +23,6 @@
#include "Timer.h"
#include "FileUtil.h"
#include "../Core/Config.h"
#ifdef __SYMBIAN32__
#include <e32debug.h>
#endif

// Don't need to savestate this.
const char *hleCurrentThreadName = NULL;
Expand Down Expand Up @@ -278,16 +275,12 @@ void LogChannel::RemoveListener(LogListener *listener) {
}

void LogChannel::Trigger(LogTypes::LOG_LEVELS level, const char *msg) {
#ifdef __SYMBIAN32__
RDebug::Printf("%s",msg);
#else
lock_guard lk(m_listeners_lock);

std::set<LogListener*>::const_iterator i;
for (i = m_listeners.begin(); i != m_listeners.end(); ++i) {
(*i)->Log(level, msg);
}
#endif
}

FileLogListener::FileLogListener(const char *filename) {
Expand Down
38 changes: 1 addition & 37 deletions Common/MemoryUtil.cpp
Expand Up @@ -48,20 +48,6 @@ static SYSTEM_INFO sys_info;
#define MEM_PAGE_MASK ((MEM_PAGE_SIZE)-1)
#define round_page(x) ((((uintptr_t)(x)) + MEM_PAGE_MASK) & ~(MEM_PAGE_MASK))

#ifdef __SYMBIAN32__
#include <e32std.h>
#define CODECHUNK_SIZE 1024*1024*20
static RChunk* g_code_chunk = NULL;
static RHeap* g_code_heap = NULL;
static u8* g_next_ptr = NULL;
static u8* g_orig_ptr = NULL;

void ResetExecutableMemory(void* ptr) {
// Just reset the ptr to the base
g_next_ptr = g_orig_ptr;
}
#endif

#ifdef _WIN32
// Win32 flags are odd...
uint32_t ConvertProtFlagsWin32(uint32_t flags) {
Expand Down Expand Up @@ -153,19 +139,6 @@ void *AllocateExecutableMemory(size_t size) {
else
#endif
ptr = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
#elif defined(__SYMBIAN32__)
//This function may be called more than once, and we want to create only one big
//memory chunk for all the executable code for the JIT
if( g_code_chunk == NULL && g_code_heap == NULL)
{
g_code_chunk = new RChunk();
g_code_chunk->CreateLocalCode(CODECHUNK_SIZE, CODECHUNK_SIZE + 3*GetMemoryProtectPageSize());
g_code_heap = UserHeap::ChunkHeap(*g_code_chunk, CODECHUNK_SIZE, 1, CODECHUNK_SIZE + 3*GetMemoryProtectPageSize());
g_next_ptr = reinterpret_cast<u8*>(g_code_heap->AllocZ(CODECHUNK_SIZE));
g_orig_ptr = g_next_ptr;
}
void* ptr = (void*)g_next_ptr;
g_next_ptr += size;
#else
static char *map_hint = 0;
#if defined(_M_X64)
Expand All @@ -191,7 +164,7 @@ void *AllocateExecutableMemory(size_t size) {

#endif /* defined(_WIN32) */

#if !defined(_WIN32) && !defined(__SYMBIAN32__)
#if !defined(_WIN32)
static const void *failed_result = MAP_FAILED;
#else
static const void *failed_result = nullptr;
Expand Down Expand Up @@ -222,8 +195,6 @@ void *AllocateMemoryPages(size_t size, uint32_t memProtFlags) {
#ifdef _WIN32
uint32_t protect = ConvertProtFlagsWin32(memProtFlags);
void* ptr = VirtualAlloc(0, size, MEM_COMMIT, protect);
#elif defined(__SYMBIAN32__)
void* ptr = malloc(size);
#else
uint32_t protect = ConvertProtFlagsUnix(memProtFlags);
void* ptr = mmap(0, size, protect, MAP_ANON | MAP_PRIVATE, -1, 0);
Expand All @@ -243,9 +214,6 @@ void *AllocateAlignedMemory(size_t size, size_t alignment) {
void* ptr = NULL;
#ifdef ANDROID
ptr = memalign(alignment, size);
#elif defined(__SYMBIAN32__)
// On Symbian, alignment won't matter as NEON isn't supported.
ptr = malloc(size);
#else
if (posix_memalign(&ptr, alignment, size) != 0)
ptr = NULL;
Expand All @@ -268,8 +236,6 @@ void FreeMemoryPages(void *ptr, size_t size) {
#ifdef _WIN32
if (!VirtualFree(ptr, 0, MEM_RELEASE))
PanicAlert("FreeMemoryPages failed!\n%s", GetLastErrorMsg());
#elif defined(__SYMBIAN32__)
free(ptr);
#else
munmap(ptr, size);
#endif
Expand Down Expand Up @@ -310,8 +276,6 @@ void ProtectMemoryPages(const void* ptr, size_t size, uint32_t memProtFlags) {
DWORD oldValue;
if (!VirtualProtect((void *)ptr, size, protect, &oldValue))
PanicAlert("WriteProtectMemory failed!\n%s", GetLastErrorMsg());
#elif defined(__SYMBIAN32__)
// Do nothing
#else
uint32_t protect = ConvertProtFlagsUnix(memProtFlags);
uint32_t page_size = GetMemoryProtectPageSize();
Expand Down
4 changes: 0 additions & 4 deletions Common/MemoryUtil.h
Expand Up @@ -46,10 +46,6 @@ void FreeMemoryPages(void* ptr, size_t size);
void* AllocateAlignedMemory(size_t size, size_t alignment);
void FreeAlignedMemory(void* ptr);

#ifdef __SYMBIAN32__
void ResetExecutableMemory(void* ptr);
#endif

int GetMemoryProtectPageSize();

template <typename T>
Expand Down
7 changes: 0 additions & 7 deletions Common/MipsEmitter.cpp
Expand Up @@ -15,11 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

// Symbian can't build this due to an old gcc/lib combination, and doesn't need to.
// Kind programmer, if you want to translate this to a proper feature-detection
// define, please feel free to.
#ifndef __SYMBIAN32__

#include "base/logging.h"

#include <assert.h>
Expand Down Expand Up @@ -497,5 +492,3 @@ void MIPSCodeBlock::FreeCodeSpace() {
}

}

#endif
6 changes: 0 additions & 6 deletions Common/MipsEmitter.h
Expand Up @@ -16,10 +16,6 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#pragma once
// Symbian can't build this due to an old gcc/lib combination, and doesn't need to.
// Kind programmer, if you want to translate this to a proper feature-detection
// define, please feel free to.
#ifndef __SYMBIAN32__

#include <functional>
#include <vector>
Expand Down Expand Up @@ -321,5 +317,3 @@ class MIPSCodeBlock : public MIPSEmitter {
};

};

#endif
2 changes: 1 addition & 1 deletion Common/Misc.cpp
Expand Up @@ -20,7 +20,7 @@

#include <string.h>

#if defined(__APPLE__) || defined(__SYMBIAN32__)
#if defined(__APPLE__)
#define __thread
#endif

Expand Down
9 changes: 2 additions & 7 deletions Core/Config.cpp
Expand Up @@ -407,12 +407,7 @@ static int DefaultZoomType() {
}

static bool DefaultTimerHack() {
// Has been in use on Symbian since v0.7. Preferred option.
#ifdef __SYMBIAN32__
return true;
#else
return false;
#endif
}

static int DefaultAndroidHwScale() {
Expand Down Expand Up @@ -569,7 +564,7 @@ static ConfigSetting controlSettings[] = {
ConfigSetting("ComboKey3Mapping", &g_Config.iCombokey3, 0, true, true),
ConfigSetting("ComboKey4Mapping", &g_Config.iCombokey4, 0, true, true),

#if !defined(__SYMBIAN32__) && !defined(IOS) && !defined(MAEMO)
#if !defined(IOS) && !defined(MAEMO)
#if defined(_WIN32)
// A win32 user seeing touch controls is likely using PPSSPP on a tablet. There it makes
// sense to default this to on.
Expand Down Expand Up @@ -672,7 +667,7 @@ static ConfigSetting networkSettings[] = {

static int DefaultPSPModel() {
// TODO: Can probably default this on, but not sure about its memory differences.
#if !defined(_M_X64) && !defined(_WIN32) && !defined(__SYMBIAN32__)
#if !defined(_M_X64) && !defined(_WIN32)
return PSP_MODEL_FAT;
#else
return PSP_MODEL_SLIM;
Expand Down
2 changes: 1 addition & 1 deletion Core/Config.h
Expand Up @@ -342,7 +342,7 @@ struct Config {
int iCombokey3;
int iCombokey4;

#if !defined(__SYMBIAN32__) && !defined(IOS) && !defined(MAEMO)
#if !defined(IOS) && !defined(MAEMO)
bool bShowTouchPause;
#endif

Expand Down
3 changes: 0 additions & 3 deletions Core/Core.cpp
Expand Up @@ -133,9 +133,6 @@ bool Core_GetPowerSaving() {
bool UpdateScreenScale(int width, int height, bool smallWindow) {
g_dpi = 72;
g_dpi_scale = 1.0f;
#if defined(__SYMBIAN32__)
g_dpi_scale = 1.4f;
#endif
if (smallWindow) {
g_dpi_scale = 2.0f;
}
Expand Down
5 changes: 0 additions & 5 deletions Core/FileLoaders/HTTPFileLoader.cpp
Expand Up @@ -61,12 +61,7 @@ void HTTPFileLoader::Prepare() {
size_pos = header.find_first_not_of(' ', size_pos);
}
if (size_pos != header.npos) {
// TODO: Find a way to get this to work right on Symbian?
#ifndef __SYMBIAN32__
filesize_ = atoll(&header[size_pos]);
#else
filesize_ = atoi(&header[size_pos]);
#endif
}
}
if (startsWithNoCase(header, "Accept-Ranges:")) {
Expand Down
3 changes: 0 additions & 3 deletions Core/FileSystems/DirectoryFileSystem.cpp
Expand Up @@ -40,9 +40,6 @@
#include <sys/types.h>
#include <sys/vfs.h>
#define statvfs statfs
#elif defined(__SYMBIAN32__)
#include <mw/QSystemStorageInfo>
QTM_USE_NAMESPACE
#else
#include <sys/statvfs.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion Core/FileSystems/DirectoryFileSystem.h
Expand Up @@ -39,7 +39,7 @@ typedef void * HANDLE;
#define HOST_IS_CASE_SENSITIVE 1
#endif

#elif defined(_WIN32) || defined(__SYMBIAN32__)
#elif defined(_WIN32)
#define HOST_IS_CASE_SENSITIVE 0

#else // Android, Linux, BSD (and the rest?)
Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/sceRtc.cpp
Expand Up @@ -97,7 +97,7 @@ time_t rtc_timegm(struct tm *tm)
return _mkgmtime(tm);
}

#elif (defined(__GLIBC__) && !defined(ANDROID)) || defined(__SYMBIAN32__)
#elif (defined(__GLIBC__) && !defined(ANDROID))
#define rtc_timegm timegm
#else

Expand Down
10 changes: 0 additions & 10 deletions Core/MIPS/IR/IRInst.h
Expand Up @@ -6,16 +6,6 @@
#include "Common/CommonTypes.h"
#include "Core/MIPS/MIPS.h"

#ifdef __SYMBIAN32__
// Seems std::move() doesn't exist, so assuming it can't do moves at all.
namespace std {
template <typename T>
const T &move(const T &x) {
return x;
}
};
#endif

// Basic IR
//
// This IR refers implicitly to the MIPS register set and is simple to interpret.
Expand Down

0 comments on commit 4f655f8

Please sign in to comment.