From: tip-bot for Brian Gerst <brgerst@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
brgerst@gmail.com, tglx@linutronix.de
Subject: [tip:x86/io] x86: Clean up mem*io functions.
Date: Fri, 5 Feb 2010 22:49:48 GMT [thread overview]
Message-ID: <tip-6175ddf06b6172046a329e3abfd9c901a43efd2e@git.kernel.org> (raw)
In-Reply-To: <1265380629-3212-6-git-send-email-brgerst@gmail.com>
Commit-ID: 6175ddf06b6172046a329e3abfd9c901a43efd2e
Gitweb: http://git.kernel.org/tip/6175ddf06b6172046a329e3abfd9c901a43efd2e
Author: Brian Gerst <brgerst@gmail.com>
AuthorDate: Fri, 5 Feb 2010 09:37:07 -0500
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Fri, 5 Feb 2010 13:57:33 -0800
x86: Clean up mem*io functions.
Iomem has no special significance on x86. Use the standard mem*
functions instead of trying to call other versions. Some fixups
are needed to match the function prototypes.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
LKML-Reference: <1265380629-3212-6-git-send-email-brgerst@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/boot/compressed/misc.c | 13 ++++---------
arch/x86/include/asm/io_32.h | 10 +++++-----
arch/x86/include/asm/io_64.h | 22 +++++++++++++---------
arch/x86/lib/Makefile | 2 +-
arch/x86/lib/io_64.c | 25 -------------------------
5 files changed, 23 insertions(+), 49 deletions(-)
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 3b22fe8..88042e8 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -19,11 +19,6 @@
#define _ASM_X86_DESC_H 1
#endif
-#ifdef CONFIG_X86_64
-#define _LINUX_STRING_H_ 1
-#define __LINUX_BITMAP_H 1
-#endif
-
#include <linux/linkage.h>
#include <linux/screen_info.h>
#include <linux/elf.h>
@@ -131,8 +126,8 @@ static void error(char *m);
static struct boot_params *real_mode; /* Pointer to real-mode data */
static int quiet;
-static void *memset(void *s, int c, unsigned n);
-void *memcpy(void *dest, const void *src, unsigned n);
+void *memset(void *s, int c, size_t n);
+void *memcpy(void *dest, const void *src, size_t n);
static void __putstr(int, const char *);
#define putstr(__x) __putstr(0, __x)
@@ -223,7 +218,7 @@ static void __putstr(int error, const char *s)
outb(0xff & (pos >> 1), vidport+1);
}
-static void *memset(void *s, int c, unsigned n)
+void *memset(void *s, int c, size_t n)
{
int i;
char *ss = s;
@@ -233,7 +228,7 @@ static void *memset(void *s, int c, unsigned n)
return s;
}
-void *memcpy(void *dest, const void *src, unsigned n)
+void *memcpy(void *dest, const void *src, size_t n)
{
int i;
const char *s = src;
diff --git a/arch/x86/include/asm/io_32.h b/arch/x86/include/asm/io_32.h
index 72a6a4a..685e332 100644
--- a/arch/x86/include/asm/io_32.h
+++ b/arch/x86/include/asm/io_32.h
@@ -49,21 +49,21 @@
#define xlate_dev_kmem_ptr(p) p
static inline void
-memset_io(volatile void __iomem *addr, unsigned char val, int count)
+memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
{
memset((void __force *)addr, val, count);
}
static inline void
-memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
+memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
{
- __memcpy(dst, (const void __force *)src, count);
+ memcpy(dst, (const void __force *)src, count);
}
static inline void
-memcpy_toio(volatile void __iomem *dst, const void *src, int count)
+memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
{
- __memcpy((void __force *)dst, src, count);
+ memcpy((void __force *)dst, src, count);
}
/*
diff --git a/arch/x86/include/asm/io_64.h b/arch/x86/include/asm/io_64.h
index 4a94aef..1305525 100644
--- a/arch/x86/include/asm/io_64.h
+++ b/arch/x86/include/asm/io_64.h
@@ -1,6 +1,8 @@
#ifndef _ASM_X86_IO_64_H
#define _ASM_X86_IO_64_H
+#include <linux/string.h>
+#include <linux/compiler.h>
/*
* This file contains the definitions for the x86 IO instructions
@@ -46,20 +48,22 @@
*/
#define xlate_dev_kmem_ptr(p) p
-void memset_io(volatile void __iomem *a, int b, size_t c);
+static inline void
+memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
+{
+ memset((void __force *)addr, val, count);
+}
-void __memcpy_fromio(void *, unsigned long, unsigned);
-static inline void memcpy_fromio(void *to, const volatile void __iomem *from,
- unsigned len)
+static inline void
+memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
{
- __memcpy_fromio(to, (unsigned long)from, len);
+ memcpy(dst, (const void __force *)src, count);
}
-void __memcpy_toio(unsigned long, const void *, unsigned);
-static inline void memcpy_toio(volatile void __iomem *to, const void *from,
- unsigned len)
+static inline void
+memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
{
- __memcpy_toio((unsigned long)to, from, len);
+ memcpy((void __force *)dst, src, count);
}
/*
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index cffd754..fff1427 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -34,7 +34,7 @@ ifneq ($(CONFIG_X86_CMPXCHG64),y)
endif
lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
else
- obj-y += io_64.o iomap_copy_64.o
+ obj-y += iomap_copy_64.o
lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
lib-y += thunk_64.o clear_page_64.o copy_page_64.o
lib-y += memmove_64.o memset_64.o
diff --git a/arch/x86/lib/io_64.c b/arch/x86/lib/io_64.c
deleted file mode 100644
index 3f1eb59..0000000
--- a/arch/x86/lib/io_64.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <linux/string.h>
-#include <linux/module.h>
-#include <asm/io.h>
-
-void __memcpy_toio(unsigned long dst, const void *src, unsigned len)
-{
- __inline_memcpy((void *)dst, src, len);
-}
-EXPORT_SYMBOL(__memcpy_toio);
-
-void __memcpy_fromio(void *dst, unsigned long src, unsigned len)
-{
- __inline_memcpy(dst, (const void *)src, len);
-}
-EXPORT_SYMBOL(__memcpy_fromio);
-
-void memset_io(volatile void __iomem *a, int b, size_t c)
-{
- /*
- * TODO: memset can mangle the IO patterns quite a bit.
- * perhaps it would be better to use a dumb one:
- */
- memset((void *)a, b, c);
-}
-EXPORT_SYMBOL(memset_io);
next prev parent reply other threads:[~2010-02-05 22:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 14:37 [PATCH 0/7] x86: Merge 32-bit and 64-bit io.h Brian Gerst
2010-02-05 14:37 ` [PATCH 1/7] x86-32: Move XQUAD definitions to numaq.h Brian Gerst
2010-02-05 22:48 ` [tip:x86/io] " tip-bot for Brian Gerst
2010-02-05 14:37 ` [PATCH 2/7] x86-32: Remove _local variants of in/out from io_32.h Brian Gerst
2010-02-05 22:49 ` [tip:x86/io] " tip-bot for Brian Gerst
2010-02-05 14:37 ` [PATCH 3/7] x86-64: Reorganize io_64.h Brian Gerst
2010-02-05 22:49 ` [tip:x86/io] " tip-bot for Brian Gerst
2010-02-05 14:37 ` [PATCH 4/7] x86-64: Use BUILDIO in io_64.h Brian Gerst
2010-02-05 22:49 ` [tip:x86/io] " tip-bot for Brian Gerst
2010-02-05 14:37 ` [PATCH 5/7] x86: Clean up mem*io functions Brian Gerst
2010-02-05 22:49 ` tip-bot for Brian Gerst [this message]
2010-02-05 14:37 ` [PATCH 6/7] x86: Simplify flush_write_buffers() Brian Gerst
2010-02-05 22:50 ` [tip:x86/io] " tip-bot for Brian Gerst
2010-02-05 14:37 ` [PATCH 7/7] x86: Merge io.h Brian Gerst
2010-02-05 22:50 ` [tip:x86/io] " tip-bot for Brian Gerst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-6175ddf06b6172046a329e3abfd9c901a43efd2e@git.kernel.org \
--to=brgerst@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox