From: Catalin Marinas <catalin.marinas@arm.com>
To: linux-arch@vger.kernel.org
Subject: [RFC PATCH 1/4] pio-mapping: Add generic support for PIO mapping API
Date: Fri, 05 Feb 2010 16:31:49 +0000 [thread overview]
Message-ID: <20100205163149.30827.29314.stgit@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20100205163044.30827.10915.stgit@pc1117.cambridge.arm.com>
Implement partial support for PIO mapping API. Currently only map/unmap
single and page functions are included. These functions are intended to
be used by device drivers doing PIO to page cache pages that may
potentially be mapped in user space and cause cache coherency issues.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
include/linux/pio-mapping.h | 61 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
create mode 100644 include/linux/pio-mapping.h
diff --git a/include/linux/pio-mapping.h b/include/linux/pio-mapping.h
new file mode 100644
index 0000000..9f53aff
--- /dev/null
+++ b/include/linux/pio-mapping.h
@@ -0,0 +1,61 @@
+/*
+ * include/linux/pio-mapping.h
+ *
+ * Copyright (C) 2010 ARM Ltd.
+ * Written by Catalin Marinas <catalin.marinas@arm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PIO_MAPPING_H
+#define PIO_MAPPING_H
+
+#include <linux/mm.h>
+
+enum pio_data_direction {
+ PIO_BIDIRECTIONAL,
+ PIO_TO_DEVICE,
+ PIO_FROM_DEVICE,
+ PIO_NONE
+};
+
+#ifdef CONFIG_HAVE_ARCH_PIO
+#include <asm/pio-mapping.h>
+#else
+
+static inline void *pio_map_single(void *addr, size_t size,
+ enum pio_data_direction dir)
+{
+ return addr;
+}
+
+static inline void pio_unmap_single(void *addr, size_t size,
+ enum pio_data_direction dir)
+{
+}
+
+static inline void *pio_map_page(struct page *page, unsigned long offset,
+ size_t size, enum pio_data_direction dir)
+{
+ return page_address(page) + offset;
+}
+
+static inline void pio_unmap_page(void *addr, size_t size,
+ enum pio_data_direction dir)
+{
+}
+
+#endif /* CONFIG_HAVE_ARCH_PIO */
+
+#endif /* PIO_MAPPING_H */
next prev parent reply other threads:[~2010-02-05 16:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 16:31 [RFC PATCH 0/4] PIO drivers and cache coherency Catalin Marinas
2010-02-05 16:31 ` Catalin Marinas [this message]
2010-02-05 16:31 ` [RFC PATCH 2/4] pio-mapping: Add ARM support for the PIO mapping API Catalin Marinas
2010-02-05 16:43 ` James Bottomley
2010-02-05 17:20 ` Catalin Marinas
2010-02-05 17:36 ` James Bottomley
2010-02-05 18:02 ` Catalin Marinas
2010-02-08 16:10 ` Catalin Marinas
2010-02-08 16:54 ` Russell King
2010-02-08 17:20 ` James Bottomley
2010-02-08 17:33 ` Russell King
2010-02-08 19:07 ` James Bottomley
2010-02-08 18:02 ` [RFC PATCH 2/4] pio-mapping: Add ARM support for the PIOmapping API Catalin Marinas
2010-02-08 19:09 ` James Bottomley
2010-02-08 17:14 ` [RFC PATCH 2/4] pio-mapping: Add ARM support for the PIO mapping API James Bottomley
2010-02-09 18:03 ` Catalin Marinas
2010-02-17 9:11 ` Benjamin Herrenschmidt
2010-02-17 20:04 ` Russell King
2010-02-17 20:39 ` Benjamin Herrenschmidt
2010-02-05 16:32 ` [RFC PATCH 3/4] pio-mapping: Use the PIO mapping API in libata-sff.c Catalin Marinas
2010-02-05 16:32 ` [RFC PATCH 4/4] pio-mapping: Use the PIO mapping API in the ISP1760 HCD driver Catalin Marinas
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=20100205163149.30827.29314.stgit@pc1117.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=linux-arch@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).