diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-09 08:56:35 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-09 11:31:18 +0100 |
commit | 9588f01739179bebbed960ceecbad92bca90d7f9 (patch) | |
tree | 679323164d8cbde9a988fd01138962dc7d14afde /Userland/DevTools/UserspaceEmulator/SoftCPU.cpp | |
parent | 4faeaf101c228ffc3d0540ed88d04b26d01f0929 (diff) | |
download | serenity-9588f01739179bebbed960ceecbad92bca90d7f9.zip |
UserspaceEmulator+LibC: Use sys$emuctl() to pass malloc info to UE
Get rid of the awkward secret handshake sequence between malloc and UE
and simply use sys$emuctl() to notify UE of malloc, free and realloc.
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator/SoftCPU.cpp')
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/SoftCPU.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp index 3ab0509ba0..e5d3063351 100644 --- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -112,22 +112,6 @@ void SoftCPU::dump() const fflush(stdout); } -void SoftCPU::did_receive_secret_data() -{ - if (m_secret_data[0] == 1) { - if (auto* tracer = m_emulator.malloc_tracer()) - tracer->target_did_malloc({}, m_secret_data[2], m_secret_data[1]); - } else if (m_secret_data[0] == 2) { - if (auto* tracer = m_emulator.malloc_tracer()) - tracer->target_did_free({}, m_secret_data[1]); - } else if (m_secret_data[0] == 3) { - if (auto* tracer = m_emulator.malloc_tracer()) - tracer->target_did_realloc({}, m_secret_data[2], m_secret_data[1]); - } else { - VERIFY_NOT_REACHED(); - } -} - void SoftCPU::update_code_cache() { auto* region = m_emulator.mmu().find_region({ cs(), eip() }); @@ -2757,18 +2741,6 @@ void SoftCPU::PUSH_reg16(const X86::Instruction& insn) void SoftCPU::PUSH_reg32(const X86::Instruction& insn) { push32(gpr32(insn.reg32())); - - if (m_secret_handshake_state == 2) { - m_secret_data[0] = gpr32(insn.reg32()).value(); - ++m_secret_handshake_state; - } else if (m_secret_handshake_state == 3) { - m_secret_data[1] = gpr32(insn.reg32()).value(); - ++m_secret_handshake_state; - } else if (m_secret_handshake_state == 4) { - m_secret_data[2] = gpr32(insn.reg32()).value(); - m_secret_handshake_state = 0; - did_receive_secret_data(); - } } template<typename T, bool cf> @@ -2964,11 +2936,6 @@ void SoftCPU::SALC(const X86::Instruction&) { // FIXME: Respect shadow flags once they exists! set_al(shadow_wrap_as_initialized<u8>(cf() ? 0xff : 0x00)); - - if (m_secret_handshake_state < 2) - ++m_secret_handshake_state; - else - m_secret_handshake_state = 0; } template<typename T> |