893b4bde88
Due to missing headers, when including "tb-jmp-cache.h" we might get: accel/tcg/tb-jmp-cache.h:21:21: error: field ‘rcu’ has incomplete type 21 | struct rcu_head rcu; | ^~~ accel/tcg/tb-jmp-cache.h:24:9: error: unknown type name ‘vaddr’ 24 | vaddr pc; | ^~~~~ Add the missing "qemu/rcu.h" and "exec/cpu-common.h" headers. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240111162442.43755-1-philmd@linaro.org>
34 lines
852 B
C
34 lines
852 B
C
/*
|
|
* 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
|
|
|
|
#include "qemu/rcu.h"
|
|
#include "exec/cpu-common.h"
|
|
|
|
#define TB_JMP_CACHE_BITS 12
|
|
#define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS)
|
|
|
|
/*
|
|
* Invalidated in parallel; all accesses to 'tb' must be atomic.
|
|
* A valid entry is read/written by a single CPU, therefore there is
|
|
* no need for qatomic_rcu_read() and pc is always consistent with a
|
|
* non-NULL value of 'tb'. Strictly speaking pc is only needed for
|
|
* CF_PCREL, but it's used always for simplicity.
|
|
*/
|
|
struct CPUJumpCache {
|
|
struct rcu_head rcu;
|
|
struct {
|
|
TranslationBlock *tb;
|
|
vaddr pc;
|
|
} array[TB_JMP_CACHE_SIZE];
|
|
};
|
|
|
|
#endif /* ACCEL_TCG_TB_JMP_CACHE_H */
|