From f6847af0cdd345c5903349dc7e7b04992ecef44f Mon Sep 17 00:00:00 2001 From: chenhy0106 <42792255+chenhy0106@users.noreply.github.com> Date: Thu, 9 Mar 2023 20:25:54 +0800 Subject: [PATCH] [libcpu/riscv/c906] fix "next_asid" type error (#7031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MAX_ASID最大为0x10000,在next_asid==MAX_ASID时进入下一个generation。因此next_asid不能只有16位,否则将不能进入下一个generation。修改rt_uint16_t为rt_uint32_t。 --- libcpu/risc-v/t-head/c906/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpu/risc-v/t-head/c906/mmu.c b/libcpu/risc-v/t-head/c906/mmu.c index 73481dccf0..75893d65e6 100644 --- a/libcpu/risc-v/t-head/c906/mmu.c +++ b/libcpu/risc-v/t-head/c906/mmu.c @@ -42,7 +42,7 @@ volatile __attribute__((aligned(4 * 1024))) rt_ubase_t MMUTable[__SIZE(VPN2_BIT)]; static rt_uint8_t ASID_BITS = 0; -static rt_uint16_t next_asid; +static rt_uint32_t next_asid; static rt_uint64_t global_asid_generation; #define ASID_MASK ((1 << ASID_BITS) - 1) #define ASID_FIRST_GENERATION (1 << ASID_BITS)