[PATCH] BRe: mmapr.c compile problem

Jeff Chua <[email protected]>
Newsgroups gmane.comp.xfree86.devel
Message-ID <[email protected]>
Here's a patch to fix mmapr.c and mmapw.c so that compile under linux.

Thanks,
Jeff.
[ jchua AT fedex DOT com ]


--- xfree86/xc/programs/Xserver/hw/xfree86/etc/mmapr.c.org	Tue Apr  5 13:58:21 2005
+++ xfree86/xc/programs/Xserver/hw/xfree86/etc/mmapr.c	Tue Apr  5 14:01:16 2005
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/mmapr.c,v 1.11 2005/03/29 18:41:45 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/mmapr.c,v 1.10 2004/12/31 16:07:09 tsi Exp $ */
  /*
   * Copyright 2002 through 2005 by Marc Aurele La France (TSI @ UQV), [email protected]
   *
@@ -51,12 +51,11 @@
  #endif

  #ifdef linux
-# include <sys/ioctl.h>
-# include <linux/pci.h>
+#include <sys/ioctl.h>

  # ifndef PCIIOC_BASE
     /* Selected ioctls for /proc/bus/pci/<bus>/<dfn> nodes */
-#  define PCIIOC_BASE		(('P') << 24) | ('C' << 16) | ('I' << 8))
+#  define PCIIOC_BASE		(('P' << 24) | ('C' << 16) | ('I' << 8))

     /* Set mmap state to I/O space */
  #  define PCIIOC_MMAP_IS_IO	(PCIIOC_BASE | 0x01)
@@ -159,6 +158,7 @@
                  case 'q':
                      Size = sizeof(dataq);
                      break;
+
  #ifdef linux
  		case 'i':
  		    mmap_ioctl = PCIIOC_MMAP_IS_IO;
@@ -168,6 +168,7 @@
  		    mmap_ioctl = PCIIOC_MMAP_IS_MEM;
  		    break;
  #endif
+
                  default:
                      usage();
              }
--- /v6/src2/xfree86/xc/programs/Xserver/hw/xfree86/etc/mmapw.c.org	Tue Apr  5 13:21:33 2005
+++ /v6/src2/xfree86/xc/programs/Xserver/hw/xfree86/etc/mmapw.c	Tue Apr  5 14:02:43 2005
@@ -51,7 +51,6 @@

  #ifdef linux
  # include <sys/ioctl.h>
-# include <linux/pci.h>

  # ifndef PCIIOC_BASE
     /* Selected ioctls for /proc/bus/pci/<bus>/<dfn> nodes */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.