2024-07-09 09:18:34 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
2024-07-19 08:09:07 +00:00
|
|
|
/// Initializes a stack for the current thread for use by patch implementations.
|
|
|
|
void InitializeThreadPatchStack();
|
|
|
|
|
|
|
|
/// Cleans up the patch stack for the current thread.
|
|
|
|
void CleanupThreadPatchStack();
|
|
|
|
|
2024-09-15 20:48:34 +00:00
|
|
|
/// Registers a module for patching, providing an area to generate trampoline code.
|
|
|
|
void RegisterPatchModule(void* module_ptr, u64 module_size, void* trampoline_area_ptr,
|
|
|
|
u64 trampoline_area_size);
|
|
|
|
|
|
|
|
/// Applies CPU patches that need to be done before beginning executions.
|
|
|
|
void PrePatchInstructions(u64 segment_addr, u64 segment_size);
|
2024-07-09 09:18:34 +00:00
|
|
|
|
|
|
|
} // namespace Core
|