[PATCH xserver 4/7] Move check definition MAP_FAILED in xf86_OSlib.h

Alexandr Shadchin alexandr.shadchin at gmail.com
Sat Oct 15 07:25:27 PDT 2011


Also remove odd definition MAP_FAILED.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
---
 hw/xfree86/os-support/bsd/alpha_video.c   |    4 ----
 hw/xfree86/os-support/bsd/arm_video.c     |    5 -----
 hw/xfree86/os-support/bsd/i386_video.c    |    4 ----
 hw/xfree86/os-support/bsd/ppc_video.c     |    5 -----
 hw/xfree86/os-support/bsd/sparc64_video.c |    4 ----
 hw/xfree86/os-support/linux/lnx_video.c   |    4 ----
 hw/xfree86/os-support/shared/bios_mmap.c  |    4 ----
 hw/xfree86/os-support/xf86_OSlib.h        |    4 ++++
 8 files changed, 4 insertions(+), 30 deletions(-)

diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index ee5c86a..c47f7bf 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -52,10 +52,6 @@
 #define MAP_FLAGS (MAP_FILE | MAP_SHARED)
 #endif
 
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
 axpDevice bsdGetAXP(void);
 
 #ifndef __NetBSD__
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index ffc42a8..1de6c87 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -97,11 +97,6 @@ struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL,
 #define MAP_FLAGS (MAP_FILE | MAP_SHARED)
 #endif
 
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-
 #define BUS_BASE	0L
 #define BUS_BASE_BWX	0L
 
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 2edad18..389841c 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -64,10 +64,6 @@
 #define MAP_FLAGS (MAP_FILE | MAP_SHARED)
 #endif
 
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
 #ifdef __OpenBSD__
 #define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
 		   "\tin /etc/sysctl.conf and reboot your machine\n" \
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index 920a002..e5d832e 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -36,11 +36,6 @@
 
 #include "bus/Pci.h"
 
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-
 /***************************************************************************/
 /* Video Memory Mapping section                                            */
 /***************************************************************************/
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
index a2a30c9..960c850 100644
--- a/hw/xfree86/os-support/bsd/sparc64_video.c
+++ b/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -34,10 +34,6 @@
 #include "xf86_OSlib.h"
 #include "xf86OSpriv.h"
 
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
 /***************************************************************************/
 /* Video Memory Mapping section                                            */
 /***************************************************************************/
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 3d45511..e711784 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -46,10 +46,6 @@
 #include <asm/mtrr.h>
 #endif
 
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
 static Bool ExtendedEnabled = FALSE;
 
 #ifdef __ia64__
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
index 33a8df0..b7b35d9 100644
--- a/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/hw/xfree86/os-support/shared/bios_mmap.c
@@ -31,10 +31,6 @@
 #include "xf86Priv.h"
 #include "xf86_OSlib.h"
 
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
 /*
  * Read BIOS via mmap()ing DEV_MEM
  */
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 34b8669..0a5861f 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -363,6 +363,10 @@
 #define DEV_MEM "/dev/mem"
 #endif
 
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
 #define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
 
 #define XF86_OS_PRIVS
-- 
1.7.6



More information about the xorg-devel mailing list