As we run more threaded applications it is becoming apparent that this
needs to be fixed now.
This duplicates the FrontendDecoder and Passmanager per thread so they
no longer block each other while compiling.
Increases a bit of memory usage but completely worth it.
This is a bit of a peculiar one, we want to ensure a single threaded
application is running on the emulator's primary thread.
This mitigates the problem that an application can do a getpid versus
gettid comparison and notice a problem.
Some games rely on getpid being the actual process ID and will spin
forever if it isn't the case.
This is also necessary for wine bringup since thread creation needs a
bit more finesse there.
Fixes#186
If we are loading EXEC then we actually need to start loading in to the
lower 32bits of memory.
This lets the frontend code loader handle the memory base instead of
hiding it behind some core magic instead.
This lets us get EXEC programs working.
So now we support EXEC, DYN, and static applications
Turns out my Threadripper stomps these tests so the arbitrary wait time
actually slows down my unit test time.
Don't want to make it shorter since `strace -f` becomes ugly at that
point.
Instead set up a semaphore style waiting structure that waits until
there are no longer any participants in the atomic
Adds some additional validation that an IR op is generating RA for ops
that set a destination.
Ensuring correct register class and that there is a physical register
assigned
Fixing some bugs in threading required fixing how the futexes operate.
Instead of the terrible condition variables and atomic values just use
the kernel futex facility directly.
This required fixing some of the threading management since otherwise
there was a issue around the weird mixture of our threads using our
"Futex" class and the kernel expecting real futexes on the values.
Just switch everything over and it ends up being cleaner
Fixes random mutex failures that were happening in various applications
Splits out to a jump table approach and loosely classifies and groups
the syscalls.
Also defines syscalls by number of arguments so it can be optimized