> 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
 11:08:48 up 1 day,  1:22,  1 user,  load average: 0.25, 0.28, 0.26
This commit is contained in:
tracer-ics2023
2024-09-13 11:08:48 +08:00
committed by zzy
parent 0caf9154b7
commit b857a67491
2 changed files with 2 additions and 4 deletions

View File

@ -23,7 +23,7 @@ static void __am_input_config(AM_INPUT_CONFIG_T *cfg) { cfg->present = true; }
static void __am_uart_config(AM_UART_CONFIG_T *cfg) { cfg->present = false; }
static void __am_net_config (AM_NET_CONFIG_T *cfg) { cfg->present = false; }
typedef void (*handler_t)(void *buf);
typedef void (*handler_t)(volatile void *buf);
static void *lut[128] = {
[AM_TIMER_CONFIG] = __am_timer_config,
[AM_TIMER_RTC ] = __am_timer_rtc,

View File

@ -1,15 +1,13 @@
#include <am.h>
#include <nemu.h>
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() {
__timer_start = GET_TIME();
}
void __am_timer_uptime(AM_TIMER_UPTIME_T *uptime) {
uptime->us = GET_TIME() - __timer_start;
uptime->us = GET_TIME();
}
void __am_timer_rtc(AM_TIMER_RTC_T *rtc) {