Lines Matching full:cmos_data
66 uint8_t cmos_data[128];
124 s->cmos_data[RTC_REG_C] |= 0xc0;
141 period_code = s->cmos_data[RTC_REG_A] & 0x0f;
155 && (((s->cmos_data[RTC_REG_B] & REG_B_PIE) && enable_pie)
156 || ((s->cmos_data[RTC_REG_B] & REG_B_SQWE) && s->sqw_irq))) {
184 if (s->cmos_data[RTC_REG_B] & REG_B_PIE) {
185 s->cmos_data[RTC_REG_C] |= 0xc0;
198 if (s->cmos_data[RTC_REG_B] & REG_B_SQWE) {
221 s->cmos_data[s->cmos_index] = data;
230 s->cmos_data[s->cmos_index] = data;
232 if (!(s->cmos_data[RTC_REG_B] & REG_B_SET)) {
238 s->cmos_data[RTC_REG_A] = (data & ~REG_A_UIP) |
239 (s->cmos_data[RTC_REG_A] & REG_A_UIP);
245 s->cmos_data[RTC_REG_A] &= ~REG_A_UIP;
249 if (s->cmos_data[RTC_REG_B] & REG_B_SET) {
253 s->cmos_data[RTC_REG_B] = data;
261 s->cmos_data[s->cmos_index] = data;
269 if (s->cmos_data[RTC_REG_B] & REG_B_DM) {
278 if (s->cmos_data[RTC_REG_B] & REG_B_DM) {
289 tm->tm_sec = rtc_from_bcd(s, s->cmos_data[RTC_SECONDS]);
290 tm->tm_min = rtc_from_bcd(s, s->cmos_data[RTC_MINUTES]);
291 tm->tm_hour = rtc_from_bcd(s, s->cmos_data[RTC_HOURS] & 0x7f);
292 if (!(s->cmos_data[RTC_REG_B] & 0x02) &&
293 (s->cmos_data[RTC_HOURS] & 0x80)) {
296 tm->tm_wday = rtc_from_bcd(s, s->cmos_data[RTC_DAY_OF_WEEK]) - 1;
297 tm->tm_mday = rtc_from_bcd(s, s->cmos_data[RTC_DAY_OF_MONTH]);
298 tm->tm_mon = rtc_from_bcd(s, s->cmos_data[RTC_MONTH]) - 1;
299 tm->tm_year = rtc_from_bcd(s, s->cmos_data[RTC_YEAR]) + s->base_year - 1900;
307 s->cmos_data[RTC_SECONDS] = rtc_to_bcd(s, tm->tm_sec);
308 s->cmos_data[RTC_MINUTES] = rtc_to_bcd(s, tm->tm_min);
309 if (s->cmos_data[RTC_REG_B] & 0x02) {
311 s->cmos_data[RTC_HOURS] = rtc_to_bcd(s, tm->tm_hour);
314 s->cmos_data[RTC_HOURS] = rtc_to_bcd(s, tm->tm_hour % 12);
316 s->cmos_data[RTC_HOURS] |= 0x80;
318 s->cmos_data[RTC_DAY_OF_WEEK] = rtc_to_bcd(s, tm->tm_wday + 1);
319 s->cmos_data[RTC_DAY_OF_MONTH] = rtc_to_bcd(s, tm->tm_mday);
320 s->cmos_data[RTC_MONTH] = rtc_to_bcd(s, tm->tm_mon + 1);
324 s->cmos_data[RTC_YEAR] = rtc_to_bcd(s, year);
387 if ((s->cmos_data[RTC_REG_A] & 0x70) != 0x20) {
393 if (!(s->cmos_data[RTC_REG_B] & REG_B_SET)) {
395 s->cmos_data[RTC_REG_A] |= REG_A_UIP;
411 if (!(s->cmos_data[RTC_REG_B] & REG_B_SET)) {
416 if (s->cmos_data[RTC_REG_B] & REG_B_AIE) {
417 if (((s->cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0 ||
418 s->cmos_data[RTC_SECONDS_ALARM] == s->current_tm.tm_sec) &&
419 ((s->cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 ||
420 s->cmos_data[RTC_MINUTES_ALARM] == s->current_tm.tm_mon) &&
421 ((s->cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 ||
422 s->cmos_data[RTC_HOURS_ALARM] == s->current_tm.tm_hour)) {
424 s->cmos_data[RTC_REG_C] |= 0xa0;
430 if (s->cmos_data[RTC_REG_B] & REG_B_UIE) {
431 s->cmos_data[RTC_REG_C] |= 0x90;
436 s->cmos_data[RTC_REG_A] &= ~REG_A_UIP;
457 ret = s->cmos_data[s->cmos_index];
460 ret = s->cmos_data[s->cmos_index];
463 ret = s->cmos_data[s->cmos_index];
465 s->cmos_data[RTC_REG_C] = 0x00;
468 ret = s->cmos_data[s->cmos_index];
482 s->cmos_data[addr] = val;
513 qemu_put_buffer(f, s->cmos_data, 128);
539 qemu_get_buffer(f, s->cmos_data, 128);
586 s->cmos_data[RTC_REG_B] &= ~(REG_B_PIE | REG_B_AIE | REG_B_SQWE);
587 s->cmos_data[RTC_REG_C] &= ~(REG_C_UF | REG_C_IRQF | REG_C_PF | REG_C_AF);
605 s->cmos_data[RTC_REG_A] = 0x26;
606 s->cmos_data[RTC_REG_B] = 0x02;
607 s->cmos_data[RTC_REG_C] = 0x00;
608 s->cmos_data[RTC_REG_D] = 0x80;
732 s->cmos_data[RTC_REG_A] = 0x26;
733 s->cmos_data[RTC_REG_B] = 0x02;
734 s->cmos_data[RTC_REG_C] = 0x00;
735 s->cmos_data[RTC_REG_D] = 0x80;