[PATCH v3 8/9] target/loongarch: Add static definition with function loongarch_tlb_search()

Bibo Mao posted 9 patches 6 months, 3 weeks ago
There is a newer version of this series
[PATCH v3 8/9] target/loongarch: Add static definition with function loongarch_tlb_search()
Posted by Bibo Mao 6 months, 3 weeks ago
Function loongarch_tlb_search() is only referenced in file tcg/tlb_helper.c,
define this function with static attribution.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 target/loongarch/internals.h      | 2 --
 target/loongarch/tcg/tlb_helper.c | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h
index 9fdc3059d8..3a079feb1d 100644
--- a/target/loongarch/internals.h
+++ b/target/loongarch/internals.h
@@ -54,8 +54,6 @@ uint64_t cpu_loongarch_get_constant_timer_counter(LoongArchCPU *cpu);
 uint64_t cpu_loongarch_get_constant_timer_ticks(LoongArchCPU *cpu);
 void cpu_loongarch_store_constant_timer_config(LoongArchCPU *cpu,
                                                uint64_t value);
-bool loongarch_tlb_search(CPULoongArchState *env, target_ulong vaddr,
-                          int *index);
 int get_physical_address(CPULoongArchState *env, hwaddr *physical,
                          int *prot, target_ulong address,
                          MMUAccessType access_type, int mmu_idx, int is_debug);
diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c
index 8509aa99cf..2fdd10022b 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -209,8 +209,8 @@ static uint32_t get_random_tlb(uint32_t low, uint32_t high)
  * field in tlb entry contains bit[47:13], so need adjust.
  * virt_vpn = vaddr[47:13]
  */
-bool loongarch_tlb_search(CPULoongArchState *env, target_ulong vaddr,
-                          int *index)
+static bool loongarch_tlb_search(CPULoongArchState *env, target_ulong vaddr,
+                                 int *index)
 {
     LoongArchTLB *tlb;
     uint16_t csr_asid, tlb_asid, stlb_idx;
-- 
2.39.3
Re: [PATCH v3 8/9] target/loongarch: Add static definition with function loongarch_tlb_search()
Posted by Philippe Mathieu-Daudé 6 months, 3 weeks ago
On 22/4/25 04:57, Bibo Mao wrote:
> Function loongarch_tlb_search() is only referenced in file tcg/tlb_helper.c,
> define this function with static attribution.
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   target/loongarch/internals.h      | 2 --
>   target/loongarch/tcg/tlb_helper.c | 4 ++--
>   2 files changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>