Lines Matching refs:addr
419 static uint8_t cmos_read(uint8_t addr) in cmos_read() argument
421 pio_write8(addr, CMOS_ADDR_PORT); in cmos_read()
425 static void cmos_write(uint8_t addr, uint8_t value) in cmos_write() argument
427 pio_write8(addr, CMOS_ADDR_PORT); in cmos_write()
436 static uint8_t cmos_get_reg_val(uint8_t addr) in cmos_get_reg_val() argument
448 reg = cmos_read(addr); in cmos_get_reg_val()
454 static void cmos_set_reg_val(uint8_t addr, uint8_t value) in cmos_set_reg_val() argument
465 cmos_write(addr, value); in cmos_set_reg_val()
535 static bool vrtc_read(struct acrn_vcpu *vcpu, uint16_t addr, __unused size_t width) in vrtc_read() argument
544 offset = vrtc->addr; in vrtc_read()
546 if (addr == CMOS_ADDR_PORT) { in vrtc_read()
613 static bool vrtc_write(struct acrn_vcpu *vcpu, uint16_t addr, size_t width, in vrtc_write() argument
623 if ((width == 1U) && (addr == CMOS_ADDR_PORT)) { in vrtc_write()
624 vrtc->addr = (uint8_t)(value & 0x7FU); in vrtc_write()
627 if (vrtc_is_time_register(vrtc->addr)) { in vrtc_write()
629 cmos_set_reg_val(vcpu->vm->vrtc.addr, (uint8_t)(value & 0xFFU)); in vrtc_write()
633 cmos_set_reg_val(vcpu->vm->vrtc.addr, (uint8_t)(value & 0xFFU)); in vrtc_write()
636 switch (vrtc->addr) { in vrtc_write()
640 RTC_DEBUG("RTC reg_%x set to %#x (ignored)\n", vrtc->addr, value); in vrtc_write()
650 *((uint8_t *)&vrtc->rtcdev + vrtc->addr) = (uint8_t)(value & 0x7FU); in vrtc_write()
651 RTC_DEBUG("RTC alarm reg(%d) set to %#x (ignored)\n", vrtc->addr, value); in vrtc_write()
660 RTC_DEBUG("RTC offset %#x set to %#x\n", vrtc->addr, value); in vrtc_write()
661 *((uint8_t *)&vrtc->rtcdev + vrtc->addr) = (uint8_t)(value & mask); in vrtc_write()
668 if (is_postlaunched_vm(vcpu->vm) && vrtc_is_time_register(vrtc->addr)) { in vrtc_write()
810 vm->vrtc.addr = 0U; in vrtc_init()