aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/os-support/solaris
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/os-support/solaris')
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/Makefile.am37
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/Makefile.in818
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/agpgart.h108
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar806
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S73
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S73
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S144
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_agp.c338
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_apm.c232
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_bell.c185
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_bios.c103
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_init.c357
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_mouse.c717
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_vid.c236
14 files changed, 4227 insertions, 0 deletions
diff --git a/xorg-server/hw/xfree86/os-support/solaris/Makefile.am b/xorg-server/hw/xfree86/os-support/solaris/Makefile.am
new file mode 100644
index 000000000..68f6b4cd0
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/Makefile.am
@@ -0,0 +1,37 @@
+if SOLARIS_USL_CONSOLE
+VTSW_SRC = $(srcdir)/../shared/VTsw_usl.c
+else
+VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c
+endif
+
+# TODO: Don't build agpgart on SPARC
+#if defined(i386Architecture) || defined(AMD64Architecture)
+AGP_SRC = sun_agp.c
+#else
+#AGP_SRC = $(srcdir)/../shared/agp_noop.c
+#endif
+
+SOLARIS_INOUT_SRC = solaris-@SOLARIS_INOUT_ARCH@.S
+DISTCLEANFILES = solaris-@SOLARIS_INOUT_ARCH@.il
+
+solaris-@SOLARIS_INOUT_ARCH@.il: solaris-@SOLARIS_INOUT_ARCH@.S
+ $(CPP) -P -DINLINE_ASM solaris-@SOLARIS_INOUT_ARCH@.S > $@
+
+noinst_LTLIBRARIES = libsolaris.la
+libsolaris_la_SOURCES = sun_bios.c sun_init.c \
+ sun_mouse.c sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c \
+ $(srcdir)/../shared/kmod_noop.c \
+ $(srcdir)/../shared/posix_tty.c $(srcdir)/../shared/sigiostubs.c \
+ $(srcdir)/../shared/stdResource.c \
+ $(VTSW_SRC)
+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) $(DIX_CFLAGS)
+
+INCLUDES = $(XORG_INCS)
+
+EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \
+ apSolaris.shar sun_inout.s
diff --git a/xorg-server/hw/xfree86/os-support/solaris/Makefile.in b/xorg-server/hw/xfree86/os-support/solaris/Makefile.in
new file mode 100644
index 000000000..cf4e440c8
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/Makefile.in
@@ -0,0 +1,818 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = hw/xfree86/os-support/solaris
+DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xgl-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libsolaris_la_LIBADD =
+am__libsolaris_la_SOURCES_DIST = sun_bios.c sun_init.c sun_mouse.c \
+ sun_vid.c sun_bell.c sun_agp.c sun_apm.c \
+ $(srcdir)/../shared/kmod_noop.c \
+ $(srcdir)/../shared/posix_tty.c \
+ $(srcdir)/../shared/sigiostubs.c \
+ $(srcdir)/../shared/stdResource.c \
+ $(srcdir)/../shared/VTsw_noop.c $(srcdir)/../shared/VTsw_usl.c
+am__objects_1 = sun_agp.lo
+@SOLARIS_USL_CONSOLE_FALSE@am__objects_2 = VTsw_noop.lo
+@SOLARIS_USL_CONSOLE_TRUE@am__objects_2 = VTsw_usl.lo
+am_libsolaris_la_OBJECTS = sun_bios.lo sun_init.lo sun_mouse.lo \
+ sun_vid.lo sun_bell.lo $(am__objects_1) sun_apm.lo \
+ kmod_noop.lo posix_tty.lo sigiostubs.lo stdResource.lo \
+ $(am__objects_2)
+am__objects_3 = solaris-@SOLARIS_INOUT_ARCH@.lo
+nodist_libsolaris_la_OBJECTS = $(am__objects_3)
+libsolaris_la_OBJECTS = $(am_libsolaris_la_OBJECTS) \
+ $(nodist_libsolaris_la_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libsolaris_la_SOURCES) $(nodist_libsolaris_la_SOURCES)
+DIST_SOURCES = $(am__libsolaris_la_SOURCES_DIST)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(sdkdir)" "$(DESTDIR)$(sdkdir)"
+nodist_sdkHEADERS_INSTALL = $(INSTALL_HEADER)
+sdkHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(nodist_sdk_HEADERS) $(sdk_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+APPDEFAULTDIR = @APPDEFAULTDIR@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LAUNCHD = @LAUNCHD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MESA_SOURCE = @MESA_SOURCE@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+MKFONTDIR = @MKFONTDIR@
+MKFONTSCALE = @MKFONTSCALE@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJCFLAGS = @OBJCFLAGS@
+OBJCLINK = @OBJCLINK@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = @SED@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
+VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
+VENDOR_NAME = @VENDOR_NAME@
+VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
+VENDOR_RELEASE = @VENDOR_RELEASE@
+VERSION = @VERSION@
+X11APP_ARCHS = @X11APP_ARCHS@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
+XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
+XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
+XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86MISC_CFLAGS = @XF86MISC_CFLAGS@
+XF86MISC_LIBS = @XF86MISC_LIBS@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
+XGLMODULES_LIBS = @XGLMODULES_LIBS@
+XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
+XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
+XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
+XGL_LIBS = @XGL_LIBS@
+XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
+XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
+XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
+XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
+XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
+XORG_OS = @XORG_OS@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
+XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
+XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
+XPRINT_CFLAGS = @XPRINT_CFLAGS@
+XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+ft_config = @ft_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xglmoduledir = @xglmoduledir@
+xpconfigdir = @xpconfigdir@
+@SOLARIS_USL_CONSOLE_FALSE@VTSW_SRC = $(srcdir)/../shared/VTsw_noop.c
+@SOLARIS_USL_CONSOLE_TRUE@VTSW_SRC = $(srcdir)/../shared/VTsw_usl.c
+
+# TODO: Don't build agpgart on SPARC
+#if defined(i386Architecture) || defined(AMD64Architecture)
+AGP_SRC = sun_agp.c
+#else
+#AGP_SRC = $(srcdir)/../shared/agp_noop.c
+#endif
+SOLARIS_INOUT_SRC = solaris-@SOLARIS_INOUT_ARCH@.S
+DISTCLEANFILES = solaris-@SOLARIS_INOUT_ARCH@.il
+noinst_LTLIBRARIES = libsolaris.la
+libsolaris_la_SOURCES = sun_bios.c sun_init.c \
+ sun_mouse.c sun_vid.c sun_bell.c $(AGP_SRC) sun_apm.c \
+ $(srcdir)/../shared/kmod_noop.c \
+ $(srcdir)/../shared/posix_tty.c $(srcdir)/../shared/sigiostubs.c \
+ $(srcdir)/../shared/stdResource.c \
+ $(VTSW_SRC)
+
+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) $(DIX_CFLAGS)
+INCLUDES = $(XORG_INCS)
+EXTRA_DIST = solaris-amd64.S solaris-ia32.S solaris-sparcv8plus.S \
+ apSolaris.shar sun_inout.s
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/os-support/solaris/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign hw/xfree86/os-support/solaris/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libsolaris.la: $(libsolaris_la_OBJECTS) $(libsolaris_la_DEPENDENCIES)
+ $(LINK) $(libsolaris_la_OBJECTS) $(libsolaris_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_noop.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VTsw_usl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kmod_noop.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix_tty.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigiostubs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solaris-@SOLARIS_INOUT_ARCH@.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdResource.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_agp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_apm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_bell.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_bios.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_init.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_mouse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_vid.Plo@am__quote@
+
+.S.o:
+@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCCAS_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ $<
+
+.S.obj:
+@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCCAS_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.S.lo:
+@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCCAS_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCCAS_FALSE@ $(LTCPPASCOMPILE) -c -o $@ $<
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+kmod_noop.lo: $(srcdir)/../shared/kmod_noop.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kmod_noop.lo -MD -MP -MF $(DEPDIR)/kmod_noop.Tpo -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/kmod_noop.Tpo $(DEPDIR)/kmod_noop.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../shared/kmod_noop.c' object='kmod_noop.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kmod_noop.lo `test -f '$(srcdir)/../shared/kmod_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/kmod_noop.c
+
+posix_tty.lo: $(srcdir)/../shared/posix_tty.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT posix_tty.lo -MD -MP -MF $(DEPDIR)/posix_tty.Tpo -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/posix_tty.Tpo $(DEPDIR)/posix_tty.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../shared/posix_tty.c' object='posix_tty.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o posix_tty.lo `test -f '$(srcdir)/../shared/posix_tty.c' || echo '$(srcdir)/'`$(srcdir)/../shared/posix_tty.c
+
+sigiostubs.lo: $(srcdir)/../shared/sigiostubs.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sigiostubs.lo -MD -MP -MF $(DEPDIR)/sigiostubs.Tpo -c -o sigiostubs.lo `test -f '$(srcdir)/../shared/sigiostubs.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigiostubs.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sigiostubs.Tpo $(DEPDIR)/sigiostubs.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../shared/sigiostubs.c' object='sigiostubs.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sigiostubs.lo `test -f '$(srcdir)/../shared/sigiostubs.c' || echo '$(srcdir)/'`$(srcdir)/../shared/sigiostubs.c
+
+stdResource.lo: $(srcdir)/../shared/stdResource.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdResource.lo -MD -MP -MF $(DEPDIR)/stdResource.Tpo -c -o stdResource.lo `test -f '$(srcdir)/../shared/stdResource.c' || echo '$(srcdir)/'`$(srcdir)/../shared/stdResource.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/stdResource.Tpo $(DEPDIR)/stdResource.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../shared/stdResource.c' object='stdResource.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdResource.lo `test -f '$(srcdir)/../shared/stdResource.c' || echo '$(srcdir)/'`$(srcdir)/../shared/stdResource.c
+
+VTsw_noop.lo: $(srcdir)/../shared/VTsw_noop.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT VTsw_noop.lo -MD -MP -MF $(DEPDIR)/VTsw_noop.Tpo -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/VTsw_noop.Tpo $(DEPDIR)/VTsw_noop.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../shared/VTsw_noop.c' object='VTsw_noop.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o VTsw_noop.lo `test -f '$(srcdir)/../shared/VTsw_noop.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_noop.c
+
+VTsw_usl.lo: $(srcdir)/../shared/VTsw_usl.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT VTsw_usl.lo -MD -MP -MF $(DEPDIR)/VTsw_usl.Tpo -c -o VTsw_usl.lo `test -f '$(srcdir)/../shared/VTsw_usl.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_usl.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/VTsw_usl.Tpo $(DEPDIR)/VTsw_usl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../shared/VTsw_usl.c' object='VTsw_usl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o VTsw_usl.lo `test -f '$(srcdir)/../shared/VTsw_usl.c' || echo '$(srcdir)/'`$(srcdir)/../shared/VTsw_usl.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-nodist_sdkHEADERS: $(nodist_sdk_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sdkdir)" || $(MKDIR_P) "$(DESTDIR)$(sdkdir)"
+ @list='$(nodist_sdk_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(nodist_sdkHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(sdkdir)/$$f'"; \
+ $(nodist_sdkHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(sdkdir)/$$f"; \
+ done
+
+uninstall-nodist_sdkHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_sdk_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(sdkdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sdkdir)/$$f"; \
+ done
+install-sdkHEADERS: $(sdk_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sdkdir)" || $(MKDIR_P) "$(DESTDIR)$(sdkdir)"
+ @list='$(sdk_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(sdkHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(sdkdir)/$$f'"; \
+ $(sdkHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(sdkdir)/$$f"; \
+ done
+
+uninstall-sdkHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sdk_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(sdkdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sdkdir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(sdkdir)" "$(DESTDIR)$(sdkdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-nodist_sdkHEADERS install-sdkHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-nodist_sdkHEADERS uninstall-sdkHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-nodist_sdkHEADERS install-pdf install-pdf-am \
+ install-ps install-ps-am install-sdkHEADERS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-nodist_sdkHEADERS \
+ uninstall-sdkHEADERS
+
+
+solaris-@SOLARIS_INOUT_ARCH@.il: solaris-@SOLARIS_INOUT_ARCH@.S
+ $(CPP) -P -DINLINE_ASM solaris-@SOLARIS_INOUT_ARCH@.S > $@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/hw/xfree86/os-support/solaris/agpgart.h b/xorg-server/hw/xfree86/os-support/solaris/agpgart.h
new file mode 100644
index 000000000..566de8046
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/agpgart.h
@@ -0,0 +1,108 @@
+/*
+ * AGPGART module version 0.99
+ * Copyright (C) 1999 Jeff Hartmann
+ * Copyright (C) 1999 Precision Insight, Inc.
+ * Copyright (C) 1999 Xi Graphics, Inc.
+ *
+ * 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
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS 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.
+ */
+/*
+ * Copyright 2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#ifndef _AGPGART_H
+#define _AGPGART_H
+
+#pragma ident "@(#)agpgart.h 1.1 05/04/04 SMI"
+
+typedef struct _agp_version {
+ uint16_t agpv_major;
+ uint16_t agpv_minor;
+} agp_version_t;
+
+typedef struct _agp_info {
+ agp_version_t agpi_version;
+ uint32_t agpi_devid; /* bridge vendor + device */
+ uint32_t agpi_mode; /* mode of bridge */
+ ulong_t agpi_aperbase; /* base of aperture */
+ size_t agpi_apersize; /* aperture range size */
+ uint32_t agpi_pgtotal; /* max number of pages in aperture */
+ uint32_t agpi_pgsystem; /* same as pg_total */
+ uint32_t agpi_pgused; /* NUMBER of currently used pages */
+} agp_info_t;
+
+typedef struct _agp_setup {
+ uint32_t agps_mode;
+} agp_setup_t;
+
+typedef struct _agp_allocate {
+ int32_t agpa_key;
+ uint32_t agpa_pgcount;
+ uint32_t agpa_type;
+ uint32_t agpa_physical; /* for i810/830 driver */
+} agp_allocate_t;
+
+typedef struct _agp_bind {
+ int32_t agpb_key;
+ uint32_t agpb_pgstart;
+} agp_bind_t;
+
+typedef struct _agp_unbind {
+ int32_t agpu_key;
+ uint32_t agpu_pri; /* no use in solaris */
+} agp_unbind_t;
+
+#define AGPIOC_BASE 'G'
+#define AGPIOC_INFO _IOR(AGPIOC_BASE, 0, 100)
+#define AGPIOC_ACQUIRE _IO(AGPIOC_BASE, 1)
+#define AGPIOC_RELEASE _IO(AGPIOC_BASE, 2)
+#define AGPIOC_SETUP _IOW(AGPIOC_BASE, 3, agp_setup_t)
+#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 4, agp_allocate_t)
+#define AGPIOC_DEALLOCATE _IOW(AGPIOC_BASE, 5, int)
+#define AGPIOC_BIND _IOW(AGPIOC_BASE, 6, agp_bind_t)
+#define AGPIOC_UNBIND _IOW(AGPIOC_BASE, 7, agp_unbind_t)
+
+#define AGP_DEVICE "/dev/agpgart"
+
+#endif /* _AGPGART_H */
diff --git a/xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar b/xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar
new file mode 100644
index 000000000..a3548f7b4
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/apSolaris.shar
@@ -0,0 +1,806 @@
+#!/bin/sh
+#
+# This is a shell archive. Save it in a file, remove anything before
+# this line, and then unpack it by entering "sh file". Note, it may
+# create directories; files and directories will be owned by you and
+# have default permissions.
+# Made on Sun Jun 25 20:24:59 CEST 2006 by Martin Bochnig at martux.org
+#
+# This archive contains:
+#
+# ./aperture
+#
+# ./aperture/Makefile
+# ./aperture/Makefile.amd64
+# ./aperture/Makefile.sparcv9
+# ./aperture/README
+# ./aperture/aperture.c
+# ./aperture/aperture.conf
+# ./aperture/devlink.tab
+#
+echo c - ./aperture
+mkdir -p ./aperture > /dev/null 2>&1
+#
+echo x - ./aperture/Makefile
+sed 's/^X//' >./aperture/Makefile << 'END-of-./aperture/Makefile'
+X#
+X# File: makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X#
+X# >>NOTE<< Have a look at Makefile.sparcv9 for specifics.
+X#
+X# Modified: Martin Bochnig (martin@martux.org)
+X# Date: 2006.06.24
+X# - Slightly modified to also build on Solaris 10 and 11.
+X# - amd64 64 bit kernel support
+X# - cosmetical changes to also support sun4v, not only sun4u
+X#
+X# >>NOTE<< Have a look at Makefile.amd64 for amd64 specifics.
+X#
+X# GNU gcc compiler
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3
+X
+X#
+X# SUNWspro compiler
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` $(DRIVER); \
+X else \
+X rm -f $(DRIVER); \
+X ld -r -o $(DRIVER) $(OBJS); \
+X fi
+X
+Xinstall: $(DRIVER)
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` install; \
+X else \
+X cp aperture.conf /kernel/drv; \
+X cp $(DRIVER) /kernel/drv; \
+X fi
+X
+Xadd_drv:
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` add_drv; \
+X else \
+X add_drv aperture; \
+X fi
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+X
+X.c.o:
+X @if [ -f "Makefile.`isainfo -k`" ]; then \
+X make -f Makefile.`isainfo -k` $@; \
+X else \
+X rm -f $@; \
+X $(CC) -c $(CFLAGS) $*.c -o $@; \
+X fi
+END-of-./aperture/Makefile
+echo x - ./aperture/Makefile.amd64
+sed 's/^X//' >./aperture/Makefile.amd64 << 'END-of-./aperture/Makefile.amd64'
+X#
+X# File: Makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X# Modified: Martin Bochnig (martin@martux.org)
+X# - amd64 64 bit kernel support, cosmetics and also
+X# supporting sun4v (and arbitrary sparcv9) platforms
+X# as well as SunOS 5.10 or higher now
+X# - Changed name
+X#
+X
+X#
+X# GNU gcc compiler, version 3.2 or later
+X#
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3 -m64 -mcmodel=kernel
+X
+X#
+X# SUNWspro compiler (untested, might not properly work for amd64 here)
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X rm -f $(DRIVER)
+X ld -r -o $(DRIVER) $(OBJS)
+X
+Xinstall: $(DRIVER)
+X cp aperture.conf /kernel/drv
+X cp $(DRIVER) /kernel/drv/amd64
+X
+Xadd_drv:
+X add_drv aperture
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+END-of-./aperture/Makefile.amd64
+echo x - ./aperture/Makefile.sparcv9
+sed 's/^X//' >./aperture/Makefile.sparcv9 << 'END-of-./aperture/Makefile.sparcv9'
+X#
+X# File: makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X# Modified: Martin Bochnig (martin@martux.org)
+X# Date: 2006.06.24
+X# - Changed name for generic sparcv9 support
+X# - updated to better work with Solaris 10 and 11
+X#
+X
+X#
+X# GNU gcc compiler, version 3.2 or later
+X#
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3 -m64
+X
+X#
+X# SUNWspro compiler
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X rm -f $(DRIVER)
+X ld -r -o $(DRIVER) $(OBJS)
+X
+Xinstall: $(DRIVER)
+X cp aperture.conf /kernel/drv
+X cp $(DRIVER) /kernel/drv/sparcv9
+X
+Xadd_drv:
+X add_drv aperture
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+END-of-./aperture/Makefile.sparcv9
+echo x - ./aperture/README
+sed 's/^X//' >./aperture/README << 'END-of-./aperture/README'
+XFramebuffer aperture driver.
+X
+XThis driver was written to provide a device that, unlike /dev/mem, allows
+Xmmap()'ing of ranges beyond installed memory.
+X
+XThe original x86-based version of this driver was the collaborative work of
+XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since
+Xbeen rewritten to also work on sparc machines and - later on - also on sparcv9
+Xand recently amd64 64 bit kernels.
+XIt flawlessly compiles and installs on Solaris 10 and 11 now.
+X
+X
+XInstallation instructions:
+X
+X1) Check the Makefile, for appropriate CC, and CFLAGS definitions. Compiling
+X with APERTURE_DEBUG defined means the driver will generate reams of
+X debugging output. You'll probably want to leave this off...
+X
+X2) Type 'make' (or 'gmake'). Both the driver and test program should compile
+X without any problems. No warning messages should be generated.
+X
+X3) Become 'root'.
+X
+X4) Type 'make install' and 'make add_drv'. The screen should look something
+X like this:
+X
+X # make install
+X cp aperture aperture.conf /kernel/drv
+X # make add_drv
+X add_drv aperture
+X
+X On a sparcv9 machine this will mention the /kernel/drv/sparcv9 directory
+X instead of /kernel/drv. Similarily /kernel/drv/amd64 should be used on amd64.
+X
+X This installs the driver to the system.
+X
+X5) While as root modify the file /etc/devlink.tab, adding these lines:
+X
+X# The following entry is for the framebuffer driver
+Xtype=ddi_pseudo;name=aperture fbs/\M0
+X
+X Add that line exactly as shown. You may also simply add the
+X contents of the devlink.tab file supplied to /etc/devlink.tab.
+X It contains the lines as well. (Yes, that is a tab between
+X aperture and fbs, not spaces - very important)
+X
+X6) Perform a reconfiguration boot of the system.
+X
+X # touch /reconfigure
+X # init 6
+X
+XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org.
+END-of-./aperture/README
+echo x - ./aperture/aperture.c
+sed 's/^X//' >./aperture/aperture.c << 'END-of-./aperture/aperture.c'
+X/*
+X * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
+X *
+X * Permission is hereby granted, free of charge, to any person obtaining a copy
+X * of this software and associated documentation files (the "Software"), to
+X * deal in the Software without restriction, including without limitation the
+X * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+X * sell copies of the Software, and to permit persons to whom the Software is
+X * furnished to do so, subject to the following conditions:
+X *
+X * The above copyright notice and this permission notice shall be included in
+X * all copies or substantial portions of the Software.
+X *
+X * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+X * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+X * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+X * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+X * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+X * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+X *
+X * Except as contained in this notice, the name of the XFree86 Project shall
+X * not be used in advertising or otherwise to promote the sale, use or other
+X * dealings in this Software without prior written authorization from the
+X * XFree86 Project.
+X */
+X
+X/*
+X * Aperture driver for Solaris.
+X */
+X
+X/*
+X * Modified: Martin Bochnig (martin@martux.org)
+X * Log: Commented out obsolete kernel interfaces DDI_IDENTIFIED and DDI_NOT_IDENTIFIED
+X * not supported by SunOS 5.10 or higher anymore,
+X * see http://docs.sun.com/app/docs/doc/819-2255/6n4ibnffr?a=view
+X */
+X
+X#include <sys/conf.h>
+X#include <sys/ddi.h>
+X#include <sys/modctl.h>
+X#include <sys/open.h>
+X#include <sys/stat.h>
+X#include <sys/sunddi.h>
+X
+X#define DEV_IDENT "aperture"
+X#define DEV_BANNER "XFree86 aperture driver"
+X
+X#ifndef D_64BIT
+X#define D_64BIT 0
+X#endif
+X
+X#ifndef NULL
+X#define NULL ((void *)0)
+X#endif
+X
+X/*
+X * open(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_open
+X(
+X#ifdef __STDC__
+X dev_t *devp,
+X int flag,
+X int typ,
+X struct cred *cred
+X#endif
+X)
+X#ifndef __STDC__
+X dev_t *devp;
+X int flag;
+X int typ;
+X struct cred *cred;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n");
+X
+X#endif
+X
+X if ((typ != OTYP_CHR) || (getminor(*devp)))
+X error = EINVAL;
+X else
+X error = 0;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * mmap(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_mmap
+X(
+X#ifdef __STDC__
+X dev_t dev,
+X off_t off,
+X int prot
+X#endif
+X)
+X#ifndef __STDC__
+X dev_t dev;
+X off_t off;
+X int prot;
+X#endif
+X{
+X pfn_t pf;
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off);
+X
+X#endif
+X
+X pf = btop((unsigned long)off);
+X
+X /* Deal with mmap(9E) interface limits */
+X error = (int)pf;
+X if ((error < 0) || (pf != (pfn_t)error))
+X error = -1;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+Xstatic struct cb_ops aperture_cb_ops =
+X{
+X aperture_open, /* open */
+X nulldev, /* close */
+X nodev, /* strategy */
+X nodev, /* print */
+X nodev, /* dump */
+X nodev, /* read */
+X nodev, /* write */
+X nodev, /* ioctl */
+X nodev, /* devmap */
+X aperture_mmap, /* mmap */
+X ddi_segmap, /* segmap */
+X nochpoll, /* poll */
+X ddi_prop_op, /* cb_prop_op */
+X 0, /* streamtab */
+X D_NEW | D_MP | D_64BIT /* Driver compatibility flag */
+X};
+X
+X
+Xstatic dev_info_t *aperture_dip; /* private copy of devinfo pointer */
+X
+X/*
+X * getinfo(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_getinfo
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_info_cmd_t infocmd,
+X void *arg,
+X void **result
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_info_cmd_t infocmd;
+X void *arg;
+X void **result;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n");
+X
+X#endif
+X
+X switch (infocmd) {
+X case DDI_INFO_DEVT2DEVINFO:
+X *result = aperture_dip;
+X error = DDI_SUCCESS;
+X break;
+X case DDI_INFO_DEVT2INSTANCE:
+X *result = NULL;
+X error = DDI_SUCCESS;
+X break;
+X default:
+X error = DDI_FAILURE;
+X }
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * identify(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_identify
+X(
+X#ifdef __STDC__
+X dev_info_t *dip
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n");
+X
+X#endif
+X
+X if (strcmp(ddi_get_name(dip), DEV_IDENT))
+X error = 1 /* DDI_NOT_IDENTIFIED obsolete since SunOS 5.10 */ ;
+X else
+X error = 2 /* DDI_IDENTIFIED obsolete since SunOS 5.10 */ ;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * attach(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_attach
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_attach_cmd_t cmd
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_attach_cmd_t cmd;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n");
+X
+X#endif
+X
+X if (cmd != DDI_ATTACH)
+X {
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n");
+X
+X#endif
+X
+X error = DDI_FAILURE;
+X }
+X else
+X {
+X error = ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR,
+X (minor_t)ddi_get_instance(dip),
+X NULL, 0 /* NODESPECIFIC_DEV obsolete since SunOS 5.10 */ );
+X
+X if (error == DDI_SUCCESS)
+X {
+X aperture_dip = dip;
+X ddi_report_dev(dip);
+X }
+X }
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * detach(9E)
+X */
+Xstatic int
+Xaperture_detach
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_detach_cmd_t cmd
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_detach_cmd_t cmd;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n");
+X
+X#endif
+X
+X if (cmd != DDI_DETACH)
+X {
+X error = DDI_FAILURE;
+X }
+X else
+X {
+X ddi_remove_minor_node(dip, NULL);
+X aperture_dip = NULL;
+X error = DDI_SUCCESS;
+X }
+X
+X#if APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X
+Xstatic struct dev_ops aperture_ops =
+X{
+X DEVO_REV, /* revision */
+X 0, /* refcnt */
+X aperture_getinfo, /* getinfo */
+X aperture_identify, /* identify */
+X nulldev, /* probe */
+X aperture_attach, /* attach */
+X aperture_detach, /* detach */
+X nodev, /* reset */
+X &aperture_cb_ops, /* driver operations */
+X NULL /* bus operations */
+X};
+X
+X
+Xstatic struct modldrv modldrv =
+X{
+X &mod_driverops, /* mod_ops structure pointer */
+X DEV_BANNER, /* driver banner string */
+X &aperture_ops, /* dev_ops structure pointer */
+X};
+X
+X
+Xstatic struct modlinkage modlinkage =
+X{
+X MODREV_1, /* module API revision */
+X {
+X &modldrv, /* module driver structure pointer */
+X NULL /* list termination */
+X }
+X};
+X
+X
+X/*
+X * _init(9E)
+X */
+Xint
+X_init
+X(
+X#ifdef __STDC__
+X void
+X#endif
+X)
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n");
+X
+X#endif
+X
+X error = mod_install(&modlinkage);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * _info(9E)
+X */
+Xint
+X_info
+X(
+X#ifdef __STDC__
+X struct modinfo *modinfop
+X#endif
+X)
+X#ifndef __STDC__
+X struct modinfo *modinfop;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n");
+X
+X#endif
+X
+X error = mod_info(&modlinkage, modinfop);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * _fini(9E)
+X */
+Xint
+X_fini
+X(
+X#ifdef __STDC__
+X void
+X#endif
+X)
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n");
+X
+X#endif
+X
+X error = mod_remove(&modlinkage);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+END-of-./aperture/aperture.c
+echo x - ./aperture/aperture.conf
+sed 's/^X//' >./aperture/aperture.conf << 'END-of-./aperture/aperture.conf'
+X#
+X# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
+X#
+X# File: aperture.conf
+X# Author: Doug Anson (danson@lgc.com)
+X#
+X# Modified: David Holland (davidh@use.com)
+X# Log: Change comments 02/23/94
+X# Change defaults/comments 09/25/94
+X#
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Log: SPARC changes 2001.09
+X#
+X# Purpose: This conf file is used by the aperture driver.
+X#
+Xname="aperture" parent="pseudo";
+END-of-./aperture/aperture.conf
+echo x - ./aperture/devlink.tab
+sed 's/^X//' >./aperture/devlink.tab << 'END-of-./aperture/devlink.tab'
+X# The following entry is for the aperture driver
+Xtype=ddi_pseudo;name=aperture fbs/\M0
+END-of-./aperture/devlink.tab
+exit
+
diff --git a/xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S b/xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S
new file mode 100644
index 000000000..9f5e58cb0
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/solaris-amd64.S
@@ -0,0 +1,73 @@
+/ Copyright 2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+/ to whom the Software is furnished to do so, provided that the above
+/ copyright notice(s) and this permission notice appear in all copies of
+/ the Software and that both the above copyright notice(s) and this
+/ permission notice appear in supporting documentation.
+/
+/ 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
+/ OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+/ HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+/
+/ Except as contained in this notice, the name of a copyright holder
+/ shall not be used in advertising or otherwise to promote the sale, use
+/ or other dealings in this Software without prior written authorization
+/ of the copyright holder.
+
+#ifdef INLINE_ASM
+#define FUNCTION_START(f,n) .inline f,n
+#define FUNCTION_END(f) .end
+#else
+#define _ASM
+#include <sys/asm_linkage.h>
+#define FUNCTION_START(f,n) ENTRY(f)
+#define FUNCTION_END(f) SET_SIZE(f)
+#endif
+
+ FUNCTION_START(inb,4)
+ movq %rdi, %rdx
+ xorq %rax, %rax
+ inb (%dx)
+ FUNCTION_END(inb)
+
+ FUNCTION_START(inw,4)
+ movq %rdi, %rdx
+ xorq %rax, %rax
+ inw (%dx)
+ FUNCTION_END(inw)
+
+ FUNCTION_START(inl,4)
+ movq %rdi, %rdx
+ xorq %rax, %rax
+ inl (%dx)
+ FUNCTION_END(inl)
+
+ FUNCTION_START(outb,8)
+ movq %rdi, %rdx
+ movq %rsi, %rax
+ outb (%dx)
+ FUNCTION_END(outb)
+
+ FUNCTION_START(outw,8)
+ movq %rdi, %rdx
+ movq %rsi, %rax
+ outw (%dx)
+ FUNCTION_END(outw)
+
+ FUNCTION_START(outl,8)
+ movq %rdi, %rdx
+ movq %rsi, %rax
+ outl (%dx)
+ FUNCTION_END(outl)
+
diff --git a/xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S b/xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S
new file mode 100644
index 000000000..e2d9cf60a
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/solaris-ia32.S
@@ -0,0 +1,73 @@
+/ Copyright 2004 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+/ to whom the Software is furnished to do so, provided that the above
+/ copyright notice(s) and this permission notice appear in all copies of
+/ the Software and that both the above copyright notice(s) and this
+/ permission notice appear in supporting documentation.
+/
+/ 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
+/ OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+/ HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+/
+/ Except as contained in this notice, the name of a copyright holder
+/ shall not be used in advertising or otherwise to promote the sale, use
+/ or other dealings in this Software without prior written authorization
+/ of the copyright holder.
+
+#ifdef INLINE_ASM
+#define FUNCTION_START(f,n) .inline f,n
+#define FUNCTION_END(f) .end
+#else
+#define _ASM
+#include <sys/asm_linkage.h>
+#define FUNCTION_START(f,n) ENTRY(f)
+#define FUNCTION_END(f) SET_SIZE(f)
+#endif
+
+ FUNCTION_START(inb,4)
+ movl (%esp), %edx
+ xorl %eax, %eax
+ inb (%dx)
+ FUNCTION_END(inb)
+
+ FUNCTION_START(inw,4)
+ movl (%esp), %edx
+ xorl %eax, %eax
+ inw (%dx)
+ FUNCTION_END(inw)
+
+ FUNCTION_START(inl,4)
+ movl (%esp), %edx
+ xorl %eax, %eax
+ inl (%dx)
+ FUNCTION_END(inl)
+
+ FUNCTION_START(outb,8)
+ movl (%esp), %edx
+ movl 4(%esp), %eax
+ outb (%dx)
+ FUNCTION_END(outb)
+
+ FUNCTION_START(outw,8)
+ movl (%esp), %edx
+ movl 4(%esp), %eax
+ outw (%dx)
+ FUNCTION_END(outw)
+
+ FUNCTION_START(outl,8)
+ movl (%esp), %edx
+ movl 4(%esp), %eax
+ outl (%dx)
+ FUNCTION_END(outl)
+
diff --git a/xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S b/xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S
new file mode 100644
index 000000000..fb23942ef
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S
@@ -0,0 +1,144 @@
+/* Copyright 2004 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#ifdef INLINE_ASM
+#define FUNCTION_START(f,n) .inline f,n
+#define FUNCTION_END(f) .end
+#else
+#define _ASM
+#include <sys/asm_linkage.h>
+#define FUNCTION_START(f,n) ENTRY(f)
+#define FUNCTION_END(f) SET_SIZE(f)
+#endif
+
+/* Converted from common/compiler.h gcc inline format to Sun cc inline
+ * format by Kenjiro Tsuji
+ *
+ * The value 0x88 means ASI_PRIMARY_LITTLE.
+ * The store or load to/from the address space will be done
+ * as little-endian. In the original xrog code, the value
+ * is defined as the macro ASI_PL.
+ *
+ * In the original xorg code, "membar #StoreStore|#StoreLoad"
+ * is directly implemented as an instruction "0x8143e00a".
+ *
+ */
+
+ FUNCTION_START(outb, 0)
+ stba %o1, [%o0] 0x88
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(outb)
+
+ FUNCTION_START(outw, 0)
+ stha %o1, [%o0] 0x88
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(outw)
+
+ FUNCTION_START(outl, 0)
+ sta %o1, [%o0] 0x88
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(outl)
+
+ FUNCTION_START(inb, 0)
+ lduba [%o0] 0x88, %o0
+ FUNCTION_END(inb)
+
+ FUNCTION_START(inw, 0)
+ lduha [%o0] 0x88, %o0
+ FUNCTION_END(inw)
+
+ FUNCTION_START(inl, 0)
+ lda [%o0] 0x88, %o0
+ FUNCTION_END(inl)
+
+ FUNCTION_START(xf86ReadMmio8, 0)
+ lduba [%o0 + %o1] 0x88, %o0
+ FUNCTION_END(xf86ReadMmio8)
+
+ FUNCTION_START(xf86ReadMmio16Be, 0)
+ lduh [%o0 + %o1], %o0
+ FUNCTION_END(xf86ReadMmio16Be)
+
+ FUNCTION_START(xf86ReadMmio16Le, 0)
+ lduha [%o0 + %o1] 0x88, %o0
+ FUNCTION_END(xf86ReadMmio16Le)
+
+ FUNCTION_START(xf86ReadMmio32Be, 0)
+ ld [%o0 + %o1], %o0
+ FUNCTION_END(xf86ReadMmio32Be)
+
+ FUNCTION_START(xf86ReadMmio32Le, 0)
+ lda [%o0 + %o1] 0x88, %o0
+ FUNCTION_END(xf86ReadMmio32Le)
+
+ FUNCTION_START(xf86WriteMmio8, 0)
+ stba %o2, [%o0 + %o1] 0x88
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(xf86WriteMmio8)
+
+ FUNCTION_START(xf86WriteMmio16Be, 0)
+ sth %o2, [%o0 + %o1]
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(xf86WriteMmio16Be)
+
+ FUNCTION_START(xf86WriteMmio16Le, 0)
+ stha %o2, [%o0 + %o1] 0x88
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(xf86WriteMmio16Le)
+
+ FUNCTION_START(xf86WriteMmio32Be, 0)
+ st %o2, [%o0 + %o1]
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(xf86WriteMmio32Be)
+
+ FUNCTION_START(xf86WriteMmio32Le, 0)
+ sta %o2, [%o0 + %o1] 0x88
+ membar #StoreStore|#StoreLoad
+ FUNCTION_END(xf86WriteMmio32Le)
+
+ FUNCTION_START(xf86WriteMmio8NB, 0)
+ add %o0, %o1, %o0
+ stba %o2, [%o0] 0x88
+ FUNCTION_END(xf86WriteMmio8NB)
+
+ FUNCTION_START(xf86WriteMmio16BeNB, 0)
+ sth %o2, [%o0 + %o1]
+ FUNCTION_END(xf86WriteMmio16BeNB)
+
+ FUNCTION_START(xf86WriteMmio16LeNB, 0)
+ stha %o2, [%o0 + %o1] 0x88
+ FUNCTION_END(xf86WriteMmio16LeNB)
+
+ FUNCTION_START(xf86WriteMmio32BeNB, 0)
+ st %o2, [%o0 + %o1]
+ FUNCTION_END(xf86WriteMmio32BeNB)
+
+ FUNCTION_START(xf86WriteMmio32LeNB, 0)
+ sta %o2, [%o0 + %o1] 0x88
+ FUNCTION_END(xf86WriteMmio32LeNB)
+
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_agp.c b/xorg-server/hw/xfree86/os-support/solaris/sun_agp.c
new file mode 100644
index 000000000..e97ab9ef9
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_agp.c
@@ -0,0 +1,338 @@
+/*
+ * Abstraction of the AGP GART interface.
+ *
+ * This version is for Solaris.
+ *
+ * Copyright © 2000 VA Linux Systems, Inc.
+ * Copyright © 2001 The XFree86 Project, Inc.
+ */
+/* Copyright 2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#pragma ident "@(#)sun_agp.c 1.1 05/04/04 SMI"
+
+#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 "xf86_OSproc.h"
+#include <unistd.h>
+#include <sys/ioccom.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include "agpgart.h"
+
+#ifndef AGP_DEVICE
+#define AGP_DEVICE "/dev/agpgart"
+#endif
+/* AGP page size is independent of the host page size. */
+#ifndef AGP_PAGE_SIZE
+#define AGP_PAGE_SIZE 4096
+#endif
+
+static int gartFd = -1;
+static int acquiredScreen = -1;
+static Bool initDone = FALSE;
+/*
+ * Close /dev/agpgart. This frees all associated memory allocated during
+ * this server generation.
+ */
+_X_EXPORT Bool
+xf86GARTCloseScreen(int screenNum)
+{
+ if (gartFd != -1) {
+ close(gartFd);
+ acquiredScreen = -1;
+ gartFd = -1;
+ initDone = FALSE;
+
+ xf86DrvMsg(screenNum, X_INFO,
+ "xf86GARTCloseScreen: device closed successfully\n");
+
+ }
+ return TRUE;
+}
+
+/*
+ * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called.
+ */
+static Bool
+GARTInit(int screenNum)
+{
+ if (initDone)
+ return (gartFd != -1);
+
+ if (gartFd == -1)
+ gartFd = open(AGP_DEVICE, O_RDWR);
+ else
+ return FALSE;
+
+ if (gartFd == -1) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "GARTInit: Unable to open " AGP_DEVICE " (%s)\n",
+ strerror(errno));
+ return FALSE;
+ }
+
+ initDone = TRUE;
+ xf86DrvMsg(screenNum, X_INFO,
+ "GARTInit: " AGP_DEVICE " opened successfully\n");
+
+ return TRUE;
+}
+
+_X_EXPORT Bool
+xf86AgpGARTSupported(void)
+{
+ return (GARTInit(-1));
+
+}
+
+_X_EXPORT AgpInfoPtr
+xf86GetAGPInfo(int screenNum)
+{
+ agp_info_t agpinf;
+ AgpInfoPtr info;
+
+ if (!GARTInit(screenNum))
+ return NULL;
+
+ if ((info = xcalloc(sizeof(AgpInfo), 1)) == NULL) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "xf86GetAGPInfo: Failed to allocate AgpInfo\n");
+ return NULL;
+ }
+
+ if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n",
+ strerror(errno));
+ return NULL;
+ }
+
+ info->bridgeId = agpinf.agpi_devid;
+ info->agpMode = agpinf.agpi_mode;
+ info->base = agpinf.agpi_aperbase;
+ info->size = agpinf.agpi_apersize;
+ info->totalPages = (unsigned long)agpinf.agpi_pgtotal;
+ info->systemPages = (unsigned long)agpinf.agpi_pgsystem;
+ info->usedPages = (unsigned long)agpinf.agpi_pgused;
+
+ return info;
+}
+
+_X_EXPORT Bool
+xf86AcquireGART(int screenNum)
+{
+
+ if (!GARTInit(screenNum))
+ return FALSE;
+
+ if (acquiredScreen != screenNum) {
+ if (ioctl(gartFd, AGPIOC_ACQUIRE, 0) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "xf86AcquireGART: AGPIOC_ACQUIRE failed (%s)\n",
+ strerror(errno));
+ return FALSE;
+ }
+ acquiredScreen = screenNum;
+ xf86DrvMsg(screenNum, X_INFO,
+ "xf86AcquireGART: AGPIOC_ACQUIRE succeeded\n");
+ }
+ return TRUE;
+}
+
+_X_EXPORT Bool
+xf86ReleaseGART(int screenNum)
+{
+
+ if (!GARTInit(screenNum))
+ return FALSE;
+
+ if (acquiredScreen == screenNum) {
+ /*
+ * The FreeBSD agp driver removes allocations on release.
+ * The Solaris driver doesn't. xf86ReleaseGART() is expected
+ * to give up access to the GART, but not to remove any
+ * allocations.
+ */
+
+ if (ioctl(gartFd, AGPIOC_RELEASE, 0) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "xf86ReleaseGART: AGPIOC_RELEASE failed (%s)\n",
+ strerror(errno));
+ return FALSE;
+ }
+ acquiredScreen = -1;
+ xf86DrvMsg(screenNum, X_INFO,
+ "xf86ReleaseGART: AGPIOC_RELEASE succeeded\n");
+ return TRUE;
+ }
+ return FALSE;
+}
+
+_X_EXPORT int
+xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
+ unsigned long *physical)
+{
+ agp_allocate_t alloc;
+ int pages;
+
+ /*
+ * Allocates "size" bytes of GART memory (rounds up to the next
+ * page multiple) or type "type". A handle (key) for the allocated
+ * memory is returned. On error, the return value is -1.
+ * "size" should be larger than 0, or AGPIOC_ALLOCATE ioctl will
+ * return error.
+ */
+
+ if (!GARTInit(screenNum) || (acquiredScreen != screenNum))
+ return -1;
+
+ pages = (size / AGP_PAGE_SIZE);
+ if (size % AGP_PAGE_SIZE != 0)
+ pages++;
+
+ alloc.agpa_pgcount = pages;
+ alloc.agpa_type = type;
+
+ if (ioctl(gartFd, AGPIOC_ALLOCATE, &alloc) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86AllocateGARTMemory: "
+ "allocation of %d pages failed\n\t(%s)\n", pages,
+ strerror(errno));
+ return -1;
+ }
+
+ if (physical)
+ *physical = (unsigned long)alloc.agpa_physical;
+
+ return alloc.agpa_key;
+}
+
+_X_EXPORT Bool
+xf86DeallocateGARTMemory(int screenNum, int key)
+{
+ if (!GARTInit(screenNum) || (acquiredScreen != screenNum))
+ return FALSE;
+
+ if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *)key) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86DeAllocateGARTMemory: "
+ "deallocation of gart memory with key %d failed\n"
+ "\t(%s)\n", key, strerror(errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Bind GART memory with "key" at "offset" */
+_X_EXPORT Bool
+xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
+{
+ agp_bind_t bind;
+ int pageOffset;
+
+ if (!GARTInit(screenNum) || (acquiredScreen != screenNum))
+ return FALSE;
+
+ if (offset % AGP_PAGE_SIZE != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: "
+ "offset (0x%lx) is not page-aligned (%d)\n",
+ offset, AGP_PAGE_SIZE);
+ return FALSE;
+ }
+ pageOffset = offset / AGP_PAGE_SIZE;
+
+ xf86DrvMsgVerb(screenNum, X_INFO, 3,
+ "xf86BindGARTMemory: bind key %d at 0x%08lx "
+ "(pgoffset %d)\n", key, offset, pageOffset);
+
+ bind.agpb_pgstart = pageOffset;
+ bind.agpb_key = key;
+
+ if (ioctl(gartFd, AGPIOC_BIND, &bind) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: "
+ "binding of gart memory with key %d\n"
+ "\tat offset 0x%lx failed (%s)\n",
+ key, offset, strerror(errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Unbind GART memory with "key" */
+_X_EXPORT Bool
+xf86UnbindGARTMemory(int screenNum, int key)
+{
+ agp_unbind_t unbind;
+
+ if (!GARTInit(screenNum) || (acquiredScreen != screenNum))
+ return FALSE;
+
+ unbind.agpu_pri = 0;
+ unbind.agpu_key = key;
+
+ if (ioctl(gartFd, AGPIOC_UNBIND, &unbind) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86UnbindGARTMemory: "
+ "unbinding of gart memory with key %d "
+ "failed (%s)\n", key, strerror(errno));
+ return FALSE;
+ }
+
+ xf86DrvMsgVerb(screenNum, X_INFO, 3,
+ "xf86UnbindGARTMemory: unbind key %d\n", key);
+
+ return TRUE;
+}
+
+
+/* XXX Interface may change. */
+_X_EXPORT Bool
+xf86EnableAGP(int screenNum, CARD32 mode)
+{
+ agp_setup_t setup;
+
+ if (!GARTInit(screenNum) || (acquiredScreen != screenNum))
+ return FALSE;
+
+ setup.agps_mode = mode;
+ if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: "
+ "AGPIOC_SETUP with mode %x failed (%s)\n",
+ mode, strerror(errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_apm.c b/xorg-server/hw/xfree86/os-support/solaris/sun_apm.c
new file mode 100644
index 000000000..7decc900f
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_apm.c
@@ -0,0 +1,232 @@
+/* Based on hw/xfree86/os-support/bsd/bsd_apm.c which bore no explicit
+ * copyright notice, so is covered by the following notice:
+ *
+ * Copyright (C) 1994-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.
+ */
+
+/* Copyright 2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+#include "xf86_OSlib.h"
+
+#ifndef PLEASE_FIX_THIS
+#define APM_STANDBY_REQ 0xa01
+#define APM_SUSPEND_REQ 0xa02
+#define APM_NORMAL_RESUME 0xa03
+#define APM_CRIT_RESUME 0xa04
+#define APM_BATTERY_LOW 0xa05
+#define APM_POWER_CHANGE 0xa06
+#define APM_UPDATE_TIME 0xa07
+#define APM_CRIT_SUSPEND_REQ 0xa08
+#define APM_USER_STANDBY_REQ 0xa09
+#define APM_USER_SUSPEND_REQ 0xa0a
+#define APM_SYS_STANDBY_RESUME 0xa0b
+#define APM_IOC_NEXTEVENT 0xa0c
+#define APM_IOC_RESUME 0xa0d
+#define APM_IOC_SUSPEND 0xa0e
+#define APM_IOC_STANDBY 0xa0f
+#endif
+
+typedef struct apm_event_info
+{
+ int type;
+} apm_event_info;
+
+/*
+ This may be replaced with a better device name
+ very soon...
+*/
+#define APM_DEVICE "/dev/srn"
+#define APM_DEVICE1 "/dev/apm"
+
+static pointer APMihPtr = NULL;
+static void sunCloseAPM(void);
+
+static struct {
+ u_int apmBsd;
+ pmEvent xf86;
+} sunToXF86Array [] = {
+ { APM_STANDBY_REQ, XF86_APM_SYS_STANDBY },
+ { APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND },
+ { APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME },
+ { APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME },
+ { APM_BATTERY_LOW, XF86_APM_LOW_BATTERY },
+ { APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE },
+ { APM_UPDATE_TIME, XF86_APM_UPDATE_TIME },
+ { APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND },
+ { APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY },
+ { APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND },
+ { APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME },
+#ifdef APM_CAPABILITY_CHANGE
+ { APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED },
+#endif
+};
+
+#define numApmEvents (sizeof(sunToXF86Array) / sizeof(sunToXF86Array[0]))
+
+static pmEvent
+sunToXF86(int type)
+{
+ int i;
+
+ for (i = 0; i < numApmEvents; i++) {
+ if (type == sunToXF86Array[i].apmBsd) {
+ return sunToXF86Array[i].xf86;
+ }
+ }
+ return XF86_APM_UNKNOWN;
+}
+
+/*
+ * APM events can be requested direclty from /dev/apm
+ */
+static int
+sunPMGetEventFromOS(int fd, pmEvent *events, int num)
+{
+ struct apm_event_info sunEvent;
+ int i;
+
+ for (i = 0; i < num; i++) {
+
+ if (ioctl(fd, APM_IOC_NEXTEVENT, &sunEvent) < 0) {
+ if (errno != EAGAIN) {
+ xf86Msg(X_WARNING, "sunPMGetEventFromOS: APM_IOC_NEXTEVENT"
+ " %s\n", strerror(errno));
+ }
+ break;
+ }
+ events[i] = sunToXF86(sunEvent.type);
+ }
+ xf86Msg(X_WARNING, "Got some events\n");
+ return i;
+}
+
+static pmWait
+sunPMConfirmEventToOs(int fd, pmEvent event)
+{
+ switch (event) {
+/* XXX: NOT CURRENTLY RETURNED FROM OS */
+ case XF86_APM_SYS_STANDBY:
+ case XF86_APM_USER_STANDBY:
+ if (ioctl( fd, APM_IOC_STANDBY, NULL ) == 0)
+ return PM_WAIT; /* should we stop the Xserver in standby, too? */
+ else
+ return PM_NONE;
+ case XF86_APM_SYS_SUSPEND:
+ case XF86_APM_CRITICAL_SUSPEND:
+ case XF86_APM_USER_SUSPEND:
+ xf86Msg(X_WARNING, "Got SUSPENDED\n");
+ if (ioctl( fd, APM_IOC_SUSPEND, NULL ) == 0)
+ return PM_CONTINUE;
+ else {
+ xf86Msg(X_WARNING, "sunPMConfirmEventToOs: APM_IOC_SUSPEND"
+ " %s\n", strerror(errno));
+ return PM_FAILED;
+ }
+ case XF86_APM_STANDBY_RESUME:
+ case XF86_APM_NORMAL_RESUME:
+ case XF86_APM_CRITICAL_RESUME:
+ case XF86_APM_STANDBY_FAILED:
+ case XF86_APM_SUSPEND_FAILED:
+ xf86Msg(X_WARNING, "Got RESUME\n");
+ if (ioctl( fd, APM_IOC_RESUME, NULL ) == 0)
+ return PM_CONTINUE;
+ else {
+ xf86Msg(X_WARNING, "sunPMConfirmEventToOs: APM_IOC_RESUME"
+ " %s\n", strerror(errno));
+ return PM_FAILED;
+ }
+ default:
+ return PM_NONE;
+ }
+}
+
+PMClose
+xf86OSPMOpen(void)
+{
+ int fd;
+
+ if (APMihPtr || !xf86Info.pmFlag) {
+ return NULL;
+ }
+
+ if ((fd = open(APM_DEVICE, O_RDWR)) == -1) {
+ if ((fd = open(APM_DEVICE1, O_RDWR)) == -1) {
+ return NULL;
+ }
+ }
+ xf86PMGetEventFromOs = sunPMGetEventFromOS;
+ xf86PMConfirmEventToOs = sunPMConfirmEventToOs;
+ APMihPtr = xf86AddInputHandler(fd, xf86HandlePMEvents, NULL);
+ return sunCloseAPM;
+}
+
+static void
+sunCloseAPM(void)
+{
+ int fd;
+
+ if (APMihPtr) {
+ fd = xf86RemoveInputHandler(APMihPtr);
+ close(fd);
+ APMihPtr = NULL;
+ }
+}
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_bell.c b/xorg-server/hw/xfree86/os-support/solaris/sun_bell.c
new file mode 100644
index 000000000..29ecd7300
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_bell.c
@@ -0,0 +1,185 @@
+/* Copyright 2004-2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <sys/audio.h>
+#include <sys/uio.h>
+#include <limits.h>
+#include <math.h>
+#include <poll.h>
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#define BELL_RATE 48000 /* Samples per second */
+#define BELL_HZ 50 /* Fraction of a second i.e. 1/x */
+#define BELL_MS (1000/BELL_HZ) /* MS */
+#define BELL_SAMPLES (BELL_RATE / BELL_HZ)
+#define BELL_MIN 3 /* Min # of repeats */
+
+#define AUDIO_DEVICE "/dev/audio"
+
+_X_EXPORT void
+xf86OSRingBell(int loudness, int pitch, int duration)
+{
+ static short samples[BELL_SAMPLES];
+ static short silence[BELL_SAMPLES]; /* "The Sound of Silence" */
+ static int lastFreq;
+ int cnt;
+ int i;
+ int written;
+ int repeats;
+ int freq;
+ audio_info_t audioInfo;
+ struct iovec iov[IOV_MAX];
+ int iovcnt;
+ double ampl, cyclen, phase;
+ int audioFD;
+
+ if ((loudness <= 0) || (pitch <= 0) || (duration <= 0)) {
+ return;
+ }
+
+ lastFreq = 0;
+ bzero(silence, sizeof(silence));
+
+ audioFD = open(AUDIO_DEVICE, O_WRONLY | O_NONBLOCK);
+ if (audioFD == -1) {
+ xf86Msg(X_ERROR, "Bell: cannot open audio device \"%s\": %s\n",
+ AUDIO_DEVICE, strerror(errno));
+ return;
+ }
+
+ freq = pitch;
+ freq = min(freq, (BELL_RATE / 2) - 1);
+ freq = max(freq, 2 * BELL_HZ);
+
+ /*
+ * Ensure full waves per buffer
+ */
+ freq -= freq % BELL_HZ;
+
+ if (freq != lastFreq) {
+ lastFreq = freq;
+ ampl = 16384.0;
+
+ cyclen = (double) freq / (double) BELL_RATE;
+ phase = 0.0;
+
+ for (i = 0; i < BELL_SAMPLES; i++) {
+ samples[i] = (short) (ampl * sin(2.0 * M_PI * phase));
+ phase += cyclen;
+ if (phase >= 1.0)
+ phase -= 1.0;
+ }
+ }
+
+ repeats = (duration + (BELL_MS / 2)) / BELL_MS;
+ repeats = max(repeats, BELL_MIN);
+
+ loudness = max(0, loudness);
+ loudness = min(loudness, 100);
+
+#ifdef DEBUG
+ ErrorF("BELL : freq %d volume %d duration %d repeats %d\n",
+ freq, loudness, duration, repeats);
+#endif
+
+ AUDIO_INITINFO(&audioInfo);
+ audioInfo.play.encoding = AUDIO_ENCODING_LINEAR;
+ audioInfo.play.sample_rate = BELL_RATE;
+ audioInfo.play.channels = 2;
+ audioInfo.play.precision = 16;
+ audioInfo.play.gain = min(AUDIO_MAX_GAIN, AUDIO_MAX_GAIN * loudness / 100);
+
+ if (ioctl(audioFD, AUDIO_SETINFO, &audioInfo) < 0){
+ xf86Msg(X_ERROR,
+ "Bell: AUDIO_SETINFO failed on audio device \"%s\": %s\n",
+ AUDIO_DEVICE, strerror(errno));
+ close(audioFD);
+ return;
+ }
+
+ iovcnt = 0;
+
+ for (cnt = 0; cnt <= repeats; cnt++) {
+ iov[iovcnt].iov_base = (char *) samples;
+ iov[iovcnt++].iov_len = sizeof(samples);
+ if (cnt == repeats) {
+ /* Insert a bit of silence so that multiple beeps are distinct and
+ * not compressed into a single tone.
+ */
+ iov[iovcnt].iov_base = (char *) silence;
+ iov[iovcnt++].iov_len = sizeof(silence);
+ }
+ if ((iovcnt >= IOV_MAX) || (cnt == repeats)) {
+ written = writev(audioFD, iov, iovcnt);
+
+ if ((written < ((int)(sizeof(samples) * iovcnt)))) {
+ /* audio buffer was full! */
+
+ int naptime;
+
+ if (written == -1) {
+ if (errno != EAGAIN) {
+ xf86Msg(X_ERROR,
+ "Bell: writev failed on audio device \"%s\": %s\n",
+ AUDIO_DEVICE, strerror(errno));
+ close(audioFD);
+ return;
+ }
+ i = iovcnt;
+ } else {
+ i = ((sizeof(samples) * iovcnt) - written)
+ / sizeof(samples);
+ }
+ cnt -= i;
+
+ /* sleep a little to allow audio buffer to drain */
+ naptime = BELL_MS * i;
+ poll(NULL, 0, naptime);
+
+ i = ((sizeof(samples) * iovcnt) - written) % sizeof(samples);
+ iovcnt = 0;
+ if ((written != -1) && (i > 0)) {
+ iov[iovcnt].iov_base = ((char *) samples) + i;
+ iov[iovcnt++].iov_len = sizeof(samples) - i;
+ }
+ } else {
+ iovcnt = 0;
+ }
+ }
+ }
+
+ close(audioFD);
+ return;
+}
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_bios.c b/xorg-server/hw/xfree86/os-support/solaris/sun_bios.c
new file mode 100644
index 000000000..a27a5a5a7
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_bios.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * Copyright 1999 by David Holland <davidh@iquest.net>
+ *
+ * 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 the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ * SHALL THE COPYRIGHT HOLDERS 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
+
+#if defined(__i386__) || defined(__i386)
+#define _NEED_SYSI86
+#endif
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+extern char *apertureDevName;
+
+/*
+ * Read BIOS via mmap()ing physical memory.
+ */
+_X_EXPORT int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ int fd;
+ unsigned char *ptr;
+ char solx86_vtname[20];
+ int psize;
+ int mlen;
+
+ /*
+ * Solaris 2.1 x86 SVR4 (10/27/93)
+ * The server must treat the virtual terminal device file
+ * as the standard SVR4 /dev/pmem. By default, then used VT
+ * is considered the "default" file to open.
+ *
+ * Solaris 2.8 x86 (7/26/99) - DWH
+ *
+ * Use /dev/xsvc for everything.
+ */
+ psize = getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+#if (defined(__i386__) || defined(__i386)) && !defined(__SOL8__)
+ if (Base >= 0xA0000 && Base + mlen < 0xFFFFF && xf86Info.vtno >= 0)
+ sprintf(solx86_vtname, "/dev/vt%02d", xf86Info.vtno);
+ else
+#endif
+ {
+ if (!xf86LinearVidMem())
+ FatalError("xf86ReadBIOS: Could not mmap BIOS"
+ " [a=%lx]\n", Base);
+ sprintf(solx86_vtname, apertureDevName);
+ }
+
+ if ((fd = open(solx86_vtname, O_RDONLY)) < 0)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
+ solx86_vtname, strerror(errno));
+ return(-1);
+ }
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, fd, (off_t)Base);
+ if (ptr == MAP_FAILED)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed "
+ "[0x%08lx, 0x%04x]\n",
+ solx86_vtname, Base, mlen);
+ close(fd);
+ return -1;
+ }
+
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+ (void)close(fd);
+
+ return Len;
+}
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_init.c b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c
new file mode 100644
index 000000000..1f389cb40
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c
@@ -0,0 +1,357 @@
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * Copyright 1999 by David Holland <davidh@iquest.net>
+ *
+ * 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 the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS 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 "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#if defined(__i386__) || defined(__i386) || defined(__x86)
+# include <sys/kd.h>
+#endif
+
+static Bool KeepTty = FALSE;
+static Bool Protect0 = FALSE;
+#ifdef HAS_USL_VTS
+static int VTnum = -1;
+static int xf86StartVT = -1;
+#endif
+
+#if defined(__SOL8__) || (!defined(__i386__) && !defined(__i386))
+static char fb_dev[PATH_MAX] = "/dev/fb";
+#else
+static char fb_dev[PATH_MAX] = "/dev/console";
+#endif
+
+void
+xf86OpenConsole(void)
+{
+#ifdef HAS_USL_VTS
+ int fd, i;
+ struct vt_mode VT;
+ struct vt_stat vtinfo;
+ int FreeVTslot;
+ MessageType from = X_PROBED;
+#endif
+
+ if (serverGeneration == 1)
+ {
+ /* Check if we're run with euid==0 */
+ if (geteuid() != 0)
+ FatalError("xf86OpenConsole: Server must be suid root\n");
+
+ /* Protect page 0 to help find NULL dereferencing */
+ /* mprotect() doesn't seem to work */
+ if (Protect0)
+ {
+ int fd = -1;
+
+ if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0)
+ {
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: cannot open /dev/zero (%s)\n",
+ strerror(errno));
+ }
+ else
+ {
+ if ((int)mmap(0, 0x1000, PROT_NONE,
+ MAP_FIXED | MAP_SHARED, fd, 0) == -1)
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: failed to protect page 0 (%s)\n",
+ strerror(errno));
+
+ close(fd);
+ }
+ }
+
+#ifdef HAS_USL_VTS
+
+ /*
+ * Setup the virtual terminal manager
+ */
+ if (VTnum != -1)
+ {
+ xf86Info.vtno = VTnum;
+ from = X_CMDLINE;
+ }
+ else
+ {
+ if ((fd = open("/dev/vt00",O_RDWR,0)) < 0)
+ FatalError("xf86OpenConsole: Cannot open /dev/vt00 (%s)\n",
+ strerror(errno));
+
+ if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
+ FatalError("xf86OpenConsole: Cannot determine current VT\n");
+
+ xf86StartVT = vtinfo.v_active;
+
+ /*
+ * There is a SEVERE problem with x86's VT's. The VT_OPENQRY
+ * ioctl() will panic the entire system if all 8 (7 VT's+Console)
+ * terminals are used. The only other way I've found to determine
+ * if there is a free VT is to try activating all the the available
+ * VT's and see if they all succeed - if they do, there there is no
+ * free VT, and the Xserver cannot continue without panic'ing the
+ * system. (It's ugly, but it seems to work.) Note there is a
+ * possible race condition here.
+ *
+ * David Holland 2/23/94
+ */
+
+ FreeVTslot = 0;
+ for (i = 7; (i >= 0) && !FreeVTslot; i--)
+ if (ioctl(fd, VT_ACTIVATE, i) != 0)
+ FreeVTslot = 1;
+
+ if (!FreeVTslot ||
+ (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
+ (xf86Info.vtno == -1))
+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
+
+ close(fd);
+ }
+
+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
+
+ sprintf(fb_dev, "/dev/vt%02d", xf86Info.vtno); /* Solaris 2.1 x86 */
+
+#endif /* HAS_USL_VTS */
+
+ if (!KeepTty)
+ setpgrp();
+
+ if (((xf86Info.consoleFd = open(fb_dev, O_RDWR | O_NDELAY, 0)) < 0))
+ FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
+ fb_dev, strerror(errno));
+
+#ifdef HAS_USL_VTS
+
+ /* Change ownership of the vt */
+ chown(fb_dev, getuid(), getgid());
+
+ /*
+ * Now get the VT
+ */
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_GETMODE failed\n");
+
+ signal(SIGUSR1, xf86VTRequest);
+
+ VT.mode = VT_PROCESS;
+ VT.relsig = SIGUSR1;
+ VT.acqsig = SIGUSR1;
+
+ if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
+#endif
+#ifdef KDSETMODE
+ if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
+ FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
+#endif
+ }
+ else /* serverGeneration != 1 */
+ {
+#ifdef HAS_USL_VTS
+ /*
+ * Now re-get the VT
+ */
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
+
+ /*
+ * If the server doesn't have the VT when the reset occurs,
+ * this is to make sure we don't continue until the activate
+ * signal is received.
+ */
+ if (!xf86Screens[0]->vtSema)
+ sleep(5);
+
+#endif /* HAS_USL_VTS */
+
+ }
+}
+
+void
+xf86CloseConsole(void)
+{
+#ifdef HAS_USL_VTS
+ struct vt_mode VT;
+#endif
+
+#if !defined(__i386__) && !defined(__i386) && !defined(__x86)
+
+ if (!xf86DoProbe && !xf86DoConfigure) {
+ int fd;
+
+ /*
+ * Wipe out framebuffer just like the non-SI Xsun server does. This
+ * could be improved by saving framebuffer contents in
+ * xf86OpenConsole() above and restoring them here. Also, it's unclear
+ * at this point whether this should be done for all framebuffers in
+ * the system, rather than only the console.
+ */
+ if ((fd = open("/dev/fb", O_RDWR, 0)) < 0) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to open framebuffer (%s)\n",
+ strerror(errno));
+ } else {
+ struct fbgattr fbattr;
+
+ if ((ioctl(fd, FBIOGATTR, &fbattr) < 0) &&
+ (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0)) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to retrieve framebuffer"
+ " attributes (%s)\n", strerror(errno));
+ } else {
+ pointer fbdata;
+
+ fbdata = mmap(NULL, fbattr.fbtype.fb_size,
+ PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (fbdata == MAP_FAILED) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to mmap framebuffer"
+ " (%s)\n", strerror(errno));
+ } else {
+ (void)memset(fbdata, 0, fbattr.fbtype.fb_size);
+ (void)munmap(fbdata, fbattr.fbtype.fb_size);
+ }
+ }
+
+ close(fd);
+ }
+ }
+
+#endif
+
+#ifdef KDSETMODE
+ /* Reset the display back to text mode */
+ ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
+#endif
+
+#ifdef HAS_USL_VTS
+
+ /*
+ * Solaris 2.1 x86 doesn't seem to "switch" back to the console when the VT
+ * is relinquished and its mode is reset to auto. Also, Solaris 2.1 seems
+ * to associate vt00 with the console so I've opened the "console" back up
+ * and made it the active vt again in text mode and then closed it. There
+ * must be a better hack for this but I'm not aware of one at this time.
+ *
+ * Doug Anson 11/6/93
+ * danson@lgc.com
+ *
+ * Fixed - 12/5/93 - David Holland - davidh@dorite.use.com
+ * Did the whole thing similarly to the way linux does it
+ */
+
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
+ {
+ VT.mode = VT_AUTO; /* Set default vt handling */
+ ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
+ }
+
+ /* Activate the VT that X was started on */
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
+
+#endif /* HAS_USL_VTS */
+
+ close(xf86Info.consoleFd);
+}
+
+int
+xf86ProcessArgument(int argc, char **argv, int i)
+{
+ /*
+ * Keep server from detaching from controlling tty. This is useful when
+ * debugging, so the server can receive keyboard signals.
+ */
+ if (!strcmp(argv[i], "-keeptty"))
+ {
+ KeepTty = TRUE;
+ return 1;
+ }
+
+ /*
+ * Undocumented flag to protect page 0 from read/write to help catch NULL
+ * pointer dereferences. This is purely a debugging flag.
+ */
+ if (!strcmp(argv[i], "-protect0"))
+ {
+ Protect0 = TRUE;
+ return 1;
+ }
+
+#ifdef HAS_USL_VTS
+
+ if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
+ {
+ if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
+ {
+ UseMsg();
+ VTnum = -1;
+ return 0;
+ }
+
+ return 1;
+ }
+
+#endif /* HAS_USL_VTS */
+
+#if defined(__SOL8__) || (!defined(__i386__) && !defined(__i386))
+
+ if ((i + 1) < argc) {
+ if (!strcmp(argv[i], "-dev")) {
+ strncpy(fb_dev, argv[i+1], PATH_MAX);
+ fb_dev[PATH_MAX - 1] = '\0';
+ return 2;
+ }
+ }
+
+#endif
+
+ return 0;
+}
+
+void xf86UseMsg()
+{
+#ifdef HAS_USL_VTS
+ ErrorF("vtXX Use the specified VT number\n");
+#endif
+#if defined(__SOL8__) || !defined(__i386__)
+ ErrorF("-dev <fb> Framebuffer device\n");
+#endif
+ ErrorF("-keeptty Don't detach controlling tty\n");
+ ErrorF(" (for debugging only)\n");
+}
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_mouse.c b/xorg-server/hw/xfree86/os-support/solaris/sun_mouse.c
new file mode 100644
index 000000000..a5955ef2c
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_mouse.c
@@ -0,0 +1,717 @@
+/*
+ * Copyright 1999-2001 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.
+ */
+/* Copyright 2004-2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * 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
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86.h"
+#include "xf86_OSlib.h"
+#include "xf86OSmouse.h"
+
+#if defined(__SOL8__) || !defined(__i386)
+
+#include "xisb.h"
+#include "mipointer.h"
+#include <sys/stropts.h>
+#include <sys/vuid_event.h>
+#include <sys/msio.h>
+
+/* Wheel mouse support in VUID drivers in Solaris 9 updates & Solaris 10 */
+#ifdef WHEEL_DEVID /* Defined in vuid_event.h if VUID wheel support present */
+# define HAVE_VUID_WHEEL
+#endif
+#ifdef HAVE_VUID_WHEEL
+# include <sys/vuid_wheel.h>
+#endif
+
+/* Support for scaling absolute coordinates to screen size in
+ * Solaris 10 updates and beyond */
+#if !defined(HAVE_ABSOLUTE_MOUSE_SCALING)
+# ifdef MSIOSRESOLUTION /* Defined in msio.h if scaling support present */
+# define HAVE_ABSOLUTE_MOUSE_SCALING
+# endif
+#endif
+
+/* Names of protocols that are handled internally here. */
+
+static const char *internalNames[] = {
+ "VUID",
+ NULL
+};
+
+static const char *solarisMouseDevs[] = {
+ /* Device file: Protocol: */
+ "/dev/mouse", "VUID", /* USB or SPARC */
+#if defined(__i386) || defined(__x86)
+ "/dev/kdmouse", "PS/2", /* PS/2 */
+#endif
+ NULL
+};
+
+typedef struct _VuidMseRec {
+ struct _VuidMseRec *next;
+ InputInfoPtr pInfo;
+ Firm_event event;
+ unsigned char * buffer;
+ char * strmod;
+ Bool(*wrapped_device_control)(DeviceIntPtr device, int what);
+#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+ Ms_screen_resolution absres;
+#endif
+} VuidMseRec, *VuidMsePtr;
+
+static VuidMsePtr vuidMouseList = NULL;
+
+static int vuidMouseProc(DeviceIntPtr pPointer, int what);
+static void vuidReadInput(InputInfoPtr pInfo);
+
+#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+static void vuidMouseSendScreenSize(ScreenPtr pScreen, VuidMsePtr pVuidMse);
+static void vuidMouseAdjustFrame(int index, int x, int y, int flags);
+
+static int vuidMouseGeneration = 0;
+static DevPrivateKey vuidMouseScreenKey = &vuidMouseScreenKey;
+#define vuidMouseGetScreenPrivate(s) ( \
+ dixLookupPrivate(&(s)->devPrivates, vuidMouseScreenKey))
+#define vuidMouseSetScreenPrivate(s,p) \
+ dixSetPrivate(&(s)->devPrivates, vuidMouseScreenKey, (void *) p)
+#endif /* HAVE_ABSOLUTE_MOUSE_SCALING */
+
+static inline
+VuidMsePtr getVuidMsePriv(InputInfoPtr pInfo)
+{
+ VuidMsePtr m = vuidMouseList;
+
+ while ((m != NULL) && (m->pInfo != pInfo)) {
+ m = m->next;
+ }
+
+ return m;
+}
+
+
+/*
+ * Initialize and enable the mouse wheel, if present.
+ *
+ * Returns 1 if mouse wheel was successfully enabled.
+ * Returns 0 if an error occurred or if there is no mouse wheel.
+ */
+static int
+vuidMouseWheelInit(InputInfoPtr pInfo)
+{
+#ifdef HAVE_VUID_WHEEL
+ wheel_state wstate;
+ int nwheel = -1;
+ int i;
+
+ wstate.vers = VUID_WHEEL_STATE_VERS;
+ wstate.id = 0;
+ wstate.stateflags = -1;
+
+ SYSCALL(i = ioctl(pInfo->fd, VUIDGWHEELCOUNT, &nwheel));
+ if (i != 0)
+ return (0);
+
+ SYSCALL(i = ioctl(pInfo->fd, VUIDGWHEELSTATE, &wstate));
+ if (i != 0) {
+ xf86Msg(X_WARNING, "%s: couldn't get wheel state\n", pInfo->name);
+ return (0);
+ }
+
+ wstate.stateflags |= VUID_WHEEL_STATE_ENABLED;
+
+ SYSCALL(i = ioctl(pInfo->fd, VUIDSWHEELSTATE, &wstate));
+ if (i != 0) {
+ xf86Msg(X_WARNING, "%s: couldn't enable wheel\n", pInfo->name);
+ return (0);
+ }
+
+ return (1);
+#else
+ return (0);
+#endif
+}
+
+
+/* This function is called when the protocol is "VUID". */
+static Bool
+vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ MouseDevPtr pMse = pInfo->private;
+ VuidMsePtr pVuidMse;
+ int buttons, i;
+
+ pVuidMse = xcalloc(sizeof(VuidMseRec), 1);
+ if (pVuidMse == NULL) {
+ xf86Msg(X_ERROR, "%s: cannot allocate VuidMouseRec\n", pInfo->name);
+ xfree(pMse);
+ return FALSE;
+ }
+
+ pMse->protocol = protocol;
+ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
+
+ /* Collect the options, and process the common options. */
+ xf86CollectInputOptions(pInfo, NULL, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ /* Check if the device can be opened. */
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1) {
+ if (xf86GetAllowMouseOpenFail())
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
+ xfree(pVuidMse);
+ xfree(pMse);
+ return FALSE;
+ }
+ }
+
+ pVuidMse->buffer = (unsigned char *)&pVuidMse->event;
+
+ pVuidMse->strmod = xf86SetStrOption(pInfo->options, "StreamsModule", NULL);
+ if (pVuidMse->strmod) {
+ SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod));
+ if (i < 0) {
+ xf86Msg(X_ERROR,
+ "%s: cannot push module '%s' onto mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ xfree(pVuidMse->strmod);
+ xfree(pVuidMse);
+ xfree(pMse);
+ return FALSE;
+ }
+ }
+
+ buttons = xf86SetIntOption(pInfo->options, "Buttons", 0);
+ if (buttons == 0) {
+ SYSCALL(i = ioctl(pInfo->fd, MSIOBUTTONS, &buttons));
+ if (i == 0) {
+ pInfo->conf_idev->commonOptions =
+ xf86ReplaceIntOption(pInfo->conf_idev->commonOptions,
+ "Buttons", buttons);
+ xf86Msg(X_INFO, "%s: Setting Buttons option to \"%d\"\n",
+ pInfo->name, buttons);
+ }
+ }
+
+ if (pVuidMse->strmod) {
+ SYSCALL(i = ioctl(pInfo->fd, I_POP, pVuidMse->strmod));
+ if (i == -1) {
+ xf86Msg(X_WARNING,
+ "%s: cannot pop module '%s' off mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ }
+ }
+
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+
+ /* Process common mouse options (like Emulate3Buttons, etc). */
+ pMse->CommonOptions(pInfo);
+
+ /* Setup the local procs. */
+ pVuidMse->wrapped_device_control = pInfo->device_control;
+ pInfo->device_control = vuidMouseProc;
+ pInfo->read_input = vuidReadInput;
+
+ pMse->xisbscale = sizeof(Firm_event);
+
+#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+ pVuidMse->absres.height = pVuidMse->absres.width = 0;
+#endif
+ pVuidMse->pInfo = pInfo;
+ pVuidMse->next = vuidMouseList;
+ vuidMouseList = pVuidMse;
+
+ pInfo->flags |= XI86_CONFIGURED;
+ return TRUE;
+}
+
+static void
+vuidFlushAbsEvents(InputInfoPtr pInfo, int absX, int absY,
+ Bool *absXset, Bool *absYset)
+{
+#ifdef DEBUG
+ ErrorF("vuidFlushAbsEvents: %d,%d (set: %d, %d)\n", absX, absY,
+ *absXset, *absYset);
+#endif
+ if ((*absXset) && (*absYset)) {
+ xf86PostMotionEvent(pInfo->dev,
+ /* is_absolute: */ TRUE,
+ /* first_valuator: */ 0,
+ /* num_valuators: */ 2,
+ absX, absY);
+ } else if (*absXset) {
+ xf86PostMotionEvent(pInfo->dev,
+ /* is_absolute: */ TRUE,
+ /* first_valuator: */ 0,
+ /* num_valuators: */ 1,
+ absX);
+ } else if (*absYset) {
+ xf86PostMotionEvent(pInfo->dev,
+ /* is_absolute: */ TRUE,
+ /* first_valuator: */ 1,
+ /* num_valuators: */ 1,
+ absY);
+ }
+
+ *absXset = FALSE;
+ *absYset = FALSE;
+}
+
+static void
+vuidReadInput(InputInfoPtr pInfo)
+{
+ MouseDevPtr pMse;
+ VuidMsePtr pVuidMse;
+ int buttons;
+ int dx = 0, dy = 0, dz = 0, dw = 0;
+ unsigned int n;
+ int c;
+ unsigned char *pBuf;
+ int wmask;
+ int absX, absY;
+ Bool absXset = FALSE, absYset = FALSE;
+
+ pMse = pInfo->private;
+ pVuidMse = getVuidMsePriv(pInfo);
+ buttons = pMse->lastButtons;
+ XisbBlockDuration(pMse->buffer, -1);
+ pBuf = pVuidMse->buffer;
+ n = 0;
+
+ do {
+ while (n < sizeof(Firm_event) && (c = XisbRead(pMse->buffer)) >= 0) {
+ pBuf[n++] = (unsigned char)c;
+ }
+
+ if (n == 0)
+ return;
+
+ if (n != sizeof(Firm_event)) {
+ xf86Msg(X_WARNING, "%s: incomplete packet, size %d\n",
+ pInfo->name, n);
+ }
+
+#ifdef DEBUG
+ ErrorF("vuidReadInput: event type: %3d value: %5d\n",
+ pVuidMse->event.id, pVuidMse->event.value);
+#endif
+
+ if (pVuidMse->event.id >= BUT_FIRST && pVuidMse->event.id <= BUT_LAST) {
+ /* button */
+ int butnum = pVuidMse->event.id - BUT_FIRST;
+
+ if (butnum < 3)
+ butnum = 2 - butnum;
+ if (!pVuidMse->event.value)
+ buttons &= ~(1 << butnum);
+ else
+ buttons |= (1 << butnum);
+ } else if (pVuidMse->event.id >= VLOC_FIRST &&
+ pVuidMse->event.id <= VLOC_LAST) {
+ /* axis */
+ int delta = pVuidMse->event.value;
+ switch(pVuidMse->event.id) {
+ case LOC_X_DELTA:
+ dx += delta;
+ break;
+ case LOC_Y_DELTA:
+ dy -= delta;
+ break;
+ case LOC_X_ABSOLUTE:
+ if (absXset) {
+ vuidFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset);
+ }
+ absX = delta;
+ absXset = TRUE;
+ break;
+ case LOC_Y_ABSOLUTE:
+ if (absYset) {
+ vuidFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset);
+ }
+ absY = delta;
+ absYset = TRUE;
+ break;
+ }
+ }
+#ifdef HAVE_VUID_WHEEL
+ else if (vuid_in_range(VUID_WHEEL, pVuidMse->event.id)) {
+ if (vuid_id_offset(pVuidMse->event.id) == 0)
+ dz -= VUID_WHEEL_GETDELTA(pVuidMse->event.value);
+ else
+ dw -= VUID_WHEEL_GETDELTA(pVuidMse->event.value);
+ }
+#endif
+#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+ else if (pVuidMse->event.id == MOUSE_TYPE_ABSOLUTE) {
+ /* force sending absolute resolution scaling ioctl */
+ pVuidMse->absres.height = pVuidMse->absres.width = 0;
+ vuidMouseSendScreenSize(miPointerCurrentScreen(), pVuidMse);
+ }
+#endif
+
+ n = 0;
+ if ((c = XisbRead(pMse->buffer)) >= 0) {
+ /* Another packet. Handle it right away. */
+ pBuf[n++] = c;
+ }
+ } while (n != 0);
+
+ if (absXset || absYset) {
+ vuidFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset);
+ }
+
+ pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
+ return;
+}
+
+#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+static void vuidMouseSendScreenSize(ScreenPtr pScreen, VuidMsePtr pVuidMse)
+{
+ InputInfoPtr pInfo = pVuidMse->pInfo;
+ ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
+ int result;
+
+ if ((pVuidMse->absres.width != pScr->currentMode->HDisplay) ||
+ (pVuidMse->absres.height != pScr->currentMode->VDisplay))
+ {
+ pVuidMse->absres.width = pScr->currentMode->HDisplay;
+ pVuidMse->absres.height = pScr->currentMode->VDisplay;
+
+ do {
+ result = ioctl(pInfo->fd, MSIOSRESOLUTION, &(pVuidMse->absres));
+ } while ( (result != 0) && (errno == EINTR) );
+
+ if (result != 0) {
+ xf86Msg(X_WARNING,
+ "%s: couldn't set absolute mouse scaling resolution: %s\n",
+ pInfo->name, strerror(errno));
+#ifdef DEBUG
+ } else {
+ xf86Msg(X_INFO,
+ "%s: absolute mouse scaling resolution set to %d x %d\n",
+ pInfo->name,
+ pVuidMse->absres.width, pVuidMse->absres.height);
+#endif
+ }
+ }
+}
+
+static void vuidMouseAdjustFrame(int index, int x, int y, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[index];
+ ScreenPtr pScreen = pScrn->pScreen;
+ xf86AdjustFrameProc *wrappedAdjustFrame
+ = (xf86AdjustFrameProc *) vuidMouseGetScreenPrivate(pScreen);
+ VuidMsePtr m;
+
+ if(wrappedAdjustFrame) {
+ pScrn->AdjustFrame = wrappedAdjustFrame;
+ (*pScrn->AdjustFrame)(index, x, y, flags);
+ pScrn->AdjustFrame = vuidMouseAdjustFrame;
+ }
+
+ if (miPointerCurrentScreen() == pScreen) {
+ for (m = vuidMouseList; m != NULL ; m = m->next) {
+ vuidMouseSendScreenSize(pScreen, m);
+ }
+ }
+}
+#endif /* HAVE_ABSOLUTE_MOUSE_SCALING */
+
+
+static int
+vuidMouseProc(DeviceIntPtr pPointer, int what)
+{
+ InputInfoPtr pInfo;
+ MouseDevPtr pMse;
+ VuidMsePtr pVuidMse;
+ int ret = Success;
+ int i;
+
+ pInfo = pPointer->public.devicePrivate;
+ pMse = pInfo->private;
+ pMse->device = pPointer;
+
+ pVuidMse = getVuidMsePriv(pInfo);
+ if (pVuidMse == NULL) {
+ return BadImplementation;
+ }
+
+ switch (what) {
+
+ case DEVICE_INIT:
+#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+ if (vuidMouseGeneration != serverGeneration) {
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
+ vuidMouseSetScreenPrivate(pScreen, pScrn->AdjustFrame);
+ pScrn->AdjustFrame = vuidMouseAdjustFrame;
+ }
+ vuidMouseGeneration = serverGeneration;
+ }
+#endif
+ ret = pVuidMse->wrapped_device_control(pPointer, what);
+ break;
+
+ case DEVICE_ON:
+ ret = pVuidMse->wrapped_device_control(pPointer, DEVICE_ON);
+
+ if ((ret == Success) && (pInfo->fd != -1)) {
+ int fmt = VUID_FIRM_EVENT;
+
+ if (pVuidMse->strmod) {
+ SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod));
+ if (i < 0) {
+ xf86Msg(X_WARNING,
+ "%s: cannot push module '%s' onto mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ xfree(pVuidMse->strmod);
+ pVuidMse->strmod = NULL;
+ }
+ }
+ SYSCALL(i = ioctl(pInfo->fd, VUIDSFORMAT, &fmt));
+ if (i < 0) {
+ xf86Msg(X_WARNING,
+ "%s: cannot set mouse device to VUID mode: %s\n",
+ pInfo->name, strerror(errno));
+ }
+ vuidMouseWheelInit(pInfo);
+#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
+ vuidMouseSendScreenSize(screenInfo.screens[0], pVuidMse);
+#endif
+ xf86FlushInput(pInfo->fd);
+ }
+ break;
+
+ case DEVICE_OFF:
+ case DEVICE_CLOSE:
+ if (pInfo->fd != -1) {
+ if (pVuidMse->strmod) {
+ SYSCALL(i = ioctl(pInfo->fd, I_POP, pVuidMse->strmod));
+ if (i == -1) {
+ xf86Msg(X_WARNING,
+ "%s: cannot pop module '%s' off mouse device: %s\n",
+ pInfo->name, pVuidMse->strmod, strerror(errno));
+ }
+ }
+ }
+ ret = pVuidMse->wrapped_device_control(pPointer, what);
+ break;
+
+ default: /* Should never be called, but just in case */
+ ret = pVuidMse->wrapped_device_control(pPointer, what);
+ break;
+ }
+ return ret;
+}
+
+static Bool
+sunMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ /* The protocol is guaranteed to be one of the internalNames[] */
+ if (xf86NameCmp(protocol, "VUID") == 0) {
+ return vuidPreInit(pInfo, protocol, flags);
+ }
+ return TRUE;
+}
+
+static const char **
+BuiltinNames(void)
+{
+ return internalNames;
+}
+
+static Bool
+CheckProtocol(const char *protocol)
+{
+ int i;
+
+ for (i = 0; internalNames[i]; i++)
+ if (xf86NameCmp(protocol, internalNames[i]) == 0)
+ return TRUE;
+
+ return FALSE;
+}
+
+static const char *
+DefaultProtocol(void)
+{
+ return "Auto";
+}
+
+static Bool
+solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol,
+ const char **device)
+{
+ const char **pdev, **pproto, *dev = NULL;
+ int fd = -1;
+ Bool found;
+
+ for (pdev = solarisMouseDevs; *pdev; pdev += 2) {
+ pproto = pdev + 1;
+ if ((*protocol != NULL) && (strcmp(*protocol, "Auto") != 0) &&
+ (*pproto != NULL) && (strcmp(*pproto, *protocol) != 0)) {
+ continue;
+ }
+ if ((*device != NULL) && (strcmp(*device, *pdev) != 0)) {
+ continue;
+ }
+ SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
+ if (fd == -1) {
+#ifdef DEBUG
+ ErrorF("Cannot open %s (%s)\n", pdev, strerror(errno));
+#endif
+ } else {
+ found = TRUE;
+ if ((*pproto != NULL) && (strcmp(*pproto, "VUID") == 0)) {
+ int i, r;
+ SYSCALL(r = ioctl(fd, VUIDGFORMAT, &i));
+ if (r < 0) {
+ found = FALSE;
+ }
+ }
+ close(fd);
+ if (found == TRUE) {
+ if (*pproto != NULL) {
+ *protocol = *pproto;
+ }
+ *device = *pdev;
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+static const char *
+SetupAuto(InputInfoPtr pInfo, int *protoPara)
+{
+ const char *pdev = NULL;
+ const char *pproto = NULL;
+ MouseDevPtr pMse = pInfo->private;
+
+ if (pInfo->fd == -1) {
+ /* probe to find device/protocol to use */
+ if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
+ /* Set the Device option. */
+ pInfo->conf_idev->commonOptions =
+ xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
+ xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
+ pInfo->name, pdev);
+ }
+ } else if (pMse->protocolID == PROT_AUTO) {
+ pdev = xf86CheckStrOption(pInfo->conf_idev->commonOptions,
+ "Device", NULL);
+ solarisMouseAutoProbe(pInfo, &pproto, &pdev);
+ }
+ return pproto;
+}
+
+static const char *
+FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ const char *pdev = NULL;
+ const char *pproto = protocol;
+
+ if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
+ /* Set the Device option. */
+ pInfo->conf_idev->commonOptions =
+ xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
+ xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
+ pInfo->name, pdev);
+ }
+ return pdev;
+}
+
+#else /* __SOL8__ || !__i386 */
+
+#undef MSE_MISC
+#define MSE_MISC 0
+
+#endif /* !__SOL8__ && __i386 */
+
+static int
+SupportedInterfaces(void)
+{
+ /* XXX This needs to be checked. */
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_XPS2 | MSE_MISC;
+}
+
+_X_EXPORT OSMouseInfoPtr
+xf86OSMouseInit(int flags)
+{
+ OSMouseInfoPtr p;
+
+ p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ if (!p)
+ return NULL;
+ p->SupportedInterfaces = SupportedInterfaces;
+#if defined(__SOL8__) || !defined(__i386)
+ p->BuiltinNames = BuiltinNames;
+ p->CheckProtocol = CheckProtocol;
+ p->PreInit = sunMousePreInit;
+ p->DefaultProtocol = DefaultProtocol;
+ p->SetupAuto = SetupAuto;
+ p->FindDevice = FindDevice;
+#endif
+ return p;
+}
+
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_vid.c b/xorg-server/hw/xfree86/os-support/solaris/sun_vid.c
new file mode 100644
index 000000000..e7b529ccb
--- /dev/null
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_vid.c
@@ -0,0 +1,236 @@
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * 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 the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ * SHALL THE COPYRIGHT HOLDERS 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 <sys/types.h> /* get __x86 definition if not set by compiler */
+
+#if defined(__i386__) || defined(__i386) || defined(__x86)
+#define _NEED_SYSI86
+#endif
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+char *apertureDevName = NULL;
+
+_X_EXPORT Bool
+xf86LinearVidMem(void)
+{
+ int mmapFd;
+
+ if (apertureDevName)
+ return TRUE;
+
+ apertureDevName = "/dev/xsvc";
+ if ((mmapFd = open(apertureDevName, O_RDWR)) < 0)
+ {
+ apertureDevName = "/dev/fbs/aperture";
+ if((mmapFd = open(apertureDevName, O_RDWR)) < 0)
+ {
+ xf86MsgVerb(X_WARNING, 0,
+ "xf86LinearVidMem: failed to open %s (%s)\n",
+ apertureDevName, strerror(errno));
+ xf86MsgVerb(X_WARNING, 0,
+ "xf86LinearVidMem: either /dev/fbs/aperture or /dev/xsvc"
+ " device driver required\n");
+ xf86MsgVerb(X_WARNING, 0,
+ "xf86LinearVidMem: linear memory access disabled\n");
+ apertureDevName = NULL;
+ return FALSE;
+ }
+ }
+ close(mmapFd);
+ return TRUE;
+}
+
+_X_EXPORT pointer
+xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
+{
+ pointer base;
+ int fd;
+ char vtname[20];
+
+ /*
+ * Solaris 2.1 x86 SVR4 (10/27/93)
+ * The server must treat the virtual terminal device file as the
+ * standard SVR4 /dev/pmem.
+ *
+ * Using the /dev/vtXX device as /dev/pmem only works for the
+ * A0000-FFFFF region - If we wish you mmap the linear aperture
+ * it requires a device driver.
+ *
+ * So what we'll do is use /dev/vtXX for the A0000-FFFFF stuff, and
+ * try to use the /dev/fbs/aperture or /dev/xsvc driver if the server
+ * tries to mmap anything > FFFFF. Its very very unlikely that the
+ * server will try to mmap anything below FFFFF that can't be handled
+ * by /dev/vtXX.
+ *
+ * DWH - 2/23/94
+ * DWH - 1/31/99 (Gee has it really been 5 years?)
+ *
+ * Solaris 2.8 7/26/99
+ * Use /dev/xsvc for everything
+ *
+ * DWH - 7/26/99 - Solaris8/dev/xsvc changes
+ *
+ * TSI - 2001.09 - SPARC changes
+ */
+
+#if defined(__i386__) && !defined(__SOL8__)
+ if(Base < 0xFFFFF)
+ sprintf(vtname, "/dev/vt%02d", xf86Info.vtno);
+ else
+#endif
+ {
+ if (!xf86LinearVidMem())
+ FatalError("xf86MapVidMem: no aperture device\n");
+
+ strcpy(vtname, apertureDevName);
+ }
+
+ fd = open(vtname, (Flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
+ if (fd < 0)
+ FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ vtname, strerror(errno));
+
+ base = mmap(NULL, Size,
+ (Flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, (off_t)Base);
+ close(fd);
+ if (base == MAP_FAILED)
+ FatalError("xf86MapVidMem: mmap failure: %s\n",
+ strerror(errno));
+
+ return(base);
+}
+
+/* ARGSUSED */
+_X_EXPORT void
+xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap(Base, Size);
+}
+
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+#if defined(__i386__) || defined(__i386) || defined(__x86)
+static Bool ExtendedEnabled = FALSE;
+#endif
+
+_X_EXPORT Bool
+xf86EnableIO(void)
+{
+#if defined(__i386__) || defined(__i386) || defined(__x86)
+ if (ExtendedEnabled)
+ return TRUE;
+
+ if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) {
+ xf86Msg(X_WARNING,"xf86EnableIOPorts: Failed to set IOPL for I/O\n");
+ return FALSE;
+ }
+ ExtendedEnabled = TRUE;
+#endif /* i386 */
+ return TRUE;
+}
+
+_X_EXPORT void
+xf86DisableIO(void)
+{
+#if defined(__i386__) || defined(__i386) || defined(__x86)
+ if(!ExtendedEnabled)
+ return;
+
+ sysi86(SI86V86, V86SC_IOPL, 0);
+
+ ExtendedEnabled = FALSE;
+#endif /* i386 */
+}
+
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+_X_EXPORT Bool xf86DisableInterrupts(void)
+{
+#if defined(__i386__) || defined(__i386) || defined(__x86)
+ if (!ExtendedEnabled && (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0))
+ return FALSE;
+
+#ifdef __GNUC__
+ __asm__ __volatile__("cli");
+#else
+ asm("cli");
+#endif /* __GNUC__ */
+
+ if (!ExtendedEnabled)
+ sysi86(SI86V86, V86SC_IOPL, 0);
+#endif /* i386 */
+
+ return TRUE;
+}
+
+_X_EXPORT void xf86EnableInterrupts(void)
+{
+#if defined(__i386__) || defined(__i386) || defined(__x86)
+ if (!ExtendedEnabled && (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0))
+ return;
+
+#ifdef __GNUC__
+ __asm__ __volatile__("sti");
+#else
+ asm("sti");
+#endif /* __GNUC__ */
+
+ if (!ExtendedEnabled)
+ sysi86(SI86V86, V86SC_IOPL, 0);
+#endif /* i386 */
+}
+
+_X_EXPORT void
+xf86MapReadSideEffects(int ScreenNum, int Flags, pointer Base,
+ unsigned long Size)
+{
+}
+
+_X_EXPORT Bool
+xf86CheckMTRR(int ScreenNum)
+{
+ return FALSE;
+}
+