diff --git a/bsp/xuantie/virt64/c906/libcpu/riscv_mmu.h b/bsp/xuantie/virt64/c906/libcpu/riscv_mmu.h index 0214ba3fb9..c3c66d9b8f 100644 --- a/bsp/xuantie/virt64/c906/libcpu/riscv_mmu.h +++ b/bsp/xuantie/virt64/c906/libcpu/riscv_mmu.h @@ -18,6 +18,18 @@ #undef PAGE_SIZE +/* + * RISC-V Standard Svpbmt Extension (Bit 61-62) + * 00: PMA (Normal Memory, Cacheable, No change to implied PMA memory type) + * 01: NC (Non-cacheable, Weakly-ordered) + * 10: IO (Strongly-ordered, Non-cacheable, Non-idempotent) + * 11: Reserved + */ +#define PTE_PBMT_PMA (0UL << 61) +#define PTE_PBMT_NC (1UL << 61) +#define PTE_PBMT_IO (2UL << 61) +#define PTE_PBMT_MASK (3UL << 61) + #define PAGE_OFFSET_SHIFT 0 #define PAGE_OFFSET_BIT 12 #define PAGE_SIZE __SIZE(PAGE_OFFSET_BIT)