diff options
Diffstat (limited to 'hw/xfree86/os-support/shared')
-rw-r--r-- | hw/xfree86/os-support/shared/ia64Pci.c | 81 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/ia64Pci.h | 41 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/libc_wrapper.c | 48 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/sigio.c | 12 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/sigiostubs.c | 3 |
5 files changed, 173 insertions, 12 deletions
diff --git a/hw/xfree86/os-support/shared/ia64Pci.c b/hw/xfree86/os-support/shared/ia64Pci.c new file mode 100644 index 000000000..d0046a7f2 --- /dev/null +++ b/hw/xfree86/os-support/shared/ia64Pci.c @@ -0,0 +1,81 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c,v 1.3 2003/02/23 20:26:49 tsi Exp $ */ +/* + * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the XFree86 Project shall + * not be used in advertising or otherwise to promote the sale, use or other + * dealings in this Software without prior written authorization from the + * XFree86 Project. + */ + +/* + * This file contains the glue needed to support various IA-64 chipsets. + */ + +#include "460gxPCI.h" +#include "e8870PCI.h" +#include "zx1PCI.h" +#include "Pci.h" +#include "ia64Pci.h" + +void +ia64ScanPCIWrapper(scanpciWrapperOpt flags) +{ + static IA64Chipset chipset = NONE_CHIPSET; + + if (flags == SCANPCI_INIT) { + + /* PCI configuration space probes should be done first */ + if (xorgProbe460GX(flags)) { + chipset = I460GX_CHIPSET; + xf86PreScan460GX(); + return; + } else if (xorgProbeE8870(flags)) { + chipset = E8870_CHIPSET; + xf86PreScanE8870(); + return; + } +#ifdef OS_PROBE_PCI_CHIPSET + chipset = OS_PROBE_PCI_CHIPSET(flags); + switch (chipset) { + case ZX1_CHIPSET: + xf86PreScanZX1(); + return; + default: + return; + } +#endif + } else /* if (flags == SCANPCI_TERM) */ { + + switch (chipset) { + case I460GX_CHIPSET: + xf86PostScan460GX(); + return; + case E8870_CHIPSET: + xf86PostScanE8870(); + return; + case ZX1_CHIPSET: + xf86PostScanZX1(); + return; + default: + return; + } + } +} diff --git a/hw/xfree86/os-support/shared/ia64Pci.h b/hw/xfree86/os-support/shared/ia64Pci.h new file mode 100644 index 000000000..1ee2fc091 --- /dev/null +++ b/hw/xfree86/os-support/shared/ia64Pci.h @@ -0,0 +1,41 @@ +/* + * Copyright 2004, Egbert Eich + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * EGBERT EICH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- + * NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Egbert Eich shall not + * be used in advertising or otherwise to promote the sale, use or other deal- + *ings in this Software without prior written authorization from Egbert Eich. + * + */ +#ifndef _IA64_PCI_H +# define _IA64_PCI_H + +#include "Pci.h" + +typedef enum { + NONE_CHIPSET, + I460GX_CHIPSET, + E8870_CHIPSET, + ZX1_CHIPSET +} IA64Chipset; + +# ifdef OS_PROBE_PCI_CHIPSET +extern IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags); +# endif +#endif diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c index 34f375f6c..59c08d85a 100644 --- a/hw/xfree86/os-support/shared/libc_wrapper.c +++ b/hw/xfree86/os-support/shared/libc_wrapper.c @@ -1884,7 +1884,8 @@ int xf86shmget(xf86key_t key, int size, int xf86shmflg) { int shmflg; - + int ret; + /* This copies the permissions (SHM_R, SHM_W for u, g, o). */ shmflg = xf86shmflg & 0777; @@ -1893,14 +1894,20 @@ xf86shmget(xf86key_t key, int size, int xf86shmflg) if (xf86shmflg & XF86IPC_CREAT) shmflg |= IPC_CREAT; if (xf86shmflg & XF86IPC_EXCL) shmflg |= IPC_EXCL; if (xf86shmflg & XF86IPC_NOWAIT) shmflg |= IPC_NOWAIT; - return shmget((key_t) key, size, shmflg); + ret = shmget((key_t) key, size, shmflg); + + if (ret == -1) + xf86errno = xf86GetErrno(); + + return ret; } char * xf86shmat(int id, char *addr, int xf86shmflg) { int shmflg = 0; - + pointer ret; + #ifdef SHM_RDONLY if (xf86shmflg & XF86SHM_RDONLY) shmflg |= SHM_RDONLY; #endif @@ -1911,13 +1918,25 @@ xf86shmat(int id, char *addr, int xf86shmflg) if (xf86shmflg & XF86SHM_REMAP) shmflg |= SHM_REMAP; #endif - return shmat(id,addr,shmflg); + ret = shmat(id,addr,shmflg); + + if (ret == (pointer) -1) + xf86errno = xf86GetErrno(); + + return ret; } int xf86shmdt(char *addr) { - return shmdt(addr); + int ret; + + ret = shmdt(addr); + + if (ret == -1) + xf86errno = xf86GetErrno(); + + return ret; } /* @@ -1927,7 +1946,8 @@ int xf86shmctl(int id, int xf86cmd, pointer buf) { int cmd; - + int ret; + switch (xf86cmd) { case XF86IPC_RMID: cmd = IPC_RMID; @@ -1936,32 +1956,44 @@ xf86shmctl(int id, int xf86cmd, pointer buf) return 0; } - return shmctl(id, cmd, buf); + ret = shmctl(id, cmd, buf); + + if (ret == -1) + xf86errno = xf86GetErrno(); + + return ret; } #else int xf86shmget(xf86key_t key, int size, int xf86shmflg) { - return -1; + xf86errno = ENOSYS; + return -1; } char * xf86shmat(int id, char *addr, int xf86shmflg) { + xf86errno = ENOSYS; + return (char *)-1; } int xf86shmctl(int id, int xf86cmd, pointer buf) { + xf86errno = ENOSYS; + return -1; } int xf86shmdt(char *addr) { + xf86errno = ENOSYS; + return -1; } #endif /* HAVE_SYSV_IPC */ diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index fbab2a517..7bcb93a0b 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -259,17 +259,25 @@ int xf86BlockSIGIO (void) { sigset_t set, old; - + int ret; + sigemptyset (&set); sigaddset (&set, SIGIO); sigprocmask (SIG_BLOCK, &set, &old); - return sigismember (&old, SIGIO); + ret = sigismember (&old, SIGIO); +#ifdef DEBUG + ErrorF("%i = xf86BlockSIGIO()\n",ret); +#endif + return ret; } void xf86UnblockSIGIO (int wasset) { sigset_t set; +#ifdef DEBUG + ErrorF("xf86UnblockSIGIO(%i)\n",wasset); +#endif if (!wasset) { diff --git a/hw/xfree86/os-support/shared/sigiostubs.c b/hw/xfree86/os-support/shared/sigiostubs.c index 51f98f2a4..5e08d4fbe 100644 --- a/hw/xfree86/os-support/shared/sigiostubs.c +++ b/hw/xfree86/os-support/shared/sigiostubs.c @@ -25,6 +25,7 @@ * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.2 2004/06/28 18:08:26 alanc Exp $ */ #ifdef XFree86Server #ifdef __UNIXOS2__ @@ -32,10 +33,8 @@ #endif # include "X.h" # include "xf86.h" -# include "xf86drm.h" # include "xf86Priv.h" # include "xf86_OSlib.h" -# include "xf86drm.h" #else # include <unistd.h> # include <signal.h> |