diff --git a/nemu/src/device/timer.c b/nemu/src/device/timer.c index a582580..3fe5b1c 100644 --- a/nemu/src/device/timer.c +++ b/nemu/src/device/timer.c @@ -21,7 +21,7 @@ static uint32_t *rtc_port_base = NULL; static void rtc_io_handler(uint32_t offset, int len, bool is_write) { assert(offset == 0 || offset == 4); - if (!is_write && offset == 4) { + if (!is_write && offset == 0) { uint64_t us = get_time(); printf("rtc_io_handle %ld\n", us); rtc_port_base[0] = (uint32_t)us;