Lines Matching +full:0 +full:x26
23 static uint8_t base = 0x70;
27 return (((value >> 4) & 0x0F) * 10) + (value & 0x0F); in bcd2dec()
32 outb(base + 0, reg); in cmos_read()
38 outb(base + 0, reg); in cmos_write()
59 return 0; in tm_cmp()
62 #if 0
85 if ((cmos_read(RTC_REG_B) & REG_B_DM) == 0) { in cmos_get_date_time()
94 hour_offset = 0x80; in cmos_get_date_time()
97 if ((cmos_read(0x0B) & REG_B_24H) == 0) { in cmos_get_date_time()
115 date->tm_gmtoff = 0; in cmos_get_date_time()
143 cmos_get_date_time(&date[0]); in check_time()
151 if (tm_cmp(&date[0], &date[1]) == 0) { in check_time()
152 datep = &date[0]; in check_time()
153 } else if (tm_cmp(&date[1], &date[2]) == 0) { in check_time()
155 } else if (tm_cmp(&date[2], &date[3]) == 0) { in check_time()
161 if (!(tm_cmp(&start, datep) <= 0 && tm_cmp(datep, &end) <= 0)) { in check_time()
184 cmos_write(RTC_REG_A, 0x76); in set_year_20xx()
185 cmos_write(RTC_YEAR, 0x11); in set_year_20xx()
186 cmos_write(RTC_CENTURY, 0x20); in set_year_20xx()
187 cmos_write(RTC_MONTH, 0x02); in set_year_20xx()
188 cmos_write(RTC_DAY_OF_MONTH, 0x02); in set_year_20xx()
189 cmos_write(RTC_HOURS, 0x02); in set_year_20xx()
190 cmos_write(RTC_MINUTES, 0x04); in set_year_20xx()
191 cmos_write(RTC_SECONDS, 0x58); in set_year_20xx()
192 cmos_write(RTC_REG_A, 0x26); in set_year_20xx()
194 g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02); in set_year_20xx()
195 g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04); in set_year_20xx()
196 g_assert_cmpint(cmos_read(RTC_SECONDS), >=, 0x58); in set_year_20xx()
197 g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02); in set_year_20xx()
198 g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02); in set_year_20xx()
199 g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11); in set_year_20xx()
200 g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20); in set_year_20xx()
207 cmos_write(RTC_REG_A, 0x76); in set_year_20xx()
208 cmos_write(RTC_YEAR, 0x80); in set_year_20xx()
209 cmos_write(RTC_REG_A, 0x26); in set_year_20xx()
211 g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02); in set_year_20xx()
212 g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04); in set_year_20xx()
213 g_assert_cmpint(cmos_read(RTC_SECONDS), >=, 0x58); in set_year_20xx()
214 g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02); in set_year_20xx()
215 g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02); in set_year_20xx()
216 g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x80); in set_year_20xx()
217 g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20); in set_year_20xx()
219 cmos_write(RTC_REG_A, 0x76); in set_year_20xx()
220 cmos_write(RTC_YEAR, 0x11); in set_year_20xx()
221 cmos_write(RTC_REG_A, 0x26); in set_year_20xx()
223 g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02); in set_year_20xx()
224 g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04); in set_year_20xx()
225 g_assert_cmpint(cmos_read(RTC_SECONDS), >=, 0x58); in set_year_20xx()
226 g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02); in set_year_20xx()
227 g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02); in set_year_20xx()
228 g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11); in set_year_20xx()
229 g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20); in set_year_20xx()
236 cmos_write(RTC_REG_A, 0x76); in set_year_1980()
237 cmos_write(RTC_YEAR, 0x80); in set_year_1980()
238 cmos_write(RTC_CENTURY, 0x19); in set_year_1980()
239 cmos_write(RTC_MONTH, 0x02); in set_year_1980()
240 cmos_write(RTC_DAY_OF_MONTH, 0x02); in set_year_1980()
241 cmos_write(RTC_HOURS, 0x02); in set_year_1980()
242 cmos_write(RTC_MINUTES, 0x04); in set_year_1980()
243 cmos_write(RTC_SECONDS, 0x58); in set_year_1980()
244 cmos_write(RTC_REG_A, 0x26); in set_year_1980()
246 g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02); in set_year_1980()
247 g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04); in set_year_1980()
248 g_assert_cmpint(cmos_read(RTC_SECONDS), >=, 0x58); in set_year_1980()
249 g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02); in set_year_1980()
250 g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02); in set_year_1980()
251 g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x80); in set_year_1980()
252 g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x19); in set_year_1980()
290 for (i = 0; i < 2 + wiggle; i++) { in alarm_time()
299 g_assert((cmos_read(RTC_REG_C) & REG_C_AF) != 0); in alarm_time()
300 g_assert(cmos_read(RTC_REG_C) == 0); in alarm_time()
313 cmos_write(RTC_REG_A, 0x76); in set_time()
315 cmos_write(RTC_REG_A, 0x26); in set_time()
323 cmos_write(RTC_YEAR, y & 0xFF); in set_datetime_bcd()
344 cmos_write(RTC_REG_A, 0x76); in set_datetime()
350 cmos_write(RTC_REG_A, 0x26); in set_datetime()
358 } while(0)
367 g_assert_cmpint(cmos_read(RTC_YEAR), ==, (y & 0xFF)); \
369 } while(0)
374 set_time(0, 0x81, 0x59, 0x00); in basic_12h_bcd()
376 assert_time(0x81, 0x59, 0x01); in basic_12h_bcd()
378 assert_time(0x82, 0x00, 0x00); in basic_12h_bcd()
381 set_time(0, 0x09, 0x59, 0x59); in basic_12h_bcd()
383 assert_time(0x10, 0x00, 0x59); in basic_12h_bcd()
386 set_time(0, 0x12, 0x59, 0x59); in basic_12h_bcd()
388 assert_time(0x01, 0x00, 0x00); in basic_12h_bcd()
391 set_time(0, 0x92, 0x59, 0x59); in basic_12h_bcd()
393 assert_time(0x81, 0x00, 0x00); in basic_12h_bcd()
396 set_time(0, 0x11, 0x59, 0x59); in basic_12h_bcd()
398 assert_time(0x92, 0x00, 0x00); in basic_12h_bcd()
402 set_time(0, 0x91, 0x59, 0x59); in basic_12h_bcd()
404 assert_time(0x12, 0x00, 0x00); in basic_12h_bcd()
411 set_time(REG_B_DM, 0x81, 59, 0); in basic_12h_dec()
413 assert_time(0x81, 59, 1); in basic_12h_dec()
415 assert_time(0x82, 0, 0); in basic_12h_dec()
418 set_time(REG_B_DM, 0x8c, 59, 59); in basic_12h_dec()
420 assert_time(0x81, 0, 0); in basic_12h_dec()
423 set_time(REG_B_DM, 0x0c, 59, 59); in basic_12h_dec()
425 assert_time(0x01, 0, 0); in basic_12h_dec()
428 set_time(REG_B_DM, 0x0b, 59, 59); in basic_12h_dec()
430 assert_time(0x8c, 0, 0); in basic_12h_dec()
433 set_time(REG_B_DM, 0x8b, 59, 59); in basic_12h_dec()
435 assert_time(0x0c, 0, 0); in basic_12h_dec()
442 set_time(REG_B_24H, 0x09, 0x59, 0x00); in basic_24h_bcd()
444 assert_time(0x09, 0x59, 0x01); in basic_24h_bcd()
446 assert_time(0x10, 0x00, 0x00); in basic_24h_bcd()
449 set_time(REG_B_24H, 0x09, 0x59, 0x00); in basic_24h_bcd()
451 assert_time(0x10, 0x00, 0x00); in basic_24h_bcd()
454 set_time(REG_B_24H, 0x23, 0x59, 0x00); in basic_24h_bcd()
456 assert_time(0x00, 0x00, 0x00); in basic_24h_bcd()
462 set_time(REG_B_24H | REG_B_DM, 9, 59, 0); in basic_24h_dec()
466 assert_time(10, 0, 0); in basic_24h_dec()
469 set_time(REG_B_24H | REG_B_DM, 9, 59, 0); in basic_24h_dec()
471 assert_time(10, 0, 0); in basic_24h_dec()
474 set_time(REG_B_24H | REG_B_DM, 23, 59, 0); in basic_24h_dec()
476 assert_time(0, 0, 0); in basic_24h_dec()
481 cmos_write(RTC_MINUTES_ALARM, 0xC0); in am_pm_alarm()
482 cmos_write(RTC_SECONDS_ALARM, 0xC0); in am_pm_alarm()
485 cmos_write(RTC_REG_B, 0); in am_pm_alarm()
488 cmos_write(RTC_REG_A, 0x76); in am_pm_alarm()
489 cmos_write(RTC_HOURS_ALARM, 0x82); in am_pm_alarm()
490 cmos_write(RTC_HOURS, 0x81); in am_pm_alarm()
491 cmos_write(RTC_MINUTES, 0x59); in am_pm_alarm()
492 cmos_write(RTC_SECONDS, 0x00); in am_pm_alarm()
494 cmos_write(RTC_REG_A, 0x26); in am_pm_alarm()
498 g_assert(cmos_read(RTC_HOURS) == 0x82); in am_pm_alarm()
499 g_assert((cmos_read(RTC_REG_C) & REG_C_AF) != 0); in am_pm_alarm()
504 * model keeps counting even when GATE=0, so we cannot simply disable in am_pm_alarm()
515 cmos_write(RTC_REG_A, 0x76); in am_pm_alarm()
516 cmos_write(RTC_HOURS_ALARM, 0x82); in am_pm_alarm()
518 cmos_write(RTC_MINUTES, 0); in am_pm_alarm()
519 cmos_write(RTC_SECONDS, 0); in am_pm_alarm()
521 cmos_write(RTC_REG_A, 0x26); in am_pm_alarm()
525 g_assert(cmos_read(RTC_HOURS) == 0x82); in am_pm_alarm()
526 g_assert((cmos_read(RTC_REG_C) & REG_C_AF) != 0); in am_pm_alarm()
529 cmos_write(RTC_REG_A, 0x76); in am_pm_alarm()
532 cmos_write(RTC_MINUTES, 0); in am_pm_alarm()
533 cmos_write(RTC_SECONDS, 0); in am_pm_alarm()
535 cmos_write(RTC_REG_A, 0x26); in am_pm_alarm()
539 g_assert(cmos_read(RTC_HOURS) == 0x82); in am_pm_alarm()
540 g_assert((cmos_read(RTC_REG_C) & REG_C_AF) == 0); in am_pm_alarm()
548 for (i = 0; i < 1000; i++) { in fuzz_registers()
551 reg = (uint8_t)g_test_rand_int_range(0, 16); in fuzz_registers()
552 val = (uint8_t)g_test_rand_int_range(0, 256); in fuzz_registers()
564 g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0); in register_b_set_flag()
569 set_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in register_b_set_flag()
571 assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in register_b_set_flag()
575 assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in register_b_set_flag()
580 assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in register_b_set_flag()
584 assert_datetime_bcd(0x02, 0x04, 0x59, 0x02, 0x02, 0x2011); in register_b_set_flag()
593 cmos_write(RTC_REG_A, 0x76); in divider_reset()
594 set_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in divider_reset()
596 assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in divider_reset()
600 assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in divider_reset()
603 cmos_write(RTC_REG_A, 0x26); in divider_reset()
605 g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0); in divider_reset()
606 assert_datetime_bcd(0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in divider_reset()
609 g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, !=, 0); in divider_reset()
611 g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0); in divider_reset()
613 assert_datetime_bcd(0x02, 0x04, 0x59, 0x02, 0x02, 0x2011); in divider_reset()
618 set_datetime(REG_B_24H, 0x02, 0x04, 0x58, 0x02, 0x02, 0x2011); in uip_stuck()
623 g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0); in uip_stuck()
624 assert_datetime_bcd(0x02, 0x04, 0x59, 0x02, 0x02, 0x2011); in uip_stuck()
627 cmos_write(RTC_HOURS_ALARM, 0x02); in uip_stuck()
628 cmos_write(RTC_MINUTES_ALARM, 0xC0); in uip_stuck()
629 cmos_write(RTC_SECONDS_ALARM, 0xC0); in uip_stuck()
633 g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, !=, 0); in uip_stuck()
636 cmos_write(RTC_HOURS_ALARM, 0x03); in uip_stuck()
638 g_assert_cmpint(cmos_read(RTC_REG_A) & REG_A_UIP, ==, 0); in uip_stuck()
652 g_assert((cmos_read(RTC_REG_C) & REG_C_PF) != 0); in wait_periodic_interrupt()
670 for (i = 0; i < RTC_PERIOD_TEST_NR; i++) { in periodic_timer()