[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Re: [Xen-changelog] [linux-2.6.18-xen] Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.


  • To: Hollis Blanchard <hollisb@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
  • Date: Sat, 07 Jul 2007 10:01:31 +0100
  • Cc: Jun Kamada <kama@xxxxxxxxxxxxxx>
  • Delivery-date: Sat, 07 Jul 2007 01:56:19 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcfAdWkUp9j4yCxoEdyLpAAWy6hiGQ==
  • Thread-topic: [Xen-devel] Re: [Xen-changelog] [linux-2.6.18-xen] Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.

We define it in asm/mach-xen/asm/io.h.

However, the patch *is* of questionable value. It guards the only non-static
definition in the file with #ifdef ARCH_HAS_DEV_MEM. Which begs the question
why you would build the file at all if !ARCH_HAS_DEV_MEM. I'll revert it.

By the way, I wonder how PPC manages to build both drivers/char/mem.c and
drivers/xen/char/mem.c without ARCH_HAS_DEV_MEM? The model is supposed to be
that mem_fops defined by the Xen file is picked up by the generic file. If
!ARCH_HAS_DEV_MEM then that doesn't happen -- so who picks up the Xen
mem_fops?

 -- Keir

On 6/7/07 21:25, "Hollis Blanchard" <hollisb@xxxxxxxxxx> wrote:

> This is producing warnings for me on PowerPC, which does not define
> ARCH_HAS_DEV_MEM:
> 
> /home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:151:
> warning: 'xen_mmap_mem' defined but not used
> /home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:172:
> warning: 'memory_lseek' defined but not used
> /home/hollisb/source/linux-2.6.18-xen-ppc.hg/drivers/xen/char/mem.c:195:
> warning: 'open_mem' defined but not used
> 
> As far as I can see, x86 does not define ARCH_HAS_DEV_MEM either, so
> should see the same problem?
> 
> On Fri, 2007-07-06 at 10:15 -0700, Xen patchbot-linux-2.6.18-xen wrote:
>> # HG changeset patch
>> # User kfraser@xxxxxxxxxxxxxxxxxxxxx
>> # Date 1183728779 -3600
>> # Node ID 4a08141e62ca189577041d8854bb478e5fbe502f
>> # Parent  9e66b8728bd3a5d857500117c421051ae7dd0d61
>> Add "#ifdef ARCH_HAS_DEV_MEM" to archtecture specific file_operations.
>> Signed-off-by: Jun Kamada <kama@xxxxxxxxxxxxxx>
>> ---
>>  drivers/xen/Kconfig       |    4 ++++
>>  drivers/xen/char/Makefile |    3 +--
>>  drivers/xen/char/mem.c    |    4 ++++
>>  3 files changed, 9 insertions(+), 2 deletions(-)
>> 
>> diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/Kconfig
>> --- a/drivers/xen/Kconfig Fri Jul 06 14:01:27 2007 +0100
>> +++ b/drivers/xen/Kconfig Fri Jul 06 14:32:59 2007 +0100
>> @@ -281,4 +281,8 @@ config XEN_XENCOMM
>>  config XEN_XENCOMM
>> bool
>> 
>> +config XEN_DEVMEM
>> + bool
>> + default y
>> +
>>  endif
>> diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/char/Makefile
>> --- a/drivers/xen/char/Makefile Fri Jul 06 14:01:27 2007 +0100
>> +++ b/drivers/xen/char/Makefile Fri Jul 06 14:32:59 2007 +0100
>> @@ -1,2 +1,1 @@
>> -
>> -obj-y := mem.o
>> +obj-$(CONFIG_XEN_DEVMEM) := mem.o
>> diff -r 9e66b8728bd3 -r 4a08141e62ca drivers/xen/char/mem.c
>> --- a/drivers/xen/char/mem.c Fri Jul 06 14:01:27 2007 +0100
>> +++ b/drivers/xen/char/mem.c Fri Jul 06 14:32:59 2007 +0100
>> @@ -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
>> 
>> _______________________________________________
>> Xen-changelog mailing list
>> Xen-changelog@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-changelog



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.