All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Kamada <kama@jp.fujitsu.com>
To: xen-devel@lists.xensource.com, xen-ia64-devel@lists.xensource.com
Subject: [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64 machine
Date: Wed, 04 Jul 2007 20:43:29 +0900	[thread overview]
Message-ID: <20070704203821.B340.KAMA@jp.fujitsu.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

Hi all,

Attached patch modifies common code in files below, so I will post it
to xen-devel and xen-ia64-devel.

- drivers/xen/Kconfig
- drivers/xen/Makefile
- drivers/xen/char/mem.c

This patch makes architecture specific memory operations to be available
only if ARCH_HAS_DEV_MEM is defined.

Background why I posted the patch is as follows.

We would like to support Xwindow on IA64 by remapping machine address to
pseudo physical address at PCI device initialization (pci_acpi_scan_root()
in arch/ia64/pci/pci.c) but at "mmap /dev/mem" systemcall.
With the new scheme, we need no longer the archtecture specific memory
operations described above.

Please see 
http://lists.xensource.com/archives/html/xen-ia64-devel/2007-06/msg00167.html

Thanks

-----
Jun Kamada
Virtual Systems Development Div.
Platform Technology Development Unit
Fujitsu Ltd.
kama@jp.fujitsu.com

[-- Attachment #2: ifdef_arch_has_dev_mem.patch --]
[-- Type: application/octet-stream, Size: 1995 bytes --]

# HG changeset patch
# User Jun Kamada <kama@jp.fujitsu.com>
# Date 1182406401 -32400
# Node ID 40489068407c9c5488100a2c8d54d5c64676aba0
# Parent  6d89642c02d490c24fe7ad39dce4f2622f1ef1cb
Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.

Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>

diff -r 6d89642c02d4 -r 40489068407c drivers/xen/Kconfig
--- a/drivers/xen/Kconfig	Thu Jun 21 15:12:20 2007 +0900
+++ b/drivers/xen/Kconfig	Thu Jun 21 15:13:21 2007 +0900
@@ -273,4 +273,8 @@ config XEN_SMPBOOT
 	default y
 	depends on SMP
 
+config XEN_DEVMEM
+	bool
+	default y
+
 endif
diff -r 6d89642c02d4 -r 40489068407c drivers/xen/Makefile
--- a/drivers/xen/Makefile	Thu Jun 21 15:12:20 2007 +0900
+++ b/drivers/xen/Makefile	Thu Jun 21 15:13:21 2007 +0900
@@ -5,9 +5,9 @@ obj-y	+= xenbus/
 obj-y	+= xenbus/
 obj-y	+= gntdev/
 obj-y	+= balloon/
-obj-y	+= char/
 
 obj-y	+= util.o
+obj-$(CONFIG_XEN_DEVMEM)		+= char/
 obj-$(CONFIG_XEN_BLKDEV_BACKEND)	+= blkback/
 obj-$(CONFIG_XEN_BLKDEV_TAP)		+= blktap/
 obj-$(CONFIG_XEN_NETDEV_BACKEND)	+= netback/
diff -r 6d89642c02d4 -r 40489068407c drivers/xen/char/mem.c
--- a/drivers/xen/char/mem.c	Thu Jun 21 15:12:20 2007 +0900
+++ b/drivers/xen/char/mem.c	Thu Jun 21 15:13:21 2007 +0900
@@ -33,6 +33,7 @@ static inline int valid_phys_addr_range(
 }
 #endif
 
+#ifdef ARCH_HAS_DEV_MEM
 /*
  * This funcion reads the *physical* memory. The f_pos points directly to the 
  * memory location. 
@@ -135,6 +136,7 @@ static ssize_t write_mem(struct file * f
 	*ppos += written;
 	return written;
 }
+#endif
 
 #ifndef ARCH_HAS_DEV_MEM_MMAP_MEM
 static inline int uncached_access(struct file *file)
@@ -194,6 +196,7 @@ static int open_mem(struct inode * inode
 	return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
 }
 
+#ifdef ARCH_HAS_DEV_MEM
 const struct file_operations mem_fops = {
 	.llseek		= memory_lseek,
 	.read		= read_mem,
@@ -201,3 +204,4 @@ const struct file_operations mem_fops = 
 	.mmap		= xen_mmap_mem,
 	.open		= open_mem,
 };
+#endif

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

             reply	other threads:[~2007-07-04 11:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-04 11:43 Jun Kamada [this message]
2007-07-04 12:04 ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jan Beulich
2007-07-04 12:24   ` [Xen-devel] [Patch] ARCH_HAS_DEV_MEM patch for Xwindow onIA64machine Akio Takebe
2007-07-06  9:46   ` [Patch] ARCH_HAS_DEV_MEM patch for Xwindow on IA64machine Jun Kamada

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=20070704203821.B340.KAMA@jp.fujitsu.com \
    --to=kama@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.