Add support for xserver on OpenBSD/sgi and enable build.

ok matthieu@
This commit is contained in:
jsing 2008-01-04 13:44:23 +00:00
parent 385bbc9fcb
commit 458c03da50
5 changed files with 137 additions and 3 deletions

View File

@ -1,12 +1,12 @@
# $OpenBSD: Makefile.bsd-wrapper,v 1.17 2007/05/27 05:56:03 matthieu Exp $ # $OpenBSD: Makefile.bsd-wrapper,v 1.18 2008/01/04 13:44:23 jsing Exp $
DIST= ${.CURDIR} DIST= ${.CURDIR}
# Machines for which we don't build the Xorg Xserver # Machines for which we don't build the Xorg Xserver
NO_XORG_MACHINES= aviion hppa hppa64 landisk \ NO_XORG_MACHINES= aviion hppa hppa64 landisk \
mvme68k mvme88k mvmeppc sgi solbourne vax mvme68k mvme88k mvmeppc solbourne vax
NO_XF86UTIL_MACHINES= hp300 landisk mac68k sparc vax NO_XF86UTIL_MACHINES= hp300 landisk mac68k sgi sparc vax
NO_XPRINT_MACHINES= landisk vax NO_XPRINT_MACHINES= landisk vax

View File

@ -320,6 +320,10 @@ case $host_cpu in
*freebsd*) DEFAULT_INT10=stub ;; *freebsd*) DEFAULT_INT10=stub ;;
esac esac
;; ;;
mips*)
SGI_VIDEO=yes
BSD_ARCH_SOURCES="sgi_video.c ioperm_noop.c"
;;
sparc*) sparc*)
xorg_loader_sparcmuldiv="yes" xorg_loader_sparcmuldiv="yes"
SPARC64_VIDEO=yes SPARC64_VIDEO=yes
@ -348,6 +352,7 @@ AM_CONDITIONAL(HP300_VIDEO, [test "x$HP300_VIDEO" = xyes])
AM_CONDITIONAL(HPPA_VIDEO, [test "x$HPPA_VIDEO" = xyes]) AM_CONDITIONAL(HPPA_VIDEO, [test "x$HPPA_VIDEO" = xyes])
AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes]) AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes])
AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes]) AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
AM_CONDITIONAL(SGI_VIDEO, [test "x$SGI_VIDEO" = xyes])
AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes]) AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
DRI=no DRI=no

View File

@ -59,6 +59,11 @@ ARCH_SOURCES = ppc_video.c \
$(srcdir)/../shared/ioperm_noop.c $(srcdir)/../shared/ioperm_noop.c
endif endif
if SGI_VIDEO
ARCH_SOURCES = sgi_video.c \
$(srcdir)/../shared/ioperm_noop.c
endif
if SPARC64_VIDEO if SPARC64_VIDEO
# Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO. # Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO.
ARCH_SOURCES = \ ARCH_SOURCES = \

View File

@ -0,0 +1,120 @@
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of Rich Murphey and David Wexelblat
* not be used in advertising or publicity pertaining to distribution of
* the software without specific, written prior permission. Rich Murphey and
* David Wexelblat make no representations about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <X11/X.h>
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "xf86OSpriv.h"
#ifndef MAP_FAILED
#define MAP_FAILED ((caddr_t)-1)
#endif
#define DEBUG 1
/***************************************************************************/
/* Video Memory Mapping section */
/***************************************************************************/
static pointer sgiMapVidMem(int, unsigned long, unsigned long, int);
static void sgiUnmapVidMem(int, pointer, unsigned long);
void
xf86OSInitVidMem(VidMemInfoPtr pVidMem)
{
pVidMem->linearSupported = TRUE;
pVidMem->mapMem = sgiMapVidMem;
pVidMem->unmapMem = sgiUnmapVidMem;
pVidMem->initialised = TRUE;
}
static pointer
sgiMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
int flags)
{
int fd = xf86Info.screenFd;
pointer base;
#ifdef DEBUG
xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
Base, Size, fd);
#endif
base = mmap(0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
MAP_SHARED, fd, Base);
if (base == MAP_FAILED)
FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
"xf86MapVidMem", Size, Base, strerror(errno));
return base;
}
static void
sgiUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
{
munmap(Base, Size);
}
_X_EXPORT int
xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
int Len)
{
return (0);
}
/***************************************************************************/
/* Interrupt Handling section */
/***************************************************************************/
_X_EXPORT Bool
xf86DisableInterrupts()
{
return(TRUE);
}
_X_EXPORT void
xf86EnableInterrupts()
{
return;
}
#ifdef X_PRIVSEP
/*
* Do all things that need root privileges early
* and revoke those privileges
*/
_X_EXPORT void
xf86PrivilegedInit(void)
{
xf86OpenConsole();
}
#endif

View File

@ -307,6 +307,10 @@
# define ARCH_PCI_INIT linuxPciInit # define ARCH_PCI_INIT linuxPciInit
# define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN # define INCLUDE_XF86_NO_DOMAIN
# elif defined(__OpenBSD__)
# define ARCH_PCI_INIT freebsdPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
# endif # endif
#elif defined(__powerpc__) || defined(__powerpc64__) #elif defined(__powerpc__) || defined(__powerpc64__)
# if defined(linux) # if defined(linux)