···1515#include <linux/mc146818rtc.h>1616#include <linux/rtc.h>1717#include <linux/bcd.h>1818+#include <linux/delay.h>18191920#define RTC_PIE 0x40 /* periodic interrupt enable */2021#define RTC_AIE 0x20 /* alarm interrupt enable */···44434544static inline unsigned int get_rtc_time(struct rtc_time *time)4645{4747- unsigned long uip_watchdog = jiffies;4846 unsigned char ctrl;4947 unsigned long flags;5048···53535454 /*5555 * read RTC once any update in progress is done. The update5656- * can take just over 2ms. We wait 10 to 20ms. There is no need to5656+ * can take just over 2ms. We wait 20ms. There is no need to5757 * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP.5858 * If you need to know *exactly* when a second has started, enable5959 * periodic update complete interrupts, (via ioctl) and then 6060 * immediately read /dev/rtc which will block until you get the IRQ.6161 * Once the read clears, read the RTC time (again via ioctl). Easy.6262 */6363-6464- if (rtc_is_updating() != 0)6565- while (jiffies - uip_watchdog < 2*HZ/100) {6666- barrier();6767- cpu_relax();6868- }6363+ if (rtc_is_updating())6464+ mdelay(20);69657066 /*7167 * Only the values that we read from the RTC are set. We leave