Some preliminary cleanup of the global namespace for LTO.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6942 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang 2011-01-28 00:53:30 +00:00
parent 72d604d3f2
commit 2a7f305d45
8 changed files with 42 additions and 28 deletions

View File

@ -1,7 +1,5 @@
include_directories(include) include_directories(include)
set(SRCS src/glew.c set(SRCS src/glew.c)
src/glewinfo.c
src/visualinfo.c)
add_library(GLEW STATIC ${SRCS}) add_library(GLEW STATIC ${SRCS})

View File

@ -1,15 +1,19 @@
# -*- python -*- # -*- python -*-
Import('env') Import('env')
import sys
if env.has_key('shared_glew') and env['shared_glew']: if env.has_key('shared_glew') and env['shared_glew']:
Return() Return()
files = [ if sys.platform == 'darwin':
'src/glew.c', libs = ['GLEW']
'src/glewinfo.c', frames = ['AGL', 'OpenGL']
'src/visualinfo.c', else:
] libs = ['GLEW', 'GL', 'GLU']
frames = []
env.StaticLibrary(env['local_libs'] + "GLEW", files) env.Program('glewinfo', 'src/glewinfo.c', LIBS = libs, FRAMEWORKS = frames)
env.Program('visualinfo', 'src/visualinfo.c', LIBS = libs, FRAMEWORKS = frames)
env.StaticLibrary(env['local_libs'] + 'GLEW', ['src/glew.c'])
env['CPPPATH'] += ['#Externals/GLew/include'] env['CPPPATH'] += ['#Externals/GLew/include']

View File

