Re: [PATCH] HPET driver

From: Andrew Morton
Date: Mon May 17 2004 - 18:12:44 EST


Andrew Morton <akpm@xxxxxxxx> wrote:
>
> Robert Picco <Robert.Picco@xxxxxx> wrote:
> >
> > O.K. Did this but had to add a writeq and readq for i386.
>
> You implementation of these is private to hpet.c. From what Jeff is
> saying, it looks like it should be in include/asm-i386/io.h?

This look OK?

readq()/writeq() are supposed to be defined in terms of u64's.




---

25-akpm/drivers/char/hpet.c | 15 ---------------
25-akpm/include/asm-i386/io.h | 11 +++++++++++
2 files changed, 11 insertions(+), 15 deletions(-)

diff -puN drivers/char/hpet.c~hpet-driver-updates-move-readq drivers/char/hpet.c
--- 25/drivers/char/hpet.c~hpet-driver-updates-move-readq Mon May 17 16:06:34 2004
+++ 25-akpm/drivers/char/hpet.c Mon May 17 16:06:47 2004
@@ -90,21 +90,6 @@ static struct hpets *hpets;
#define read_counter(MC) readl(MC)
#endif

-#ifndef readq
-static unsigned long long __inline readq(void *addr)
-{
- return readl(addr) | (((unsigned long long)readl(addr + 4)) << 32LL);
-}
-#endif
-
-#ifndef writeq
-static void __inline writeq(unsigned long long v, void *addr)
-{
- writel(v & 0xffffffff, addr);
- writel(v >> 32, addr + 4);
-}
-#endif
-
static irqreturn_t hpet_interrupt(int irq, void *data, struct pt_regs *regs)
{
struct hpet_dev *devp;
diff -puN include/asm-i386/io.h~hpet-driver-updates-move-readq include/asm-i386/io.h
--- 25/include/asm-i386/io.h~hpet-driver-updates-move-readq Mon May 17 16:06:34 2004
+++ 25-akpm/include/asm-i386/io.h Mon May 17 16:11:11 2004
@@ -364,4 +364,15 @@ BUILDIO(b,b,char)
BUILDIO(w,w,short)
BUILDIO(l,,int)

+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);
+}
+
#endif

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/