diff options
author | liangzhen <zhen.liang@spacemit.com> | 2023-10-16 13:47:52 +0800 |
---|---|---|
committer | liangzhen <zhen.liang@spacemit.com> | 2023-10-16 13:47:52 +0800 |
commit | 4dfd2e7b4b6ef3f1dc134d299cc2ea4d2bbadab1 (patch) | |
tree | ba118d19cf517afb88cc6795b7937bd2f7777b94 /debug/programs/init.h | |
parent | c36c814ae49610bc407a5c4e144866fa50e4510e (diff) | |
download | riscv-tests-4dfd2e7b4b6ef3f1dc134d299cc2ea4d2bbadab1.zip riscv-tests-4dfd2e7b4b6ef3f1dc134d299cc2ea4d2bbadab1.tar.gz riscv-tests-4dfd2e7b4b6ef3f1dc134d299cc2ea4d2bbadab1.tar.bz2 |
Make CLINT address configurable
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
Diffstat (limited to 'debug/programs/init.h')
-rw-r--r-- | debug/programs/init.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/debug/programs/init.h b/debug/programs/init.h index 06d5384..e79681d 100644 --- a/debug/programs/init.h +++ b/debug/programs/init.h @@ -1,8 +1,10 @@ #ifndef INIT_H #define INIT_H -#define MTIME (*(volatile long long *)(0x02000000 + 0xbff8)) -#define MTIMECMP ((volatile long long *)(0x02000000 + 0x4000)) +#ifdef CLINT +#define MTIME (*(volatile long long *)(CLINT + 0xbff8)) +#define MTIMECMP ((volatile long long *)(CLINT + 0x4000)) +#endif typedef void* (*trap_handler_t)(unsigned hartid, unsigned mcause, void *mepc, void *sp); |