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.26 by gbeauche, 2004-01-24T11:28:06Z vs.
Revision 1.29 by gbeauche, 2004-02-20T17:20:15Z

# Line 158 | Line 158 | public:
158          void interrupt(uint32 entry);
159          void handle_interrupt();
160  
161        // Lazy memory allocator (one item at a time)
162        void *operator new(size_t size)
163                { return allocator_helper< sheepshaver_cpu, lazy_allocator >::allocate(); }
164        void operator delete(void *p)
165                { allocator_helper< sheepshaver_cpu, lazy_allocator >::deallocate(p); }
166        // FIXME: really make surre array allocation fail at link time?
167        void *operator new[](size_t);
168        void operator delete[](void *p);
169
161          // Make sure the SIGSEGV handler can access CPU registers
162          friend sigsegv_return_t sigsegv_handler(sigsegv_address_t, sigsegv_address_t);
163   };
164  
165 < lazy_allocator< sheepshaver_cpu > allocator_helper< sheepshaver_cpu, lazy_allocator >::allocator;
165 > // Memory allocator returning areas aligned on 16-byte boundaries
166 > void *operator new(size_t size)
167 > {
168 >        void *p;
169 >
170 >        /* XXX: try different approaches */
171 >        if (posix_memalign(&p, 16, size) != 0)
172 >                throw std::bad_alloc();
173 >
174 >        return p;
175 > }
176 >
177 > void operator delete(void *p)
178 > {
179 >        free(p);
180 > }
181  
182   sheepshaver_cpu::sheepshaver_cpu()
183          : powerpc_cpu(enable_jit_p())
# Line 181 | Line 187 | sheepshaver_cpu::sheepshaver_cpu()
187  
188   void sheepshaver_cpu::init_decoder()
189   {
184 #ifndef PPC_NO_STATIC_II_INDEX_TABLE
185        static bool initialized = false;
186        if (initialized)
187                return;
188        initialized = true;
189 #endif
190
190          static const instr_info_t sheep_ii_table[] = {
191                  { "sheep",
192                    (execute_pmf)&sheepshaver_cpu::execute_sheep,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines