aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/os-support/shared
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/os-support/shared')
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c6
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c6
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/agp_noop.c20
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/bios_devmem.c2
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/bios_mmap.c8
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/ia64Pci.c12
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c4
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/kmod_noop.c2
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/posix_tty.c47
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/sigio.c56
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/sigiostubs.c8
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/vidmem.c12
12 files changed, 102 insertions, 81 deletions
diff --git a/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c b/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c
index a3cfe40b9..78cbe0e34 100644
--- a/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c
+++ b/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c
@@ -36,19 +36,19 @@
*/
Bool
-xf86VTSwitchPending()
+xf86VTSwitchPending(void)
{
return(FALSE);
}
Bool
-xf86VTSwitchAway()
+xf86VTSwitchAway(void)
{
return(FALSE);
}
Bool
-xf86VTSwitchTo()
+xf86VTSwitchTo(void)
{
return(TRUE);
}
diff --git a/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c b/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c
index 4d473147f..9308640e2 100644
--- a/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c
+++ b/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c
@@ -53,13 +53,13 @@ xf86VTRequest(int sig)
}
Bool
-xf86VTSwitchPending()
+xf86VTSwitchPending(void)
{
return(xf86Info.vtRequestsPending ? TRUE : FALSE);
}
Bool
-xf86VTSwitchAway()
+xf86VTSwitchAway(void)
{
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
@@ -76,7 +76,7 @@ xf86VTSwitchAway()
}
Bool
-xf86VTSwitchTo()
+xf86VTSwitchTo(void)
{
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
diff --git a/xorg-server/hw/xfree86/os-support/shared/agp_noop.c b/xorg-server/hw/xfree86/os-support/shared/agp_noop.c
index 5774bc231..eda466a52 100644
--- a/xorg-server/hw/xfree86/os-support/shared/agp_noop.c
+++ b/xorg-server/hw/xfree86/os-support/shared/agp_noop.c
@@ -40,63 +40,63 @@
#include "xf86_OSlib.h"
#include "xf86OSpriv.h"
-_X_EXPORT Bool
+Bool
xf86GARTCloseScreen(int screenNum)
{
return FALSE;
}
-_X_EXPORT Bool
+Bool
xf86AgpGARTSupported()
{
return FALSE;
}
-_X_EXPORT AgpInfoPtr
+AgpInfoPtr
xf86GetAGPInfo(int screenNum)
{
return NULL;
}
-_X_EXPORT Bool
+Bool
xf86AcquireGART(int screenNum)
{
return FALSE;
}
-_X_EXPORT Bool
+Bool
xf86ReleaseGART(int screenNum)
{
return FALSE;
}
-_X_EXPORT int
+int
xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
unsigned long *physical)
{
return -1;
}
-_X_EXPORT Bool
+Bool
xf86DeallocateGARTMemory(int screenNum, int key)
{
return FALSE;
}
-_X_EXPORT Bool
+Bool
xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
{
return FALSE;
}
-_X_EXPORT Bool
+Bool
xf86UnbindGARTMemory(int screenNum, int key)
{
return FALSE;
}
-_X_EXPORT Bool
+Bool
xf86EnableAGP(int screenNum, CARD32 mode)
{
return FALSE;
diff --git a/xorg-server/hw/xfree86/os-support/shared/bios_devmem.c b/xorg-server/hw/xfree86/os-support/shared/bios_devmem.c
index 7288239be..67a14f5d6 100644
--- a/xorg-server/hw/xfree86/os-support/shared/bios_devmem.c
+++ b/xorg-server/hw/xfree86/os-support/shared/bios_devmem.c
@@ -39,7 +39,7 @@
# define DEV_MEM "/dev/mem"
#endif
-_X_EXPORT int
+int
xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
int Len)
{
diff --git a/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c b/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c
index 0c368e713..a615a1d45 100644
--- a/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c
@@ -40,7 +40,7 @@
*/
#ifndef __alpha__
-_X_EXPORT int
+int
xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
int Len)
{
@@ -68,10 +68,8 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
close(fd);
return(-1);
}
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ DebugF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
Base, ptr[0] | (ptr[1] << 8));
-#endif
(void)memcpy(Buf, (void *)(ptr + Offset), Len);
(void)munmap((caddr_t)ptr, mlen);
(void)close(fd);
@@ -133,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
return(-1);
}
- xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
+ xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len);
munmap((caddr_t)base, mlen);
close(fd);
diff --git a/xorg-server/hw/xfree86/os-support/shared/ia64Pci.c b/xorg-server/hw/xfree86/os-support/shared/ia64Pci.c
index 6f6924b59..c93c74c4a 100644
--- a/xorg-server/hw/xfree86/os-support/shared/ia64Pci.c
+++ b/xorg-server/hw/xfree86/os-support/shared/ia64Pci.c
@@ -60,7 +60,7 @@ static int ia64_port_to_fd(unsigned long port)
return (port >> 24) & 0xffffffff;
}
-_X_EXPORT void outb(unsigned long port, unsigned char val)
+void outb(unsigned long port, unsigned char val)
{
int fd = ia64_port_to_fd(port);
@@ -80,7 +80,7 @@ _X_EXPORT void outb(unsigned long port, unsigned char val)
return;
}
-_X_EXPORT void outw(unsigned long port, unsigned short val)
+void outw(unsigned long port, unsigned short val)
{
int fd = ia64_port_to_fd(port);
@@ -100,7 +100,7 @@ _X_EXPORT void outw(unsigned long port, unsigned short val)
return;
}
-_X_EXPORT void outl(unsigned long port, unsigned int val)
+void outl(unsigned long port, unsigned int val)
{
int fd = ia64_port_to_fd(port);
@@ -120,7 +120,7 @@ _X_EXPORT void outl(unsigned long port, unsigned int val)
return;
}
-_X_EXPORT unsigned int inb(unsigned long port)
+unsigned int inb(unsigned long port)
{
int fd = ia64_port_to_fd(port);
unsigned char val;
@@ -142,7 +142,7 @@ _X_EXPORT unsigned int inb(unsigned long port)
return val;
}
-_X_EXPORT unsigned int inw(unsigned long port)
+unsigned int inw(unsigned long port)
{
int fd = ia64_port_to_fd(port);
unsigned short val;
@@ -164,7 +164,7 @@ _X_EXPORT unsigned int inw(unsigned long port)
return val;
}
-_X_EXPORT unsigned int inl(unsigned long port)
+unsigned int inl(unsigned long port)
{
int fd = ia64_port_to_fd(port);
unsigned int val;
diff --git a/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c b/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c
index 1d7851a5b..805caccac 100644
--- a/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c
+++ b/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c
@@ -35,13 +35,13 @@
#include "xf86Priv.h"
#include "xf86_OSlib.h"
-_X_EXPORT Bool
+Bool
xf86EnableIO()
{
return TRUE;
}
-_X_EXPORT void
+void
xf86DisableIO()
{
return;
diff --git a/xorg-server/hw/xfree86/os-support/shared/kmod_noop.c b/xorg-server/hw/xfree86/os-support/shared/kmod_noop.c
index 6525e8414..e86d7472f 100644
--- a/xorg-server/hw/xfree86/os-support/shared/kmod_noop.c
+++ b/xorg-server/hw/xfree86/os-support/shared/kmod_noop.c
@@ -31,7 +31,7 @@
#include "xf86_OSproc.h"
-_X_EXPORT int xf86LoadKernelModule(const char *pathname)
+int xf86LoadKernelModule(const char *pathname)
{
(void) pathname;
return 0; /* failure */
diff --git a/xorg-server/hw/xfree86/os-support/shared/posix_tty.c b/xorg-server/hw/xfree86/os-support/shared/posix_tty.c
index 316526bdc..bf1bb03a3 100644
--- a/xorg-server/hw/xfree86/os-support/shared/posix_tty.c
+++ b/xorg-server/hw/xfree86/os-support/shared/posix_tty.c
@@ -111,7 +111,7 @@ GetBaud (int baudrate)
return (0);
}
-_X_EXPORT int
+int
xf86OpenSerial (pointer options)
{
struct termios t;
@@ -194,7 +194,7 @@ xf86OpenSerial (pointer options)
return (fd);
}
-_X_EXPORT int
+int
xf86SetSerial (int fd, pointer options)
{
struct termios t;
@@ -365,7 +365,7 @@ xf86SetSerial (int fd, pointer options)
return (r);
}
-_X_EXPORT int
+int
xf86SetSerialSpeed (int fd, int speed)
{
struct termios t;
@@ -396,41 +396,36 @@ xf86SetSerialSpeed (int fd, int speed)
return (r);
}
-_X_EXPORT int
+int
xf86ReadSerial (int fd, void *buf, int count)
{
int r;
-#ifdef DEBUG
int i;
-#endif
+
SYSCALL (r = read (fd, buf, count));
-#ifdef DEBUG
- ErrorF("ReadingSerial: 0x%x",
+ DebugF("ReadingSerial: 0x%x",
(unsigned char)*(((unsigned char *)buf)));
for (i = 1; i < r; i++)
- ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
- ErrorF("\n");
-#endif
+ DebugF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
+ DebugF("\n");
return (r);
}
-_X_EXPORT int
+int
xf86WriteSerial (int fd, const void *buf, int count)
{
int r;
-#ifdef DEBUG
int i;
- ErrorF("WritingSerial: 0x%x",(unsigned char)*(((unsigned char *)buf)));
+ DebugF("WritingSerial: 0x%x",(unsigned char)*(((unsigned char *)buf)));
for (i = 1; i < count; i++)
ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
- ErrorF("\n");
-#endif
+ DebugF("\n");
SYSCALL (r = write (fd, buf, count));
return (r);
}
-_X_EXPORT int
+int
xf86CloseSerial (int fd)
{
int r;
@@ -439,7 +434,7 @@ xf86CloseSerial (int fd)
return (r);
}
-_X_EXPORT int
+int
xf86WaitForInput (int fd, int timeout)
{
fd_set readfds;
@@ -465,7 +460,7 @@ xf86WaitForInput (int fd, int timeout)
return (r);
}
-_X_EXPORT int
+int
xf86SerialSendBreak (int fd, int duration)
{
int r;
@@ -475,16 +470,14 @@ xf86SerialSendBreak (int fd, int duration)
}
-_X_EXPORT int
+int
xf86FlushInput(int fd)
{
fd_set fds;
struct timeval timeout;
char c[4];
-#ifdef DEBUG
- ErrorF("FlushingSerial\n");
-#endif
+ DebugF("FlushingSerial\n");
if (tcflush(fd, TCIFLUSH) == 0)
return 0;
@@ -576,7 +569,7 @@ getOsStateMask(void)
static int osStateMask = 0;
-_X_EXPORT int
+int
xf86SetSerialModemState(int fd, int state)
{
int ret;
@@ -609,7 +602,7 @@ xf86SetSerialModemState(int fd, int state)
#endif
}
-_X_EXPORT int
+int
xf86GetSerialModemState(int fd)
{
int ret;
@@ -632,7 +625,7 @@ xf86GetSerialModemState(int fd)
#endif
}
-_X_EXPORT int
+int
xf86SerialModemSetBits(int fd, int bits)
{
int ret;
@@ -654,7 +647,7 @@ xf86SerialModemSetBits(int fd, int bits)
#endif
}
-_X_EXPORT int
+int
xf86SerialModemClearBits(int fd, int bits)
{
int ret;
diff --git a/xorg-server/hw/xfree86/os-support/shared/sigio.c b/xorg-server/hw/xfree86/os-support/shared/sigio.c
index 92bdd2988..44136ccfb 100644
--- a/xorg-server/hw/xfree86/os-support/shared/sigio.c
+++ b/xorg-server/hw/xfree86/os-support/shared/sigio.c
@@ -63,6 +63,10 @@
# include "xf86_OSlib.h"
# include "inputstr.h"
+#ifdef HAVE_STROPTS_H
+# include <stropts.h>
+#endif
+
/*
* Linux libc5 defines FASYNC, but not O_ASYNC. Don't know if it is
* functional or not.
@@ -71,11 +75,11 @@
# define O_ASYNC FASYNC
#endif
-#ifdef MAX_DEVICES
-/* MAX_DEVICES represents the maximimum number of input devices usable
+#ifdef MAXDEVICES
+/* MAXDEVICES represents the maximimum number of input devices usable
* at the same time plus one entry for DRM support.
*/
-# define MAX_FUNCS (MAX_DEVICES + 1)
+# define MAX_FUNCS (MAXDEVICES + 1)
#else
# define MAX_FUNCS 16
#endif
@@ -132,13 +136,14 @@ xf86IsPipe (int fd)
return S_ISFIFO(buf.st_mode);
}
-_X_EXPORT int
+int
xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
{
struct sigaction sa;
struct sigaction osa;
int i;
int blocked;
+ int installed = FALSE;
for (i = 0; i < MAX_FUNCS; i++)
{
@@ -147,15 +152,30 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
if (xf86IsPipe (fd))
return 0;
blocked = xf86BlockSIGIO();
+#ifdef O_ASYNC
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
- xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
+ xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
fd, strerror(errno));
- xf86UnblockSIGIO(blocked);
- return 0;
+ } else {
+ if (fcntl(fd, F_SETOWN, getpid()) == -1) {
+ xf86Msg(X_WARNING, "fcntl(%d, F_SETOWN): %s\n",
+ fd, strerror(errno));
+ } else {
+ installed = TRUE;
+ }
}
- if (fcntl(fd, F_SETOWN, getpid()) == -1) {
- xf86Msg(X_WARNING, "fcntl(%d, F_SETOWN): %s\n",
- fd, strerror(errno));
+#endif
+#ifdef I_SETSIG /* System V Streams - used on Solaris for input devices */
+ if (!installed && isastream(fd)) {
+ if (ioctl(fd, I_SETSIG, S_INPUT | S_ERROR | S_HANGUP) == -1) {
+ xf86Msg(X_WARNING, "fcntl(%d, I_SETSIG): %s\n",
+ fd, strerror(errno));
+ } else {
+ installed = TRUE;
+ }
+ }
+#endif
+ if (!installed) {
xf86UnblockSIGIO(blocked);
return 0;
}
@@ -186,7 +206,7 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
return 0;
}
-_X_EXPORT int
+int
xf86RemoveSIGIOHandler(int fd)
{
struct sigaction sa;
@@ -221,7 +241,17 @@ xf86RemoveSIGIOHandler(int fd)
}
if (ret)
{
+#ifdef O_ASYNC
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_ASYNC);
+#endif
+#ifdef I_SETSIG
+ if (isastream(fd)) {
+ if (ioctl(fd, I_SETSIG, 0) == -1) {
+ xf86Msg(X_WARNING, "fcntl(%d, I_SETSIG, 0): %s\n",
+ fd, strerror(errno));
+ }
+ }
+#endif
xf86SigIOMax = max;
xf86SigIOMaxFd = maxfd;
if (!max)
@@ -236,7 +266,7 @@ xf86RemoveSIGIOHandler(int fd)
return ret;
}
-_X_EXPORT int
+int
xf86BlockSIGIO (void)
{
sigset_t set, old;
@@ -249,7 +279,7 @@ xf86BlockSIGIO (void)
return ret;
}
-_X_EXPORT void
+void
xf86UnblockSIGIO (int wasset)
{
sigset_t set;
diff --git a/xorg-server/hw/xfree86/os-support/shared/sigiostubs.c b/xorg-server/hw/xfree86/os-support/shared/sigiostubs.c
index 7113968c6..cecec37f7 100644
--- a/xorg-server/hw/xfree86/os-support/shared/sigiostubs.c
+++ b/xorg-server/hw/xfree86/os-support/shared/sigiostubs.c
@@ -34,25 +34,25 @@
# include "xf86Priv.h"
# include "xf86_OSlib.h"
-_X_EXPORT int
+int
xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
{
return 0;
}
-_X_EXPORT int
+int
xf86RemoveSIGIOHandler(int fd)
{
return 0;
}
-_X_EXPORT int
+int
xf86BlockSIGIO (void)
{
return 0;
}
-_X_EXPORT void
+void
xf86UnblockSIGIO (int wasset)
{
}
diff --git a/xorg-server/hw/xfree86/os-support/shared/vidmem.c b/xorg-server/hw/xfree86/os-support/shared/vidmem.c
index 0b4411604..803ce09bd 100644
--- a/xorg-server/hw/xfree86/os-support/shared/vidmem.c
+++ b/xorg-server/hw/xfree86/os-support/shared/vidmem.c
@@ -184,7 +184,7 @@ xf86InitVidMem(void)
}
}
-_X_EXPORT pointer
+pointer
xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
{
pointer vbase = NULL;
@@ -230,7 +230,7 @@ xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
return vbase;
}
-_X_EXPORT void
+void
xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
{
VidMapPtr vp;
@@ -257,7 +257,7 @@ xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
removeMapping(vp, mp);
}
-_X_EXPORT Bool
+Bool
xf86CheckMTRR(int ScreenNum)
{
VidMapPtr vp = getVidMapRec(ScreenNum);
@@ -274,14 +274,14 @@ xf86CheckMTRR(int ScreenNum)
return FALSE;
}
-_X_EXPORT Bool
-xf86LinearVidMem()
+Bool
+xf86LinearVidMem(void)
{
xf86InitVidMem();
return vidMemInfo.linearSupported;
}
-_X_EXPORT void
+void
xf86MapReadSideEffects(int ScreenNum, int Flags, pointer base,
unsigned long Size)
{