Merge branch 'riscv64-clint' into 'rv64'

riscv64-noop: let timer adapt to standard CLINT register offset

See merge request projectn/nexus-am!25
This commit is contained in:
Zihao Yu 2019-11-15 10:38:09 +08:00
commit 77fe1cd954
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@
# define FB_ADDR 0x40000000
#elif defined(__ARCH_RISCV64_NOOP)
# define KBD_ADDR 0x40900000
# define RTC_ADDR 0x40700000
# define RTC_ADDR 0x4070bff8
# define SCREEN_ADDR 0x40800000
# define SYNC_ADDR 0x40800004
# define FB_ADDR 0x40000000

View File

@ -3,8 +3,8 @@
#include <klib.h>
#define CLINT_MMIO 0x40700000
#define CLINT_MTIME (CLINT_MMIO + 0)
#define CLINT_MTIMECMP (CLINT_MMIO + 8)
#define CLINT_MTIME (CLINT_MMIO + 0xbff8)
#define CLINT_MTIMECMP (CLINT_MMIO + 0x4000)
#define TIME_INC 10
static inline void inc_mtimecmp(uint64_t this) {
outd(CLINT_MTIMECMP, this + TIME_INC);