Commit Graph

62 Commits

Author SHA1 Message Date
gbeauche
55f5e3a41b Fix CR save/restore in EmulOp thunk. I don't know what it fixes for real
but that was definitely wrong to only preserve CR2 there.
2005-06-30 07:34:17 +00:00
gbeauche
c41f403f56 Rework sheepshaver_cpu object allocation and get rid of POSIX'ish functions. 2005-06-22 16:38:15 +00:00
gbeauche
287296b363 it makes more sense to dump the crash dump header to stderr 2005-03-17 23:40:01 +00:00
gbeauche
48213aa5eb Revert to no nested native ppc interrupt processing, also filter out cases
where InterruptFlags is 0.
2005-03-05 18:33:30 +00:00
gbeauche
9019e71cfc Preserve all necessary registers on interrupt, thus also permitting nested
interrupts to occur. SheepShaver locks should now be reduced.
2005-03-05 15:25:10 +00:00
gbeauche
df0d5d2a41 Happy New Year 2005! 2005-01-30 21:48:22 +00:00
gbeauche
126e549397 add FP regs & state to preserved context on interrupt 2005-01-30 21:12:07 +00:00
gbeauche
f9937854be ethernet seems to work with sheepnet, even on kernel 2.6/x86_64! 2004-12-18 18:40:04 +00:00
gbeauche
53dfcecb54 16-byte aligned memory allocator only for sheepshaver_cpu 2004-11-25 00:21:09 +00:00
gbeauche
114f5ff6c7 Use BUILD_SHEEPSHAVER_PROCEDURE to allocate static procedures into the
SheepShaver globals. Fix build of sheepshaver_glue.cpp without JIT.
2004-11-22 22:04:38 +00:00
gbeauche
3ace37f4eb Implement Direct Addressing mode similarly to Basilisk II. This is to get
SheepShaver working on OSes that don't support maipping of Low Memory globals
at 0x00000000, e.g. Windows.
2004-11-13 14:09:16 +00:00
gbeauche
4d60dea4ee Revert last change until I can check myself... 2004-07-11 08:12:21 +00:00
gbeauche
58e74f3ca0 Enable ethernet everywhere, several users got it to work. Hangs may be
unrelated to ethernet code anyway and ethernet driver should be endian
safe nowadays.
2004-07-11 07:54:56 +00:00
gbeauche
623a804814 Remove "native" EmulOp stuff as it is useless and duplicates functionalities 2004-07-11 06:42:28 +00:00
gbeauche
3e5c98c7d4 Performance of VOSF is heuristically determined at run-time, so have to
initialize SIGSEGV handlers early, as in Basilisk II. Besides, also add
missing call to vm_init() in case host system doesn't have MAP_ANON.
2004-06-26 15:26:18 +00:00
gbeauche
0dcb2b4516 SDL support in SheepShaver too, though it doesn't work in native mode
on Linux/ppc as libSDL is pulling in libpthread which conflicts with
our sheepthreads.
2004-06-24 15:37:26 +00:00
gbeauche
e0a76f9e38 Don't handle XLM_IRQ_NEST atomically in emulated mode. That's useless since
this variable is modified only within a single thread and interrupts are
not handled asynchronously.
2004-06-22 17:10:08 +00:00
gbeauche
070ac7079f Always handle interrupt even if InterruptFlags == 0, though it should not
really happen in practise.
2004-06-22 14:18:35 +00:00
gbeauche
301d3a3192 STATS: Account for all interrupts, but still count native interrupts. It
turns out that for a regular bootup sequence to the Finder, less than 30%
interrupts triggered were in native mode.

Default EMUL_TIME_STATS to 0, end user probably doesn't want garbage to
be printed to his console.
2004-06-05 07:09:38 +00:00
gbeauche
389dd61d0d Check for SIGSEGVs from DR Cache code too. 2004-05-31 10:08:31 +00:00
gbeauche
05bd5f40b4 Fix NativeOp code generation, especially in PPC_REENTRANT_JIT mode 2004-05-23 05:28:12 +00:00
gbeauche
bd6eaf680a Get rid of old (and broken) ASYNC_IRQ / MUTICORE code 2004-05-20 12:33:58 +00:00
gbeauche
3a960764ea Don't allow "recursive" NanoKernel interrupts 2004-05-20 11:47:27 +00:00
gbeauche
ec6c98035b Better interrupt context checking code 2004-05-20 11:05:30 +00:00
gbeauche
c3f2342f47 Make NativeOp() handler a sheepshaver_cpu handler, thus getting rid of ugly
GPR macro definition.

