A64 Interface: Allow changing processor id.

This commit allows the JIT to be used per guest thread and change it's
core when the thread is migrated.
This commit is contained in:
Fernando Sahmkow 2020-02-27 13:01:39 -04:00 committed by MerryMage
parent d86a6f2211
commit 2068658a82
3 changed files with 16 additions and 1 deletions

View file

@ -105,6 +105,8 @@ public:
/// Modify PSTATE /// Modify PSTATE
void SetPstate(std::uint32_t value); void SetPstate(std::uint32_t value);
void ChangeProcessorID(std::size_t new_processor);
/// Clears exclusive state for this core. /// Clears exclusive state for this core.
void ClearExclusiveState(); void ClearExclusiveState();

View file

@ -47,8 +47,12 @@ public:
void InvalidateCacheRanges(const boost::icl::interval_set<u64>& ranges); void InvalidateCacheRanges(const boost::icl::interval_set<u64>& ranges);
void ChangeProcessorID(size_t value) {
conf.processor_id = value;
}
protected: protected:
const A64::UserConfig conf; A64::UserConfig conf;
A64::Jit* jit_interface; A64::Jit* jit_interface;
BlockRangeInformation<u64> block_ranges; BlockRangeInformation<u64> block_ranges;

View file

@ -185,6 +185,11 @@ public:
jit_state.SetPstate(value); jit_state.SetPstate(value);
} }
void ChangeProcessorID(size_t value) {
conf.processor_id = value;
emitter.ChangeProcessorID(value);
}
void ClearExclusiveState() { void ClearExclusiveState() {
jit_state.exclusive_state = 0; jit_state.exclusive_state = 0;
} }
@ -379,6 +384,10 @@ void Jit::SetPstate(u32 value) {
impl->SetPstate(value); impl->SetPstate(value);
} }
void Jit::ChangeProcessorID(size_t new_processor) {
impl->ChangeProcessorID(new_processor);
}
void Jit::ClearExclusiveState() { void Jit::ClearExclusiveState() {
impl->ClearExclusiveState(); impl->ClearExclusiveState();
} }