2022-08-15 22:13:05 +02:00
|
|
|
/*
|
|
|
|
* The per-CPU TranslationBlock jump cache.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003 Fabrice Bellard
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ACCEL_TCG_TB_JMP_CACHE_H
|
|
|
|
#define ACCEL_TCG_TB_JMP_CACHE_H
|
|
|
|
|
|
|
|
#define TB_JMP_CACHE_BITS 12
|
|
|
|
#define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Accessed in parallel; all accesses to 'tb' must be atomic.
|
2023-02-27 14:51:39 +01:00
|
|
|
* For CF_PCREL, accesses to 'pc' must be protected by a
|
|
|
|
* load_acquire/store_release to 'tb'.
|
2022-08-15 22:13:05 +02:00
|
|
|
*/
|
|
|
|
struct CPUJumpCache {
|
2023-01-24 19:01:18 +01:00
|
|
|
struct rcu_head rcu;
|
2022-08-15 22:13:05 +02:00
|
|
|
struct {
|
|
|
|
TranslationBlock *tb;
|
2023-06-21 15:56:28 +02:00
|
|
|
vaddr pc;
|
2022-08-15 22:13:05 +02:00
|
|
|
} array[TB_JMP_CACHE_SIZE];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ACCEL_TCG_TB_JMP_CACHE_H */
|