diff --git a/abstract-machine/am/src/platform/nemu/ioe/timer.c b/abstract-machine/am/src/platform/nemu/ioe/timer.c index 251c31f..a22c539 100644 --- a/abstract-machine/am/src/platform/nemu/ioe/timer.c +++ b/abstract-machine/am/src/platform/nemu/ioe/timer.c @@ -18,7 +18,7 @@ void __am_timer_init() { void __am_timer_uptime(AM_TIMER_UPTIME_T *uptime) { (*(volatile AM_TIMER_UPTIME_T *)uptime).us = GET_TIME() - __timer_start; - PNT_BITS(uptime->us); + PNT_BITS(uptime->us); } void __am_timer_rtc(AM_TIMER_RTC_T *rtc) { diff --git a/abstract-machine/klib/include/klib-macros.h b/abstract-machine/klib/include/klib-macros.h index 1f7c370..7789f86 100644 --- a/abstract-machine/klib/include/klib-macros.h +++ b/abstract-machine/klib/include/klib-macros.h @@ -16,8 +16,8 @@ ({ for (const char *p = s; *p; p++) putch(*p); }) #define io_read(reg) \ - ({ reg##_T __io_param; \ - ioe_read(reg, &__io_param); \ + ({ volatile reg##_T __io_param; \ + ioe_read(reg, (void*)&__io_param); \ __io_param; }) #define io_write(reg, ...) \