includes: move tb_flush into its own header

This aids subsystems (like gdbstub) that want to trigger a flush
without pulling target specific headers.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Message-Id: <20230302190846.2593720-8-alex.bennee@linaro.org>
Message-Id: <20230303025805.625589-8-richard.henderson@linaro.org>
This commit is contained in:
Alex Bennée 2023-03-02 18:57:43 -08:00
parent 9f56787c12
commit 548c96095d
14 changed files with 39 additions and 2 deletions

View file

@ -677,7 +677,6 @@ void tb_invalidate_phys_addr(target_ulong addr);
#else
void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs);
#endif
void tb_flush(CPUState *cpu);
void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end);
void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr);

26
include/exec/tb-flush.h Normal file
View file

@ -0,0 +1,26 @@
/*
* tb-flush prototype for use by the rest of the system.
*
* Copyright (c) 2022 Linaro Ltd
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _TB_FLUSH_H_
#define _TB_FLUSH_H_
/**
* tb_flush() - flush all translation blocks
* @cs: CPUState (must be valid, but treated as anonymous pointer)
*
* Used to flush all the translation blocks in the system. Sometimes
* it is simpler to flush everything than work out which individual
* translations are now invalid and ensure they are not called
* anymore.
*
* tb_flush() takes care of running the flush in an exclusive context
* if it is not already running in one. This means no guest code will
* run until this complete.
*/
void tb_flush(CPUState *cs);
#endif /* _TB_FLUSH_H_ */