On Linux, when we say _forceinline, actually force it to inline.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@261 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2008-11-01 06:15:25 +00:00 committed by Gregory Hainaut
parent 2e5ba07383
commit a6a2676cc9
6 changed files with 45 additions and 25 deletions

View File

@ -310,9 +310,11 @@ typedef struct tagDMACh{
#ifdef _WIN32 #ifdef _WIN32
extern PSMEMORYMAP* memLUT; extern PSMEMORYMAP* memLUT;
#endif
extern __forceinline u8* dmaGetAddr(u32 mem) extern __forceinline u8* dmaGetAddr(u32 mem)
#else
static __forceinline u8* dmaGetAddr(u32 mem)
#endif
{ {
u8* p, *pbase; u8* p, *pbase;
mem &= ~0xf; mem &= ~0xf;
@ -345,7 +347,12 @@ extern __forceinline u8* dmaGetAddr(u32 mem)
extern u8 *psS; //0.015 mb, scratch pad extern u8 *psS; //0.015 mb, scratch pad
extern uptr *memLUTR; extern uptr *memLUTR;
#ifdef _WIN32
extern __forceinline void *dmaGetAddr(u32 addr) { extern __forceinline void *dmaGetAddr(u32 addr) {
#else
static __forceinline void *dmaGetAddr(u32 addr) {
#endif
u8 *ptr; u8 *ptr;
/*#ifdef DMA_LOG /*#ifdef DMA_LOG

View File

@ -23,6 +23,8 @@
#include <malloc.h> #include <malloc.h>
#include <assert.h> #include <assert.h>
#include "PS2Etypes.h"
#ifndef _WIN32 #ifndef _WIN32
#include <unistd.h> #include <unistd.h>
#endif #endif
@ -157,7 +159,11 @@ BOOL Save_Patch_Proc( char * filename );
#include <sys/timeb.h> #include <sys/timeb.h>
#ifdef _WIN32
extern __forceinline u32 timeGetTime() extern __forceinline u32 timeGetTime()
#else
static __forceinline u32 timeGetTime()
#endif
{ {
struct timeb t; struct timeb t;
ftime(&t); ftime(&t);
@ -268,7 +274,7 @@ void injectIRX(char *filename);
#if !defined(_MSC_VER) && !defined(HAVE_ALIGNED_MALLOC) #if !defined(_MSC_VER) && !defined(HAVE_ALIGNED_MALLOC)
// declare linux equivalents // declare linux equivalents
extern __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align) static __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
{ {
assert( align < 0x10000 ); assert( align < 0x10000 );
char* p = (char*)malloc(size+align); char* p = (char*)malloc(size+align);
@ -280,7 +286,7 @@ extern __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
return p; return p;
} }
extern __forceinline void pcsx2_aligned_free(void* pmem) static __forceinline void pcsx2_aligned_free(void* pmem)
{ {
if( pmem != NULL ) { if( pmem != NULL ) {
char* p = (char*)pmem; char* p = (char*)pmem;
@ -291,6 +297,9 @@ extern __forceinline void pcsx2_aligned_free(void* pmem)
#define _aligned_malloc pcsx2_aligned_malloc #define _aligned_malloc pcsx2_aligned_malloc
#define _aligned_free pcsx2_aligned_free #define _aligned_free pcsx2_aligned_free
// This might work, too; I'll have to test the two, and see if it makes a difference.
//#define _aligned_malloc(size,align) memalign(align, size)
//#define _aligned_free free
#endif #endif
// cross-platform atomic operations // cross-platform atomic operations
@ -325,8 +334,11 @@ typedef void* PVOID;
return __test_and_set(__p, (unsigned long)__q); return __test_and_set(__p, (unsigned long)__q);
# endif # endif
}*/ }*/
#ifdef _WIN32
extern __forceinline void InterlockedExchangePointer(PVOID volatile* Target, void* Value) extern __forceinline void InterlockedExchangePointer(PVOID volatile* Target, void* Value)
#else
static __forceinline void InterlockedExchangePointer(PVOID volatile* Target, void* Value)
#endif
{ {
#ifdef __x86_64__ #ifdef __x86_64__
__asm__ __volatile__(".intel_syntax\n" __asm__ __volatile__(".intel_syntax\n"
@ -339,7 +351,11 @@ extern __forceinline void InterlockedExchangePointer(PVOID volatile* Target, voi
#endif #endif
} }
#ifdef _WIN32
extern __forceinline long InterlockedExchange(long volatile* Target, long Value) extern __forceinline long InterlockedExchange(long volatile* Target, long Value)
#else
static __forceinline long InterlockedExchange(long volatile* Target, long Value)
#endif
{ {
__asm__ __volatile__(".intel_syntax\n" __asm__ __volatile__(".intel_syntax\n"
"lock xchg [%0], %%eax\n" "lock xchg [%0], %%eax\n"
@ -347,7 +363,11 @@ extern __forceinline long InterlockedExchange(long volatile* Target, long Value)
return 0; // The only function that even looks at this is a debugging function return 0; // The only function that even looks at this is a debugging function
} }
#ifdef _WIN32
extern __forceinline long InterlockedExchangeAdd(long volatile* Addend, long Value) extern __forceinline long InterlockedExchangeAdd(long volatile* Addend, long Value)
#else
static __forceinline long InterlockedExchangeAdd(long volatile* Addend, long Value)
#endif
{ {
__asm__ __volatile__(".intel_syntax\n" __asm__ __volatile__(".intel_syntax\n"
"lock xadd [%0], %%eax\n" "lock xadd [%0], %%eax\n"

View File

@ -88,7 +88,7 @@ typedef union _LARGE_INTEGER
{ {
long long QuadPart; long long QuadPart;
} LARGE_INTEGER; } LARGE_INTEGER;
#define _inline __inline__ #define _inline __inline__ __attribute__((unused))
#endif #endif
#if defined(__MINGW32__) #if defined(__MINGW32__)
@ -100,7 +100,7 @@ typedef union _LARGE_INTEGER
#define PCSX2_ALIGNED16_DECL(x) x #define PCSX2_ALIGNED16_DECL(x) x
#ifndef __forceinline #ifndef __forceinline
#define __forceinline inline #define __forceinline __attribute__((always_inline,unused))
#endif #endif
#endif // _MSC_VER #endif // _MSC_VER

View File

@ -168,7 +168,12 @@ extern PCSX2_ALIGNED16_DECL(VURegs VU0);
#define VU1 (*g_pVU1) #define VU1 (*g_pVU1)
#ifdef _WIN32
extern __forceinline u32* GET_VU_MEM(VURegs* VU, u32 addr) extern __forceinline u32* GET_VU_MEM(VURegs* VU, u32 addr)
#else
static __forceinline u32* GET_VU_MEM(VURegs* VU, u32 addr)
#endif
{ {
if( VU == g_pVU1 ) return (u32*)(VU1.Mem+(addr&0x3fff)); if( VU == g_pVU1 ) return (u32*)(VU1.Mem+(addr&0x3fff));

View File

@ -40,19 +40,7 @@ make clean
make install make install
else else
make $@ make $@
#if [ $? -ne 0 ]
#then
#exit 1
#fi
#if [ $# -eq 0 ] || [ $1 != "clean" ]
#then
#make install
#fi
fi fi
if [ $? -ne 0 ] if [ $? -ne 0 ]

View File

@ -28,16 +28,16 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [debug build]),
if test "x$debug" == xyes if test "x$debug" == xyes
then then
AC_DEFINE(_DEBUG,1,[_DEBUG]) AC_DEFINE(_DEBUG,1,[_DEBUG])
CFLAGS+="${DEBUG_FLAGS}" CFLAGS+=" ${DEBUG_FLAGS}"
CPPFLAGS+="${DEBUG_FLAGS}" CPPFLAGS+=" ${DEBUG_FLAGS}"
CXXFLAGS+="${DEBUG_FLAGS}" CXXFLAGS+=" ${DEBUG_FLAGS}"
CCASFLAGS+=" -D_DEBUG ${DEBUG_FLAGS}" CCASFLAGS+="-D_DEBUG ${DEBUG_FLAGS}"
MYOBJDIR="Debug" MYOBJDIR="Debug"
else else
AC_DEFINE(NDEBUG,1,[NDEBUG]) AC_DEFINE(NDEBUG,1,[NDEBUG])
CFLAGS+="${NORMAL_FLAGS}" CFLAGS+=" ${NORMAL_FLAGS}"
CPPFLAGS+="${NORMAL_FLAGS}" CPPFLAGS+=" ${NORMAL_FLAGS}"
CXXFLAGS+="${NORMAL_FLAGS}" CXXFLAGS+=" ${NORMAL_FLAGS}"
MYOBJDIR="Release" MYOBJDIR="Release"
fi fi
AC_MSG_RESULT($debug) AC_MSG_RESULT($debug)