[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/33] accel/tcg: Use bool for page_find_alloc
From: |
Richard Henderson |
Subject: |
[PATCH v2 07/33] accel/tcg: Use bool for page_find_alloc |
Date: |
Tue, 16 Aug 2022 15:33:34 -0500 |
Bool is more appropriate type for the alloc parameter.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/translate-all.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 298277a590..596029b26d 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -464,7 +464,7 @@ void page_init(void)
#endif
}
-static PageDesc *page_find_alloc(tb_page_addr_t index, int alloc)
+static PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc)
{
PageDesc *pd;
void **lp;
@@ -532,11 +532,11 @@ static PageDesc *page_find_alloc(tb_page_addr_t index,
int alloc)
static inline PageDesc *page_find(tb_page_addr_t index)
{
- return page_find_alloc(index, 0);
+ return page_find_alloc(index, false);
}
static void page_lock_pair(PageDesc **ret_p1, tb_page_addr_t phys1,
- PageDesc **ret_p2, tb_page_addr_t phys2, int alloc);
+ PageDesc **ret_p2, tb_page_addr_t phys2, bool
alloc);
/* In user-mode page locks aren't used; mmap_lock is enough */
#ifdef CONFIG_USER_ONLY
@@ -650,7 +650,7 @@ static inline void page_unlock(PageDesc *pd)
/* lock the page(s) of a TB in the correct acquisition order */
static inline void page_lock_tb(const TranslationBlock *tb)
{
- page_lock_pair(NULL, tb->page_addr[0], NULL, tb->page_addr[1], 0);
+ page_lock_pair(NULL, tb->page_addr[0], NULL, tb->page_addr[1], false);
}
static inline void page_unlock_tb(const TranslationBlock *tb)
@@ -839,7 +839,7 @@ void page_collection_unlock(struct page_collection *set)
#endif /* !CONFIG_USER_ONLY */
static void page_lock_pair(PageDesc **ret_p1, tb_page_addr_t phys1,
- PageDesc **ret_p2, tb_page_addr_t phys2, int alloc)
+ PageDesc **ret_p2, tb_page_addr_t phys2, bool alloc)
{
PageDesc *p1, *p2;
tb_page_addr_t page1;
@@ -1289,7 +1289,7 @@ tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
* Note that inserting into the hash table first isn't an option, since
* we can only insert TBs that are fully initialized.
*/
- page_lock_pair(&p, phys_pc, &p2, phys_page2, 1);
+ page_lock_pair(&p, phys_pc, &p2, phys_page2, true);
tb_page_add(p, tb, 0, phys_pc & TARGET_PAGE_MASK);
if (p2) {
tb_page_add(p2, tb, 1, phys_page2);
@@ -2224,7 +2224,7 @@ void page_set_flags(target_ulong start, target_ulong end,
int flags)
for (addr = start, len = end - start;
len != 0;
len -= TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) {
- PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, 1);
+ PageDesc *p = page_find_alloc(addr >> TARGET_PAGE_BITS, true);
/* If the write protection bit is set, then we invalidate
the code inside. */
--
2.34.1
- [PATCH v2 11/33] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp, (continued)
- [PATCH v2 11/33] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp, Richard Henderson, 2022/08/16
- [PATCH v2 09/33] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c, Richard Henderson, 2022/08/16
- [PATCH v2 08/33] accel/tcg: Make tb_htable_lookup static, Richard Henderson, 2022/08/16
- [PATCH v2 04/33] linux-user: Honor PT_GNU_STACK, Richard Henderson, 2022/08/16
- [PATCH v2 14/33] accel/tcg: Raise PROT_EXEC exception early, Richard Henderson, 2022/08/16
- [PATCH v2 13/33] accel/tcg: Unlock mmap_lock after longjmp, Richard Henderson, 2022/08/16
- [PATCH v2 19/33] accel/tcg: Use DisasContextBase in plugin_gen_tb_start, Richard Henderson, 2022/08/16
- [PATCH v2 21/33] include/hw/core: Create struct CPUJumpCache, Richard Henderson, 2022/08/16
- [PATCH v2 15/33] accel/tcg: Introduce is_same_page(), Richard Henderson, 2022/08/16
- [PATCH v2 17/33] accel/tcg: Add pc and host_pc params to gen_intermediate_code, Richard Henderson, 2022/08/16
- [PATCH v2 07/33] accel/tcg: Use bool for page_find_alloc,
Richard Henderson <=
- [PATCH v2 20/33] accel/tcg: Do not align tb->page_addr[0], Richard Henderson, 2022/08/16
- [PATCH v2 12/33] accel/tcg: Add nofault parameter to get_page_addr_code_hostp, Richard Henderson, 2022/08/16
- [PATCH v2 18/33] accel/tcg: Add fast path for translator_ld*, Richard Henderson, 2022/08/16
- [PATCH v2 10/33] accel/tcg: Properly implement get_page_addr_code for user-only, Richard Henderson, 2022/08/16
- [PATCH v2 24/33] accel/tcg: Split log_cpu_exec into inline and slow path, Richard Henderson, 2022/08/16
- [PATCH v2 26/33] target/arm: Change gen_goto_tb to work on displacements, Richard Henderson, 2022/08/16
- [PATCH v2 25/33] target/arm: Introduce curr_insn_len, Richard Henderson, 2022/08/16
- [PATCH v2 27/33] target/arm: Change gen_*set_pc_im to gen_*update_pc, Richard Henderson, 2022/08/16
- [PATCH v2 23/33] accel/tcg: Introduce TARGET_TB_PCREL, Richard Henderson, 2022/08/16
- [PATCH v2 32/33] target/arm: Introduce gen_pc_plus_diff for aarch32, Richard Henderson, 2022/08/16