cpu_code_cache.h (1025B)
1 // SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com> 2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) 3 4 #pragma once 5 6 #include "bus.h" 7 #include "cpu_types.h" 8 9 class Error; 10 11 namespace CPU::CodeCache { 12 13 /// Returns true if any recompiler is in use. 14 bool IsUsingAnyRecompiler(); 15 16 /// Returns true if any recompiler and fastmem is in use. 17 bool IsUsingFastmem(); 18 19 /// Allocates resources, call once at startup. 20 bool ProcessStartup(Error* error); 21 22 /// Frees resources, call once at shutdown. 23 void ProcessShutdown(); 24 25 /// Initializes resources for the system. 26 void Initialize(); 27 28 /// Frees resources used by the system. 29 void Shutdown(); 30 31 /// Runs the system. 32 [[noreturn]] void Execute(); 33 34 /// Flushes the code cache, forcing all blocks to be recompiled. 35 void Reset(); 36 37 /// Invalidates all blocks which are in the range of the specified code page. 38 void InvalidateBlocksWithPageIndex(u32 page_index); 39 40 /// Invalidates all blocks in the cache. 41 void InvalidateAllRAMBlocks(); 42 43 } // namespace CPU::CodeCache