Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/src/core/cpu_code_cache.h
4214 views
1
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <[email protected]>
2
// SPDX-License-Identifier: 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 IsUsingRecompiler();
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
/// Runs the system.
26
[[noreturn]] void Execute();
27
28
/// Flushes the code cache, forcing all blocks to be recompiled.
29
void Reset();
30
31
/// Free all non-persistent resources for the code cache.
32
void Shutdown();
33
34
/// Invalidates all blocks which are in the range of the specified code page.
35
void InvalidateBlocksWithPageIndex(u32 page_index);
36
37
/// Invalidates all blocks in the cache.
38
void InvalidateAllRAMBlocks();
39
40
} // namespace CPU::CodeCache
41
42