> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 09:38:56 up 23:52, 1 user, load average: 0.74, 0.46, 0.38
This commit is contained in:
@ -1,15 +1,16 @@
|
||||
#include <am.h>
|
||||
#include <nemu.h>
|
||||
|
||||
static uint64_t start;
|
||||
#define GET_TIME() (inl(RTC_ADDR) | ((uint64_t)inl(RTC_ADDR + 4) << 32))
|
||||
static uint64_t __timer_start;
|
||||
#define GET_TIME() ((uint64_t) (uint32_t)inl(RTC_ADDR) | ((uint64_t) (uint32_t)inl(RTC_ADDR + 4) << 32))
|
||||
|
||||
void __am_timer_init() {
|
||||
start = GET_TIME();
|
||||
__timer_start = GET_TIME();
|
||||
putstr("timer start");
|
||||
}
|
||||
|
||||
void __am_timer_uptime(AM_TIMER_UPTIME_T *uptime) {
|
||||
uptime->us = GET_TIME() - start;
|
||||
uptime->us = GET_TIME() - __timer_start;
|
||||
}
|
||||
|
||||
void __am_timer_rtc(AM_TIMER_RTC_T *rtc) {
|
||||
|
Reference in New Issue
Block a user