1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 * Copyright (C) 2014-2021 Paul Cercueil <paul@crapouillou.net>
6 #ifndef __BLOCKCACHE_H__
7 #define __BLOCKCACHE_H__
13 struct block * lightrec_find_block(struct blockcache *cache, u32 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);
18 void lightrec_register_block(struct blockcache *cache, struct block *block);
19 void lightrec_unregister_block(struct blockcache *cache, struct block *block);
21 struct blockcache * lightrec_blockcache_init(struct lightrec_state *state);
22 void lightrec_free_block_cache(struct blockcache *cache);
24 u32 lightrec_calculate_block_hash(const struct block *block);
25 _Bool lightrec_block_is_outdated(struct lightrec_state *state, struct block *block);
27 #endif /* __BLOCKCACHE_H__ */