aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw')
-rw-r--r--xorg-server/hw/xfree86/common/compiler.h25
-rw-r--r--xorg-server/hw/xfree86/common/xf86Init.c4
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_axp.c86
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c73
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_video.c12
-rw-r--r--xorg-server/hw/xquartz/mach-startup/bundle-main.c36
-rw-r--r--xorg-server/hw/xquartz/mach-startup/stub.c1
7 files changed, 44 insertions, 193 deletions
diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h
index ae6a4615c..e35b04b9e 100644
--- a/xorg-server/hw/xfree86/common/compiler.h
+++ b/xorg-server/hw/xfree86/common/compiler.h
@@ -316,46 +316,47 @@ static __inline__ void stw_u(uint16_t val, uint16_t *p)
/* note that the appropriate setup via "ioperm" needs to be done */
/* *before* any inx/outx is done. */
-extern _X_EXPORT void (*_alpha_outb)(char val, unsigned long port);
+extern _X_EXPORT void _outb(unsigned char val, unsigned long port);
+extern _X_EXPORT void _outw(unsigned short val, unsigned long port);
+extern _X_EXPORT void _outl(unsigned int val, unsigned long port);
+extern _X_EXPORT unsigned int _inb(unsigned long port);
+extern _X_EXPORT unsigned int _inw(unsigned long port);
+extern _X_EXPORT unsigned int _inl(unsigned long port);
+
static __inline__ void
outb(unsigned long port, unsigned char val)
{
- _alpha_outb(val, port);
+ _outb(val, port);
}
-extern _X_EXPORT void (*_alpha_outw)(short val, unsigned long port);
static __inline__ void
outw(unsigned long port, unsigned short val)
{
- _alpha_outw(val, port);
+ _outw(val, port);
}
-extern _X_EXPORT void (*_alpha_outl)(int val, unsigned long port);
static __inline__ void
outl(unsigned long port, unsigned int val)
{
- _alpha_outl(val, port);
+ _outl(val, port);
}
-extern _X_EXPORT unsigned int (*_alpha_inb)(unsigned long port);
static __inline__ unsigned int
inb(unsigned long port)
{
- return _alpha_inb(port);
+ return _inb(port);
}
-extern _X_EXPORT unsigned int (*_alpha_inw)(unsigned long port);
static __inline__ unsigned int
inw(unsigned long port)
{
- return _alpha_inw(port);
+ return _inw(port);
}
-extern _X_EXPORT unsigned int (*_alpha_inl)(unsigned long port);
static __inline__ unsigned int
inl(unsigned long port)
{
- return _alpha_inl(port);
+ return _inl(port);
}
# endif /* linux */
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c
index 2d682aaa9..30f0c8559 100644
--- a/xorg-server/hw/xfree86/common/xf86Init.c
+++ b/xorg-server/hw/xfree86/common/xf86Init.c
@@ -1151,8 +1151,10 @@ OsVendorInit(void)
signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */
#endif
- if (!beenHere)
+ if (!beenHere) {
+ umask(022);
xf86LogInit();
+ }
/* Set stderr to non-blocking. */
#ifndef O_NONBLOCK
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c b/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c
index 10b97b0d6..10fd9e865 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c
@@ -4,10 +4,7 @@
#endif
#include <stdio.h>
-#include <X11/X.h>
-#include "os.h"
#include "xf86.h"
-#include "xf86Priv.h"
#include "shared/xf86Axp.h"
axpDevice lnxGetAXP(void);
@@ -102,86 +99,3 @@ lnxGetAXP(void)
count++;
} while (1);
}
-
-/*
- * pciconfig_iobase wrappers and dynamic i/o selection
- */
-#include "lnx.h"
-#include <unistd.h>
-#include <errno.h>
-
-/* glibc versions (single hose only) */
-extern void _outb(char val, unsigned long port);
-extern void _outw(short val, unsigned long port);
-extern void _outl(int val, unsigned long port);
-extern unsigned int _inb(unsigned long port);
-extern unsigned int _inw(unsigned long port);
-extern unsigned int _inl(unsigned long port);
-
-extern void _dense_outb(char, unsigned long);
-extern void _dense_outw(short, unsigned long);
-extern void _dense_outl(int, unsigned long);
-extern unsigned int _dense_inb(unsigned long);
-extern unsigned int _dense_inw(unsigned long);
-extern unsigned int _dense_inl(unsigned long);
-
-_X_EXPORT void (*_alpha_outb)(char, unsigned long) = _outb;
-_X_EXPORT void (*_alpha_outw)(short, unsigned long) = _outw;
-_X_EXPORT void (*_alpha_outl)(int, unsigned long) = _outl;
-_X_EXPORT unsigned int (*_alpha_inb)(unsigned long) = _inb;
-_X_EXPORT unsigned int (*_alpha_inw)(unsigned long) = _inw;
-_X_EXPORT unsigned int (*_alpha_inl)(unsigned long) = _inl;
-
-static long _alpha_iobase_query(unsigned, int, int, int);
-long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query;
-
-static long
-_alpha_iobase(unsigned flags, int hose, int bus, int devfn)
-{
- if (bus < 0) {
- bus = hose;
- flags |= IOBASE_FROM_HOSE;
- }
-
- return syscall(__NR_pciconfig_iobase, flags, bus, devfn);
-}
-
-static long
-_alpha_iobase_legacy(unsigned flags, int hose, int bus, int devfn)
-{
- if (hose > 0) return -ENODEV;
- if (flags & IOBASE_DENSE_MEM) return _bus_base();
- if (flags & IOBASE_SPARSE_MEM) return _bus_base_sparse();
- return 0;
-}
-
-static long
-_alpha_iobase_query(unsigned flags, int hose, int bus, int devfn)
-{
- /*
- * Only use iobase if the syscall is supported *and* it's
- * a dense io system
- */
- if (_alpha_iobase(IOBASE_DENSE_IO, 0, 0, 0) > 0) {
- /*
- * The syscall worked and it's a dense io system - take over the
- * io subsystem
- */
- _iobase = _alpha_iobase;
-
- /*
- * Only take over the inx/outx functions if this is a dense I/O
- * system *and* addressing domains are being used. The dense I/O
- * routines expect I/O to be mapped (as done in xf86MapLegacyIO)
- */
- _alpha_outb = _dense_outb;
- _alpha_outw = _dense_outw;
- _alpha_outl = _dense_outl;
- _alpha_inb = _dense_inb;
- _alpha_inw = _dense_inw;
- _alpha_inl = _dense_inl;
- } else _iobase = _alpha_iobase_legacy;
-
- return _iobase(flags, hose, bus, devfn);
-}
-
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c b/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c
index c65e1cca4..cb3460d29 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c
@@ -3,15 +3,8 @@
#include <xorg-config.h>
#endif
-#include <X11/X.h>
-#include "input.h"
-#include "scrnintstr.h"
-#include "compiler.h"
-
#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
+#include "compiler.h"
int readDense8(pointer Base, register unsigned long Offset);
int readDense16(pointer Base, register unsigned long Offset);
@@ -88,67 +81,3 @@ writeDense32(int Value, pointer Base, register unsigned long Offset)
write_mem_barrier();
*(volatile CARD32 *)((unsigned long)Base+(Offset)) = Value;
}
-
-
-
-void
-_dense_outb(char val, unsigned long port)
-{
- if ((port & ~0xffff) == 0) {
- _outb(val, port);
- } else {
- write_mem_barrier();
- *(volatile CARD8 *)port = val;
- }
-}
-
-void
-_dense_outw(short val, unsigned long port)
-{
- if ((port & ~0xffff) == 0) {
- _outw(val, port);
- } else {
- write_mem_barrier();
- *(volatile CARD16 *)port = val;
- }
-}
-
-void
-_dense_outl(int val, unsigned long port)
-{
- if ((port & ~0xffff) == 0) {
- _outl(val, port);
- } else {
- write_mem_barrier();
- *(volatile CARD32 *)port = val;
- }
-}
-
-unsigned int
-_dense_inb(unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _inb(port);
-
- mem_barrier();
- return *(volatile CARD8 *)port;
-}
-
-unsigned int
-_dense_inw(unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _inw(port);
-
- mem_barrier();
- return *(volatile CARD16 *)port;
-}
-
-unsigned int
-_dense_inl(unsigned long port)
-{
- if ((port & ~0xffff) == 0) return _inl(port);
-
- mem_barrier();
- return *(volatile CARD32 *)port;
-}
-
-
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
index e159f4691..26a17425a 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
@@ -73,15 +73,9 @@ extern int iopl(int __level);
#endif
#ifdef __alpha__
-
-extern void sethae(unsigned long hae);
-
# define BUS_BASE bus_base
-
#else
-
#define BUS_BASE (0)
-
#endif /* __alpha__ */
/***************************************************************************/
@@ -91,6 +85,10 @@ extern void sethae(unsigned long hae);
static pointer mapVidMem(int, unsigned long, unsigned long, int);
static void unmapVidMem(int, pointer, unsigned long);
#if defined (__alpha__)
+extern void sethae(unsigned long hae);
+extern unsigned long _bus_base __P ((void)) __attribute__ ((const));
+extern unsigned long _bus_base_sparse __P ((void)) __attribute__ ((const));
+
static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
extern axpDevice lnxGetAXP(void);
static void unmapVidMemSparse(int, pointer, unsigned long);
@@ -99,7 +97,6 @@ static Bool needSparse;
static unsigned long hae_thresh;
static unsigned long hae_mask;
static unsigned long bus_base;
-static unsigned long sparse_size;
#endif
#ifdef HAS_MTRR_SUPPORT
@@ -375,7 +372,6 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
if ((needSparse = (_bus_base_sparse() > 0))) {
hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
hae_mask = xf86AXPParams[axpSystem].hae_mask;
- sparse_size = xf86AXPParams[axpSystem].size;
}
bus_base = _bus_base();
}
diff --git a/xorg-server/hw/xquartz/mach-startup/bundle-main.c b/xorg-server/hw/xquartz/mach-startup/bundle-main.c
index 640a91f23..0366f3ba2 100644
--- a/xorg-server/hw/xquartz/mach-startup/bundle-main.c
+++ b/xorg-server/hw/xquartz/mach-startup/bundle-main.c
@@ -333,8 +333,10 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
/* If we didn't get handed a launchd DISPLAY socket, we should
* unset DISPLAY or we can run into problems with pbproxy
*/
- if(!launchd_socket_handed_off)
+ if(!launchd_socket_handed_off) {
+ fprintf(stderr, "X11.app: No launchd socket handed off, unsetting DISPLAY\n");
unsetenv("DISPLAY");
+ }
if(!_argv || !_envp) {
return KERN_FAILURE;
@@ -473,7 +475,7 @@ static void setup_env(void) {
server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1));
if(!server_bootstrap_name) {
- fprintf(stderr, "Memory allocation error.\n");
+ fprintf(stderr, "X11.app: Memory allocation error.\n");
exit(1);
}
strcpy(server_bootstrap_name, pds);
@@ -482,7 +484,7 @@ static void setup_env(void) {
len = strlen(server_bootstrap_name);
launchd_id_prefix = malloc(sizeof(char) * (len - 3));
if(!launchd_id_prefix) {
- fprintf(stderr, "Memory allocation error.\n");
+ fprintf(stderr, "X11.app: Memory allocation error.\n");
exit(1);
}
strlcpy(launchd_id_prefix, server_bootstrap_name, len - 3);
@@ -497,21 +499,27 @@ static void setup_env(void) {
}
if(s && *s) {
- temp = (char *)malloc(sizeof(char) * len);
- if(!temp) {
- fprintf(stderr, "Memory allocation error creating space for socket name test.\n");
- exit(1);
- }
- strlcpy(temp, launchd_id_prefix, len);
- strlcat(temp, ":0", len);
+ if(strcmp(launchd_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) {
+ fprintf(stderr, "X11.app: Detected old style launchd DISPLAY, please update xinit.\n");
+ } else {
+ temp = (char *)malloc(sizeof(char) * len);
+ if(!temp) {
+ fprintf(stderr, "X11.app: Memory allocation error creating space for socket name test.\n");
+ exit(1);
+ }
+ strlcpy(temp, launchd_id_prefix, len);
+ strlcat(temp, ":0", len);
- if(strcmp(temp, s) != 0) {
- /* If we don't have a match, unset it. */
- unsetenv("DISPLAY");
+ if(strcmp(temp, s) != 0) {
+ /* If we don't have a match, unset it. */
+ fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, launchd_id_prefix);
+ unsetenv("DISPLAY");
+ }
+ free(temp);
}
- free(temp);
} else {
/* The DISPLAY environment variable is not formatted like a launchd socket, so reset. */
+ fprintf(stderr, "X11.app: DISPLAY does not look like a launchd set variable, unsetting.\n");
unsetenv("DISPLAY");
}
}
diff --git a/xorg-server/hw/xquartz/mach-startup/stub.c b/xorg-server/hw/xquartz/mach-startup/stub.c
index 8f670353a..af1c59efb 100644
--- a/xorg-server/hw/xquartz/mach-startup/stub.c
+++ b/xorg-server/hw/xquartz/mach-startup/stub.c
@@ -232,6 +232,7 @@ int main(int argc, char **argv, char **envp) {
kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
if(kr != KERN_SUCCESS) {
+ fprintf(stderr, "Xquartz: Unable to locate waiting server: %s\n", server_bootstrap_name);
pid_t child;
set_x11_path();