lkml.org 
[lkml]   [2004]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.083 / U:3.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site