master
h 38 lines 1.14 KB
Raw
1 /*
2 * tb-flush prototype for use by the rest of the system.
3 *
4 * Copyright (c) 2022 Linaro Ltd
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 #ifndef _TB_FLUSH_H_
9 #define _TB_FLUSH_H_
10
11 /**
12 * tb_flush__exclusive_or_serial()
13 *
14 * Used to flush all the translation blocks in the system. Mostly this is
15 * used to empty the code generation buffer after it is full. Sometimes it
16 * is used when it is simpler to flush everything than work out which
17 * individual translations are now invalid.
18 *
19 * Must be called from an exclusive or serial context, e.g. start_exclusive,
20 * vm_stop, or when there is only one vcpu. Note that start_exclusive cannot
21 * be called from within the cpu run loop, so this cannot be called from
22 * within target code.
23 */
24 void tb_flush__exclusive_or_serial(void);
25
26 /**
27 * queue_tb_flush() - add flush to the cpu work queue
28 * @cs: CPUState
29 *
30 * Flush all translation blocks the next time @cs processes the work queue.
31 * This should generally be followed by cpu_loop_exit(), so that the work
32 * queue is processed promptly.
33 */
34 void queue_tb_flush(CPUState *cs);
35
36 void tcg_flush_jmp_cache(CPUState *cs);
37
38 #endif /* _TB_FLUSH_H_ */