From 05b41e2dc60a0aefc685a33260e5d8e09580908b Mon Sep 17 00:00:00 2001 From: Alexandr Shadchin Date: Tue, 4 Oct 2011 17:20:13 +0600 Subject: [PATCH] Move check definition MAP_FAILED in xf86_OSlib.h Also remove odd definition MAP_FAILED. Signed-off-by: Alexandr Shadchin Reviewed-by: Alan Coopersmith --- 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 ee5c86aee..c47f7bfc7 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 ffc42a86d..1de6c87d6 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 d16e4a82c..35e00fce7 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 920a002a4..e5d832eed 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 a2a30c9d7..960c850a8 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 3d455112c..e711784e7 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -46,10 +46,6 @@ #include #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 33a8df042..b7b35d9db 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 34b8669e3..0a5861f49 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