Make the JIT engine somewhat reentrant. This brings a massive performance
boost for applications that cause many Execute68k(). e.g. audio in PlayerPRO.
2004-05-19 21:23:17 +00:00
gbeauche
ae0e7293dd Don't take an EMUL_OP mode switch for Microseconds() and SynchIdleTime() 2004-05-15 17:26:28 +00:00
gbeauche
7da40bee5c Handle SAFE_INTERRUPT_PPC to check possible nested calls (and this happens) 2004-05-12 15:54:23 +00:00
gbeauche
ba7bfc478e Extend NativeOp count to 64 (6-bit value), aka fix NATIVE_FILLRECT opcpdes.
Translate NQD_{bitblt,fillrect,invrect} to direct native calls.
Use Mac2HostAddr() for converting Mac base address to native.
2004-04-22 22:54:47 +00:00
gbeauche
8b40a7e721 NQD: use ReadMacInt*() and WriteMacInt*() accessors, i.e. code should now
be little-endian and 64-bit safe.
2004-04-22 21:45:18 +00:00
gbeauche
b4ac3fb507 Basic fillrect/invrect NQD. Code may need to be factored out somehow.
Verify that bitblt NQD transfer modes are really CopyBits() ones [MB5].
2004-04-22 20:57:31 +00:00
gbeauche
a65a6c6db2 Start Native QuickDraw acceleration 2004-04-18 23:03:53 +00:00
gbeauche
47348e8120 16-byte aligned memory allocator will try the following functions in-order
(determined at compile-time): posix_memalign, memalign, valloc, malloc.
2004-02-24 14:09:12 +00:00
gbeauche
ae93ea2f16 Make SheepShaver work with OS 8.6 out-of-the-box with no extra patch for
the time being. i.e. ignore writes to the zero page when faking SCSIGlobals
2004-02-24 11:12:54 +00:00
gbeauche
cdab3d6975 we have to 16-byte align sheepshaver_cpu object has it contains SSE values
that require this alignment.
2004-02-20 17:20:15 +00:00
gbeauche
18893e22bd GCC 3.4 does not allow the lazy_allocator instantiation, the other form is
not supported by any GCC but ICC accepts it.
2004-02-16 15:34:55 +00:00
gbeauche
313cddeeb2 AltiVec emulation! ;-) 2004-02-15 17:17:37 +00:00
gbeauche
10b9ab2c34 Generate PowerPC code wrapping GetResource() replacements. That way, it's
a normal PPC function invocation that can be JIT compiled to native code
instead of nesting execute() calls which may lead to use the interpreter
(this took around 11% of total execution time on boot, downto 3%).

Also, optimize some SheepShaver EmulOps and actually report non-CTI.
2004-01-24 11:28:06 +00:00
cebix
2d5de1af9d Happy New Year! :) 2004-01-12 15:37:24 +00:00
gbeauche
97ce4fdc75 Match Linux/ppc native version better: jump to ROM with EmulatorData in r4,
preserve CR & XER registers on EmulOp.
2003-12-25 23:54:36 +00:00
gbeauche
bbde2a2054 Use an alternate stack base while servicing PowerPC interrupts. 2003-12-05 13:37:56 +00:00
gbeauche
091a219280 Use a unique ExecuteNative() interface in any case, i.e. native & emulated 2003-12-04 23:37:38 +00:00
gbeauche
328bb9f239 Add new thunking system for 64-bit fixes. 2003-12-04 17:26:38 +00:00
gbeauche
7ebe0347bf Add "jit" prefs item. Fix PPC_DECODE_CACHE version to fill in new min_pc &
max_pc members of block info. Increase -finline-limit to 10000 for older gcc
2003-12-03 10:52:50 +00:00
gbeauche
4a3cd024ed better handling of static translation cache allocation, handle nested
execution paths from the cpu core, cleanups for KPX_MAX_CPUS == 1.
2003-11-30 17:21:53 +00:00
gbeauche
73d51962f6 Merge in-progress PowerPC "JIT1" engine for AMD64, IA-32, PPC.
The merge probably got wrong as there are some problems probably due to the
experiment begining with CR deferred evaluation. With nbench/ppc, performance
improvement was around 2x. With nbench on x86, performance improvement was
around 4x on average.

Incompatible change: instr_info_t has a new field in the middle. But since
insertion of PPC_I(XXX) identifiers is auto-generated, there is no problem.
2003-11-24 23:45:52 +00:00
gbeauche
b66d8ef433 Fix "ignoresegv" case to actually skip the faulty instruction. Merge
conditions to skip instruction on SIGSEGVfrom PowerPC native mode. The
instruction skipper takes care to set the output register to 0.
2003-11-10 16:23:58 +00:00
gbeauche
0260210ddf - XLM_IRQ_NEST is always in native byte order format since any write to
this variable go through {Enable,Disable}Interrupt().
- Add Ether thunks but only for WORDS_BIGENDIAN case since we do need more
complicated translation functions.
2003-11-10 15:11:44 +00:00
gbeauche
8c40d739b6 Add some statistics for interrupt handling, Execute68k/Trap, MacOS & NativeOp 2003-11-04 20:48:29 +00:00
gbeauche
a42281aad1 Implement partial block cache invalidation. Rewrite core cached blocks
execution loop with a Duff's device. Gather some predecode time statistics.
This shows that only around 2% of total emulation time is spent for
predecoding the instructions.
2003-11-03 21:28:32 +00:00
gbeauche
f0ea192460 Optimized pointers to non virtual member functions. This reduces space
and overhead since runtime checks are eliminated. Actually, it yields
up to 10% performance improvement with specialized decoders.
2003-11-02 14:48:20 +00:00