[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC 04/25] Replace "/" operand with div64
Also, I assume the gcc arm target can at least do 64-bit arithmetic via library calls, which you could then implement in arch/arm. __divdi3 etc. Perhaps you intend to do this anyway and do_div() here is a bandaid. -- Keir On 07/12/2011 07:00, "Zhang, Xiantao" <xiantao.zhang@xxxxxxxxx> wrote: > Hi, Stefano > Great work from you guys! One quick comment: Just found the below logic's > change maybe wrong and probably break current things. > Original logic is A+B -(C%D), but it is changed to (A+B-C)%D, so if it is > not an intended fix, it should be an issue. > Thanks! > Xiantao > >> diff --git a/xen/common/timer.c b/xen/common/timer.c index 0547ea3..043250e >> 100644 >> --- a/xen/common/timer.c >> +++ b/xen/common/timer.c >> @@ -23,6 +23,7 @@ >> #include <xen/symbols.h> >> #include <asm/system.h> >> #include <asm/desc.h> >> +#include <asm/div64.h> >> #include <asm/atomic.h> >> >> /* We program the time hardware this far behind the closest deadline. */ @@ >> -503,16 +504,18 @@ static void timer_softirq_action(void) >> >> s_time_t align_timer(s_time_t firsttick, uint64_t period) { >> + uint64_t n; >> if ( !period ) >> return firsttick; > >> - return firsttick + (period - 1) - ((firsttick - 1) % period); >> + n = firsttick + (period - 1) - (firsttick - 1); >> + return do_div(n, period); >> } > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@xxxxxxxxxxxxxxxxxxx > http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |