Log of /SheepShaver/src/Unix/sysdeps.h
Parent Directory
|
Revision Log
Revision
1.59 -
(
view)
(
annotate)
-
[select for diffs]
Mon Aug 17 20:44:30 2009 UTC
(3 years, 9 months ago)
by
asvitkine
Branch:
MAIN
CVS Tags:
HEAD
Changes since
1.58: +9 -0 lines
Diff to
previous 1.58
,
to
selected 1.57
[Charles Srstka]
Attached is a set of patches to port the precise timer that is currently used in the Linux and BeOS builds of SheepShaver to Mac OS X (and any other Mach-based operating systems).
Currently, the Linux build uses the clock_gettime() function to get nanosecond-precision time, and falls back on gettimeofday() if it is not present. Unfortunately, Mac OS X does not currently support clock_gettime(), and gettimeofday() has only microsecond granularity. The Mach kernel, however, has a clock_get_time() function that does very nearly the same thing as clock_gettime(). The patches to BasiliskII cause the timing functions such as timer_current_time() to use clock_get_time() instead of gettimeofday() on Mach-based systems that do not support clock_gettime().
The changes to SheepShaver involve the precise timer. The existing code for Linux uses pthreads and real-time signals to handle the timing. Mac OS X unfortunately does not seem to support real-time signals, so Mach calls are again used to suspend and resume the timer thread in order to attempt to duplicate the Linux and BeOS versions of the timer. The code is somewhat ugly right now, as I decided to leave alone the pre-existing style of the source file, which unfortunately involves #ifdefs scattered throughout the file and some duplication of code. A future patch may want to clean this up to separate out the OS-specific code and put it all together at the top of the file. However, for the time being, this seems to work.
This has not been extensively tested, because I have not been able to get my hands on a good test-case app for the classic Mac OS that would run inside the emulator and try out the timer. However, performance does seem to be better than with the pre-existing code, and nothing seems to have blown up as far as I can tell. I did find a game via a Google search - Cap'n Magneto - that is known to have problems with Basilisk/SheepShaver's legacy 60 Hz timer, and the opening fade-to-color for this game appears to run much more smoothly with the precise timer code in place.
Revision
1.58 -
(
view)
(
annotate)
-
[select for diffs]
Fri Jun 20 00:50:33 2008 UTC
(4 years, 11 months ago)
by
asvitkine
Branch:
MAIN
Changes since
1.57: +1 -1 lines
Diff to
previous 1.57
Don't profile by default - as this is no use to non-developers.
Revision
1.57 -
(
view)
(
annotate)
-
[selected]
Tue Jan 1 09:47:39 2008 UTC
(5 years, 4 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.56: +1 -1 lines
Diff to
previous 1.56
Happy New Year!
Revision
1.55 -
(
view)
(
annotate)
-
[select for diffs]
Wed Jan 17 07:05:19 2007 UTC
(6 years, 4 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.54: +1 -1 lines
Diff to
previous 1.54
,
to
selected 1.57
Rearrange powerpc_registers struct and nuke fp_result register which is
only needed for JIT (and to be handled differently in the future).
Revision
1.54 -
(
view)
(
annotate)
-
[select for diffs]
Thu Jul 6 00:01:04 2006 UTC
(6 years, 10 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.53: +1 -1 lines
Diff to
previous 1.53
,
to
selected 1.57
Add more micro asm optimisations to x86{,-64} (mulhw, mulhwu, slw, srw, cntlzw
and subf* series). Also now enable the optimzations on x86_64 by default.
Revision
1.52 -
(
view)
(
annotate)
-
[select for diffs]
Tue May 2 19:33:10 2006 UTC
(7 years ago)
by
gbeauche
Branch:
MAIN
Changes since
1.51: +0 -15 lines
Diff to
previous 1.51
,
to
selected 1.57
Move likely() definitions to dyngen-exec.h, they are only used in the CPU
core where it's most useful (give a stronger hint to gcc4)
Revision
1.51 -
(
view)
(
annotate)
-
[select for diffs]
Sat Apr 1 21:41:18 2006 UTC
(7 years, 1 month ago)
by
gbeauche
Branch:
MAIN
Changes since
1.50: +15 -0 lines
Diff to
previous 1.50
,
to
selected 1.57
Helper macros to annotate likely branch directions. Colateral effect: this
also fixes build with GCC 4.1 (ppc-dyngen-ops.cpp) since the branches are
re-ordered in a way there is now only one exit-point in op_jump_next_A0().
Revision
1.50 -
(
view)
(
annotate)
-
[select for diffs]
Wed Nov 30 07:24:53 2005 UTC
(7 years, 5 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.49: +0 -2 lines
Diff to
previous 1.49
,
to
selected 1.57
Always use the complete non-stubs Ethernet driver (XXX probably do that
only in Emulated PPC mode for performance reasons?)
Revision
1.48 -
(
view)
(
annotate)
-
[select for diffs]
Sun Jul 3 22:02:01 2005 UTC
(7 years, 10 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.47: +5 -0 lines
Diff to
previous 1.47
,
to
selected 1.57
Minor tweaks to support compilation of ether.cpp within MacOS. i.e. mostly
migrate the Ethernet driver to the MacOS side. This is enabled for
DIRECT_ADDRESSING cases. I didn't want to alter much of ether.cpp (as it
would have required to support that mode). Of course, in REAL_ADDRESSING
mode (the default) and for debugging purposes, the old driver is still
available.
Revision
1.47 -
(
view)
(
annotate)
-
[select for diffs]
Sun Jul 3 13:39:06 2005 UTC
(7 years, 10 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.46: +0 -14 lines
Diff to
previous 1.46
,
to
selected 1.57
Remove obsolete and broken Cygwin/X11 hacks. Forbid builds of the Windows
version from within the Unix/ directory.
Revision
1.46 -
(
view)
(
annotate)
-
[select for diffs]
Fri Jul 1 23:15:11 2005 UTC
(7 years, 10 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.45: +1 -1 lines
Diff to
previous 1.45
,
to
selected 1.57
Hopefully fix the remaining issue in the High Resolution Timing support
code and re-enable it on Linux platforms (they have clock_nanosleep). Why
did I trigger an interrupt inside a held lock? Hmmm, we should probably
add an _ack semaphore like we do e.g. for ethernet.
Revision
1.45 -
(
view)
(
annotate)
-
[select for diffs]
Thu Jun 30 13:29:43 2005 UTC
(7 years, 10 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.44: +1 -2 lines
Diff to
previous 1.44
,
to
selected 1.57
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.
Revision
1.44 -
(
view)
(
annotate)
-
[select for diffs]
Sat Jun 25 11:39:47 2005 UTC
(7 years, 11 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.43: +8 -7 lines
Diff to
previous 1.43
,
to
selected 1.57
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.
Revision
1.43 -
(
view)
(
annotate)
-
[select for diffs]
Sat Jun 25 11:06:24 2005 UTC
(7 years, 11 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.42: +1 -1 lines
Diff to
previous 1.42
,
to
selected 1.57
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.
Revision
1.42 -
(
view)
(
annotate)
-
[select for diffs]
Wed Jun 22 12:32:32 2005 UTC
(7 years, 11 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.41: +8 -0 lines
Diff to
previous 1.41
,
to
selected 1.57
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.
Revision
1.41 -
(
view)
(
annotate)
-
[select for diffs]
Sun Mar 27 13:41:46 2005 UTC
(8 years, 1 month ago)
by
gbeauche
Branch:
MAIN
Changes since
1.40: +1 -1 lines
Diff to
previous 1.40
,
to
selected 1.57
Disable high-res timings as it could still hang. The advantage is that we
now can use special mutexes to debug deadlocks
Revision
1.40 -
(
view)
(
annotate)
-
[select for diffs]
Sat Mar 5 19:07:35 2005 UTC
(8 years, 2 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.39: +6 -0 lines
Diff to
previous 1.39
,
to
selected 1.57
Enable high precision timings on POSIX systems supporting clock_nanosleep().
Since pthread_suspend_np() is not available to Linux (but NetBSD 2.0), thread
suspend is implemented likewise to boehm-gc.
Revision
1.39 -
(
view)
(
annotate)
-
[select for diffs]
Sun Feb 27 21:52:06 2005 UTC
(8 years, 2 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.38: +1 -0 lines
Diff to
previous 1.38
,
to
selected 1.57
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)
Revision
1.38 -
(
view)
(
annotate)
-
[select for diffs]
Sun Feb 20 18:08:50 2005 UTC
(8 years, 3 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.37: +1 -1 lines
Diff to
previous 1.37
,
to
selected 1.57
Initial support for NetBSD/ppc in native mode (some crashes occur but I
could boot MacOS 9.0.4)
Revision
1.34 -
(
view)
(
annotate)
-
[select for diffs]
Sat Nov 13 14:09:16 2004 UTC
(8 years, 6 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.33: +14 -9 lines
Diff to
previous 1.33
,
to
selected 1.57
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.
Revision
1.32 -
(
view)
(
annotate)
-
[select for diffs]
Wed Jun 2 16:11:49 2004 UTC
(8 years, 11 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.31: +17 -3 lines
Diff to
previous 1.31
,
to
selected 1.57
Disable testandset() locks, use pthread's as SheepShaver occasionnally hangs
with spinlocks. Weird as those are derived from x86 linuxthreads.
Revision
1.29 -
(
view)
(
annotate)
-
[select for diffs]
Wed May 19 21:23:15 2004 UTC
(9 years ago)
by
gbeauche
Branch:
MAIN
Changes since
1.28: +1 -0 lines
Diff to
previous 1.28
,
to
selected 1.57
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.
Revision
1.24 -
(
view)
(
annotate)
-
[select for diffs]
Tue Feb 24 23:09:39 2004 UTC
(9 years, 3 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.23: +6 -0 lines
Diff to
previous 1.23
,
to
selected 1.57
Portability fixes: declare Set_pthread_attr() only if HAVE_PTHREADS. Merge
add_{serial,ether}_names() from B2 prefs editor for FreeBSD/IRIX.
Revision
1.19 -
(
view)
(
annotate)
-
[select for diffs]
Wed Dec 31 18:16:55 2003 UTC
(9 years, 4 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.18: +19 -0 lines
Diff to
previous 1.18
,
to
selected 1.57
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.
Revision
1.16 -
(
view)
(
annotate)
-
[select for diffs]
Fri Nov 28 22:13:49 2003 UTC
(9 years, 5 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.15: +2 -0 lines
Diff to
previous 1.15
,
to
selected 1.57
Gather stats about compile time. Define KPX_MAX_CPUS to 1 for allowing
allocation of translation cache into .data section on PowerPC.
Revision
1.14 -
(
view)
(
annotate)
-
[select for diffs]
Tue Nov 11 11:32:24 2003 UTC
(9 years, 6 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.13: +1 -2 lines
Diff to
previous 1.13
,
to
selected 1.57
Remove obsolete code related to PPC_NO_FPSCR_UPDATE, PPC_LAZY_PC_UPDATE,
PPC_LAZY_CC_UPDATE, PPC_HAVE_SPLIT_CR defines.
Revision
1.13 -
(
view)
(
annotate)
-
[select for diffs]
Sun Oct 26 14:16:37 2003 UTC
(9 years, 7 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.12: +1 -1 lines
Diff to
previous 1.12
,
to
selected 1.57
Fix ASYNC_IRQ build but locks may still happen. Note that with a predecode
cache, checking for pending interrupts may not be the bottle neck nowadays.
Revision
1.12 -
(
view)
(
annotate)
-
[select for diffs]
Sun Oct 26 13:59:02 2003 UTC
(9 years, 7 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.11: +2 -1 lines
Diff to
previous 1.11
,
to
selected 1.57
Rewrite interrupts handling code so that the emulator can work with a
predecode cache. This implies to run in interpreted mode only while
processing EmulOps or other native (nested) runs.
Note that the FLIGHT_RECORDER with a predecode cache gets slower than
without caching at all.
Revision
1.11 -
(
view)
(
annotate)
-
[select for diffs]
Sun Oct 12 05:44:14 2003 UTC
(9 years, 7 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.10: +1 -0 lines
Diff to
previous 1.10
,
to
selected 1.57
- Handle MakeExecutable() replacement
- Disable predecode cache in CVS for now
- Fix flight recorder ordering in predecode cache mode
Revision
1.10 -
(
view)
(
annotate)
-
[select for diffs]
Sat Oct 11 09:57:49 2003 UTC
(9 years, 7 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.9: +1 -2 lines
Diff to
previous 1.9
,
to
selected 1.57
- Add support for FLIGHT_RECORDER with predecode cache
- Always enable predecode cache & flight recorder for now
Revision
1.8 -
(
view)
(
annotate)
-
[select for diffs]
Mon Sep 29 22:41:50 2003 UTC
(9 years, 7 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.7: +1 -1 lines
Diff to
previous 1.7
,
to
selected 1.57
Make older & bogus compilers happy. aka. force "static" storage class
for SPIN_LOCK_UNLOCKED constant.
Revision
1.7 -
(
view)
(
annotate)
-
[select for diffs]
Mon Sep 29 15:46:07 2003 UTC
(9 years, 7 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.6: +2 -0 lines
Diff to
previous 1.6
,
to
selected 1.57
- Share EmulatorData & KernelData struct definitions
- Introduce new SheepShaver data area for alternate stacks, thunks, etc.
- Experimental asynchronous interrupts handling. This improves performance
by 30% but some (rare) lockups may occur. To be debugged!
Revision
1.4 -
(
view)
(
annotate)
-
[select for diffs]
Thu May 22 22:12:05 2003 UTC
(10 years ago)
by
gbeauche
Branch:
MAIN
Changes since
1.3: +3 -0 lines
Diff to
previous 1.3
,
to
selected 1.57
Import VOSF from Basilisk II for faster and more accurate video refresh.
There may be some bugs left though. Rework sigsegv_handler() a little to
accomodate VOSF way of life.
TODO: merge video drivers infrastructure from B2.
Revision
1.3 -
(
view)
(
annotate)
-
[select for diffs]
Sat Jan 4 12:23:39 2003 UTC
(10 years, 4 months ago)
by
gbeauche
Branch:
MAIN
Changes since
1.2: +27 -8 lines
Diff to
previous 1.2
,
to
selected 1.57
Sync with changes from cxmon and B2. I have yet to find out why my old
disk image (8.1 based) no longer boots completely. :-/
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
select a symbolic revision name using the selection box, or choose
'Use Text Field' and enter a numeric revision.