Commit | Line | Data |
---|---|---|
98fa08a5 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
d16005f8 | 2 | /* |
98fa08a5 | 3 | * Copyright (C) 2014-2021 Paul Cercueil <paul@crapouillou.net> |
d16005f8 PC |
4 | */ |
5 | ||
6 | #ifndef __BLOCKCACHE_H__ | |
7 | #define __BLOCKCACHE_H__ | |
8 | ||
9 | #include "lightrec.h" | |
10 | ||
11 | struct blockcache; | |
12 | ||
13 | struct block * lightrec_find_block(struct blockcache *cache, u32 pc); | |
98fa08a5 PC |
14 | struct block * lightrec_find_block_from_lut(struct blockcache *cache, |
15 | u16 lut_entry, u32 addr_in_block); | |
16 | u16 lightrec_get_lut_entry(const struct block *block); | |
17 | ||
d16005f8 PC |
18 | void lightrec_register_block(struct blockcache *cache, struct block *block); |
19 | void lightrec_unregister_block(struct blockcache *cache, struct block *block); | |
20 | ||
21 | struct blockcache * lightrec_blockcache_init(struct lightrec_state *state); | |
22 | void lightrec_free_block_cache(struct blockcache *cache); | |
23 | ||
24 | u32 lightrec_calculate_block_hash(const struct block *block); | |
98fa08a5 | 25 | _Bool lightrec_block_is_outdated(struct lightrec_state *state, struct block *block); |
d16005f8 | 26 | |
d16005f8 | 27 | #endif /* __BLOCKCACHE_H__ */ |