add a thp-based huge page alloc fallback
[pcsx_rearmed.git] / deps / lightrec / blockcache.h
... / ...
CommitLineData
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2014-2021 Paul Cercueil <paul@crapouillou.net>
4 */
5
6#ifndef __BLOCKCACHE_H__
7#define __BLOCKCACHE_H__
8
9#include "lightrec.h"
10
11struct blockcache;
12
13struct block * lightrec_find_block(struct blockcache *cache, u32 pc);
14struct block * lightrec_find_block_from_lut(struct blockcache *cache,
15 u16 lut_entry, u32 addr_in_block);
16u16 lightrec_get_lut_entry(const struct block *block);
17
18void lightrec_register_block(struct blockcache *cache, struct block *block);
19void lightrec_unregister_block(struct blockcache *cache, struct block *block);
20
21struct blockcache * lightrec_blockcache_init(struct lightrec_state *state);
22void lightrec_free_block_cache(struct blockcache *cache);
23
24u32 lightrec_calculate_block_hash(const struct block *block);
25_Bool lightrec_block_is_outdated(struct lightrec_state *state, struct block *block);
26
27void lightrec_remove_outdated_blocks(struct blockcache *cache,
28 const struct block *except);
29
30#endif /* __BLOCKCACHE_H__ */