diff options
Diffstat (limited to 'hw/xfree86/os-support')
-rw-r--r-- | hw/xfree86/os-support/bsd/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/bsd/bsd_jstk.c | 4 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/drm/Makefile.am | 5 | ||||
-rw-r--r-- | hw/xfree86/os-support/drm/xf86drm.c | 48 | ||||
-rw-r--r-- | hw/xfree86/os-support/drm/xf86drmHash.c | 4 | ||||
-rw-r--r-- | hw/xfree86/os-support/drm/xf86drmRandom.c | 4 | ||||
-rw-r--r-- | hw/xfree86/os-support/drm/xf86drmSL.c | 7 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/int10/linux.c | 6 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_jstk.c | 4 | ||||
-rw-r--r-- | hw/xfree86/os-support/misc/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/sigio.c | 26 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/sigiostubs.c | 10 | ||||
-rw-r--r-- | hw/xfree86/os-support/solaris/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/xf86_OSproc.h | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/xf86_ansic.h | 52 | ||||
-rw-r--r-- | hw/xfree86/os-support/xf86_libc.h | 11 |
18 files changed, 34 insertions, 159 deletions
diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index ae89a6bf6..20885e866 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -50,7 +50,7 @@ ARCH_SOURCES = \ endif # FIXME: NetBSD Aperture defines (configure.ac) -AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ +AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) diff --git a/hw/xfree86/os-support/bsd/bsd_jstk.c b/hw/xfree86/os-support/bsd/bsd_jstk.c index bc99f2914..895d64e15 100644 --- a/hw/xfree86/os-support/bsd/bsd_jstk.c +++ b/hw/xfree86/os-support/bsd/bsd_jstk.c @@ -36,9 +36,7 @@ #include <machine/joystick.h> #include <fcntl.h> -#ifdef XFree86LOADER #include "misc.h" -#endif #include "xf86.h" #define JS_RETURN sizeof(struct joystick) @@ -174,7 +172,6 @@ xf86JoystickGetState(int fd, int *x, int *y, int *buttons) return 1; } -#ifdef XFree86LOADER /* * Entry point for XFree86 Loader */ @@ -184,5 +181,4 @@ bsd_jstkModuleInit(pointer *data, INT32 *magic) *magic = MAGIC_DONE; *data = NULL; } -#endif /* end of bsd_jstk.c */ diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am index 308a01b31..c56f3d717 100644 --- a/hw/xfree86/os-support/bus/Makefile.am +++ b/hw/xfree86/os-support/bus/Makefile.am @@ -53,6 +53,6 @@ libbus_la_SOURCES = Pci.c Pci.h $(PCI_SOURCES) $(PLATFORM_PCI_SOURCES) \ INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ +AM_CFLAGS = $(XORG_CFLAGS) EXTRA_DIST = $(sdk_HEADERS) diff --git a/hw/xfree86/os-support/drm/Makefile.am b/hw/xfree86/os-support/drm/Makefile.am index 8270f4304..53893251a 100644 --- a/hw/xfree86/os-support/drm/Makefile.am +++ b/hw/xfree86/os-support/drm/Makefile.am @@ -7,9 +7,8 @@ libdrm_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/GL/glx \ -I$(top_srcdir)/GL/include \ -DHAVE_XORG_CONFIG_H \ - @LIBDRM_CFLAGS@ \ - @SERVER_DEFINES@ \ - @LOADER_DEFINES@ + @LIBDRM_CFLAGS@ + libdrm_la_LDFLAGS = -module -avoid-version libdrm_ladir = $(moduledir)/@XORG_OS@ libdrm_la_SOURCES = \ diff --git a/hw/xfree86/os-support/drm/xf86drm.c b/hw/xfree86/os-support/drm/xf86drm.c index a4663048b..f3d774521 100644 --- a/hw/xfree86/os-support/drm/xf86drm.c +++ b/hw/xfree86/os-support/drm/xf86drm.c @@ -37,18 +37,10 @@ #include <xorg-config.h> #endif -#ifdef XFree86Server -# include "xf86.h" -# include "xf86_OSproc.h" -# define _DRM_MALLOC xalloc -# define _DRM_FREE xfree -# ifndef XFree86LOADER -# include <sys/mman.h> -# endif -#else -# define _DRM_MALLOC malloc -# define _DRM_FREE free -#endif +#include "xf86.h" +#include "xf86_OSproc.h" +#define _DRM_MALLOC xalloc +#define _DRM_FREE xfree #include "drm.h" #include <stdio.h> @@ -124,19 +116,9 @@ drmMsg(const char *format, ...) { va_list ap; -#ifndef XFree86Server - const char *env; - if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) -#endif - { - va_start(ap, format); -#ifdef XFree86Server - xf86VDrvMsgVerb(-1, X_NONE, DRM_MSG_VERBOSITY, format, ap); -#else - vfprintf(stderr, format, ap); -#endif - va_end(ap); - } + va_start(ap, format); + xf86VDrvMsgVerb(-1, X_NONE, DRM_MSG_VERBOSITY, format, ap); + va_end(ap); } static void *drmHashTable = NULL; /* Context switch callbacks */ @@ -270,19 +252,15 @@ static int drmOpenDevice(long dev, int minor) int fd; mode_t devmode = DRM_DEV_MODE; int isroot = !geteuid(); -#if defined(XFree86Server) uid_t user = DRM_DEV_UID; gid_t group = DRM_DEV_GID; -#endif sprintf(buf, DRM_DEV_NAME, DRM_DIR_NAME, minor); drmMsg("drmOpenDevice: node name is %s\n", buf); -#if defined(XFree86Server) devmode = xf86ConfigDRI.mode ? xf86ConfigDRI.mode : DRM_DEV_MODE; devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH); group = (xf86ConfigDRI.group >= 0) ? xf86ConfigDRI.group : DRM_DEV_GID; -#endif if (stat(DRM_DIR_NAME, &st)) { if (!isroot) return DRM_ERR_NOT_ROOT; @@ -297,10 +275,8 @@ static int drmOpenDevice(long dev, int minor) remove(buf); mknod(buf, S_IFCHR | devmode, dev); } -#if defined(XFree86Server) chown(buf, user, group); chmod(buf, devmode); -#endif fd = open(buf, O_RDWR, 0); drmMsg("drmOpenDevice: open result is %d, (%s)\n", @@ -314,10 +290,8 @@ static int drmOpenDevice(long dev, int minor) if (!isroot) return DRM_ERR_NOT_ROOT; remove(buf); mknod(buf, S_IFCHR | devmode, dev); -#if defined(XFree86Server) chown(buf, user, group); chmod(buf, devmode); -#endif } fd = open(buf, O_RDWR, 0); drmMsg("drmOpenDevice: open result is %d, (%s)\n", @@ -454,16 +428,12 @@ static int drmOpenByName(const char *name) char * id; if (!drmAvailable()) { -#if !defined(XFree86Server) - return -1; -#else /* try to load the kernel module now */ if (!xf86LoadKernelModule(name)) { ErrorF("[drm] failed to load kernel module \"%s\"\n", name); return -1; } -#endif } /* @@ -546,7 +516,6 @@ static int drmOpenByName(const char *name) */ int drmOpen(const char *name, const char *busid) { -#ifdef XFree86Server if (!drmAvailable() && name != NULL) { /* try to load the kernel */ if (!xf86LoadKernelModule(name)) { @@ -555,7 +524,6 @@ int drmOpen(const char *name, const char *busid) return -1; } } -#endif if (busid) { int fd; @@ -2259,7 +2227,6 @@ int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, return 0; } -#if defined(XFree86Server) static void drmSIGIOHandler(int interrupt, void *closure) { unsigned long key; @@ -2323,4 +2290,3 @@ int drmRemoveSIGIOHandler(int fd) return xf86RemoveSIGIOHandler(fd); } -#endif diff --git a/hw/xfree86/os-support/drm/xf86drmHash.c b/hw/xfree86/os-support/drm/xf86drmHash.c index a2567080a..ae967b22f 100644 --- a/hw/xfree86/os-support/drm/xf86drmHash.c +++ b/hw/xfree86/os-support/drm/xf86drmHash.c @@ -81,9 +81,7 @@ #if !HASH_MAIN # include "drm.h" # include "xf86drm.h" -# ifdef XFree86LOADER -# include "xf86.h" -# endif +# include "xf86.h" #endif #define N(x) drm##x diff --git a/hw/xfree86/os-support/drm/xf86drmRandom.c b/hw/xfree86/os-support/drm/xf86drmRandom.c index cc40dccad..e3e94a2af 100644 --- a/hw/xfree86/os-support/drm/xf86drmRandom.c +++ b/hw/xfree86/os-support/drm/xf86drmRandom.c @@ -84,9 +84,7 @@ #if !RANDOM_MAIN # include "drm.h" # include "xf86drm.h" -# ifdef XFree86LOADER -# include "xf86.h" -# endif +# include "xf86.h" #endif #define N(x) drm##x diff --git a/hw/xfree86/os-support/drm/xf86drmSL.c b/hw/xfree86/os-support/drm/xf86drmSL.c index 23283a950..e94825009 100644 --- a/hw/xfree86/os-support/drm/xf86drmSL.c +++ b/hw/xfree86/os-support/drm/xf86drmSL.c @@ -53,12 +53,7 @@ #else # include "drm.h" # include "xf86drm.h" -# ifdef XFree86LOADER -# include "xf86.h" -# else -# include <stdio.h> -# include <stdlib.h> -# endif +# include "xf86.h" #endif #define N(x) drm##x diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am index d492f962e..6fdc1bc42 100644 --- a/hw/xfree86/os-support/linux/Makefile.am +++ b/hw/xfree86/os-support/linux/Makefile.am @@ -34,7 +34,7 @@ liblinux_la_SOURCES = lnx_init.c lnx_video.c lnx_io.c lnx_kbd.c lnx_mouse.c \ $(APM_SOURCES) \ $(PLATFORM_PCI_SUPPORT) -AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ +AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) -I/usr/include/drm # FIXME this last part is crack diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c index a91137810..4f9e62b51 100644 --- a/hw/xfree86/os-support/linux/int10/linux.c +++ b/hw/xfree86/os-support/linux/int10/linux.c @@ -18,12 +18,6 @@ #else #define DEV_MEM "/dev/mem" #endif -#ifndef XFree86LOADER -#include <sys/mman.h> -#ifndef MAP_FAILED -#define MAP_FAILED ((void *)-1) -#endif -#endif #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1) #define SHMERRORPTR (pointer)(-1) diff --git a/hw/xfree86/os-support/linux/lnx_jstk.c b/hw/xfree86/os-support/linux/lnx_jstk.c index 667586359..36a81e490 100644 --- a/hw/xfree86/os-support/linux/lnx_jstk.c +++ b/hw/xfree86/os-support/linux/lnx_jstk.c @@ -40,9 +40,7 @@ static const char rcs_id[] = "Id: lnx_jstk.c,v 1.1 1995/12/20 14:06:09 lepied Ex #include <fcntl.h> #include <sys/ioctl.h> -#ifdef XFree86LOADER #include "xf86.h" -#endif #if !defined(JSIOCGTIMELIMIT) /* make 2.1.x joystick.h backward compatable */ @@ -172,7 +170,6 @@ xf86JoystickGetState(int fd, int *x, int *y, int *buttons) return 1; } -#ifdef XFree86LOADER /* * Entry point for XFree86 Loader */ @@ -182,6 +179,5 @@ linux_jstkModuleInit(pointer *data, INT32 *magic) *magic = MAGIC_DONE; *data = NULL; } -#endif /* end of lnx_jstk.c */ diff --git a/hw/xfree86/os-support/misc/Makefile.am b/hw/xfree86/os-support/misc/Makefile.am index 5ce23a1f1..f546e1a92 100644 --- a/hw/xfree86/os-support/misc/Makefile.am +++ b/hw/xfree86/os-support/misc/Makefile.am @@ -18,6 +18,6 @@ libmisc_la_SOURCES = xf86_Util.c Delay.c $(ARCH_SOURCES) INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ +AM_CFLAGS = $(XORG_CFLAGS) EXTRA_DIST = $(I386_SOURCES) $(PORTIO_SOURCES) $(ILHACK_SOURCES) diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index ecdc1cdd7..8d47805fe 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -58,22 +58,11 @@ #include <xorg-config.h> #endif -#ifdef XFree86Server # include <X11/X.h> # include "xf86.h" # include "xf86Priv.h" # include "xf86_OSlib.h" # include "inputstr.h" -#else -# include <unistd.h> -# include <signal.h> -# include <fcntl.h> -# include <sys/time.h> -# include <errno.h> -# include <stdio.h> -# include <string.h> -# define SYSCALL(call) while(((call) == -1) && (errno == EINTR)) -#endif /* * Linux libc5 defines FASYNC, but not O_ASYNC. Don't know if it is @@ -126,11 +115,9 @@ xf86SIGIO (int sig) xf86SigIOFuncs[i].closure); r--; } -#ifdef XFree86Server if (r > 0) { xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r); } -#endif } static int @@ -159,24 +146,14 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure) return 0; blocked = xf86BlockSIGIO(); if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) { -#ifdef XFree86Server xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n", fd, strerror(errno)); -#else - fprintf(stderr,"fcntl(%d, O_ASYNC): %s\n", - fd, strerror(errno)); -#endif xf86UnblockSIGIO(blocked); return 0; } if (fcntl(fd, F_SETOWN, getpid()) == -1) { -#ifdef XFree86Server xf86Msg(X_WARNING, "fcntl(%d, F_SETOWN): %s\n", fd, strerror(errno)); -#else - fprintf(stderr,"fcntl(%d, F_SETOWN): %s\n", - fd, strerror(errno)); -#endif xf86UnblockSIGIO(blocked); return 0; } @@ -289,7 +266,6 @@ xf86UnblockSIGIO (int wasset) } } -#ifdef XFree86Server void xf86AssertBlockedSIGIO (char *where) { @@ -308,5 +284,3 @@ xf86SIGIOSupported (void) { return 1; } - -#endif diff --git a/hw/xfree86/os-support/shared/sigiostubs.c b/hw/xfree86/os-support/shared/sigiostubs.c index eb5e2db2c..db54e53d3 100644 --- a/hw/xfree86/os-support/shared/sigiostubs.c +++ b/hw/xfree86/os-support/shared/sigiostubs.c @@ -31,7 +31,6 @@ #include <xorg-config.h> #endif -#ifdef XFree86Server #ifdef __UNIXOS2__ # define I_NEED_OS2_H #endif @@ -39,13 +38,6 @@ # include "xf86.h" # include "xf86Priv.h" # include "xf86_OSlib.h" -#else -# include <unistd.h> -# include <signal.h> -# include <fcntl.h> -# include <sys/time.h> -# include <errno.h> -#endif _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure) @@ -70,12 +62,10 @@ xf86UnblockSIGIO (int wasset) { } -#ifdef XFree86Server void xf86AssertBlockedSIGIO (char *where) { } -#endif /* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */ Bool diff --git a/hw/xfree86/os-support/solaris/Makefile.am b/hw/xfree86/os-support/solaris/Makefile.am index 63b8e9a90..6b29b3080 100644 --- a/hw/xfree86/os-support/solaris/Makefile.am +++ b/hw/xfree86/os-support/solaris/Makefile.am @@ -34,7 +34,7 @@ nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) sdk_HEADERS = agpgart.h nodist_sdk_HEADERS = solaris-$(SOLARIS_INOUT_ARCH).il -AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@ +AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 83ce9ed2b..7922fde4e 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -212,9 +212,7 @@ extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *); extern int xf86RemoveSIGIOHandler(int fd); extern int xf86BlockSIGIO (void); extern void xf86UnblockSIGIO (int); -#ifdef XFree86Server extern void xf86AssertBlockedSIGIO (char *); -#endif extern Bool xf86SIGIOSupported (void); #ifdef XF86_OS_PRIVS diff --git a/hw/xfree86/os-support/xf86_ansic.h b/hw/xfree86/os-support/xf86_ansic.h index 25dabfe89..31c0cac99 100644 --- a/hw/xfree86/os-support/xf86_ansic.h +++ b/hw/xfree86/os-support/xf86_ansic.h @@ -28,33 +28,27 @@ /* Handle <stdarg.h> */ -#ifndef IN_MODULE +#ifndef __OS2ELF__ # include <stdarg.h> -#else /* !IN_MODULE */ -# ifndef __OS2ELF__ -# include <stdarg.h> -# else /* __OS2ELF__ */ - /* EMX/gcc_elf under OS/2 does not have native header files */ -# if !defined (_VA_LIST) -# define _VA_LIST - typedef char *va_list; -# endif -# define _VA_ROUND(t) ((sizeof (t) + 3) & -4) -# if !defined (va_start) -# define va_start(ap,v) ap = (va_list)&v + ((sizeof (v) + 3) & -4) -# define va_end(ap) (ap = 0, (void)0) -# define va_arg(ap,t) (ap += _VA_ROUND (t), *(t *)(ap - _VA_ROUND (t))) -# endif -# endif /* __OS2ELF__ */ -#endif /* IN_MODULE */ +#else /* __OS2ELF__ */ + /* EMX/gcc_elf under OS/2 does not have native header files */ +# if !defined (_VA_LIST) +# define _VA_LIST + typedef char *va_list; +# endif +# define _VA_ROUND(t) ((sizeof (t) + 3) & -4) +# if !defined (va_start) +# define va_start(ap,v) ap = (va_list)&v + ((sizeof (v) + 3) & -4) +# define va_end(ap) (ap = 0, (void)0) +# define va_arg(ap,t) (ap += _VA_ROUND (t), *(t *)(ap - _VA_ROUND (t))) +# endif +#endif /* __OS2ELF__ */ /* * The first set of definitions are required both for modules and * libc_wrapper.c. */ -#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES) - #if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || \ defined(__SCO__) || defined(__UNIXWARE__) #define HAVE_VSSCANF @@ -133,9 +127,6 @@ #define MAXLONG LONG_MAX #endif -#endif /* XFree86LOADER || NEED_XF86_TYPES */ - -#if defined(XFree86LOADER) || defined(NEED_XF86_PROTOTYPES) /* * ANSI C compilers only. */ @@ -321,21 +312,6 @@ extern void xf86longjmp(xf86jmp_buf env, int val); (xf86getjmptype() == 1 ? xf86setjmp1((env), xf86setjmp1_arg2()) : \ xf86setjmperror((env)))) -#else /* XFree86LOADER || NEED_XF86_PROTOTYPES */ -#include <unistd.h> -#include <stdio.h> -#include <sys/ioctl.h> -#include <errno.h> -#include <fcntl.h> -#include <ctype.h> -#ifdef HAVE_SYSV_IPC -#include <sys/ipc.h> -#include <sys/shm.h> -#endif -#include <sys/stat.h> -#define stat_t struct stat -#endif /* XFree86LOADER || NEED_XF86_PROTOTYPES */ - /* * These things are always required by drivers (but not by libc_wrapper.c), * even for a static server because some OSs don't provide them. diff --git a/hw/xfree86/os-support/xf86_libc.h b/hw/xfree86/os-support/xf86_libc.h index 5a6056ba9..75b622529 100644 --- a/hw/xfree86/os-support/xf86_libc.h +++ b/hw/xfree86/os-support/xf86_libc.h @@ -53,8 +53,6 @@ * libc_wrapper.c. */ -#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES) - /* * First, the new data types * @@ -215,14 +213,12 @@ typedef int xf86jmp_buf[1024]; /* xf86shmclt() */ #define XF86IPC_RMID 0 -#endif /* defined(XFree86LOADER) || defined(NEED_XF86_TYPES) */ - /* * the rest of this file should only be included for code that is supposed * to go into modules */ -#if defined(XFree86LOADER) && !defined(DONT_DEFINE_WRAPPERS) +#if !defined(DONT_DEFINE_WRAPPERS) #undef abort #define abort() xf86abort() @@ -713,10 +709,9 @@ typedef int xf86jmp_buf[1024]; # define _FILEDEFED /* Already have FILE defined, don't redefine it */ #endif -#endif /* XFree86LOADER && !DONT_DEFINE_WRAPPERS */ +#endif /* !DONT_DEFINE_WRAPPERS */ -#if defined(XFree86LOADER) && \ - (!defined(DONT_DEFINE_WRAPPERS) || defined(DEFINE_SETJMP_WRAPPERS)) +#if (!defined(DONT_DEFINE_WRAPPERS) || defined(DEFINE_SETJMP_WRAPPERS)) #undef setjmp #define setjmp(a) xf86setjmp_macro(a) #undef longjmp |