Displaying 1 result from an estimated 1 matches for "sleep_diff".
2007 May 15
3
[PATCH 1/12] Add suspend/resume to devices owned by Xen
...+static u64 sleep_start;
+int time_suspend(void)
+{
+ sleep_start = get_cmos_time();
+
+ /* Better to cancel calibration timer for accuracy */
+ destroy_percpu_time();
+
+ if (cur_timer->suspend)
+ cur_timer->suspend();
+ return 0;
+}
+
+int time_resume(void)
+{
+ u64 sleep_diff;
+ u64 now;
+
+ on_resume = 1;
+
+ /* Set the clock to HZ Hz */
+#define CLOCK_TICK_RATE 1193180 /* crystal freq (Hz) */
+#define LATCH (((CLOCK_TICK_RATE)+(HZ/2))/HZ)
+ outb_p(0x34, PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */
+ outb_p(LATCH & 0xff, PIT_CH0); /* LSB */...