All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pit-div_round.patch
@ 2005-04-21  0:03 Arun Sharma
  0 siblings, 0 replies; only message in thread
From: Arun Sharma @ 2005-04-21  0:03 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

Truly round off the div result to get right PIT frequency for guest. 
Otherwise, the guest's idea of time drifts away from that of the host.
 
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

Index: trunk/xen/include/xen/lib.h
===================================================================
--- trunk/xen/include/xen/lib.h	(revision 688)
+++ trunk/xen/include/xen/lib.h	(working copy)
@@ -21,7 +21,7 @@
 #define SWAP(_a, _b) \
    do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
 
-#define DIV_ROUND(x, y) (((x) + (y) - 1) / (y))
+#define DIV_ROUND(x, y) (((x) + (y) / 2) / (y))
 
 #define reserve_bootmem(_p,_l) ((void)0)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-21  0:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-21  0:03 [PATCH] pit-div_round.patch Arun Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.