Messages in this thread | | | Date | Mon, 17 May 2004 16:33:56 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] HPET driver |
| |
Jeff Garzik <jgarzik@pobox.com> wrote: > > Andrew Morton wrote: > > +static inline u64 readq(void *addr) > > +{ > > + return readl(addr) | (((u64)readl(addr + 4)) << 32); > > +} > > + > > +static inline void writeq(u64 v, void *addr) > > +{ > > + writel(v & 0xffffffff, addr); > > + writel(v >> 32, addr + 4); > > +} > > > Seems sane, though I wonder about two things: > > * better home is probably asm-generic
It's only applicable to 32-bit machines. I thik I'd prefer to let the various arch maintainers decide if this is an appropriate implementation.
> * It seems to me that a poorly-written writel() macro might prefer some > guarantee that it's argument is pre-cast to u32. I dunno if this is > just paranoia or not.
That could be an issue if other architectures were to use this particular implementation. I'll stick the typecasts in there anyway. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |