提交 df2e647a 编写于 作者: 张梓悦's avatar 张梓悦

amtest: fix compile problem

上级 f3a18ad0
......@@ -7,7 +7,7 @@
#include ISA_H // "x86.h", "mips32.h", ...
#if defined(__ARCH_RISCV64_NOOP) || defined(__ARCH_RISCV32_NOOP) || defined(__ARCH_RISCV64_XS)
#if defined(__ARCH_RISCV64_NOOP) || defined(__ARCH_RISCV32_NOOP) || defined(__ARCH_RISCV64_XS) || defined(__ARCH_RISCV64_XS_FLASH)
#define INTR_GEN_ADDR (0x40070000UL)
#define INTR_RANDOM (0x40070008UL)
#define INTR_RANDOM_MASK (0x40070010UL)
......
......@@ -28,14 +28,17 @@ void pmp_test() {
printf("start pmp test\n");
#if defined(__ARCH_RISCV64_NOOP) || defined(__ARCH_RISCV32_NOOP) || defined(__ARCH_RISCV64_XS)
#ifdef PMP_1
access_fault_to_be_reported = 1;
volatile int *a = (int *)(0x90000040UL);
*a = 1; // should trigger a fault
#endif
#ifdef PMP_2
access_fault_to_be_reported = 0;
int *b = (int *)(0xa0000000UL);
*b = 1; // should not trigger a fault
#endif
#ifdef PMP_3
access_fault_to_be_reported = 1;
int *c = (int *)(0xb00000040UL);
*c = 1; // should trigger a fault
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册