@ -39,7 +39,7 @@ SDSP g_dsp;
DSPBreakpoints dsp_breakpoints; DSPBreakpoints dsp_breakpoints;
DSPCoreState core_state = DSPCORE_STOP; DSPCoreState core_state = DSPCORE_STOP;
u16 cyclesLeft = 0; u16 cyclesLeft = 0;
DSPEmitter *jit = NULL; DSPEmitter *dspjit = NULL;
Common::Event step_event; Common::Event step_event;
Common::CriticalSection ExtIntCriticalSection; Common::CriticalSection ExtIntCriticalSection;
@ -92,7 +92,7 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename,
{ {
g_dsp.step_counter = 0; g_dsp.step_counter = 0;
cyclesLeft = 0; cyclesLeft = 0;
jit = NULL; dspjit = NULL;
g_dsp.irom = (u16*)AllocateMemoryPages(DSP_IROM_BYTE_SIZE); g_dsp.irom = (u16*)AllocateMemoryPages(DSP_IROM_BYTE_SIZE);
g_dsp.iram = (u16*)AllocateMemoryPages(DSP_IRAM_BYTE_SIZE); g_dsp.iram = (u16*)AllocateMemoryPages(DSP_IRAM_BYTE_SIZE);
@ -150,7 +150,7 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename,
// Initialize JIT, if necessary // Initialize JIT, if necessary
if(bUsingJIT) if(bUsingJIT)
jit = new DSPEmitter(); dspjit = new DSPEmitter();
DSPAnalyzer::Analyze(); DSPAnalyzer::Analyze();
@ -165,9 +165,9 @@ void DSPCore_Shutdown()
{ {
core_state = DSPCORE_STOP; core_state = DSPCORE_STOP;
if(jit) { if(dspjit) {
delete jit; delete dspjit;
jit = NULL; dspjit = NULL;
} }
step_event.Shutdown(); step_event.Shutdown();
FreeMemoryPages(g_dsp.irom, DSP_IROM_BYTE_SIZE); FreeMemoryPages(g_dsp.irom, DSP_IROM_BYTE_SIZE);
@ -248,10 +248,10 @@ void DSPCore_CheckExceptions()
// Handle state changes and stepping. // Handle state changes and stepping.
int DSPCore_RunCycles(int cycles) int DSPCore_RunCycles(int cycles)
{ {
if (jit) if (dspjit)
{ {
cyclesLeft = cycles; cyclesLeft = cycles;
CompiledCode pExecAddr = (CompiledCode)jit->enterDispatcher; CompiledCode pExecAddr = (CompiledCode)dspjit->enterDispatcher;
pExecAddr(); pExecAddr();
if (g_dsp.external_interrupt_waiting) if (g_dsp.external_interrupt_waiting)
@ -318,7 +318,7 @@ void DSPCore_Step()
void CompileCurrent() void CompileCurrent()
{ {
jit->Compile(g_dsp.pc); dspjit->Compile(g_dsp.pc);
bool retry = true; bool retry = true;
@ -327,11 +327,11 @@ void CompileCurrent()
retry = false; retry = false;
for(u16 i = 0x0000; i < 0xffff; ++i) for(u16 i = 0x0000; i < 0xffff; ++i)
{ {
if (!jit->unresolvedJumps[i].empty()) if (!dspjit->unresolvedJumps[i].empty())
{ {
u16 addrToCompile = jit->unresolvedJumps[i].front(); u16 addrToCompile = dspjit->unresolvedJumps[i].front();
jit->Compile(addrToCompile); dspjit->Compile(addrToCompile);
if (!jit->unresolvedJumps[i].empty()) if (!dspjit->unresolvedJumps[i].empty())
retry = true; retry = true;
} }
} }

View File

@ -267,7 +267,7 @@ struct SDSP
extern SDSP g_dsp; extern SDSP g_dsp;
extern DSPBreakpoints dsp_breakpoints; extern DSPBreakpoints dsp_breakpoints;
extern DSPEmitter *jit; extern DSPEmitter *dspjit;
extern u16 cyclesLeft; extern u16 cyclesLeft;
bool DSPCore_Init(const char *irom_filename, const char *coef_filename, bool DSPCore_Init(const char *irom_filename, const char *coef_filename,

View File

@ -257,8 +257,8 @@ void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size)
NOTICE_LOG(DSPLLE, "*** Copy new UCode from 0x%08x to 0x%04x (crc: %8x)", addr, dsp_addr, g_dsp.iram_crc); NOTICE_LOG(DSPLLE, "*** Copy new UCode from 0x%08x to 0x%04x (crc: %8x)", addr, dsp_addr, g_dsp.iram_crc);
if (jit) if (dspjit)
jit->ClearIRAM(); dspjit->ClearIRAM();
DSPAnalyzer::Analyze(); DSPAnalyzer::Analyze();
} }

View File

@ -1,6 +1,7 @@
# -*- python -*- # -*- python -*-
Import('env') Import('env')
import sys
files = [ files = [
'main.cpp', 'main.cpp',
@ -11,4 +12,9 @@ libs = [
'common', 'common',
] ]
env.Program('dsptool', files, LIBS = libs) if sys.platform == 'darwin':
frames = ['CoreFoundation']
else:
frames = []
env.Program('dsptool', files, LIBS = libs, FRAMEWORKS = frames)

View File

@ -217,7 +217,7 @@ void dsp_thread()
{ {
int cycles = (int)cycle_count; int cycles = (int)cycle_count;
if (cycles > 0) { if (cycles > 0) {
if (jit) if (dspjit)
DSPCore_RunCycles(cycles); DSPCore_RunCycles(cycles);
else else
DSPInterpreter::RunCycles(cycles); DSPInterpreter::RunCycles(cycles);

View File

@ -1,6 +1,7 @@
# -*- python -*- # -*- python -*-
Import('env') Import('env')
import sys
files = [ files = [
"AudioJitTests.cpp", "AudioJitTests.cpp",
@ -12,4 +13,9 @@ libs = [
'dspcore', 'common', 'dspcore', 'common',
] ]
env.Program('tester', files, LIBS = libs) if sys.platform == 'darwin':
frames = ['CoreFoundation']
else:
frames = []
env.Program('tester', files, LIBS = libs, FRAMEWORKS = frames)