New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize faulting stuff. Differentiate between arch- and OS-specific defines. #1449
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef ANDROID | ||
#include <asm/sigcontext.h> | ||
typedef struct sigcontext mcontext_t; | ||
typedef struct ucontext { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
…c defines. - Get rid of ArmMemTools.cpp and rename x64MemTools.cpp to MemTools.cpp. ArmMemTools was almost identical to the POSIX part of x64MemTools, and the two differences, (a) lack of sigaltstack, which I added to the latter recently, and (b) use of r10 to determine the fault address instead of info->si_addr (meaning it only works for specifically formatted JIT code), I don't think are necessary. (Plus Android, see below.) - Rename Core/PowerPC/JitCommon/JitBackpatch.h to Core/MachineContext.h. It doesn't contain anything JIT-specific anymore, and e.g. locking will want to use faulting support regardless of whether any JIT is in use. - Get rid of different definitions of SContext for different architectures under __linux__, since this is POSIX. The exception is of course Android being shitty; I moved the workaround definition from ArmMemTools.cpp to here. - Get rid of #ifdefs around EMM::InstallExceptionHandler and just provide an empty implementation for unsupported systems (i.e. _M_GENERIC really). Added const bool g_exception_handlers_supported for future use; currently exception handlers are only used by the JIT, whose use implies non-M_GENERIC, but locking will change that. - Remove an unnecessary typedef.
@@ -9,7 +9,7 @@ | |||
|
|||
namespace EMM | |||
{ | |||
typedef u32 EAddr; | |||
extern const bool g_exception_handlers_supported; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
comex
added a commit
that referenced
this pull request
Nov 16, 2014
Reorganize faulting stuff. Differentiate between arch- and OS-specific defines.
stack_t uc_stack; | ||
mcontext_t uc_mcontext; | ||
// ... | ||
} ucontext_t; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
I waited forever for someone to test it on Android, but :( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Paging @Sonicadvance1. Please check that this doesn't break Android - assuming it compiles of course...
ArmMemTools was almost identical to the POSIX part of x64MemTools, and
the two differences, (a) lack of sigaltstack, which I added to the
latter recently, and (b) use of r10 to determine the fault address
instead of info->si_addr (meaning it only works for specifically
formatted JIT code), I don't think are necessary. (Plus Android, see
below.)
It doesn't contain anything JIT-specific anymore, and e.g. locking
will want to use faulting support regardless of whether any JIT is in
use.
architectures under
__linux__
, since this is POSIX. The exception isof course Android being shitty; I moved the workaround definition from
ArmMemTools.cpp to here.
provide an empty implementation for unsupported systems (i.e.
_M_GENERIC really). Added const bool g_exception_handlers_supported
for future use; currently exception handlers are only used by the JIT,
whose use implies non-M_GENERIC, but locking will change that.