mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-12 01:30:03 +00:00
[patch from Darik Horn <dajhorn@vanadac.com> ]
Makes SheepShaver compatible with Ubuntu Intrepid and other distros that bundle the gcc-4.3 compiler. The patch changes two things: 1. Renames the block_cache where its name collides with its class definition. 2. Fixes the "explicit template specialization cannot have a storage class" error in the ppc-dyngen-ops.cpp file.
This commit is contained in:
parent
a370638388
commit
d6db773362
@ -266,7 +266,7 @@ void powerpc_cpu::initialize()
|
|||||||
|
|
||||||
// Initialize block lookup table
|
// Initialize block lookup table
|
||||||
#if PPC_DECODE_CACHE || PPC_ENABLE_JIT
|
#if PPC_DECODE_CACHE || PPC_ENABLE_JIT
|
||||||
block_cache.initialize();
|
my_block_cache.initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Init cache range invalidate recorder
|
// Init cache range invalidate recorder
|
||||||
@ -551,7 +551,7 @@ void *powerpc_cpu::compile_chain_block(block_info *sbi)
|
|||||||
const uint32 bpc = sbi->pc;
|
const uint32 bpc = sbi->pc;
|
||||||
|
|
||||||
const uint32 tpc = sbi->li[n].jmp_pc;
|
const uint32 tpc = sbi->li[n].jmp_pc;
|
||||||
block_info *tbi = block_cache.find(tpc);
|
block_info *tbi = my_block_cache.find(tpc);
|
||||||
if (tbi == NULL)
|
if (tbi == NULL)
|
||||||
tbi = compile_block(tpc);
|
tbi = compile_block(tpc);
|
||||||
assert(tbi && tbi->pc == tpc);
|
assert(tbi && tbi->pc == tpc);
|
||||||
@ -573,7 +573,7 @@ void powerpc_cpu::execute(uint32 entry)
|
|||||||
if (execute_depth == 1 || (PPC_ENABLE_JIT && PPC_REENTRANT_JIT)) {
|
if (execute_depth == 1 || (PPC_ENABLE_JIT && PPC_REENTRANT_JIT)) {
|
||||||
#if PPC_ENABLE_JIT
|
#if PPC_ENABLE_JIT
|
||||||
if (use_jit) {
|
if (use_jit) {
|
||||||
block_info *bi = block_cache.find(pc());
|
block_info *bi = my_block_cache.find(pc());
|
||||||
if (bi == NULL)
|
if (bi == NULL)
|
||||||
bi = compile_block(pc());
|
bi = compile_block(pc());
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -596,7 +596,7 @@ void powerpc_cpu::execute(uint32 entry)
|
|||||||
// Don't check for backward branches here as this
|
// Don't check for backward branches here as this
|
||||||
// is now done by generated code. Besides, we will
|
// is now done by generated code. Besides, we will
|
||||||
// get here if the fast cache lookup failed too.
|
// get here if the fast cache lookup failed too.
|
||||||
if ((bi = block_cache.find(pc())) == NULL)
|
if ((bi = my_block_cache.find(pc())) == NULL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -607,7 +607,7 @@ void powerpc_cpu::execute(uint32 entry)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if PPC_DECODE_CACHE
|
#if PPC_DECODE_CACHE
|
||||||
block_info *bi = block_cache.find(pc());
|
block_info *bi = my_block_cache.find(pc());
|
||||||
if (bi != NULL)
|
if (bi != NULL)
|
||||||
goto pdi_execute;
|
goto pdi_execute;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -617,7 +617,7 @@ void powerpc_cpu::execute(uint32 entry)
|
|||||||
clock_t start_time;
|
clock_t start_time;
|
||||||
start_time = clock();
|
start_time = clock();
|
||||||
#endif
|
#endif
|
||||||
bi = block_cache.new_blockinfo();
|
bi = my_block_cache.new_blockinfo();
|
||||||
bi->init(pc());
|
bi->init(pc());
|
||||||
|
|
||||||
// Predecode a new block
|
// Predecode a new block
|
||||||
@ -667,8 +667,8 @@ void powerpc_cpu::execute(uint32 entry)
|
|||||||
bi->min_pc = dpc;
|
bi->min_pc = dpc;
|
||||||
bi->max_pc = entry;
|
bi->max_pc = entry;
|
||||||
bi->size = di - bi->di;
|
bi->size = di - bi->di;
|
||||||
block_cache.add_to_cl_list(bi);
|
my_block_cache.add_to_cl_list(bi);
|
||||||
block_cache.add_to_active_list(bi);
|
my_block_cache.add_to_active_list(bi);
|
||||||
decode_cache_p += bi->size;
|
decode_cache_p += bi->size;
|
||||||
#if PPC_PROFILE_COMPILE_TIME
|
#if PPC_PROFILE_COMPILE_TIME
|
||||||
compile_time += (clock() - start_time);
|
compile_time += (clock() - start_time);
|
||||||
@ -702,7 +702,7 @@ void powerpc_cpu::execute(uint32 entry)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((bi->pc != pc()) && ((bi = block_cache.find(pc())) == NULL))
|
if ((bi->pc != pc()) && ((bi = my_block_cache.find(pc())) == NULL))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -778,8 +778,8 @@ void powerpc_cpu::invalidate_cache()
|
|||||||
{
|
{
|
||||||
D(bug("Invalidate all cache blocks\n"));
|
D(bug("Invalidate all cache blocks\n"));
|
||||||
#if PPC_DECODE_CACHE || PPC_ENABLE_JIT
|
#if PPC_DECODE_CACHE || PPC_ENABLE_JIT
|
||||||
block_cache.clear();
|
my_block_cache.clear();
|
||||||
block_cache.initialize();
|
my_block_cache.initialize();
|
||||||
spcflags().set(SPCFLAG_JIT_EXEC_RETURN);
|
spcflags().set(SPCFLAG_JIT_EXEC_RETURN);
|
||||||
#endif
|
#endif
|
||||||
#if PPC_ENABLE_JIT
|
#if PPC_ENABLE_JIT
|
||||||
@ -822,6 +822,6 @@ void powerpc_cpu::invalidate_cache_range(uintptr start, uintptr end)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
spcflags().set(SPCFLAG_JIT_EXEC_RETURN);
|
spcflags().set(SPCFLAG_JIT_EXEC_RETURN);
|
||||||
block_cache.clear_range(start, end);
|
my_block_cache.clear_range(start, end);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ private:
|
|||||||
|
|
||||||
// Block lookup table
|
// Block lookup table
|
||||||
typedef powerpc_block_info block_info;
|
typedef powerpc_block_info block_info;
|
||||||
block_cache< block_info, lazy_allocator > block_cache;
|
block_cache< block_info, lazy_allocator > my_block_cache;
|
||||||
|
|
||||||
#if PPC_DECODE_CACHE
|
#if PPC_DECODE_CACHE
|
||||||
// Decode Cache
|
// Decode Cache
|
||||||
|
@ -100,7 +100,7 @@ struct powerpc_dyngen_helper {
|
|||||||
static inline powerpc_fpr & reg_F3() { return CPU->codegen.reg_F3; }
|
static inline powerpc_fpr & reg_F3() { return CPU->codegen.reg_F3; }
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
static inline powerpc_block_info *find_block(uint32 pc) { return CPU->block_cache.fast_find(pc); }
|
static inline powerpc_block_info *find_block(uint32 pc) { return CPU->my_block_cache.fast_find(pc); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Semantic action templates
|
// Semantic action templates
|
||||||
@ -1380,13 +1380,13 @@ static inline void do_lmw(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
static inline void do_lmw<31>(void)
|
inline void do_lmw<31>(void)
|
||||||
{
|
{
|
||||||
CPU->gpr(31) = vm_read_memory_4(T0);
|
CPU->gpr(31) = vm_read_memory_4(T0);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
static inline void do_lmw<32>(void)
|
inline void do_lmw<32>(void)
|
||||||
{
|
{
|
||||||
for (uint32 r = PARAM1, ad = T0; r <= 31; r++, ad += 4)
|
for (uint32 r = PARAM1, ad = T0; r <= 31; r++, ad += 4)
|
||||||
CPU->gpr(r) = vm_read_memory_4(ad);
|
CPU->gpr(r) = vm_read_memory_4(ad);
|
||||||
@ -1402,13 +1402,13 @@ static inline void do_stmw(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
static inline void do_stmw<31>(void)
|
inline void do_stmw<31>(void)
|
||||||
{
|
{
|
||||||
vm_write_memory_4(T0, CPU->gpr(31));
|
vm_write_memory_4(T0, CPU->gpr(31));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
static inline void do_stmw<32>(void)
|
inline void do_stmw<32>(void)
|
||||||
{
|
{
|
||||||
for (uint32 r = PARAM1, ad = T0; r <= 31; r++, ad += 4)
|
for (uint32 r = PARAM1, ad = T0; r <= 31; r++, ad += 4)
|
||||||
vm_write_memory_4(ad, CPU->gpr(r));
|
vm_write_memory_4(ad, CPU->gpr(r));
|
||||||
|
@ -143,7 +143,7 @@ powerpc_cpu::compile_block(uint32 entry_point)
|
|||||||
codegen_context_t cg_context(dg);
|
codegen_context_t cg_context(dg);
|
||||||
cg_context.entry_point = entry_point;
|
cg_context.entry_point = entry_point;
|
||||||
again:
|
again:
|
||||||
block_info *bi = block_cache.new_blockinfo();
|
block_info *bi = my_block_cache.new_blockinfo();
|
||||||
bi->init(entry_point);
|
bi->init(entry_point);
|
||||||
bi->entry_point = dg.gen_start(entry_point);
|
bi->entry_point = dg.gen_start(entry_point);
|
||||||
|
|
||||||
@ -1576,11 +1576,11 @@ powerpc_cpu::compile_block(uint32 entry_point)
|
|||||||
disasm_translation(entry_point, dpc - entry_point + 4, bi->entry_point, bi->size);
|
disasm_translation(entry_point, dpc - entry_point + 4, bi->entry_point, bi->size);
|
||||||
|
|
||||||
dg.gen_end();
|
dg.gen_end();
|
||||||
block_cache.add_to_cl_list(bi);
|
my_block_cache.add_to_cl_list(bi);
|
||||||
if (is_read_only_memory(bi->pc))
|
if (is_read_only_memory(bi->pc))
|
||||||
block_cache.add_to_dormant_list(bi);
|
my_block_cache.add_to_dormant_list(bi);
|
||||||
else
|
else
|
||||||
block_cache.add_to_active_list(bi);
|
my_block_cache.add_to_active_list(bi);
|
||||||
#if PPC_PROFILE_COMPILE_TIME
|
#if PPC_PROFILE_COMPILE_TIME
|
||||||
compile_time += (clock() - start_time);
|
compile_time += (clock() - start_time);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user