Browse Source

[libcpu/riscv/c906] fix "next_asid" type error (#7031)

MAX_ASID最大为0x10000,在next_asid==MAX_ASID时进入下一个generation。因此next_asid不能只有16位,否则将不能进入下一个generation。修改rt_uint16_t为rt_uint32_t。
chenhy0106 2 years ago
parent
commit
f6847af0cd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libcpu/risc-v/t-head/c906/mmu.c

+ 1 - 1
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)