Commit Graph

70 Commits

Author SHA1 Message Date
gbeauche
4d97079af9 Map latest 7447A CPU to a plain G4 (7400) 2005-07-06 04:58:34 +00:00
gbeauche
29207d9cf2 Move sigregs handling to dedicated header 2005-07-04 05:34:33 +00:00
gbeauche
a60b0fb78c Restore clobbered registers before calling SDL_PumpEvents(). 2005-06-30 22:26:12 +00:00
gbeauche
08c5f8b713 Improve idle wait mechanism. Now, the emulator thread can be suspended
(idle_wait) until events arrived and notified through TriggerInterrupt().
i.e. we no longer sleep a fixed amount of time on platforms that support
a thread wait/signal mechanism.
2005-06-30 10:17:58 +00:00
gbeauche
7ac6ad2f46 Clean-ups: comments, ticks per sec output, don't restore r13 twice. 2005-06-28 16:50:30 +00:00
gbeauche
38d03d02e9 The alternate stack trick never worked as you can't modify an active stack.
i.e. it returned EPERM and ran into stack corruption to eventually crash the
emulator. This is noticeable in !hw_mac_cursor_accl mode (e.g. fullscreen DGA).

In order to the sigalstack() to be effective, we must kludge the kernel to
think it's running on another stack. In practise, we provide another stack
for the SIGUSR2 handler. sigusr2_handler_init() fulfills that purpose.

I hope this fixes remaining issues forever. At some point, I had multiple
*_init() handlers in case this is necessary.
2005-06-28 16:47:32 +00:00
gbeauche
26ee263b6f Don't fake the TVECT value on non-BeOS native systems. This is important
for systems that use a global r2 as the TLS register, e.g. Linux/ppc with
newer glibc. Also remove the syscall junk which were simply workarounds
for this bug. Remove a duplicate r2 restoration in EmulOp.

BTW, it's possible to get SheepShaver running on Linux/ppc systems with
NPTL rather than SheepThreads.
2005-06-23 16:23:31 +00:00
gbeauche
e423a07632 Recognize POWER5 CPUs. ;-) 2005-06-08 12:12:50 +00:00
gbeauche
f9e3fd28a1 better logics in sigstack allocation on native platforms 2005-03-28 09:50:58 +00:00
gbeauche
d27832cb1c - Implement fullscreen DGA via fbdev access under Linux. Besides, r/w access
to /dev/mem is required on Linux to use XF86 DGA mode. Otherwise, there is
now a fallback to fbdev.
- Forward port some features from Basilisk II (set_window_name,
disable_mouse_accel).
- Don't SIGSTOP the emulation thread on suspend since that would completely
stop the process on Linux. Use a frame buffer lock instead (as B2 does)
2005-03-27 19:05:18 +00:00
gbeauche
663facbf97 Fix native Linux/ppc with recent enough glibc that supports TLS; r2 is used
in that case. Tell me if I broke other arches, e.g. r13 is no longer saved
in Video and Ethernet stubs, though it seems to be OK.

Colateral feature: SheepShaver should now run on Linux/ppc64 with relevant
32-bit runtime. Native Linux/ppc64 support is harder as low mem globals are
32-bit in mind and e.g. the TLS register there is %r13, %r2 is the TOC
(PowerOpen/AIX ABI)
2005-02-27 21:52:06 +00:00
gbeauche
8500381648 Initial support for NetBSD/ppc in native mode (some crashes occur but I
could boot MacOS 9.0.4)
2005-02-20 18:08:50 +00:00
gbeauche
df0d5d2a41 Happy New Year 2005! 2005-01-30 21:48:22 +00:00
gbeauche
f401bb1494 really invalidate caches when ROM was patched in native mode 2005-01-30 21:25:24 +00:00
gbeauche
26314e240e Add InitAll() which covers common initializations so that to avoid duplicate
code and possible bugs (e.g. on BeOS/PPC). Likewise for ExitAll().
2005-01-30 21:19:07 +00:00
gbeauche
9b17e04150 Fix Kernel Data for Gossamer ROMs: PVR, CPUClockSpeed et al. 2005-01-30 18:49:48 +00:00
gbeauche
bf2185c208 fix build on unixish platforms 2004-11-22 23:17:32 +00:00
gbeauche
d6c7e0eb23 New SheepShaver globals layout, move ZeroPage into the middle. Since it is
a read-only page, it can also be used to detect overlaps between Procedure
space and Data space.

Provide native Windows implementation of shared MacOS KernelData allocation.
This is moved under main() so that to avoid a weird linking error. This native
implementation is independent of Cygwin IPC (and possible background server)
2004-11-22 21:33:32 +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
4f78562642 SDL audio support 2004-07-19 19:42:21 +00:00
gbeauche
b60874907e Better PowerPC / POWER CPU detection from Linux cpu_specs[] table. 2004-07-10 06:15:42 +00:00
gbeauche
9a93480546 Remap any newer G4/G5 processor to plain G4 for compatibility 2004-07-07 04:33:37 +00:00
gbeauche
ebdb5d29fd get timebase-frequency on osx too. 2004-07-04 05:19:44 +00:00
gbeauche
0669b02e5f Introducce TimebaseSpeed which represents exact timebase-frequency instead
of supposing it to be (BusClockSpeed/4), which is no longer true on G5 et al.
2004-07-03 10:39:07 +00:00
gbeauche
32a6ac321c Try to recognize and handle PowerPC 970 (G5). Untested as I don't have such
platforms handy.
2004-07-01 22:55:02 +00:00
gbeauche
eb9961585b Handle 750FX, 7450, 7455, 7457. 2004-06-29 20:25:55 +00:00
gbeauche
380d4f294e Make sure to initialize alt stacks before SIGSEGV handlers 2004-06-26 16:25:22 +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
f2324520b7 Improve timing of periodic threads (from Basilisk II), aka. make 10 seconds
really last 10 seconds, not 18. ;-)
2004-06-22 12:20:17 +00:00
gbeauche
cb46ffe97a Get PVR information et al. through (slow) ioreg -c IOPlatformDevice 2004-06-17 05:15:25 +00:00
gbeauche
374101ee9e Make DR Cache executable by default in native PowerPC mode. 2004-05-31 10:55:42 +00:00
gbeauche
a533a9c455 Enable DR emulator with OldWorld ROMs too. It turned out that translated
code was also trying to access Serial memory.

Note however that I noticed some rare crashes with the DR emulator.
Probably caused by nested runs from EmulOps? We'd really want a native
68k emulator too for Execute68k() things.
2004-05-31 10:02:20 +00:00
gbeauche
7bc86b27ee Enable Apple DR emulator from NewWorld ROMs only. 2004-05-31 09:04:44 +00:00
gbeauche
bd6eaf680a Get rid of old (and broken) ASYNC_IRQ / MUTICORE code 2004-05-20 12:33:58 +00:00
gbeauche
65e1edb5b2 Fix bus frequency detection for more realistic timers.
Also add bus-frequency and timebase-frequency values to the Name Registry.
2004-05-15 11:07:11 +00:00
gbeauche
123a5210e4 Fix nested ppc_interrupt() stack corruption problem by allocating yet
another stack when next signal is triggered. I am still unsure if
even MacOS would normally handle nested calls to NanoKernel interrupt
routine.
2004-04-14 20:25:26 +00:00
gbeauche
ec2511fd99 Load XPRAM default values if signature not found. i.e. don't hang on first
boot.
2004-04-06 19:47:56 +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
546f65a365 Now that we have AltiVec emulation, we can pretend for a G4 processor
Also make sure to actually fix PVR code for 7400
2004-02-15 17:20:36 +00:00
gbeauche
8d4108dd3a Recognize 7400 & 7410 cpus 2004-01-31 11:10:49 +00:00
gbeauche
324fba4137 Post-merge fixups: machine state wrappers, Apple assembler perticularities. 2004-01-18 22:59:06 +00:00
gbeauche
0665ab1139 No need to map ROM executable on emulated/ppc. Make sure to detect unaligned
EA for lmw/stmw with real addr instead of relying on the signal number.
2004-01-18 22:22:28 +00:00
gbeauche
7f13ce6fed Wrappers around machine state registers within signal handlers. 2004-01-18 22:14:31 +00:00
cebix
2d5de1af9d Happy New Year! :) 2004-01-12 15:37:24 +00:00
gbeauche
1b0e88041e Also cache native routine descriptor instead of recreating them at each
invokation to ExecuteNative().
2004-01-07 18:24:45 +00:00
gbeauche
dd3a208906 Emulated lmw/stmw with unaligned EA. e.g. for BBEdit under MacOS 8.6.
This may be due to some switch mode that needs to save r13 and upwards.
The faultive code seems to explicitly add 0xee to r1, which causes it to
be unaligned for upcoming lmw/stmw.
2004-01-04 18:35:21 +00:00
gbeauche
e346de3199 Fix ADB problems with unitinialized mutex 2004-01-04 05:45:50 +00:00
gbeauche
e291c6d065 Add fast X11 display locking routines based on spinlocks, or on pthreads
in the worst case. Optimize out GetScrap() case when we already own the
selection. i.e. make it smoother. Use our own XDisplay{Un,}Lock() routines.
2003-12-31 18:16:55 +00:00