[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/2] xen: move wallclock functions from x86 to common
>>> On 05.11.15 at 17:57, <stefano.stabellini@xxxxxxxxxxxxx> wrote: > --- a/xen/common/time.c > +++ b/xen/common/time.c > @@ -16,7 +16,13 @@ > */ > > #include <xen/config.h> > +#include <xen/sched.h> > +#include <xen/shared.h> > +#include <xen/spinlock.h> > #include <xen/time.h> > +#include <asm/div64.h> > +#include <asm/domain.h> > + > > /* Nonzero if YEAR is a leap year (every 4 years, Stray blank line being added. Also please take the opportunity to remove xen/config.h here. > @@ -85,3 +95,87 @@ struct tm gmtime(unsigned long t) > > return tbuf; > } > + > +/* Explicitly OR with 1 just in case version number gets out of sync. */ > +#define version_update_begin(v) (((v)+1)|1) > +#define version_update_end(v) ((v)+1) This should be moved to a header instead of getting defined a second time here. Also please add spaces to match our coding style. > +struct tm wallclock_time(uint64_t *ns) > +{ > + uint64_t seconds, nsec; > + > + if ( !wc_sec ) > + return (struct tm) { 0 }; > + > + seconds = NOW() + SECONDS(wc_sec) + wc_nsec; > + nsec = do_div(seconds, 1000000000); > + > + if ( ns ) > + *ns = nsec; > + > + return gmtime(seconds); > +} > + > + Stray blank lines again. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |