ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp
(Generate patch)

Comparing SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp (file contents):
Revision 1.17 by gbeauche, 2003-11-10T16:23:58Z vs.
Revision 1.20 by gbeauche, 2003-12-03T10:52:49Z

# Line 30 | Line 30
30   #include "sigsegv.h"
31   #include "cpu/ppc/ppc-cpu.hpp"
32   #include "cpu/ppc/ppc-operations.hpp"
33 + #include "cpu/ppc/ppc-instructions.hpp"
34  
35   // Used for NativeOp trampolines
36   #include "video.h"
# Line 92 | Line 93 | static KernelData * const kernel_data =
93   // SIGSEGV handler
94   static sigsegv_return_t sigsegv_handler(sigsegv_address_t, sigsegv_address_t);
95  
96 + // JIT Compiler enabled?
97 + static inline bool enable_jit_p()
98 + {
99 +        return PrefsFindBool("jit");
100 + }
101 +
102  
103   /**
104   *              PowerPC emulator glue with special 'sheep' opcodes
105   **/
106  
107 + enum {
108 +        PPC_I(SHEEP) = PPC_I(MAX),
109 +        PPC_I(SHEEP_MAX)
110 + };
111 +
112   class sheepshaver_cpu
113          : public powerpc_cpu
114   {
# Line 112 | Line 124 | public:
124          uint32 get_cr() const           { return cr().get(); }
125          void set_cr(uint32 v)           { cr().set(v); }
126  
115        // Execution loop
116        void execute(uint32 entry, bool enable_cache = false);
117
127          // Execute 68k routine
128          void execute_68k(uint32 entry, M68kRegisters *r);
129  
# Line 147 | Line 156 | public:
156   lazy_allocator< sheepshaver_cpu > allocator_helper< sheepshaver_cpu, lazy_allocator >::allocator;
157  
158   sheepshaver_cpu::sheepshaver_cpu()
159 <        : powerpc_cpu()
159 >        : powerpc_cpu(enable_jit_p())
160   {
161          init_decoder();
162   }
# Line 165 | Line 174 | void sheepshaver_cpu::init_decoder()
174                  { "sheep",
175                    (execute_pmf)&sheepshaver_cpu::execute_sheep,
176                    NULL,
177 +                  PPC_I(SHEEP),
178                    D_form, 6, 0, CFLOW_JUMP | CFLOW_TRAP
179                  }
180          };
# Line 237 | Line 247 | void sheepshaver_cpu::execute_sheep(uint
247          }
248   }
249  
240 // Execution loop
241 void sheepshaver_cpu::execute(uint32 entry, bool enable_cache)
242 {
243        powerpc_cpu::execute(entry, enable_cache);
244 }
245
250   // Handle MacOS interrupt
251   void sheepshaver_cpu::interrupt(uint32 entry)
252   {
# Line 679 | Line 683 | void emul_ppc(uint32 entry)
683          current_cpu->start_log();
684   #endif
685          // start emulation loop and enable code translation or caching
686 <        current_cpu->execute(entry, true);
686 >        current_cpu->execute(entry);
687   }
688  
689   /*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines