Commit Graph

1602 Commits

Author SHA1 Message Date
cebix
fa5ae3ab6e minor cleanups 2005-06-30 21:25:26 +00:00
gbeauche
ec8661f431 Fix a damn silly bug. On some occasions, we could have spcflags() set to
EXEC_RETURN | HANDLE_INTERRUPT. And then, we handled the interrupt, but
EXEC_RETURN was set so we returned very quickly without completing the
interrupt routine. As a side effect, this occasionnaly hung the emulator
most likely with {ethernet,audio}-based applications that trigger a lot
of interrupts.

The fix is to always honour EXEC_RETURN flag at first, of course.
2005-06-30 15:29:11 +00:00
gbeauche
fd69df24f3 Re-enable spinlocks on {i386,x86_64} since they are now used only for really
small atomic operations (add/sub). This implementation should be enough for
that purpose.
2005-06-30 13:29:43 +00:00
gbeauche
e867749999 POSIX conforming use of pthread_cond_wait(). 2005-06-30 10:34:31 +00:00
gbeauche
e355c83f59 Add system-specific implementations of idle_{wait,resume} functions. 2005-06-30 10:20:18 +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
c9b044aeaf Completely avoid any form of nested interrupt processing. 2005-06-30 09:09:59 +00:00
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
ea42af0568 Consume the packet even if we could not allocate a message block for it in
the Ethernet interrupt. The BeOS version does that, likewise for MOL. Otherwise,
we end up into an infinite loop reporting the memory allocation failure.

I think this is now the expected behavior as we wouldn't have stats
(num_rx_no_mem) for it if we couldn't get out of the EtherIRQ. ;-) Besides,
the packet will be resent for reliable networks.
2005-06-30 06:38:09 +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
a8ba24aecf Use fast spinlocks only for small enough atomic operations. Otherwise, you
run into some performance problems in e.g. video graphics experience because
of busywaits in the current spin_lock() implementation.
2005-06-25 11:40:29 +00:00
gbeauche
198925c5ae clean-ups from previous experiment with sched_yield(), this one caused a
slow-down too.
2005-06-25 11:36:35 +00:00
gbeauche
52138d2014 We HAVE_PTHREADS even if we use our own pthreads implementation, this also
induces availability of locking primitives. I will merge the !HAVE_PTHREADS
case (a la Basilisk II) for EMULATED_PPC when I get back to home.
2005-06-25 11:06:24 +00:00
gbeauche
b92ce82a32 Rewrite SheepThreads locks & semaphores. They now look much better and avoid
busy waits for acquiring spin locks.
2005-06-25 11:00:30 +00:00
gbeauche
e991e59fc1 fix test_and_set, aka fixes X async replies when clipboard active 2005-06-25 10:58:47 +00:00
gbeauche
2de44f1910 Fix for MacOS X assembler, why don't Apple use GNU as? 2005-06-25 06:33:39 +00:00
gbeauche
d0da2a0dda - Restore TOC on EMUL_OP_EXEC_RETURN from Execute68k
- Restore r13 on EMUL_RETURN, though I never saw r13 clobbered
- Increase stack frame allocated to EmulOp processing on par with BeOS
- Factor GetResource wrappers with a macro + restore r13 too
2005-06-24 22:58:55 +00:00
gbeauche
d8a33b0952 Direct Color visual is OK for fbdev dga. 2005-06-24 22:31:28 +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
b9b90fce11 fix last commit 2005-06-23 11:56:43 +00:00
gbeauche
2deca51ca4 Add code to gather some stats on register usage. 2005-06-23 11:37:01 +00:00
gbeauche
c33f09b2d8 Fix crash in FBDev DGA mode when it failed to initialize (here, that was
because fb visual was Direct Color instead of True Color). We used to
initialize the_buffer* even if !open_display. Report that gracefully with
the dedicated STR_OPEN_WINDOW_ERR.
2005-06-22 16:40:24 +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
c4a7b10650 op_invoke*() symbols are expected to be in demangled form, i.e. "C" linkage 2005-06-22 16:35:59 +00:00
gbeauche
f887fb7bac Enable build of the JIT with GCC 2.9x compilers (e.g. "2.96" from MDK 8.1). 2005-06-22 15:37:25 +00:00
gbeauche
ae52321fe7 HOST_FLOAT_WORDS_BIG_ENDIAN is a tristate and, when defined, can still be
0, so little endian format. i.e. don't check that with a simple #ifdef...
2005-06-22 15:33:22 +00:00
gbeauche
32b5b4f0bd Integrate C++ demangler from libiberty so that to handle G++ 2.9X generated
symbols.
2005-06-22 15:30:54 +00:00
gbeauche
f226f793dd Extend internal math library from GNU libc to accomodate older systems
with glibc 2.2.X or simply no C99 capable C library. Fix vrfiz instruction
to really truncate on float values.
2005-06-22 12:32:32 +00:00
gbeauche
28a167b3bd Avoid <limits> to determine vector register numeric_limits<>. This fixes
build with ancient compilers like gcc "2.96".
2005-06-22 12:27:01 +00:00
gbeauche
3aa78832fc pointer-to-member-functions fixlets, NULL may be (void *)0 on ancient
compilers which is not suitable here.
2005-06-22 12:25:43 +00:00
gbeauche
c686f5451c Include <sys/mman.h> for fbdev dga without VOSF acceleration. 2005-06-22 12:24:36 +00:00
gbeauche
12eb8b670f Avoid C99-isms in C code for old compilers (e.g. gcc "2.96" on MDK 8.1) 2005-06-22 08:51:04 +00:00
gbeauche
1421bca4a7 Comment typo and return handled status in handle_selection() 2005-06-22 08:50:07 +00:00
gbeauche
3e532be645 Check for GTK for the GUI. Also add serial_windows.cpp to SRCS files 2005-06-20 08:43:50 +00:00
gbeauche
1e7c27958d WIP prefs editor for Windows in GTK 2005-06-20 08:40:34 +00:00
gbeauche
c57c81879c merge in serial ports emulation from original B2/win port 2005-06-20 06:11:28 +00:00
gbeauche
3a0b4ed999 Get real page size on Windows for vm_get_page_size() [64 KB] 2005-06-20 03:54:46 +00:00
gbeauche
d0fd88f7b2 gtk2 gui support 2005-06-19 15:52:09 +00:00
gbeauche
7f3e40883a Only close clipboard hidden window only if created. This fixes errors on
early exit from the GUI.
2005-06-19 15:50:52 +00:00
gbeauche
fe99211e75 Support USE_CPU_EMUL_SERVICES in SDL/video driver. Only trigger ethernet
interrupt in one_tick() if no pthreads at all are used, i.e. ether_dummy
is effective in that case. Otherwise, don't trigger ethernet again if
pthreads are available (and ether_unix) and cpu emul services are active.
2005-06-14 22:35:42 +00:00
gbeauche
e616062d6d Apple GCC uses __ppc__ as the arch token 2005-06-14 06:35:00 +00:00
gbeauche
46f9e6d2ea Support JIT on Mach/ppc platforms. Mach/i386 (Darwin/x86) is to follow. 2005-06-14 06:32:52 +00:00
gbeauche
957bee00cf Always allocate RAM and ROM areas at the same time. This avoids having ROM
suddenly allocated below RAM and thus not working. Besides, this may fix a
latent deallocation bug in real addressing mode (i.e. release the whole
block allocated at once, not separately).

Side effect: this makes Basilisk II work in direct addressing mode with JIT
on Darwin 8.0.1 for x86.
2005-06-13 20:19:15 +00:00
gbeauche
334f9ce018 Check for CoreFoundation framework (Darwin 8.0.1). Likewise for
IOKit/storage/IOBlockStorageDevice.h which is not available there on x86
2005-06-12 23:36:34 +00:00
gbeauche
2bc79fd857 Enable Basilisk II to work even if slirp_init() failed. Disable ethernet
emulation in that case, don't exit(1).
2005-06-12 22:48:48 +00:00
gbeauche
e308e5441b Mach exception recovery and instruction skipping for Darwin/x86. 2005-06-12 21:47:46 +00:00
gbeauche
ef30f8e882 remove duplicate 2005-06-11 16:47:00 +00:00
gbeauche
369d01cf16 %Ld is for long double, not long long (%lld) 2005-06-11 06:52:22 +00:00
gbeauche
0f0b06b099 Much improved responsiveness on NetBSD systems.
On those systems, it's really hard to get high resolution timings and the
system oftens fails to honour a timeout in less than 20 ms. The idea here
is to have an average m68k instruction count (countdown quantum) that
triggers real interrupt checks. The quantum is calibrated every 10 ticks
and has a 1000 Hz resolution on average.
2005-06-11 06:43:24 +00:00