diff --git a/devicemodel/hw/platform/rtc.c b/devicemodel/hw/platform/rtc.c index ea4b130b0..9965cc71f 100644 --- a/devicemodel/hw/platform/rtc.c +++ b/devicemodel/hw/platform/rtc.c @@ -850,36 +850,6 @@ vrtc_set_reg_a(struct vrtc *vrtc, uint8_t newval) } } -int -vrtc_nvram_read(struct vrtc *vrtc, int offset, uint8_t *retval) -{ - time_t basetime; - time_t curtime; - uint8_t *ptr; - - /* - * Allow all offsets in the RTC to be read. - */ - if (offset < 0 || offset >= sizeof(struct rtcdev)) - return -1; - - pthread_mutex_lock(&vrtc->mtx); - - /* - * Update RTC date/time fields if necessary. - */ - if (offset < 10 || offset == RTC_CENTURY) { - curtime = vrtc_curtime(vrtc, &basetime); - secs_to_rtc(curtime, vrtc, 0); - } - - ptr = (uint8_t *)(&vrtc->rtcdev); - *retval = ptr[offset]; - pthread_mutex_unlock(&vrtc->mtx); - - return 0; -} - int vrtc_nvram_write(struct vrtc *vrtc, int offset, uint8_t value) { diff --git a/devicemodel/include/rtc.h b/devicemodel/include/rtc.h index 08bfdbb5e..e743e8f59 100644 --- a/devicemodel/include/rtc.h +++ b/devicemodel/include/rtc.h @@ -48,7 +48,6 @@ void vrtc_deinit(struct vmctx *ctx); void vrtc_reset(struct vrtc *vrtc); time_t vrtc_get_time(struct vrtc *vrtc); int vrtc_set_time(struct vrtc *vrtc, time_t secs); -int vrtc_nvram_read(struct vrtc *vrtc, int offset, uint8_t *retval); int vrtc_nvram_write(struct vrtc *vrtc, int offset, uint8_t value); int vrtc_addr_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg);