A32: Allow cleaning up exclusive state from the interface.

This function is normally required for emulating certain OS mechanisms.
This commit is contained in:
Fernando Sahmkow 2020-06-21 13:15:13 -04:00 committed by merry
parent df58a429ee
commit 2fa1c1d13c
2 changed files with 11 additions and 0 deletions

View file

@ -87,6 +87,9 @@ public:
void SaveContext(Context&) const; void SaveContext(Context&) const;
void LoadContext(const Context&); void LoadContext(const Context&);
/// Clears exclusive state for this core.
void ClearExclusiveState();
/** /**
* Returns true if Jit::Run was called but hasn't returned yet. * Returns true if Jit::Run was called but hasn't returned yet.
* i.e.: We're in a callback. * i.e.: We're in a callback.

View file

@ -102,6 +102,10 @@ struct Jit::Impl {
emitter.ChangeProcessorID(value); emitter.ChangeProcessorID(value);
} }
void ClearExclusiveState() {
jit_state.exclusive_state = 0;
}
std::string Disassemble(const IR::LocationDescriptor& descriptor) { std::string Disassemble(const IR::LocationDescriptor& descriptor) {
auto block = GetBasicBlock(descriptor); auto block = GetBasicBlock(descriptor);
std::string result = fmt::format("address: {}\nsize: {} bytes\n", block.entrypoint, block.size); std::string result = fmt::format("address: {}\nsize: {} bytes\n", block.entrypoint, block.size);
@ -236,6 +240,10 @@ void Jit::ExceptionalExit() {
is_executing = false; is_executing = false;
} }
void Jit::ClearExclusiveState() {
impl->ClearExclusiveState();
}
void Jit::ChangeProcessorID(size_t new_processor) { void Jit::ChangeProcessorID(size_t new_processor) {
impl->ChangeProcessorID(new_processor); impl->ChangeProcessorID(new_processor);
} }