diff options
author | marha <marha@users.sourceforge.net> | 2010-01-31 18:54:23 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-01-31 18:54:23 +0000 |
commit | 62d24022ec725850c6635118b5cd372ae47d63d9 (patch) | |
tree | 1393d83c103303ade89e34444c1bf4fdf81b7d5f /xorg-server | |
parent | fe6927d79e02d01cce20ecf56c8721fcadc2d278 (diff) | |
parent | 007385f704a99ab49dab0789f9c330a1a3a455be (diff) | |
download | vcxsrv-62d24022ec725850c6635118b5cd372ae47d63d9.tar.gz vcxsrv-62d24022ec725850c6635118b5cd372ae47d63d9.tar.bz2 vcxsrv-62d24022ec725850c6635118b5cd372ae47d63d9.zip |
svn merge ^/branches/released
Diffstat (limited to 'xorg-server')
32 files changed, 38220 insertions, 38027 deletions
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 8c1085b29..92070aef7 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -1,2218 +1,2224 @@ -dnl Copyright © 2003-2007 Keith Packard, Daniel Stone -dnl -dnl Permission is hereby granted, free of charge, to any person obtaining a -dnl copy of this software and associated documentation files (the "Software"), -dnl to deal in the Software without restriction, including without limitation -dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, -dnl and/or sell copies of the Software, and to permit persons to whom the -dnl Software is furnished to do so, subject to the following conditions: -dnl -dnl The above copyright notice and this permission notice (including the next -dnl paragraph) shall be included in all copies or substantial portions of the -dnl Software. -dnl -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -dnl DEALINGS IN THE SOFTWARE. -dnl -dnl Authors: Keith Packard <keithp@keithp.com> -dnl Daniel Stone <daniel@fooishbar.org> -dnl an unwitting cast of miscellaneous others -dnl -dnl Process this file with autoconf to create configure. - -AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.7.99.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="(unreleased)" -AC_CONFIG_SRCDIR([Makefile.am]) -AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AM_MAINTAINER_MODE - -# Require xorg-macros: XORG_DEFAULT_OPTIONS -m4_ifndef([XORG_MACROS_VERSION], - [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.3) -XORG_DEFAULT_OPTIONS - -m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])]) -XORG_FONT_MACROS_VERSION(1.1) - -dnl this gets generated by autoheader, and thus contains all the defines. we -dnl don't ever actually use it, internally. -AC_CONFIG_HEADERS(include/do-not-use-config.h) -dnl xorg-server.h is an external header, designed to be included by loadable -dnl drivers. -AC_CONFIG_HEADERS(include/xorg-server.h) -dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just -dnl dix/). -AC_CONFIG_HEADERS(include/dix-config.h) -dnl xorg-config.h covers the Xorg DDX. -AC_CONFIG_HEADERS(include/xorg-config.h) -dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs. -AC_CONFIG_HEADERS(include/xkb-config.h) -dnl xwin-config.h covers the XWin DDX. -AC_CONFIG_HEADERS(include/xwin-config.h) -dnl kdrive-config.h covers the kdrive DDX -AC_CONFIG_HEADERS(include/kdrive-config.h) -dnl version-config.h covers the version numbers so they can be bumped without -dnl forcing an entire recompile.x -AC_CONFIG_HEADERS(include/version-config.h) - -AC_PROG_CC -AM_PROG_AS -AC_PROG_INSTALL -AC_PROG_LN_S -AC_LIBTOOL_WIN32_DLL -AC_DISABLE_STATIC -AC_PROG_LIBTOOL -DOLT -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG -AC_PROG_LEX -AC_PROG_YACC -AC_SYS_LARGEFILE -XORG_PROG_RAWCPP -AC_PATH_PROG(SED,sed) - -# Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow -# easier overrides at build time. -XSERVER_CFLAGS='$(CWARNFLAGS)' - -dnl Check for dtrace program (needed to build Xserver dtrace probes) -dnl Also checks for <sys/sdt.h>, since some Linux distros have an -dnl ISDN trace program named dtrace -AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH], - [Enable dtrace probes (default: enabled if dtrace found)]), - [WDTRACE=$withval], [WDTRACE=auto]) -if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then - AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin]) - if test "x$DTRACE" = "xnot_found" ; then - if test "x$WDTRACE" = "xyes" ; then - AC_MSG_FAILURE([dtrace requested but not found]) - fi - WDTRACE="no" - else - AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"]) - if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then - WDTRACE="no" - fi - fi -fi -if test "x$WDTRACE" != "xno" ; then - AC_DEFINE(XSERVER_DTRACE, 1, - [Define to 1 if the DTrace Xserver provider probes should be built in.]) - -# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into -# object files, and require linking with those as relocatable objects, not .a -# archives. MacOS X handles all this in the normal compiler toolchain, and on -# some releases (like Tiger), will error out on dtrace -G. For now, other -# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux -# ports appear to, based on my web searches, but have not yet been tested). - case $host_os in - darwin*) SPECIAL_DTRACE_OBJECTS=no ;; - *) SPECIAL_DTRACE_OBJECTS=yes ;; - esac -fi -AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"]) -AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"]) - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h fnmatch.h]) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"]) - -AC_CHECK_SIZEOF([unsigned long]) -if test "$ac_cv_sizeof_unsigned_long" = 8; then - AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.]) -fi - -AC_TYPE_PID_T - -# Checks for headers/macros for byte swapping -# Known variants: -# <byteswap.h> bswap_16, bswap_32, bswap_64 (glibc) -# <sys/endian.h> __swap16, __swap32, __swap64 (OpenBSD) -# <sys/endian.h> bswap16, bswap32, bswap64 (other BSD's) -# and a fallback to local macros if none of the above are found - -# if <byteswap.h> is found, assume it's the correct version -AC_CHECK_HEADERS([byteswap.h]) - -# if <sys/endian.h> is found, have to check which version -AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"]) - -if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then - AC_MSG_CHECKING([for __swap16 variant of <sys/endian.h> byteswapping macros]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ -#include <sys/types.h> -#include <sys/endian.h> - ], [ -int a = 1, b; -b = __swap16(a); - ]) -], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no']) - AC_MSG_RESULT([$SYS_ENDIAN__SWAP]) - - AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ -#include <sys/types.h> -#include <sys/endian.h> - ], [ -int a = 1, b; -b = bswap16(a); - ]) -], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no']) - AC_MSG_RESULT([$SYS_ENDIAN_BSWAP]) - - if test "$SYS_ENDIAN_BSWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=bswap - else - if test "$SYS_ENDIAN__SWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=__swap - else - USE_SYS_ENDIAN_H=no - fi - fi - - if test "$USE_SYS_ENDIAN_H" = "yes" ; then - AC_DEFINE([USE_SYS_ENDIAN_H], 1, - [Define to use byteswap macros from <sys/endian.h>]) - AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, - [Define to 16-bit byteswap macro]) - AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, - [Define to 32-bit byteswap macro]) - AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, - [Define to 64-bit byteswap macro]) - fi -fi - -dnl Check to see if dlopen is in default libraries (like Solaris, which -dnl has it in libc), or if libdl is needed to get it. -AC_CHECK_FUNC([dlopen], [], - AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) -AC_SUBST(DLOPEN_LIBS) - -dnl Checks for library functions. -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ - strtol getopt getopt_long vsnprintf walkcontext backtrace \ - getisax getzoneid shmctl64 strcasestr ffs]) -AC_FUNC_ALLOCA -dnl Old HAS_* names used in os/*.c. -AC_CHECK_FUNC([getdtablesize], - AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.])) -AC_CHECK_FUNC([getifaddrs], - AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.])) -AC_CHECK_FUNC([getpeereid], - AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.])) -AC_CHECK_FUNC([getpeerucred], - AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.])) -AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no) -AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno]) -AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function])) - -AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno]) - -dnl Check for mmap support for Xvfb -AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.])) - -dnl Find the math libary -AC_CHECK_LIB(m, sqrt) -AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function])) - -AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h]) - -dnl AGPGART headers -AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes) -AM_CONDITIONAL(AGP, [test "x$AGP" = xyes]) - -dnl APM header -AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes) -AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes]) - -dnl fbdev header -AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes) -AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes]) - -dnl MTRR header -AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes) -if test "x$ac_cv_asm_mtrr_h" = xyes; then - HAVE_MTRR=yes -fi - -dnl BSD MTRR header -AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes) -if test "x$ac_cv_memrange_h" = xyes; then - HAVE_MTRR=yes -fi - -if test "x$HAVE_MTRR" = xyes; then - AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available]) -fi - -dnl A NetBSD MTRR header -AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes) -if test "x$ac_cv_machine_mtrr_h" = xyes; then - AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR - support is available]) -fi - -dnl FreeBSD kldload support (sys/linker.h) -AC_CHECK_HEADERS([sys/linker.h], - [ac_cv_sys_linker_h=yes], - [ac_cv_sys_linker_h=no], - [#include <sys/param.h>]) -AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes]) - -AC_CACHE_CHECK([for SYSV IPC], - ac_cv_sysv_ipc, - [AC_TRY_LINK([ -#include <sys/types.h> -#include <sys/ipc.h> -#include <sys/shm.h> -],[ -{ - int id; - id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R); - if (id < 0) return -1; - return shmctl(id, IPC_RMID, 0); -}], - [ac_cv_sysv_ipc=yes], - [ac_cv_sysv_ipc=no])]) -if test "x$ac_cv_sysv_ipc" = xyes; then - AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available]) -fi - -dnl OpenBSD /dev/xf86 aperture driver -if test -c /dev/xf86 ; then - AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver]) -fi - -dnl BSD APM support -AC_CHECK_HEADER([machine/apmvar.h],[ - AC_CHECK_HEADER([sys/event.h], - ac_cv_BSD_KQUEUE_APM=yes, - ac_cv_BSD_APM=yes)]) - -AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes]) -AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes]) - -dnl glibc backtrace support check (hw/xfree86/common/xf86Events.c) -AC_CHECK_HEADER([execinfo.h],[ - AC_CHECK_LIB(c, backtrace, [ - AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support]) - AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h]) - ])] -) - -dnl --------------------------------------------------------------------------- -dnl Bus options and CPU capabilities. Replaces logic in -dnl hw/xfree86/os-support/bus/Makefile.am, among others. -dnl --------------------------------------------------------------------------- -DEFAULT_INT10="x86emu" - -dnl Override defaults as needed for specific platforms: - -case $host_cpu in - alpha*) - ALPHA_VIDEO=yes - case $host_os in - *freebsd*) SYS_LIBS=-lio ;; - *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;; - esac - GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee" - ;; - arm*) - ARM_VIDEO=yes - ;; - i*86) - I386_VIDEO=yes - case $host_os in - *freebsd*) AC_DEFINE(USE_DEV_IO) ;; - *dragonfly*) AC_DEFINE(USE_DEV_IO) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL) - SYS_LIBS=-li386 - ;; - *openbsd*) AC_DEFINE(USE_I386_IOPL) - SYS_LIBS=-li386 - ;; - esac - ;; - powerpc*) - PPC_VIDEO=yes - case $host_os in - *freebsd*) DEFAULT_INT10=stub ;; - esac - ;; - sparc*) - SPARC64_VIDEO=yes - BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c" - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; - x86_64*|amd64*) - I386_VIDEO=yes - case $host_os in - *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; - *dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) - SYS_LIBS=-lx86_64 - ;; - *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl]) - SYS_LIBS=-lamd64 - ;; - esac - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; - ia64*) - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; - s390*) - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; -esac -AC_SUBST(GLX_ARCH_DEFINES) - -dnl BSD *_video.c selection -AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes]) -AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes]) -AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes]) -AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes]) -AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes]) - -DRI=no -USE_SIGIO_BY_DEFAULT="yes" -dnl it would be nice to autodetect these *CONS_SUPPORTs -case $host_os in - *freebsd* | *dragonfly*) - case $host_os in - kfreebsd*-gnu) ;; - *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;; - esac - AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) - AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) - AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console]) - DRI=yes - ;; - *netbsd*) - AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) - AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) - AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) - AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) - DRI=yes - ;; - *openbsd*) - AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) - AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console]) - AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) - ;; - *linux*) - DRI=yes - ;; - *solaris*) - PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no) - # Disable use of SIGIO by default until some system bugs are - # fixed - see Sun/OpenSolaris bug id 6879897 - USE_SIGIO_BY_DEFAULT="no" - ;; - darwin*) - AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) - ;; -esac - -dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the -dnl major number -PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1` -PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1` -if test "x$PVS" = "x"; then - PVS="0" -fi - -VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)" -VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" - -VENDOR_NAME="The X.Org Foundation" -VENDOR_NAME_SHORT="X.Org" -VENDOR_WEB="http://wiki.x.org" - -m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))]) - -dnl Build options. -AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], - [Obsolete - use --enable-strict-compilation instead]), - AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation])) - -AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], - [Enable debugging (default: disabled)]), - [DEBUGGING=$enableval], [DEBUGGING=no]) -AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], - [Enable unit-tests (default: auto)]), - [UNITTESTS=$enableval], [UNITTESTS=auto]) -AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default] - [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]), - [USE_SIGIO_BY_DEFAULT=$enableval], []) -AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]), - [INT10="$withval"], - [INT10="$DEFAULT_INT10"]) -AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR], - [Vendor string reported by the server]), - [ VENDOR_NAME="$withval" ], []) -AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR], - [Short version of vendor string reported by the server]), - [ VENDOR_NAME_SHORT="$withval" ], []) -AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL], - [Vendor web address reported by the server]), - [ VENDOR_WEB="$withval" ], []) -AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR], - [Directory where modules are installed (default: $libdir/xorg/modules)]), - [ moduledir="$withval" ], - [ moduledir="${libdir}/xorg/modules" ]) -AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR], - [Directory where log files are kept (default: $localstatedir/log)]), - [ logdir="$withval" ], - [ logdir="$localstatedir/log" ]) -AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS], - [Builder address (default: xorg@lists.freedesktop.org)]), - [ BUILDERADDR="$withval" ], - [ BUILDERADDR="xorg@lists.freedesktop.org" ]) -AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]), - [ OSNAME="$withval" ], - [ OSNAME=`uname -srm` ]) -AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]), - [ OSVENDOR="$withval" ], - [ OSVENDOR="" ]) -AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]), - [ BUILDERSTRING="$withval" ] - [ ]) - -dnl Determine font path -XORG_FONTROOTDIR -XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) -XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF) -XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF) -XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1) -XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi) -XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi) - -dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d, -dnl otherwise uses standard subdirectories of FONTROOTDIR -AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d], - [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'], - [ - DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/" - case $host_os in - darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;; - esac - ]) -AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]), - [ FONTPATH="$withval" ], - [ FONTPATH="${DEFAULT_FONT_PATH}" ]) - -AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]), - [ XKBPATH="$withval" ], - [ XKBPATH="${datadir}/X11/xkb" ]) -AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), - [ XKBOUTPUT="$withval" ], - [ XKBOUTPUT="compiled" ]) -AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES], - [Keyboard ruleset (default: base/evdev)]), - [ XKB_DFLT_RULES="$withval" ], - [ XKB_DFLT_RULES="" ]) -AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL], - [Keyboard model (default: pc105)]), - [ XKB_DFLT_MODEL="$withval" ], - [ XKB_DFLT_MODEL="pc105" ]) -AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT], - [Keyboard layout (default: us)]), - [ XKB_DFLT_LAYOUT="$withval" ], - [ XKB_DFLT_LAYOUT="us" ]) -AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT], - [Keyboard variant (default: (none))]), - [ XKB_DFLT_VARIANT="$withval" ], - [ XKB_DFLT_VARIANT="" ]) -AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS], - [Keyboard layout options (default: (none))]), - [ XKB_DFLT_OPTIONS="$withval" ], - [ XKB_DFLT_OPTIONS="" ]) -AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], - [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]), - [ SERVERCONFIG="$withval" ], - [ SERVERCONFIG="${libdir}/xorg" ]) -AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]), - [ APPLE_APPLICATIONS_DIR="${withval}" ], - [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ]) -AC_SUBST([APPLE_APPLICATIONS_DIR]) -AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]), - [ APPLE_APPLICATION_NAME="${withval}" ], - [ APPLE_APPLICATION_NAME="X11" ]) -AC_SUBST([APPLE_APPLICATION_NAME]) -AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]), - [ LAUNCHD_ID_PREFIX="${withval}" ], - [ LAUNCHD_ID_PREFIX="org.x" ]) -AC_SUBST([LAUNCHD_ID_PREFIX]) -AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers]) -AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]), - [ XQUARTZ_SPARKLE="${enableval}" ], - [ XQUARTZ_SPARKLE="no" ]) -AC_SUBST([XQUARTZ_SPARKLE]) -AC_ARG_ENABLE(builddocs, AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]), - [BUILDDOCS=$enableval], - [BUILDDOCS=no]) -AC_ARG_ENABLE(install-libxf86config, - AS_HELP_STRING([--enable-install-libxf86config], - [Install libxf86config (default: disabled)]), - [INSTALL_LIBXF86CONFIG=$enableval], - [INSTALL_LIBXF86CONFIG=no]) -AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]), - [NULL_ROOT_CURSOR=$enableval], - [NULL_ROOT_CURSOR=no]) -AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]), - [SYMBOL_VISIBILITY=$enableval], - [SYMBOL_VISIBILITY=auto]) -AC_ARG_ENABLE(pc98, AC_HELP_STRING([--enable-pc98], [Enable PC98 support in Xorg (default: auto)]), - [SUPPORT_PC98=$enableval], - [SUPPORT_PC98=auto]) - -dnl GLX build options -AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]), - [ DRI_DRIVER_PATH="$withval" ], - [ DRI_DRIVER_PATH="${libdir}/dri" ]) -AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]), - [AIGLX=$enableval], - [AIGLX=yes]) -AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: disabled)]), - [GLX_USE_TLS=$enableval], - [GLX_USE_TLS=no]) - -dnl Extensions. -AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes]) -AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) -AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes]) -AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes]) -AC_ARG_ENABLE(record, AS_HELP_STRING([--enable-record], [Build Record extension (default: disabled)]), [RECORD=$enableval], [RECORD=no]) -AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes]) -AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes]) -AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto]) -AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes]) -AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto]) -AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto]) -AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes]) -AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval]) -AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto]) -AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes]) -AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto]) -AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes]) -AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--disable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no]) -AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no]) -AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no]) -AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no]) -AC_ARG_ENABLE(multibuffer, AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no]) -AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes]) -AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no]) -AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes]) -AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: no)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=no]) -AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no]) -AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto]) -AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes]) -AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes]) -AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes]) -AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes]) -AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes]) - -dnl DDXes. -AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) -AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto]) -AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) -AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) -AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) -AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) -AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) -dnl kdrive and its subsystems -AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) -AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) -AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) -AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) -dnl kdrive options -AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: enabled)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=yes]) -AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: enabled)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=yes]) -AC_ARG_ENABLE(kdrive-evdev, AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: enabled)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=yes]) - - -dnl chown/chmod to be setuid root as part of build -dnl Replaces InstallXserverSetUID in imake -AC_ARG_ENABLE(install-setuid, - AS_HELP_STRING([--enable-install-setuid], - [Install Xorg server as owned by root with setuid bit (default: auto)]), - [SETUID=$enableval], [SETUID=auto]) -AC_MSG_CHECKING([to see if we can install the Xorg server as root]) -if test "x$SETUID" = "xauto" ; then - case $host_os in - darwin*) SETUID="no" ;; - *) - case $host_cpu in - sparc) SETUID="no" ;; - *) SETUID="yes" ;; - esac - esac - if test "x$SETUID" = xyes; then - touch testfile - chown root testfile > /dev/null 2>&1 || SETUID="no" - rm -f testfile - fi -fi -AC_MSG_RESULT([$SETUID]) -AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"]) - -dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro -dnl was not expanded, since xorg-server with no transport types is rather useless. -dnl -dnl If you're seeing an error here, be sure you installed the lib/xtrans module -dnl first and if it's not in the default location, that you set the ACLOCAL -dnl environment variable to find it, such as: -dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal" -m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$]) - -# Transport selection macro from xtrans.m4 -XTRANS_CONNECTION_FLAGS - -# Secure RPC detection macro from xtrans.m4 -XTRANS_SECURE_RPC_FLAGS -AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes]) - -AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86]) -AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu]) -AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub]) -if test "x$INT10" = xyes; then - dnl VM86 headers - AC_CHECK_HEADERS([sys/vm86.h sys/io.h]) -fi - -dnl Handle building documentation -AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes) - -dnl Only build sgml docs when linuxdoc is available and -dnl def.ents has been installed -XORG_CHECK_LINUXDOC - -dnl Handle installing libxf86config -AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes]) - -dnl XQuartz DDX Detection... Yes, it's ugly to have it here... but we need to handle this early on -case $host_os in - darwin*) - DRI2=no - - if test x$XQUARTZ = xauto; then - AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[ - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -framework Carbon" - AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}], - [xorg_cv_Carbon_framework=yes], - [xorg_cv_Carbon_framework=no]) - LDFLAGS=$save_LDFLAGS]) - - if test "X$xorg_cv_Carbon_framework" = Xyes; then - XQUARTZ=yes - else - XQUARTZ=no - fi - fi - - if test "x$XQUARTZ" = xyes ; then - XQUARTZ=yes - XVFB=no - XNEST=no - - COMPOSITE=no - DGA=no - DPMSExtension=no - XF86VIDMODE=no - fi - ;; - *) XQUARTZ=no ;; -esac - -dnl --------------------------------------------------------------------------- -dnl Extension section -dnl --------------------------------------------------------------------------- -XEXT_INC='-I$(top_srcdir)/Xext' -XEXT_LIB='$(top_builddir)/Xext/libXext.la' -XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' - -dnl Optional modules -VIDEOPROTO="videoproto" -COMPOSITEPROTO="compositeproto >= 0.4" -RECORDPROTO="recordproto >= 1.13.99.1" -SCRNSAVERPROTO="scrnsaverproto >= 1.1" -RESOURCEPROTO="resourceproto" -DRIPROTO="xf86driproto >= 2.1.0" -DRI2PROTO="dri2proto >= 2.2" -XINERAMAPROTO="xineramaproto" -BIGFONTPROTO="xf86bigfontproto >= 1.2.0" -XCALIBRATEPROTO="xcalibrateproto" -DGAPROTO="xf86dgaproto >= 2.0.99.1" -GLPROTO="glproto >= 1.4.10" -DMXPROTO="dmxproto >= 2.2.99.1" -VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" -WINDOWSWMPROTO="windowswmproto" -APPLEWMPROTO="applewmproto >= 1.4" - -dnl Core modules for most extensions, et al. -REQUIRED_MODULES="[randrproto >= 1.2.99.3] [renderproto >= 0.11] [fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xextproto >= 7.0.99.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] fontsproto [inputproto >= 1.9.99.902] [kbproto >= 1.0.3]" -REQUIRED_LIBS="xfont xau [pixman-1 >= 0.15.20]" - -dnl List of libraries that require a specific version -LIBAPPLEWM="applewm >= 1.4" -LIBDMX="dmx >= 1.0.99.1" -LIBDRI="dri >= 7.1.0" -LIBDRM="libdrm >= 2.3.0" -LIBGL="gl >= 7.1.0" -LIBXEXT="xext >= 1.0.99.4" -LIBXI="xi >= 1.2.99.1" -LIBXTST="xtst >= 1.0.99.2" -LIBPCIACCESS="pciaccess >= 0.8.0" -LIBGLIB="glib-2.0 >= 2.16" -LIBUDEV="libudev >= 143" - -if test "x$CONFIG_UDEV" = xyes && - { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then - AC_MSG_ERROR([Hotplugging through both libudev and dbus/hal not allowed]) -fi - -PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no]) -if test "x$CONFIG_UDEV" = xauto; then - CONFIG_UDEV="$HAVE_LIBUDEV" -fi -AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes]) -if test "x$CONFIG_UDEV" = xyes; then - CONFIG_DBUS_API=no - CONFIG_HAL=no - if ! test "x$HAVE_LIBUDEV" = xyes; then - AC_MSG_ERROR([udev configuration API requested, but libudev is not installed]) - fi - AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug]) -fi - -dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas -dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config -dnl API. -PKG_CHECK_MODULES(DBUS, dbus-1, [HAVE_DBUS=yes], [HAVE_DBUS=no]) -if test "x$HAVE_DBUS" = xyes; then - AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support]) -fi -AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes]) - -if test "x$CONFIG_DBUS_API" = xauto; then - CONFIG_DBUS_API="$HAVE_DBUS" -fi -if test "x$CONFIG_DBUS_API" = xyes; then - if ! test "x$HAVE_DBUS" = xyes; then - AC_MSG_ERROR([D-Bus configuration API requested, but D-Bus is not installed.]) - fi - - AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API]) - CONFIG_NEED_DBUS="yes" -fi -AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes]) - -PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no]) -if test "x$CONFIG_HAL" = xauto; then - CONFIG_HAL="$HAVE_HAL" -fi -if test "x$CONFIG_HAL" = xyes; then - if ! test "x$HAVE_HAL" = xyes; then - AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.]) - fi - - AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API]) - CONFIG_NEED_DBUS="yes" -fi -AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes]) - -if test "x$CONFIG_NEED_DBUS" = xyes; then - AC_DEFINE(CONFIG_NEED_DBUS, 1, [Use D-Bus for input hotplug]) -fi -AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes]) -CONFIG_LIB='$(top_builddir)/config/libconfig.la' - -if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then - USE_SIGIO_BY_DEFAULT_VALUE=TRUE -else - USE_SIGIO_BY_DEFAULT_VALUE=FALSE -fi -AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE], - [Use SIGIO handlers for input device events by default]) - -AC_MSG_CHECKING([for glibc...]) -AC_PREPROC_IFELSE([ -#include <features.h> -#ifndef __GLIBC__ -#error -#endif -], glibc=yes, glibc=no) -AC_MSG_RESULT([$glibc]) - -AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], - [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], - [have_clock_gettime=no])]) - -AC_MSG_CHECKING([for a useful monotonic clock ...]) - -if ! test "x$have_clock_gettime" = xno; then - if ! test "x$have_clock_gettime" = xyes; then - CLOCK_LIBS="$have_clock_gettime" - else - CLOCK_LIBS="" - fi - - LIBS_SAVE="$LIBS" - LIBS="$CLOCK_LIBS" - CPPFLAGS_SAVE="$CPPFLAGS" - - if test x"$glibc" = xyes; then - CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L" - fi - - AC_RUN_IFELSE([ -#include <time.h> - -int main(int argc, char *argv[[]]) { - struct timespec tp; - - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - return 0; - else - return 1; -} - ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], - [MONOTONIC_CLOCK="cross compiling"]) - - LIBS="$LIBS_SAVE" - CPPFLAGS="$CPPFLAGS_SAVE" -else - MONOTONIC_CLOCK=no -fi - -AC_MSG_RESULT([$MONOTONIC_CLOCK]) - -if test "x$MONOTONIC_CLOCK" = xyes; then - AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) - LIBS="$LIBS $CLOCK_LIBS" -fi - -AM_CONDITIONAL(XV, [test "x$XV" = xyes]) -if test "x$XV" = xyes; then - AC_DEFINE(XV, 1, [Support Xv extension]) - AC_DEFINE(XvExtension, 1, [Build Xv extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO" -else - XVMC=no -fi - -AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes]) -if test "x$XVMC" = xyes; then - AC_DEFINE(XvMCExtension, 1, [Build XvMC extension]) -fi - -AM_CONDITIONAL(XREGISTRY, [test "x$XREGISTRY" = xyes]) -if test "x$XREGISTRY" = xyes; then - AC_DEFINE(XREGISTRY, 1, [Build registry module]) -fi - -AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes]) -if test "x$COMPOSITE" = xyes; then - AC_DEFINE(COMPOSITE, 1, [Support Composite Extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO" - COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la' - COMPOSITE_INC='-I$(top_srcdir)/composite' -fi - -AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes]) -if test "x$MITSHM" = xyes; then - AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension]) - AC_DEFINE(HAS_SHM, 1, [Support SHM]) -fi - -AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes]) -if test "x$RECORD" = xyes; then - AC_DEFINE(XRECORD, 1, [Support Record extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO" - RECORD_LIB='$(top_builddir)/record/librecord.la' -fi - -AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes]) -if test "x$SCREENSAVER" = xyes; then - AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO" -fi - -AM_CONDITIONAL(RES, [test "x$RES" = xyes]) -if test "x$RES" = xyes; then - AC_DEFINE(RES, 1, [Support X resource extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO" -fi - -if test "x$GLX" = xyes; then - PKG_CHECK_MODULES([XLIB], [x11]) - PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) - AC_SUBST(XLIB_CFLAGS) - AC_DEFINE(GLXEXT, 1, [Build GLX extension]) - GLX_LIBS='$(top_builddir)/glx/libglx.la' - GLX_SYS_LIBS="$GLX_SYS_LIBS" -else - GLX=no -fi -AM_CONDITIONAL(GLX, test "x$GLX" = xyes) - -if test "x$AIGLX" = xyes -a "x$GLX" = xyes -a "x$DRI" = xyes; then - AC_DEFINE(AIGLX, 1, [Build AIGLX loader]) -else - AIGLX=no -fi -AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes) - -if test "x$GLX_USE_TLS" = xyes -a "x$AIGLX" = xyes; then - GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" - GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" -fi -AC_SUBST([GLX_DEFINES]) - -AM_CONDITIONAL(DRI, test "x$DRI" = xyes) -if test "x$DRI" = xyes; then - AC_DEFINE(XF86DRI, 1, [Build DRI extension]) - PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO]) - PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI) - AC_SUBST(DRIPROTO_CFLAGS) -fi - -PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO, - [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no]) -case "$DRI2,$HAVE_DRI2PROTO" in - yes,no) - AC_MSG_ERROR([DRI2 requested, but dri2proto not found.]) - ;; - yes,yes | auto,yes) - AC_DEFINE(DRI2, 1, [Build DRI2 extension]) - DRI2=yes - ;; -esac -AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes) - -if test "x$DRI" = xyes || test "x$DRI2" = xyes; then - PKG_CHECK_MODULES([LIBDRM], $LIBDRM) - AC_SUBST(LIBDRM_CFLAGS) - AC_SUBST(LIBDRM_LIBS) -fi - -if test "x$DRI2" = xyes; then - save_CFLAGS=$CFLAGS - CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <GL/gl.h> -#include <GL/internal/dri_interface.h> -#ifndef __DRI_DRI2 -#error DRI2 extension not available. -#endif]])], - [HAVE_DRI2EXTENSION=yes], - [HAVE_DRI2EXTENSION=no]) - CFLAGS=$save_CFLAGS - if test "x$HAVE_DRI2EXTENSION" = xyes; then - AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader]) - DRI2_AIGLX=yes - else - AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.]) - DRI2_AIGLX=no - fi -fi -AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes) - - -AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes]) -if test "x$XINERAMA" = xyes; then - AC_DEFINE(XINERAMA, 1, [Support Xinerama extension]) - AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama]) - REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO" -fi - -AM_CONDITIONAL(XACE, [test "x$XACE" = xyes]) -if test "x$XACE" = xyes; then - AC_DEFINE(XACE, 1, [Build X-ACE extension]) -fi - -AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes]) -if test "x$XSELINUX" = xyes; then - if test "x$XACE" != xyes; then - AC_MSG_ERROR([cannot build SELinux extension without X-ACE]) - fi - AC_CHECK_HEADERS([selinux/selinux.h selinux/avc.h], [], AC_MSG_ERROR([SELinux include files not found])) - AC_CHECK_LIB(selinux, avc_init, [], AC_MSG_ERROR([SELinux library not found])) - AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers])) - AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library])) - AC_CHECK_DECL(avc_netlink_acquire_fd, - [AC_DEFINE(HAVE_AVC_NETLINK_ACQUIRE_FD, 1, "Have avc_netlink_acquire_fd")], - [], - [#include <selinux/avc.h>]) - AC_DEFINE(XSELINUX, 1, [Build SELinux extension]) - SELINUX_LIB="-lselinux -laudit" -fi - -AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes]) -if test "x$XCSECURITY" = xyes; then - if test "x$XACE" != xyes; then - AC_MSG_ERROR([cannot build Security extension without X-ACE]) - fi - AC_DEFINE(XCSECURITY, 1, [Build Security extension]) -fi - -AM_CONDITIONAL(MULTIBUFFER, [test "x$MULTIBUFFER" = xyes]) -if test "x$MULTIBUFFER" = xyes; then - AC_DEFINE(MULTIBUFFER, 1, [Build Multibuffer extension]) - # Requires xextproto which is always required -fi - -AM_CONDITIONAL(DBE, [test "x$DBE" = xyes]) -if test "x$DBE" = xyes; then - AC_DEFINE(DBE, 1, [Support DBE extension]) - DBE_LIB='$(top_builddir)/dbe/libdbe.la' -fi - -AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes]) -if test "x$XF86BIGFONT" = xyes; then - AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO" -fi - -AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes]) -if test "x$DPMSExtension" = xyes; then - AC_DEFINE(DPMSExtension, 1, [Support DPMS extension]) -fi - -if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then - AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $XCALIBRATEPROTO" -else - XCALIBRATE=no -fi -AM_CONDITIONAL(XCALIBRATE, [test "x$XCALIBRATE" = xyes]) - -AC_DEFINE(RENDER, 1, [Support RENDER extension]) -RENDER_LIB='$(top_builddir)/render/librender.la' -RENDER_INC='-I$(top_srcdir)/render' - -AC_DEFINE(RANDR, 1, [Support RANDR extension]) -RANDR_LIB='$(top_builddir)/randr/librandr.la' -RANDR_INC='-I$(top_srcdir)/randr' - -AC_DEFINE(XFIXES,1,[Support XFixes extension]) -FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la' -FIXES_INC='-I$(top_srcdir)/xfixes' - -AC_DEFINE(DAMAGE,1,[Support Damage extension]) -DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la' -DAMAGE_INC='-I$(top_srcdir)/damageext' -MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la' -MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage' - -# XINPUT extension is integral part of the server -XI_LIB='$(top_builddir)/Xi/libXi.la' -XI_INC='-I$(top_srcdir)/Xi' - -AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes) -AM_CONDITIONAL(XAA, test "x$XAA" = xyes) -AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes) -AM_CONDITIONAL(VBE, test "x$VBE" = xyes) -AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes) - -AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) - -AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) -AC_ARG_WITH(xkb-bin-directory, - AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program]), - [XKB_BIN_DIRECTORY="$withval"], - [XKB_BIN_DIRECTORY="$bindir"]) - -AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir]) - -dnl Make sure XKM_OUTPUT_DIR is an absolute path -XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` -if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then - XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" -fi - -dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed -dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused - -XKBOUTPUT=`echo $XKBOUTPUT/ | sed 's|/*$|/|'` -XKB_COMPILED_DIR=`echo $XKBOUTPUT | sed 's|/*$||'` -AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir]) -AC_SUBST(XKB_COMPILED_DIR) - -if test "x$XKB_DFLT_RULES" = x; then - case $host_os in - linux*) - dnl doesn't take AutoAddDevices into account, but whatever. - if test "x$CONFIG_HAL" = xyes; then - XKB_DFLT_RULES="evdev" - else - XKB_DFLT_RULES="base" - fi - ;; - *) - XKB_DFLT_RULES="base" - ;; - esac -fi -AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset]) -AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model]) -AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout]) -AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant]) -AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options]) - -XKB_LIB='$(top_builddir)/xkb/libxkb.la' -XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' -REQUIRED_MODULES="$REQUIRED_MODULES xkbfile" - -AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1, - [Do not have 'strcasecmp'.])) -AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1, - [Do not have 'strncasecmp'.])) -AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1, - [Do not have 'strcasestr'.])) - -if test "x$NULL_ROOT_CURSOR" = xyes; then - AC_DEFINE(NULL_ROOT_CURSOR, 1, [Use an empty root cursor]) -fi - -PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"]) -if test "x$have_libxdmcp" = xyes; then - AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS]) -fi -if test "x$XDMCP" = xauto; then - if test "x$have_libxdmcp" = xyes; then - XDMCP=yes - else - XDMCP=no - fi -fi -if test "x$XDMAUTH" = xauto; then - if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then - XDMAUTH=yes - else - XDMAUTH=no - fi -fi - -AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes]) -if test "x$XDMCP" = xyes; then - AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol]) - REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" - XDMCP_MODULES="xdmcp" -fi - -AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes]) -if test "x$XDMAUTH" = xyes; then - AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1]) - if ! test "x$XDMCP" = xyes; then - REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" - XDMCP_MODULES="xdmcp" - fi -fi - -AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) -AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) -AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path]) -AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path]) -AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path]) -AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name]) -AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name]) -AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release]) -AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) -AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) - -if test -z "$OSNAME"; then - OSNAME="UNKNOWN" -fi - -AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name]) -AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor]) -AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string]) - -AC_SUBST([VENDOR_NAME_SHORT]) -AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name]) -AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name]) -AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release]) -AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) - -AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper]) - -if test "x$DEBUGGING" = xyes; then - AC_DEFINE(DEBUG, 1, [Enable debugging code]) -fi -AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) - -# If unittests aren't explicitly disabled, check for required support -if test "x$UNITTESTS" != xno ; then - PKG_CHECK_MODULES([GLIB], $LIBGLIB, - [HAVE_GLIB=yes], [HAVE_GLIB=no]) - - # Check if linker supports -wrap, passed via compiler flags - # When cross-compiling, reports no, since unit tests run from - # "make check", so would be running on build machine, not target - AC_MSG_CHECKING([whether the linker supports -wrap]) - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,-wrap,exit" - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ - void __wrap_exit (int s) - { - __real_exit (0); - }]], - [[exit (1);]])], - [linker_can_wrap="yes"], - [linker_can_wrap="no"], - [linker_can_wrap="no"]) - AC_MSG_RESULT([$linker_can_wrap]) - LDFLAGS="$save_LDFLAGS" -fi - -if test "x$UNITTESTS" = xauto; then - if test "x$HAVE_GLIB" = xyes && test "x$linker_can_wrap" = xyes; then - UNITTESTS=yes - else - UNITTESTS=no - fi -fi -if test "x$UNITTESTS" = xyes; then - if test "x$HAVE_GLIB" = xno; then - AC_MSG_ERROR([glib required to build unit tests]) - fi - if test "x$linker_can_wrap" = xno; then - AC_MSG_ERROR([ld -wrap support required to build unit tests]) - fi - AC_DEFINE(UNITTESTS, 1, [Enable unit tests]) - AC_SUBST([GLIB_LIBS]) - AC_SUBST([GLIB_CFLAGS]) -fi -AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes]) - -AC_DEFINE(XTEST, 1, [Support XTest extension]) -AC_DEFINE(XSYNC, 1, [Support XSync extension]) -AC_DEFINE(XCMISC, 1, [Support XCMisc extension]) -AC_DEFINE(BIGREQS, 1, [Support BigRequests extension]) - -if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then - DIX_LIB='$(top_builddir)/dix/dix.O' - OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS)' -else - DIX_LIB='$(top_builddir)/dix/libdix.la' - OS_LIB='$(top_builddir)/os/libos.la' -fi -AC_SUBST([DIX_LIB]) -AC_SUBST([OS_LIB]) - -MAIN_LIB='$(top_builddir)/dix/libmain.la' -AC_SUBST([MAIN_LIB]) - -MI_LIB='$(top_builddir)/mi/libmi.la' -MI_EXT_LIB='$(top_builddir)/mi/libmiext.la' -MI_INC='-I$(top_srcdir)/mi' -FB_LIB='$(top_builddir)/fb/libfb.la' -FB_INC='-I$(top_srcdir)/fb' -MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow' -MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la' -CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' - -# SHA1 hashing -AC_ARG_WITH([sha1], - [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto], - [choose SHA1 implementation])]) -AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes]) -if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then - with_sha1=libc -fi -if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then - AC_MSG_ERROR([libc requested but not found]) -fi -if test "x$with_sha1" = xlibc; then - AC_DEFINE([HAVE_SHA1_IN_LIBC], [1], - [Use libc SHA1 functions]) - SHA1_LIBS="" -fi -AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes]) -if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then - with_sha1=CommonCrypto -fi -if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then - AC_MSG_ERROR([CommonCrypto requested but not found]) -fi -if test "x$with_sha1" = xCommonCrypto; then - AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1], - [Use CommonCrypto SHA1 functions]) - SHA1_LIBS="" -fi -AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes]) -if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then - with_sha1=libmd -fi -if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then - AC_MSG_ERROR([libmd requested but not found]) -fi -if test "x$with_sha1" = xlibmd; then - AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1], - [Use libmd SHA1 functions]) - SHA1_LIBS=-lmd -fi -AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes]) -if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then - with_sha1=libgcrypt -fi -if test "x$with_sha1" = xlibgcrypt; then - AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1], - [Use libgcrypt SHA1 functions]) - SHA1_LIBS=-lgcrypt -fi -AC_CHECK_LIB([sha1], [sha1_begin], [HAVE_LIBSHA1=yes]) -if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then - with_sha1=libsha1 -fi -if test "x$with_sha1" = xlibsha1; then - AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1], - [Use libsha1 for SHA1]) - SHA1_LIBS=-lsha1 -fi -# We don't need all of the OpenSSL libraries, just libcrypto -AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes]) -PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes], - [HAVE_OPENSSL_PKC=no]) -if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then - if test "x$with_sha1" = x; then - with_sha1=libcrypto - fi -else - if test "x$with_sha1" = xlibcrypto; then - AC_MSG_ERROR([OpenSSL libcrypto requested but not found]) - fi -fi -if test "x$with_sha1" = xlibcrypto; then - if test "x$HAVE_LIBCRYPTO" = xyes; then - SHA1_LIBS=-lcrypto - else - SHA1_LIBS="$OPENSSL_LIBS" - SHA1_CFLAGS="$OPENSSL_CFLAGS" - fi -fi -AC_MSG_CHECKING([for SHA1 implementation]) -if test "x$with_sha1" = x; then - AC_MSG_ERROR([No suitable SHA1 implementation found]) -fi -AC_MSG_RESULT([$with_sha1]) -AC_SUBST(SHA1_LIBS) -AC_SUBST(SHA1_CFLAGS) - -PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) -PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) - -# Autotools has some unfortunate issues with library handling. In order to -# get a server to rebuild when a dependency in the tree is changed, it must -# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be -# listed there, or some versions of autotools will break (especially if a -L -# is required to find the library). So, we keep two sets of libraries -# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which -# will go into the _DEPENDENCIES and _LDADD of the server, and -# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The -# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in -# NAMESPACE_SYS_LIBS. -# -# XSERVER_LIBS is the set of in-tree libraries which all servers require. -# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers -# require. -# -XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}" -XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB" -XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" -AC_SUBST([XSERVER_LIBS]) -AC_SUBST([XSERVER_SYS_LIBS]) - -UTILS_SYS_LIBS="${SYS_LIBS}" -AC_SUBST([UTILS_SYS_LIBS]) - -# The Xorg binary needs to export symbols so that they can be used from modules -# Some platforms require extra flags to do this. gcc should set these flags -# when -rdynamic is passed to it, other compilers/linkers may need to be added -# here. -if test "x$GCC" = "xyes"; then - LD_EXPORT_SYMBOLS_FLAG="-rdynamic" -fi -case $host_os in - openbsd*) - LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-dynamic" - ;; -esac -AC_SUBST([LD_EXPORT_SYMBOLS_FLAG]) - -dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so -dnl we need to replicate that here until those can all be fixed -AC_MSG_CHECKING([if SVR4 needs to be defined]) -AC_EGREP_CPP([I_AM_SVR4],[ -#if defined(SVR4) || defined(__svr4__) || defined(__SVR4) - I_AM_SVR4 -#endif -],[ -AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4]) -AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])) - -XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC" - -dnl --------------------------------------------------------------------------- -dnl DDX section. -dnl --------------------------------------------------------------------------- - -dnl Xvfb DDX - -AC_MSG_CHECKING([whether to build Xvfb DDX]) -AC_MSG_RESULT([$XVFB]) -AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) - -if test "x$XVFB" = xyes; then - XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" - XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS" - AC_SUBST([XVFB_LIBS]) - AC_SUBST([XVFB_SYS_LIBS]) -fi - - -dnl Xnest DDX - -PKG_CHECK_MODULES(XNESTMODULES, [xfont $LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no]) -AC_MSG_CHECKING([whether to build Xnest DDX]) -if test "x$XNEST" = xauto; then - XNEST="$have_xnest" -fi -AC_MSG_RESULT([$XNEST]) -AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) - -if test "x$XNEST" = xyes; then - if test "x$have_xnest" = xno; then - AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) - fi - XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB $CONFIG_LIB" - XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" - AC_SUBST([XNEST_LIBS]) - AC_SUBST([XNEST_SYS_LIBS]) -fi - - -dnl Xorg DDX - -AC_MSG_CHECKING([whether to build Xorg DDX]) -if test "x$XORG" = xauto; then - XORG="yes" - case $host_os in - cygwin*) XORG="no" ;; - darwin*) XORG="no" ;; - esac -fi -AC_MSG_RESULT([$XORG]) - -xorg_bus_linuxpci=no -xorg_bus_bsdpci=no -xorg_bus_sparc=no - -if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' - XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" - XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" - XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB" - - dnl ================================================================== - dnl symbol visibility - symbol_visibility= - have_visibility=disabled - if test x$SYMBOL_VISIBILITY != xno; then - AC_MSG_CHECKING(for symbol visibility support) - if test x$GCC = xyes; then - VISIBILITY_CFLAGS="-fvisibility=hidden" - else - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) - if test x$SUNCC = xyes; then - VISIBILITY_CFLAGS="-xldscope=hidden" - else - have_visibility=no - fi - fi - if test x$have_visibility != xno; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" - AC_TRY_COMPILE( - [#include <X11/Xfuncproto.h> - extern _X_HIDDEN int hidden_int; - extern _X_EXPORT int public_int; - extern _X_HIDDEN int hidden_int_func(void); - extern _X_EXPORT int public_int_func(void);], - [], - have_visibility=yes, - have_visibility=no) - CFLAGS=$save_CFLAGS - fi - AC_MSG_RESULT([$have_visibility]) - if test x$have_visibility != xno; then - symbol_visibility=$VISIBILITY_CFLAGS - XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS" - XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS" - fi - fi - dnl added to xorg-server.pc - AC_SUBST([symbol_visibility]) - dnl =================================================================== - - PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS) - SAVE_LIBS=$LIBS - SAVE_CFLAGS=$CFLAGS - CFLAGS=$PCIACCESS_CFLAGS - LIBS=$PCIACCESS_LIBS - AC_CHECK_FUNCS([pci_system_init_dev_mem]) - AC_CHECK_FUNCS([pci_device_enable]) - AC_CHECK_FUNCS([pci_device_is_boot_vga]) - AC_CHECK_FUNCS([pci_device_vgaarb_init]) - LIBS=$SAVE_LIBS - CFLAGS=$SAVE_CFLAGS - XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $SELINUX_LIB" - XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" - - case $host_os in - linux*) - if test "x$LNXAPM" = xyes; then - XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" - fi - XORG_OS="linux" - XORG_OS_SUBDIR="linux" - xorg_bus_linuxpci="yes" - linux_acpi="no" - case $host_cpu in - ia64*) - linux_ia64=yes - linux_acpi="yes" - ;; - alpha*) - linux_alpha=yes - ;; - i*86|amd64*|x86_64*) - linux_acpi="yes" - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - XORG_OS="freebsd" - XORG_OS_SUBDIR="bsd" - xorg_bus_bsdpci="yes" - ;; - netbsd*) - XORG_OS="netbsd" - XORG_OS_SUBDIR="bsd" - xorg_bus_bsdpci="yes" - ;; - openbsd*) - if test "x$ac_cv_BSD_APM" = xyes \ - -o "x$ac_cv_BSD_KQUEUE_APM" = xyes; then - XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" - fi - XORG_OS="openbsd" - XORG_OS_SUBDIR="bsd" - xorg_bus_bsdpci="yes" - ;; - solaris*) - XORG_OS="solaris" - XORG_OS_SUBDIR="solaris" - XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" - # Use the same stubs as BSD for old functions, since we now - # use libpciaccess for PCI - xorg_bus_bsdpci="yes" - AC_CHECK_HEADERS([sys/kd.h]) - AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no]) - # Check for minimum supported release - AC_MSG_CHECKING([Solaris version]) - OS_MINOR=`echo ${host_os}|sed -e 's/^.*solaris2\.//' -e s'/\..*$//'` - if test "${OS_MINOR}" -ge 7 ; then - AC_MSG_RESULT(Solaris ${OS_MINOR}) - else - AC_MSG_RESULT(Solaris `echo ${host_os}|sed -e 's/^.*solaris//`) - fi - if test "${OS_MINOR}" -lt 8 ; then - AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.]) - fi - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) - if test "x$SUNCC" = "xyes"; then - solaris_asm_inline="yes" - fi - AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"]) - - case $host_cpu in - sparc*) - SOLARIS_INOUT_ARCH="sparcv8plus" - ;; - i*86) - if test x$SOLARIS_64 = xyes ; then - SOLARIS_INOUT_ARCH="amd64" - else - SOLARIS_INOUT_ARCH="ia32" - fi - ;; - *) - AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \ - are supported on Solaris in this release. If you are \ - interested in porting Xorg to your platform, please email \ - xorg@lists.freedesktop.org.]) ;; - esac - AC_SUBST([SOLARIS_INOUT_ARCH]) - if test x$solaris_asm_inline = xyes ; then - SOLARIS_ASM_CFLAGS='$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-$(SOLARIS_INOUT_ARCH).il' - XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)' - fi - AC_SUBST([SOLARIS_ASM_CFLAGS]) - if test "x$SUPPORT_PC98" = xauto; then - SUPPORT_PC98="no" - fi - ;; - gnu*) - XORG_OS="gnu" - XORG_OS_SUBDIR="hurd" - # Use the same stubs as BSD for old functions, since we now - # use libpciaccess for PCI - xorg_bus_bsdpci="yes" - ;; - *) - XORG_OS="unknown" - XORG_OS_SUBDIR="unknown" - AC_MSG_ERROR([Your OS is unknown. Xorg currently only supports Linux, \ - Free/Open/NetBSD, Solaris, and OS X. If you are interested in porting \ - Xorg to your platform, please email xorg@lists.freedesktop.org.]) - ;; - esac - - case $host_cpu in - sparc*) - xorg_bus_sparc="yes" - ;; - i*86) - if test "x$SUPPORT_PC98" = xauto; then - SUPPORT_PC98="yes" - fi - ;; - esac - - if test "x$SUPPORT_PC98" = xauto; then - SUPPORT_PC98="no" - fi - if test "x$SUPPORT_PC98" = xyes; then - AC_DEFINE(SUPPORT_PC98, 1, [Support PC98]) - fi - if test "x$XORG_OS_PCI" = x ; then - XORG_OS_PCI=$XORG_OS - fi - if test "x$DGA" = xauto; then - PKG_CHECK_MODULES(DGA, $DGAPROTO, [DGA=yes], [DGA=no]) - fi - if test "x$DGA" = xyes; then - XORG_MODULES="$XORG_MODULES $DGAPROTO" - PKG_CHECK_MODULES(DGA, $DGAPROTO) - AC_DEFINE(DGA, 1, [Support DGA extension]) - AC_DEFINE(XFreeXDGA, 1, [Build XDGA support]) - fi - - if test "x$XF86VIDMODE" = xauto; then - PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no]) - fi - if test "x$XF86VIDMODE" = xyes; then - XORG_MODULES="$XORG_MODULES $VIDMODEPROTO" - PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO) - AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension]) - fi - - if test -n "$XORG_MODULES"; then - PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES]) - XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS" - XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" - fi - - AC_SUBST([XORG_LIBS]) - AC_SUBST([XORG_SYS_LIBS]) - AC_SUBST([XORG_INCS]) - AC_SUBST([XORG_OS]) - AC_SUBST([XORG_OS_SUBDIR]) - - AC_PATH_PROG(PERL, perl, no) - dnl unlikely as this may be ... - if test "x$PERL" = xno; then - AC_MSG_ERROR([Perl is required to build the XFree86/Xorg DDX.]) - fi - AC_SUBST(PERL) - - AC_SUBST([XORG_CFLAGS]) - - dnl these only go in xorg-config.h - XF86CONFIGFILE="xorg.conf" - XF86CONFIGDIR="xorg.conf.d" - CONFIGFILE="$sysconfdir/$XF86CONFIGFILE" - LOGPREFIX="$logdir/Xorg." - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) - AC_DEFINE(XFree86LOADER, 1, [Building loadable XFree86 server]) - AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) - AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file]) - AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) - AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory]) - AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path]) - AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path]) - AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location]) - AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) - AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation]) - if test "x$VGAHW" = xyes; then - AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module]) - fi - - driverdir="$moduledir/drivers" - AC_SUBST([moduledir]) - AC_SUBST([driverdir]) - sdkdir="$includedir/xorg" - extdir="$includedir/X11/extensions" - AC_SUBST([sdkdir]) - AC_SUBST([extdir]) - AC_SUBST([logdir]) - - # stuff the ABI versions into the pc file too - extract_abi() { - grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }' - } - abi_ansic=`extract_abi ANSIC` - abi_videodrv=`extract_abi VIDEODRV` - abi_xinput=`extract_abi XINPUT` - abi_extension=`extract_abi EXTENSION` - AC_SUBST([abi_ansic]) - AC_SUBST([abi_videodrv]) - AC_SUBST([abi_xinput]) - AC_SUBST([abi_extension]) -fi -AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) -AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes]) -AM_CONDITIONAL([LINUX_IA64], [test "x$linux_ia64" = xyes]) -AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) -AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) -AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) -AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes]) -AM_CONDITIONAL([DGA], [test "x$DGA" = xyes]) -AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes]) - -dnl XWin DDX - -AC_MSG_CHECKING([whether to build XWin DDX]) -if test "x$XWIN" = xauto; then - case $host_os in - cygwin*) XWIN="yes" ;; - mingw*) XWIN="yes" ;; - *) XWIN="no" ;; - esac -fi -AC_MSG_RESULT([$XWIN]) - -if test "x$XWIN" = xyes; then - PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) - AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_CHECK_TOOL(WINDRES, windres) - case $host_os in - cygwin*) - XWIN_SERVER_NAME=XWin - PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont]) - AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages]) - - dnl if we have windowswmproto, build rootless extension for multwindowextwm mode - if test "x$WINDOWSWM" = xyes ; then - AC_DEFINE(ROOTLESS,1,[Build Rootless code]) - CFLAGS="$CFLAGS -DROOTLESS_WORKAROUND" - fi - - CFLAGS="$CFLAGS -DFD_SETSIZE=256" - ;; - mingw*) - XWIN_SERVER_NAME=Xming - PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont]) - AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location]) - AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets]) - XWIN_SYS_LIBS=-lwinsock2 - ;; - esac - XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" - XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" - AC_SUBST(XWIN_LIBS) - AC_SUBST(XWIN_SERVER_NAME) - AC_SUBST(XWIN_SYS_LIBS) - - if test "x$DEBUGGING" = xyes; then - AC_DEFINE(CYGDEBUG, 1, [Simple debug messages]) - AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling]) - AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager]) - fi - - AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF]) - AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ]) - if test "x$XF86VIDMODE" = xyes; then - AC_MSG_NOTICE([Disabling XF86VidMode extension]) - XF86VIDMODE=no - fi -fi -AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) -AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && false]) -AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes && false]) -AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes && false]) -AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) - -dnl Darwin / OS X DDX -if test "x$XQUARTZ" = xyes; then - AC_DEFINE(XQUARTZ,1,[Have Quartz]) - AC_DEFINE(ROOTLESS,1,[Build Rootless code]) - - DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB" - AC_SUBST([DARWIN_LIBS]) - - AC_CHECK_LIB([Xplugin],[xp_init],[:]) - - CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA" - - PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11) - - if test "x$XQUARTZ_SPARKLE" = xyes ; then - AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.]) - fi - - if test "x$STANDALONE_XPBPROXY" = xyes ; then - AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy]) - fi -fi - -# Support for objc in autotools is minimal and not documented. -OBJC='$(CC)' -OBJCLD='$(CCLD)' -OBJCLINK='$(LINK)' -OBJCFLAGS='$(CFLAGS)' -AC_SUBST([OBJC]) -AC_SUBST([OBJCCLD]) -AC_SUBST([OBJCLINK]) -AC_SUBST([OBJCFLAGS]) -# internal, undocumented automake func follows :( -_AM_DEPENDENCIES([OBJC]) -AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) -AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"]) -AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes]) - -dnl DMX DDX -PKG_CHECK_MODULES( - [DMXMODULES], - [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES], - [PKG_CHECK_MODULES( - [XDMXCONFIG_DEP], - [xaw7 xmu xt xpm x11], - [have_dmx=yes], - [have_dmx=no])], - [have_dmx=no]) -AC_MSG_CHECKING([whether to build Xdmx DDX]) -if test "x$DMX" = xauto; then - DMX="$have_dmx" - case $host_os in - cygwin*) DMX="no" ;; - darwin*) DMX="no" ;; - esac -fi -AC_MSG_RESULT([$DMX]) -AM_CONDITIONAL(DMX, [test "x$DMX" = xyes]) - -DOXYGEN="not_found" - -if test "x$DMX" = xyes; then - if test "x$have_dmx" = xno; then - AC_MSG_ERROR([Xdmx build explicitly requested, but required - modules not found.]) - fi - DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" - XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" - XDMX_SYS_LIBS="$DMXMODULES_LIBS" - AC_SUBST([XDMX_CFLAGS]) - AC_SUBST([XDMX_LIBS]) - AC_SUBST([XDMX_SYS_LIBS]) - -dnl USB sources in DMX require <linux/input.h> - AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes", - DMX_BUILD_USB="no") -dnl Linux sources in DMX require <linux/keyboard.h> - AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes", - DMX_BUILD_LNX="no") - AC_SUBST(XDMXCONFIG_DEP_CFLAGS) - AC_SUBST(XDMXCONFIG_DEP_LIBS) - PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11]) - AC_SUBST(DMXEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11]) - AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11]) - AC_SUBST(DMXXIEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11]) - AC_SUBST(XTSTEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11]) - AC_SUBST(XRESEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11]) - AC_SUBST(X11EXAMPLES_DEP_LIBS) - -fi -AC_PATH_PROG(DOXYGEN,doxygen,[not_found]) -if test "x$DOXYGEN" = "xnot_found" ; then - AC_MSG_WARN([doxygen not found in $PATH. Cannot build dmx documentation]) -fi -AC_SUBST(DOXYGEN) -AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "xnot_found"]) -AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes]) -AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes]) - -dnl kdrive DDX - -XEPHYR_LIBS= -XEPHYR_INCS= - -AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes]) -AM_CONDITIONAL(KDRIVE_KBD, test "x$KDRIVE_KBD" = xyes) -AM_CONDITIONAL(KDRIVE_EVDEV, test "x$KDRIVE_EVDEV" = xyes) -AM_CONDITIONAL(KDRIVE_MOUSE, test "x$KDRIVE_MOUSE" = xyes) - -if test "$KDRIVE" = yes; then - AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server]) - AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx]) - - AC_CHECK_HEADERS([linux/fb.h]) - if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then - XFBDEV=yes - fi - - if test "x$XFBDEV" = xyes; then - KDRIVEFBDEVLIB=yes - AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server]) - fi - - - PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) - if test "x$HAVE_TSLIB" = xno; then - AC_CHECK_LIB(ts, ts_open, [HAVE_TSLIB="yes"]) - fi - - if test "xTSLIB" = xauto; then - TSLIB="$HAVE_TSLIB" - fi - - if test "x$TSLIB" = xyes; then - if ! test "x$HAVE_TSLIB" = xyes; then - AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/]) - else - AC_DEFINE(TSLIB, 1, [Have tslib support]) - fi - fi - - if test "x$KDRIVE_KBD" = xyes; then - AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver]) - fi - if test "x$KDRIVE_EVDEV" = xyes; then - AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver]) - fi - if test "x$KDRIVE_MOUSE" = xyes; then - AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) - fi - - XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xfont xau xdmcp" - if test "x$XV" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv" - fi - if test "x$DRI" = xyes && test "x$GLX" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm" - fi - - PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"]) - if test "x$XEPHYR" = xauto; then - XEPHYR=$xephyr - fi - - # Xephyr needs nanosleep() which is in librt on Solaris - AC_CHECK_FUNC([nanosleep], [], - AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt")) - - # damage shadow extension glx (NOTYET) fb mi - KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src' - KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" - KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' - KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" - - KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" - - KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" - KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' - case $host_os in - *linux*) - KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' - KDRIVELINUX=yes - ;; - esac - KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la' - KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB $CONFIG_LIB" - KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" - KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB" - KDRIVE_LIBS="$TSLIB_LIBS $KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" - - AC_SUBST([XEPHYR_LIBS]) - AC_SUBST([XEPHYR_INCS]) -fi -AC_SUBST([KDRIVE_INCS]) -AC_SUBST([KDRIVE_PURE_INCS]) -AC_SUBST([KDRIVE_CFLAGS]) -AC_SUBST([KDRIVE_PURE_LIBS]) -AC_SUBST([KDRIVE_LOCAL_LIBS]) -AC_SUBST([KDRIVE_LIBS]) -AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) -AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes]) -AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes]) -AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) -AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes]) -AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) - -dnl and the rest of these are generic, so they're in config.h -dnl -dnl though, thanks to the passing of some significant amount of time, the -dnl above is probably a complete fallacy, and you should not rely on it. -dnl but this is still actually better than imake, honest. -daniels - -AC_TRY_COMPILE([ -#include <features.h> -#ifndef __GLIBC__ -#error not glibc -#endif -], [], [AC_DEFINE(_GNU_SOURCE, 1, - [ Enable GNU and other extensions to the C environment for glibc])]) - -AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix]) - -BUILD_DATE="`date +'%Y%m%d'`" -AC_SUBST([BUILD_DATE]) -BUILD_TIME="`date +'1%H%M%S'`" -AC_SUBST([BUILD_TIME]) - -DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" - -AC_SUBST([DIX_CFLAGS]) - -AC_SUBST([libdir]) -AC_SUBST([exec_prefix]) -AC_SUBST([prefix]) - -AC_OUTPUT([ -Makefile -glx/Makefile -include/Makefile -composite/Makefile -damageext/Makefile -dbe/Makefile -dix/Makefile -doc/Makefile -fb/Makefile -record/Makefile -config/Makefile -mi/Makefile -miext/Makefile -miext/damage/Makefile -miext/shadow/Makefile -miext/cw/Makefile -miext/rootless/Makefile -os/Makefile -randr/Makefile -render/Makefile -xkb/Makefile -Xext/Makefile -Xi/Makefile -xfixes/Makefile -exa/Makefile -hw/Makefile -hw/xfree86/Makefile -hw/xfree86/common/Makefile -hw/xfree86/common/xf86Build.h -hw/xfree86/ddc/Makefile -hw/xfree86/dixmods/Makefile -hw/xfree86/dixmods/extmod/Makefile -hw/xfree86/doc/Makefile -hw/xfree86/doc/devel/Makefile -hw/xfree86/doc/man/Makefile -hw/xfree86/doc/sgml/Makefile -hw/xfree86/dri/Makefile -hw/xfree86/dri2/Makefile -hw/xfree86/exa/Makefile -hw/xfree86/fbdevhw/Makefile -hw/xfree86/i2c/Makefile -hw/xfree86/int10/Makefile -hw/xfree86/loader/Makefile -hw/xfree86/modes/Makefile -hw/xfree86/os-support/Makefile -hw/xfree86/os-support/bsd/Makefile -hw/xfree86/os-support/bus/Makefile -hw/xfree86/os-support/hurd/Makefile -hw/xfree86/os-support/misc/Makefile -hw/xfree86/os-support/linux/Makefile -hw/xfree86/os-support/sco/Makefile -hw/xfree86/os-support/solaris/Makefile -hw/xfree86/os-support/sysv/Makefile -hw/xfree86/parser/Makefile -hw/xfree86/ramdac/Makefile -hw/xfree86/shadowfb/Makefile -hw/xfree86/vbe/Makefile -hw/xfree86/vgahw/Makefile -hw/xfree86/x86emu/Makefile -hw/xfree86/xaa/Makefile -hw/xfree86/xf8_16bpp/Makefile -hw/xfree86/utils/Makefile -hw/xfree86/utils/cvt/Makefile -hw/xfree86/utils/gtf/Makefile -hw/dmx/config/Makefile -hw/dmx/doc/Makefile -hw/dmx/examples/Makefile -hw/dmx/input/Makefile -hw/dmx/glxProxy/Makefile -hw/dmx/Makefile -hw/vfb/Makefile -hw/xnest/Makefile -hw/xwin/Makefile -hw/xquartz/Makefile -hw/xquartz/GL/Makefile -hw/xquartz/bundle/Makefile -hw/xquartz/doc/Makefile -hw/xquartz/mach-startup/Makefile -hw/xquartz/pbproxy/Makefile -hw/xquartz/xpr/Makefile -hw/kdrive/Makefile -hw/kdrive/ephyr/Makefile -hw/kdrive/fake/Makefile -hw/kdrive/fbdev/Makefile -hw/kdrive/linux/Makefile -hw/kdrive/src/Makefile -test/Makefile -test/xi2/Makefile -xorg-server.pc -]) +dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
+dnl
+dnl Permission is hereby granted, free of charge, to any person obtaining a
+dnl copy of this software and associated documentation files (the "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+dnl
+dnl Authors: Keith Packard <keithp@keithp.com>
+dnl Daniel Stone <daniel@fooishbar.org>
+dnl an unwitting cast of miscellaneous others
+dnl
+dnl Process this file with autoconf to create configure.
+
+AC_PREREQ(2.57)
+AC_INIT([xorg-server], 1.7.99.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="(unreleased)"
+AC_CONFIG_SRCDIR([Makefile.am])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.5 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.5)
+XORG_DEFAULT_OPTIONS
+XORG_WITH_DOXYGEN
+
+m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])])
+XORG_FONT_MACROS_VERSION(1.1)
+
+dnl this gets generated by autoheader, and thus contains all the defines. we
+dnl don't ever actually use it, internally.
+AC_CONFIG_HEADERS(include/do-not-use-config.h)
+dnl xorg-server.h is an external header, designed to be included by loadable
+dnl drivers.
+AC_CONFIG_HEADERS(include/xorg-server.h)
+dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just
+dnl dix/).
+AC_CONFIG_HEADERS(include/dix-config.h)
+dnl xorg-config.h covers the Xorg DDX.
+AC_CONFIG_HEADERS(include/xorg-config.h)
+dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
+AC_CONFIG_HEADERS(include/xkb-config.h)
+dnl xwin-config.h covers the XWin DDX.
+AC_CONFIG_HEADERS(include/xwin-config.h)
+dnl kdrive-config.h covers the kdrive DDX
+AC_CONFIG_HEADERS(include/kdrive-config.h)
+dnl version-config.h covers the version numbers so they can be bumped without
+dnl forcing an entire recompile.x
+AC_CONFIG_HEADERS(include/version-config.h)
+
+AC_PROG_CC
+AM_PROG_AS
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_LIBTOOL_WIN32_DLL
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+DOLT
+AC_PROG_MAKE_SET
+PKG_PROG_PKG_CONFIG
+AC_PROG_LEX
+AC_PROG_YACC
+AC_SYS_LARGEFILE
+XORG_PROG_RAWCPP
+AC_PATH_PROG(SED,sed)
+
+# Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow
+# easier overrides at build time.
+XSERVER_CFLAGS='$(CWARNFLAGS)'
+
+dnl Check for dtrace program (needed to build Xserver dtrace probes)
+dnl Also checks for <sys/sdt.h>, since some Linux distros have an
+dnl ISDN trace program named dtrace
+AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
+ [Enable dtrace probes (default: enabled if dtrace found)]),
+ [WDTRACE=$withval], [WDTRACE=auto])
+if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
+ AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
+ if test "x$DTRACE" = "xnot_found" ; then
+ if test "x$WDTRACE" = "xyes" ; then
+ AC_MSG_FAILURE([dtrace requested but not found])
+ fi
+ WDTRACE="no"
+ else
+ AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"])
+ if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then
+ WDTRACE="no"
+ fi
+ fi
+fi
+if test "x$WDTRACE" != "xno" ; then
+ AC_DEFINE(XSERVER_DTRACE, 1,
+ [Define to 1 if the DTrace Xserver provider probes should be built in.])
+
+# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
+# object files, and require linking with those as relocatable objects, not .a
+# archives. MacOS X handles all this in the normal compiler toolchain, and on
+# some releases (like Tiger), will error out on dtrace -G. For now, other
+# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux
+# ports appear to, based on my web searches, but have not yet been tested).
+ case $host_os in
+ darwin*) SPECIAL_DTRACE_OBJECTS=no ;;
+ *) SPECIAL_DTRACE_OBJECTS=yes ;;
+ esac
+fi
+AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
+AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"])
+
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h fnmatch.h])
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])
+
+AC_CHECK_SIZEOF([unsigned long])
+if test "$ac_cv_sizeof_unsigned_long" = 8; then
+ AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.])
+fi
+
+AC_TYPE_PID_T
+
+# Checks for headers/macros for byte swapping
+# Known variants:
+# <byteswap.h> bswap_16, bswap_32, bswap_64 (glibc)
+# <sys/endian.h> __swap16, __swap32, __swap64 (OpenBSD)
+# <sys/endian.h> bswap16, bswap32, bswap64 (other BSD's)
+# and a fallback to local macros if none of the above are found
+
+# if <byteswap.h> is found, assume it's the correct version
+AC_CHECK_HEADERS([byteswap.h])
+
+# if <sys/endian.h> is found, have to check which version
+AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"])
+
+if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then
+ AC_MSG_CHECKING([for __swap16 variant of <sys/endian.h> byteswapping macros])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#include <sys/types.h>
+#include <sys/endian.h>
+ ], [
+int a = 1, b;
+b = __swap16(a);
+ ])
+], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
+ AC_MSG_RESULT([$SYS_ENDIAN__SWAP])
+
+ AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#include <sys/types.h>
+#include <sys/endian.h>
+ ], [
+int a = 1, b;
+b = bswap16(a);
+ ])
+], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
+ AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
+
+ if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
+ USE_SYS_ENDIAN_H=yes
+ BSWAP=bswap
+ else
+ if test "$SYS_ENDIAN__SWAP" = "yes" ; then
+ USE_SYS_ENDIAN_H=yes
+ BSWAP=__swap
+ else
+ USE_SYS_ENDIAN_H=no
+ fi
+ fi
+
+ if test "$USE_SYS_ENDIAN_H" = "yes" ; then
+ AC_DEFINE([USE_SYS_ENDIAN_H], 1,
+ [Define to use byteswap macros from <sys/endian.h>])
+ AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16,
+ [Define to 16-bit byteswap macro])
+ AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32,
+ [Define to 32-bit byteswap macro])
+ AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64,
+ [Define to 64-bit byteswap macro])
+ fi
+fi
+
+dnl Check to see if dlopen is in default libraries (like Solaris, which
+dnl has it in libc), or if libdl is needed to get it.
+AC_CHECK_FUNC([dlopen], [],
+ AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
+AC_SUBST(DLOPEN_LIBS)
+
+dnl Checks for library functions.
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
+ strtol getopt getopt_long vsnprintf walkcontext backtrace \
+ getisax getzoneid shmctl64 strcasestr ffs])
+AC_FUNC_ALLOCA
+dnl Old HAS_* names used in os/*.c.
+AC_CHECK_FUNC([getdtablesize],
+ AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.]))
+AC_CHECK_FUNC([getifaddrs],
+ AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.]))
+AC_CHECK_FUNC([getpeereid],
+ AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.]))
+AC_CHECK_FUNC([getpeerucred],
+ AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.]))
+AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
+AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])
+AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function]))
+
+AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
+
+dnl Check for mmap support for Xvfb
+AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.]))
+
+dnl Find the math libary
+AC_CHECK_LIB(m, sqrt)
+AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function]))
+
+AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
+
+dnl AGPGART headers
+AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes)
+AM_CONDITIONAL(AGP, [test "x$AGP" = xyes])
+
+dnl APM header
+AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes)
+AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes])
+
+dnl fbdev header
+AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes)
+AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes])
+
+dnl MTRR header
+AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes)
+if test "x$ac_cv_asm_mtrr_h" = xyes; then
+ HAVE_MTRR=yes
+fi
+
+dnl BSD MTRR header
+AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes)
+if test "x$ac_cv_memrange_h" = xyes; then
+ HAVE_MTRR=yes
+fi
+
+if test "x$HAVE_MTRR" = xyes; then
+ AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available])
+fi
+
+dnl A NetBSD MTRR header
+AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes)
+if test "x$ac_cv_machine_mtrr_h" = xyes; then
+ AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR
+ support is available])
+fi
+
+dnl FreeBSD kldload support (sys/linker.h)
+AC_CHECK_HEADERS([sys/linker.h],
+ [ac_cv_sys_linker_h=yes],
+ [ac_cv_sys_linker_h=no],
+ [#include <sys/param.h>])
+AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes])
+
+AC_CACHE_CHECK([for SYSV IPC],
+ ac_cv_sysv_ipc,
+ [AC_TRY_LINK([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+],[
+{
+ int id;
+ id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R);
+ if (id < 0) return -1;
+ return shmctl(id, IPC_RMID, 0);
+}],
+ [ac_cv_sysv_ipc=yes],
+ [ac_cv_sysv_ipc=no])])
+if test "x$ac_cv_sysv_ipc" = xyes; then
+ AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available])
+fi
+
+dnl OpenBSD /dev/xf86 aperture driver
+if test -c /dev/xf86 ; then
+ AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver])
+fi
+
+dnl BSD APM support
+AC_CHECK_HEADER([machine/apmvar.h],[
+ AC_CHECK_HEADER([sys/event.h],
+ ac_cv_BSD_KQUEUE_APM=yes,
+ ac_cv_BSD_APM=yes)])
+
+AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes])
+AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes])
+
+dnl glibc backtrace support check (hw/xfree86/common/xf86Events.c)
+AC_CHECK_HEADER([execinfo.h],[
+ AC_CHECK_LIB(c, backtrace, [
+ AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
+ AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h])
+ ])]
+)
+
+dnl ---------------------------------------------------------------------------
+dnl Bus options and CPU capabilities. Replaces logic in
+dnl hw/xfree86/os-support/bus/Makefile.am, among others.
+dnl ---------------------------------------------------------------------------
+DEFAULT_INT10="x86emu"
+
+dnl Override defaults as needed for specific platforms:
+
+case $host_cpu in
+ alpha*)
+ ALPHA_VIDEO=yes
+ case $host_os in
+ *freebsd*) SYS_LIBS=-lio ;;
+ *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
+ esac
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
+ ;;
+ arm*)
+ ARM_VIDEO=yes
+ ;;
+ i*86)
+ I386_VIDEO=yes
+ case $host_os in
+ *freebsd*) AC_DEFINE(USE_DEV_IO) ;;
+ *dragonfly*) AC_DEFINE(USE_DEV_IO) ;;
+ *netbsd*) AC_DEFINE(USE_I386_IOPL)
+ SYS_LIBS=-li386
+ ;;
+ *openbsd*) AC_DEFINE(USE_I386_IOPL)
+ SYS_LIBS=-li386
+ ;;
+ esac
+ ;;
+ powerpc*)
+ PPC_VIDEO=yes
+ case $host_os in
+ *freebsd*) DEFAULT_INT10=stub ;;
+ esac
+ ;;
+ sparc*)
+ SPARC64_VIDEO=yes
+ BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
+ ;;
+ x86_64*|amd64*)
+ I386_VIDEO=yes
+ case $host_os in
+ *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
+ *dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
+ *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
+ SYS_LIBS=-lx86_64
+ ;;
+ *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
+ SYS_LIBS=-lamd64
+ ;;
+ esac
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
+ ;;
+ ia64*)
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
+ ;;
+ s390*)
+ GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
+ ;;
+esac
+AC_SUBST(GLX_ARCH_DEFINES)
+
+dnl BSD *_video.c selection
+AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
+AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
+AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes])
+AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
+AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
+
+DRI=no
+USE_SIGIO_BY_DEFAULT="yes"
+dnl it would be nice to autodetect these *CONS_SUPPORTs
+case $host_os in
+ *freebsd* | *dragonfly*)
+ case $host_os in
+ kfreebsd*-gnu) ;;
+ *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;;
+ esac
+ AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
+ AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
+ AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console])
+ DRI=yes
+ ;;
+ *netbsd*)
+ AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
+ AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
+ AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
+ AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
+ DRI=yes
+ ;;
+ *openbsd*)
+ AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
+ AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console])
+ AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
+ ;;
+ *linux*)
+ DRI=yes
+ ;;
+ *solaris*)
+ PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no)
+ # Disable use of SIGIO by default until some system bugs are
+ # fixed - see Sun/OpenSolaris bug id 6879897
+ USE_SIGIO_BY_DEFAULT="no"
+ ;;
+ darwin*)
+ AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
+ ;;
+esac
+
+dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the
+dnl major number
+PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
+PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1`
+if test "x$PVS" = "x"; then
+ PVS="0"
+fi
+
+VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)"
+VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}"
+
+VENDOR_NAME="The X.Org Foundation"
+VENDOR_NAME_SHORT="X.Org"
+VENDOR_WEB="http://wiki.x.org"
+
+m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
+
+dnl Build options.
+AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],
+ [Obsolete - use --enable-strict-compilation instead]),
+ AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation]))
+
+AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
+ [Enable debugging (default: disabled)]),
+ [DEBUGGING=$enableval], [DEBUGGING=no])
+AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
+ [Enable unit-tests (default: auto)]),
+ [UNITTESTS=$enableval], [UNITTESTS=auto])
+AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default]
+ [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]),
+ [USE_SIGIO_BY_DEFAULT=$enableval], [])
+AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
+ [INT10="$withval"],
+ [INT10="$DEFAULT_INT10"])
+AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR],
+ [Vendor string reported by the server]),
+ [ VENDOR_NAME="$withval" ], [])
+AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR],
+ [Short version of vendor string reported by the server]),
+ [ VENDOR_NAME_SHORT="$withval" ], [])
+AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL],
+ [Vendor web address reported by the server]),
+ [ VENDOR_WEB="$withval" ], [])
+AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR],
+ [Directory where modules are installed (default: $libdir/xorg/modules)]),
+ [ moduledir="$withval" ],
+ [ moduledir="${libdir}/xorg/modules" ])
+AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR],
+ [Directory where log files are kept (default: $localstatedir/log)]),
+ [ logdir="$withval" ],
+ [ logdir="$localstatedir/log" ])
+AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS],
+ [Builder address (default: xorg@lists.freedesktop.org)]),
+ [ BUILDERADDR="$withval" ],
+ [ BUILDERADDR="xorg@lists.freedesktop.org" ])
+AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]),
+ [ OSNAME="$withval" ],
+ [ OSNAME=`uname -srm` ])
+AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]),
+ [ OSVENDOR="$withval" ],
+ [ OSVENDOR="" ])
+AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]),
+ [ BUILDERSTRING="$withval" ]
+ [ ])
+
+dnl Determine font path
+XORG_FONTROOTDIR
+XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc)
+XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF)
+XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF)
+XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1)
+XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi)
+XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi)
+
+dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d,
+dnl otherwise uses standard subdirectories of FONTROOTDIR
+AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d],
+ [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'],
+ [
+ DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
+ case $host_os in
+ darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
+ esac
+ ])
+AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
+ [ FONTPATH="$withval" ],
+ [ FONTPATH="${DEFAULT_FONT_PATH}" ])
+
+AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
+ [ XKBPATH="$withval" ],
+ [ XKBPATH="${datadir}/X11/xkb" ])
+AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
+ [ XKBOUTPUT="$withval" ],
+ [ XKBOUTPUT="compiled" ])
+AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
+ [Keyboard ruleset (default: base/evdev)]),
+ [ XKB_DFLT_RULES="$withval" ],
+ [ XKB_DFLT_RULES="" ])
+AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL],
+ [Keyboard model (default: pc105)]),
+ [ XKB_DFLT_MODEL="$withval" ],
+ [ XKB_DFLT_MODEL="pc105" ])
+AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT],
+ [Keyboard layout (default: us)]),
+ [ XKB_DFLT_LAYOUT="$withval" ],
+ [ XKB_DFLT_LAYOUT="us" ])
+AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT],
+ [Keyboard variant (default: (none))]),
+ [ XKB_DFLT_VARIANT="$withval" ],
+ [ XKB_DFLT_VARIANT="" ])
+AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS],
+ [Keyboard layout options (default: (none))]),
+ [ XKB_DFLT_OPTIONS="$withval" ],
+ [ XKB_DFLT_OPTIONS="" ])
+AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH],
+ [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]),
+ [ SERVERCONFIG="$withval" ],
+ [ SERVERCONFIG="${libdir}/xorg" ])
+AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]),
+ [ APPLE_APPLICATIONS_DIR="${withval}" ],
+ [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
+AC_SUBST([APPLE_APPLICATIONS_DIR])
+AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]),
+ [ APPLE_APPLICATION_NAME="${withval}" ],
+ [ APPLE_APPLICATION_NAME="X11" ])
+AC_SUBST([APPLE_APPLICATION_NAME])
+AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]),
+ [ LAUNCHD_ID_PREFIX="${withval}" ],
+ [ LAUNCHD_ID_PREFIX="org.x" ])
+AC_SUBST([LAUNCHD_ID_PREFIX])
+AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers])
+AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]),
+ [ XQUARTZ_SPARKLE="${enableval}" ],
+ [ XQUARTZ_SPARKLE="no" ])
+AC_SUBST([XQUARTZ_SPARKLE])
+AC_ARG_ENABLE(builddocs, AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]),
+ [BUILDDOCS=$enableval],
+ [BUILDDOCS=no])
+AC_ARG_ENABLE(install-libxf86config,
+ AS_HELP_STRING([--enable-install-libxf86config],
+ [Install libxf86config (default: disabled)]),
+ [INSTALL_LIBXF86CONFIG=$enableval],
+ [INSTALL_LIBXF86CONFIG=no])
+AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
+ [SYMBOL_VISIBILITY=$enableval],
+ [SYMBOL_VISIBILITY=auto])
+AC_ARG_ENABLE(pc98, AC_HELP_STRING([--enable-pc98], [Enable PC98 support in Xorg (default: auto)]),
+ [SUPPORT_PC98=$enableval],
+ [SUPPORT_PC98=auto])
+
+dnl GLX build options
+AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
+ [ DRI_DRIVER_PATH="$withval" ],
+ [ DRI_DRIVER_PATH="${libdir}/dri" ])
+AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
+ [AIGLX=$enableval],
+ [AIGLX=yes])
+AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: disabled)]),
+ [GLX_USE_TLS=$enableval],
+ [GLX_USE_TLS=no])
+
+dnl Extensions.
+AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
+AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
+AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
+AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
+AC_ARG_ENABLE(record, AS_HELP_STRING([--enable-record], [Build Record extension (default: disabled)]), [RECORD=$enableval], [RECORD=no])
+AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
+AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
+AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto])
+AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
+AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto])
+AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
+AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
+AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
+AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto])
+AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
+AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
+AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
+AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--disable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no])
+AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no])
+AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
+AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no])
+AC_ARG_ENABLE(multibuffer, AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no])
+AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
+AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
+AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
+AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: no)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=no])
+AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no])
+AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
+AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
+AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes])
+AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
+AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
+AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
+
+dnl DDXes.
+AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
+AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
+AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
+AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
+AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
+AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
+AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
+dnl kdrive and its subsystems
+AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
+AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
+AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto])
+AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto])
+dnl kdrive options
+AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto])
+AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto])
+AC_ARG_ENABLE(kdrive-evdev, AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto])
+
+
+dnl chown/chmod to be setuid root as part of build
+dnl Replaces InstallXserverSetUID in imake
+AC_ARG_ENABLE(install-setuid,
+ AS_HELP_STRING([--enable-install-setuid],
+ [Install Xorg server as owned by root with setuid bit (default: auto)]),
+ [SETUID=$enableval], [SETUID=auto])
+AC_MSG_CHECKING([to see if we can install the Xorg server as root])
+if test "x$SETUID" = "xauto" ; then
+ case $host_os in
+ darwin*) SETUID="no" ;;
+ *)
+ case $host_cpu in
+ sparc) SETUID="no" ;;
+ *) SETUID="yes" ;;
+ esac
+ esac
+ if test "x$SETUID" = xyes; then
+ touch testfile
+ chown root testfile > /dev/null 2>&1 || SETUID="no"
+ rm -f testfile
+ fi
+fi
+AC_MSG_RESULT([$SETUID])
+AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"])
+
+dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
+dnl was not expanded, since xorg-server with no transport types is rather useless.
+dnl
+dnl If you're seeing an error here, be sure you installed the lib/xtrans module
+dnl first and if it's not in the default location, that you set the ACLOCAL
+dnl environment variable to find it, such as:
+dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
+m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$])
+
+# Transport selection macro from xtrans.m4
+XTRANS_CONNECTION_FLAGS
+
+# Secure RPC detection macro from xtrans.m4
+XTRANS_SECURE_RPC_FLAGS
+AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes])
+
+AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
+AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
+AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
+if test "x$INT10" = xyes; then
+ dnl VM86 headers
+ AC_CHECK_HEADERS([sys/vm86.h sys/io.h])
+fi
+
+dnl Handle building documentation
+AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes)
+
+dnl Only build sgml docs when linuxdoc is available and
+dnl def.ents has been installed
+XORG_CHECK_LINUXDOC
+
+dnl Handle installing libxf86config
+AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
+
+dnl XQuartz DDX Detection... Yes, it's ugly to have it here... but we need to handle this early on
+case $host_os in
+ darwin*)
+ DRI2=no
+
+ if test x$XQUARTZ = xauto; then
+ AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -framework Carbon"
+ AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}],
+ [xorg_cv_Carbon_framework=yes],
+ [xorg_cv_Carbon_framework=no])
+ LDFLAGS=$save_LDFLAGS])
+
+ if test "X$xorg_cv_Carbon_framework" = Xyes; then
+ XQUARTZ=yes
+ else
+ XQUARTZ=no
+ fi
+ fi
+
+ if test "x$XQUARTZ" = xyes ; then
+ XQUARTZ=yes
+ XVFB=no
+ XNEST=no
+
+ COMPOSITE=no
+ DGA=no
+ DPMSExtension=no
+ XF86VIDMODE=no
+ fi
+ ;;
+ *) XQUARTZ=no ;;
+esac
+
+dnl ---------------------------------------------------------------------------
+dnl Extension section
+dnl ---------------------------------------------------------------------------
+XEXT_INC='-I$(top_srcdir)/Xext'
+XEXT_LIB='$(top_builddir)/Xext/libXext.la'
+XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
+
+dnl Optional modules
+VIDEOPROTO="videoproto"
+COMPOSITEPROTO="compositeproto >= 0.4"
+RECORDPROTO="recordproto >= 1.13.99.1"
+SCRNSAVERPROTO="scrnsaverproto >= 1.1"
+RESOURCEPROTO="resourceproto"
+DRIPROTO="xf86driproto >= 2.1.0"
+DRI2PROTO="dri2proto >= 2.2"
+XINERAMAPROTO="xineramaproto"
+BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
+XCALIBRATEPROTO="xcalibrateproto"
+DGAPROTO="xf86dgaproto >= 2.0.99.1"
+GLPROTO="glproto >= 1.4.10"
+DMXPROTO="dmxproto >= 2.2.99.1"
+VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
+WINDOWSWMPROTO="windowswmproto"
+APPLEWMPROTO="applewmproto >= 1.4"
+
+dnl Core modules for most extensions, et al.
+REQUIRED_MODULES="[randrproto >= 1.2.99.3] [renderproto >= 0.11] [fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xextproto >= 7.0.99.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] fontsproto [inputproto >= 1.9.99.902] [kbproto >= 1.0.3]"
+REQUIRED_LIBS="xfont xau [pixman-1 >= 0.15.20]"
+
+dnl List of libraries that require a specific version
+LIBAPPLEWM="applewm >= 1.4"
+LIBDMX="dmx >= 1.0.99.1"
+LIBDRI="dri >= 7.8.0"
+LIBDRM="libdrm >= 2.3.0"
+LIBGL="gl >= 7.1.0"
+LIBXEXT="xext >= 1.0.99.4"
+LIBXI="xi >= 1.2.99.1"
+LIBXTST="xtst >= 1.0.99.2"
+LIBPCIACCESS="pciaccess >= 0.8.0"
+LIBGLIB="glib-2.0 >= 2.16"
+LIBUDEV="libudev >= 143"
+
+if test "x$CONFIG_UDEV" = xyes &&
+ { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then
+ AC_MSG_ERROR([Hotplugging through both libudev and dbus/hal not allowed])
+fi
+
+PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
+if test "x$CONFIG_UDEV" = xauto; then
+ CONFIG_UDEV="$HAVE_LIBUDEV"
+fi
+AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes])
+if test "x$CONFIG_UDEV" = xyes; then
+ CONFIG_DBUS_API=no
+ CONFIG_HAL=no
+ if ! test "x$HAVE_LIBUDEV" = xyes; then
+ AC_MSG_ERROR([udev configuration API requested, but libudev is not installed])
+ fi
+ AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
+fi
+
+dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
+dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config
+dnl API.
+PKG_CHECK_MODULES(DBUS, dbus-1, [HAVE_DBUS=yes], [HAVE_DBUS=no])
+if test "x$HAVE_DBUS" = xyes; then
+ AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support])
+fi
+AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes])
+
+if test "x$CONFIG_DBUS_API" = xauto; then
+ CONFIG_DBUS_API="$HAVE_DBUS"
+fi
+if test "x$CONFIG_DBUS_API" = xyes; then
+ if ! test "x$HAVE_DBUS" = xyes; then
+ AC_MSG_ERROR([D-Bus configuration API requested, but D-Bus is not installed.])
+ fi
+
+ AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API])
+ CONFIG_NEED_DBUS="yes"
+fi
+AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes])
+
+PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no])
+if test "x$CONFIG_HAL" = xauto; then
+ CONFIG_HAL="$HAVE_HAL"
+fi
+if test "x$CONFIG_HAL" = xyes; then
+ if ! test "x$HAVE_HAL" = xyes; then
+ AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.])
+ fi
+
+ AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API])
+ CONFIG_NEED_DBUS="yes"
+fi
+AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
+
+if test "x$CONFIG_NEED_DBUS" = xyes; then
+ AC_DEFINE(CONFIG_NEED_DBUS, 1, [Use D-Bus for input hotplug])
+fi
+AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes])
+CONFIG_LIB='$(top_builddir)/config/libconfig.la'
+
+if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then
+ USE_SIGIO_BY_DEFAULT_VALUE=TRUE
+else
+ USE_SIGIO_BY_DEFAULT_VALUE=FALSE
+fi
+AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE],
+ [Use SIGIO handlers for input device events by default])
+
+AC_MSG_CHECKING([for glibc...])
+AC_PREPROC_IFELSE([
+#include <features.h>
+#ifndef __GLIBC__
+#error
+#endif
+], glibc=yes, glibc=no)
+AC_MSG_RESULT([$glibc])
+
+AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
+ [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
+ [have_clock_gettime=no])])
+
+AC_MSG_CHECKING([for a useful monotonic clock ...])
+
+if ! test "x$have_clock_gettime" = xno; then
+ if ! test "x$have_clock_gettime" = xyes; then
+ CLOCK_LIBS="$have_clock_gettime"
+ else
+ CLOCK_LIBS=""
+ fi
+
+ LIBS_SAVE="$LIBS"
+ LIBS="$CLOCK_LIBS"
+ CPPFLAGS_SAVE="$CPPFLAGS"
+
+ if test x"$glibc" = xyes; then
+ CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
+ fi
+
+ AC_RUN_IFELSE([
+#include <time.h>
+
+int main(int argc, char *argv[[]]) {
+ struct timespec tp;
+
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ return 0;
+ else
+ return 1;
+}
+ ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
+ [MONOTONIC_CLOCK="cross compiling"])
+
+ LIBS="$LIBS_SAVE"
+ CPPFLAGS="$CPPFLAGS_SAVE"
+else
+ MONOTONIC_CLOCK=no
+fi
+
+AC_MSG_RESULT([$MONOTONIC_CLOCK])
+
+if test "x$MONOTONIC_CLOCK" = xyes; then
+ AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()])
+ LIBS="$LIBS $CLOCK_LIBS"
+fi
+
+AM_CONDITIONAL(XV, [test "x$XV" = xyes])
+if test "x$XV" = xyes; then
+ AC_DEFINE(XV, 1, [Support Xv extension])
+ AC_DEFINE(XvExtension, 1, [Build Xv extension])
+ REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO"
+else
+ XVMC=no
+fi
+
+AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes])
+if test "x$XVMC" = xyes; then
+ AC_DEFINE(XvMCExtension, 1, [Build XvMC extension])
+fi
+
+AM_CONDITIONAL(XREGISTRY, [test "x$XREGISTRY" = xyes])
+if test "x$XREGISTRY" = xyes; then
+ AC_DEFINE(XREGISTRY, 1, [Build registry module])
+fi
+
+AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes])
+if test "x$COMPOSITE" = xyes; then
+ AC_DEFINE(COMPOSITE, 1, [Support Composite Extension])
+ REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO"
+ COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la'
+ COMPOSITE_INC='-I$(top_srcdir)/composite'
+fi
+
+AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes])
+if test "x$MITSHM" = xyes; then
+ AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension])
+ AC_DEFINE(HAS_SHM, 1, [Support SHM])
+fi
+
+AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes])
+if test "x$RECORD" = xyes; then
+ AC_DEFINE(XRECORD, 1, [Support Record extension])
+ REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO"
+ RECORD_LIB='$(top_builddir)/record/librecord.la'
+fi
+
+AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes])
+if test "x$SCREENSAVER" = xyes; then
+ AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension])
+ REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO"
+fi
+
+AM_CONDITIONAL(RES, [test "x$RES" = xyes])
+if test "x$RES" = xyes; then
+ AC_DEFINE(RES, 1, [Support X resource extension])
+ REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO"
+fi
+
+if test "x$GLX" = xyes; then
+ PKG_CHECK_MODULES([XLIB], [x11])
+ PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
+ AC_SUBST(XLIB_CFLAGS)
+ AC_DEFINE(GLXEXT, 1, [Build GLX extension])
+ GLX_LIBS='$(top_builddir)/glx/libglx.la'
+ GLX_SYS_LIBS="$GLX_SYS_LIBS"
+else
+ GLX=no
+fi
+AM_CONDITIONAL(GLX, test "x$GLX" = xyes)
+
+if test "x$AIGLX" = xyes -a "x$GLX" = xyes -a "x$DRI" = xyes; then
+ AC_DEFINE(AIGLX, 1, [Build AIGLX loader])
+else
+ AIGLX=no
+fi
+AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes)
+
+if test "x$GLX_USE_TLS" = xyes -a "x$AIGLX" = xyes; then
+ GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
+ GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
+fi
+AC_SUBST([GLX_DEFINES])
+
+AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
+if test "x$DRI" = xyes; then
+ AC_DEFINE(XF86DRI, 1, [Build DRI extension])
+ PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO])
+ PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI)
+ AC_SUBST(DRIPROTO_CFLAGS)
+fi
+
+PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO,
+ [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no])
+case "$DRI2,$HAVE_DRI2PROTO" in
+ yes,no)
+ AC_MSG_ERROR([DRI2 requested, but dri2proto not found.])
+ ;;
+ yes,yes | auto,yes)
+ AC_DEFINE(DRI2, 1, [Build DRI2 extension])
+ DRI2=yes
+ ;;
+esac
+AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
+
+if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
+ PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
+ AC_SUBST(LIBDRM_CFLAGS)
+ AC_SUBST(LIBDRM_LIBS)
+fi
+
+if test "x$DRI2" = xyes; then
+ save_CFLAGS=$CFLAGS
+ CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <GL/gl.h>
+#include <GL/internal/dri_interface.h>
+#ifndef __DRI_DRI2
+#error DRI2 extension not available.
+#endif]])],
+ [HAVE_DRI2EXTENSION=yes],
+ [HAVE_DRI2EXTENSION=no])
+ CFLAGS=$save_CFLAGS
+ if test "x$HAVE_DRI2EXTENSION" = xyes; then
+ AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader])
+ DRI2_AIGLX=yes
+ else
+ AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.])
+ DRI2_AIGLX=no
+ fi
+fi
+AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes)
+
+
+AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
+if test "x$XINERAMA" = xyes; then
+ AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
+ AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama])
+ REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO"
+fi
+
+AM_CONDITIONAL(XACE, [test "x$XACE" = xyes])
+if test "x$XACE" = xyes; then
+ AC_DEFINE(XACE, 1, [Build X-ACE extension])
+fi
+
+AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes])
+if test "x$XSELINUX" = xyes; then
+ if test "x$XACE" != xyes; then
+ AC_MSG_ERROR([cannot build SELinux extension without X-ACE])
+ fi
+ AC_CHECK_HEADERS([selinux/selinux.h selinux/avc.h], [], AC_MSG_ERROR([SELinux include files not found]))
+ AC_CHECK_LIB(selinux, avc_init, [], AC_MSG_ERROR([SELinux library not found]))
+ AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
+ AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
+ AC_CHECK_DECL(avc_netlink_acquire_fd,
+ [AC_DEFINE(HAVE_AVC_NETLINK_ACQUIRE_FD, 1, "Have avc_netlink_acquire_fd")],
+ [],
+ [#include <selinux/avc.h>])
+ AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
+ SELINUX_LIB="-lselinux -laudit"
+fi
+
+AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
+if test "x$XCSECURITY" = xyes; then
+ if test "x$XACE" != xyes; then
+ AC_MSG_ERROR([cannot build Security extension without X-ACE])
+ fi
+ AC_DEFINE(XCSECURITY, 1, [Build Security extension])
+fi
+
+AM_CONDITIONAL(MULTIBUFFER, [test "x$MULTIBUFFER" = xyes])
+if test "x$MULTIBUFFER" = xyes; then
+ AC_DEFINE(MULTIBUFFER, 1, [Build Multibuffer extension])
+ # Requires xextproto which is always required
+fi
+
+AM_CONDITIONAL(DBE, [test "x$DBE" = xyes])
+if test "x$DBE" = xyes; then
+ AC_DEFINE(DBE, 1, [Support DBE extension])
+ DBE_LIB='$(top_builddir)/dbe/libdbe.la'
+fi
+
+AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes])
+if test "x$XF86BIGFONT" = xyes; then
+ AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension])
+ REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO"
+fi
+
+AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes])
+if test "x$DPMSExtension" = xyes; then
+ AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
+fi
+
+if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then
+ AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension])
+ REQUIRED_MODULES="$REQUIRED_MODULES $XCALIBRATEPROTO"
+else
+ XCALIBRATE=no
+fi
+AM_CONDITIONAL(XCALIBRATE, [test "x$XCALIBRATE" = xyes])
+
+AC_DEFINE(RENDER, 1, [Support RENDER extension])
+RENDER_LIB='$(top_builddir)/render/librender.la'
+RENDER_INC='-I$(top_srcdir)/render'
+
+AC_DEFINE(RANDR, 1, [Support RANDR extension])
+RANDR_LIB='$(top_builddir)/randr/librandr.la'
+RANDR_INC='-I$(top_srcdir)/randr'
+
+AC_DEFINE(XFIXES,1,[Support XFixes extension])
+FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la'
+FIXES_INC='-I$(top_srcdir)/xfixes'
+
+AC_DEFINE(DAMAGE,1,[Support Damage extension])
+DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
+DAMAGE_INC='-I$(top_srcdir)/damageext'
+MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
+MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
+
+# XINPUT extension is integral part of the server
+XI_LIB='$(top_builddir)/Xi/libXi.la'
+XI_INC='-I$(top_srcdir)/Xi'
+
+AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes)
+AM_CONDITIONAL(XAA, test "x$XAA" = xyes)
+AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes)
+AM_CONDITIONAL(VBE, test "x$VBE" = xyes)
+AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes)
+
+AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
+
+AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
+AC_ARG_WITH(xkb-bin-directory,
+ AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program]),
+ [XKB_BIN_DIRECTORY="$withval"],
+ [XKB_BIN_DIRECTORY="$bindir"])
+
+AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir])
+
+dnl Make sure XKM_OUTPUT_DIR is an absolute path
+XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
+if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
+ XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
+fi
+
+dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
+dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused
+
+XKBOUTPUT=`echo $XKBOUTPUT/ | sed 's|/*$|/|'`
+XKB_COMPILED_DIR=`echo $XKBOUTPUT | sed 's|/*$||'`
+AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir])
+AC_SUBST(XKB_COMPILED_DIR)
+
+if test "x$XKB_DFLT_RULES" = x; then
+ case $host_os in
+ linux*)
+ dnl doesn't take AutoAddDevices into account, but whatever.
+ if test "x$CONFIG_HAL" = xyes; then
+ XKB_DFLT_RULES="evdev"
+ else
+ XKB_DFLT_RULES="base"
+ fi
+ ;;
+ *)
+ XKB_DFLT_RULES="base"
+ ;;
+ esac
+fi
+AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset])
+AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model])
+AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout])
+AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant])
+AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options])
+
+XKB_LIB='$(top_builddir)/xkb/libxkb.la'
+XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
+REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
+
+AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
+ [Do not have 'strcasecmp'.]))
+AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1,
+ [Do not have 'strncasecmp'.]))
+AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1,
+ [Do not have 'strcasestr'.]))
+
+PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"])
+if test "x$have_libxdmcp" = xyes; then
+ AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS])
+fi
+if test "x$XDMCP" = xauto; then
+ if test "x$have_libxdmcp" = xyes; then
+ XDMCP=yes
+ else
+ XDMCP=no
+ fi
+fi
+if test "x$XDMAUTH" = xauto; then
+ if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then
+ XDMAUTH=yes
+ else
+ XDMAUTH=no
+ fi
+fi
+
+AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes])
+if test "x$XDMCP" = xyes; then
+ AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol])
+ REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
+ XDMCP_MODULES="xdmcp"
+fi
+
+AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes])
+if test "x$XDMAUTH" = xyes; then
+ AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1])
+ if ! test "x$XDMCP" = xyes; then
+ REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
+ XDMCP_MODULES="xdmcp"
+ fi
+fi
+
+AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
+AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
+AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
+AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
+AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path])
+AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name])
+AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name])
+AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
+AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
+AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address])
+
+if test -z "$OSNAME"; then
+ OSNAME="UNKNOWN"
+fi
+
+AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name])
+AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor])
+AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string])
+
+AC_SUBST([VENDOR_NAME_SHORT])
+AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name])
+AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name])
+AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release])
+AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
+
+AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
+
+if test "x$DEBUGGING" = xyes; then
+ AC_DEFINE(DEBUG, 1, [Enable debugging code])
+fi
+AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
+
+# If unittests aren't explicitly disabled, check for required support
+if test "x$UNITTESTS" != xno ; then
+ PKG_CHECK_MODULES([GLIB], $LIBGLIB,
+ [HAVE_GLIB=yes], [HAVE_GLIB=no])
+
+ # Check if linker supports -wrap, passed via compiler flags
+ # When cross-compiling, reports no, since unit tests run from
+ # "make check", so would be running on build machine, not target
+ AC_MSG_CHECKING([whether the linker supports -wrap])
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,-wrap,exit"
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ void __wrap_exit (int s)
+ {
+ __real_exit (0);
+ }]],
+ [[exit (1);]])],
+ [linker_can_wrap="yes"],
+ [linker_can_wrap="no"],
+ [linker_can_wrap="no"])
+ AC_MSG_RESULT([$linker_can_wrap])
+ LDFLAGS="$save_LDFLAGS"
+fi
+
+if test "x$UNITTESTS" = xauto; then
+ if test "x$HAVE_GLIB" = xyes && test "x$linker_can_wrap" = xyes; then
+ UNITTESTS=yes
+ else
+ UNITTESTS=no
+ fi
+fi
+if test "x$UNITTESTS" = xyes; then
+ if test "x$HAVE_GLIB" = xno; then
+ AC_MSG_ERROR([glib required to build unit tests])
+ fi
+ if test "x$linker_can_wrap" = xno; then
+ AC_MSG_ERROR([ld -wrap support required to build unit tests])
+ fi
+ AC_DEFINE(UNITTESTS, 1, [Enable unit tests])
+ AC_SUBST([GLIB_LIBS])
+ AC_SUBST([GLIB_CFLAGS])
+fi
+AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes])
+
+AC_DEFINE(XTEST, 1, [Support XTest extension])
+AC_DEFINE(XSYNC, 1, [Support XSync extension])
+AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
+AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
+
+if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
+ DIX_LIB='$(top_builddir)/dix/dix.O'
+ OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS)'
+else
+ DIX_LIB='$(top_builddir)/dix/libdix.la'
+ OS_LIB='$(top_builddir)/os/libos.la'
+fi
+AC_SUBST([DIX_LIB])
+AC_SUBST([OS_LIB])
+
+MAIN_LIB='$(top_builddir)/dix/libmain.la'
+AC_SUBST([MAIN_LIB])
+
+MI_LIB='$(top_builddir)/mi/libmi.la'
+MI_EXT_LIB='$(top_builddir)/mi/libmiext.la'
+MI_INC='-I$(top_srcdir)/mi'
+FB_LIB='$(top_builddir)/fb/libfb.la'
+FB_INC='-I$(top_srcdir)/fb'
+MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
+MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
+CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
+
+# SHA1 hashing
+AC_ARG_WITH([sha1],
+ [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto],
+ [choose SHA1 implementation])])
+AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
+if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
+ with_sha1=libc
+fi
+if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then
+ AC_MSG_ERROR([libc requested but not found])
+fi
+if test "x$with_sha1" = xlibc; then
+ AC_DEFINE([HAVE_SHA1_IN_LIBC], [1],
+ [Use libc SHA1 functions])
+ SHA1_LIBS=""
+fi
+AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes])
+if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then
+ with_sha1=CommonCrypto
+fi
+if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then
+ AC_MSG_ERROR([CommonCrypto requested but not found])
+fi
+if test "x$with_sha1" = xCommonCrypto; then
+ AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1],
+ [Use CommonCrypto SHA1 functions])
+ SHA1_LIBS=""
+fi
+AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
+if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
+ with_sha1=libmd
+fi
+if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then
+ AC_MSG_ERROR([libmd requested but not found])
+fi
+if test "x$with_sha1" = xlibmd; then
+ AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
+ [Use libmd SHA1 functions])
+ SHA1_LIBS=-lmd
+fi
+AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
+if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
+ with_sha1=libgcrypt
+fi
+if test "x$with_sha1" = xlibgcrypt; then
+ AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1],
+ [Use libgcrypt SHA1 functions])
+ SHA1_LIBS=-lgcrypt
+fi
+AC_CHECK_LIB([sha1], [sha1_begin], [HAVE_LIBSHA1=yes])
+if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
+ with_sha1=libsha1
+fi
+if test "x$with_sha1" = xlibsha1; then
+ AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
+ [Use libsha1 for SHA1])
+ SHA1_LIBS=-lsha1
+fi
+# We don't need all of the OpenSSL libraries, just libcrypto
+AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes])
+PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],
+ [HAVE_OPENSSL_PKC=no])
+if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then
+ if test "x$with_sha1" = x; then
+ with_sha1=libcrypto
+ fi
+else
+ if test "x$with_sha1" = xlibcrypto; then
+ AC_MSG_ERROR([OpenSSL libcrypto requested but not found])
+ fi
+fi
+if test "x$with_sha1" = xlibcrypto; then
+ if test "x$HAVE_LIBCRYPTO" = xyes; then
+ SHA1_LIBS=-lcrypto
+ else
+ SHA1_LIBS="$OPENSSL_LIBS"
+ SHA1_CFLAGS="$OPENSSL_CFLAGS"
+ fi
+fi
+AC_MSG_CHECKING([for SHA1 implementation])
+if test "x$with_sha1" = x; then
+ AC_MSG_ERROR([No suitable SHA1 implementation found])
+fi
+AC_MSG_RESULT([$with_sha1])
+AC_SUBST(SHA1_LIBS)
+AC_SUBST(SHA1_CFLAGS)
+
+PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
+PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
+
+# Autotools has some unfortunate issues with library handling. In order to
+# get a server to rebuild when a dependency in the tree is changed, it must
+# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be
+# listed there, or some versions of autotools will break (especially if a -L
+# is required to find the library). So, we keep two sets of libraries
+# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which
+# will go into the _DEPENDENCIES and _LDADD of the server, and
+# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The
+# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in
+# NAMESPACE_SYS_LIBS.
+#
+# XSERVER_LIBS is the set of in-tree libraries which all servers require.
+# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers
+# require.
+#
+XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
+XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB"
+XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
+AC_SUBST([XSERVER_LIBS])
+AC_SUBST([XSERVER_SYS_LIBS])
+
+UTILS_SYS_LIBS="${SYS_LIBS}"
+AC_SUBST([UTILS_SYS_LIBS])
+
+# The Xorg binary needs to export symbols so that they can be used from modules
+# Some platforms require extra flags to do this. gcc should set these flags
+# when -rdynamic is passed to it, other compilers/linkers may need to be added
+# here.
+if test "x$GCC" = "xyes"; then
+ LD_EXPORT_SYMBOLS_FLAG="-rdynamic"
+fi
+case $host_os in
+ openbsd*)
+ LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-dynamic"
+ ;;
+esac
+AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
+
+dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
+dnl we need to replicate that here until those can all be fixed
+AC_MSG_CHECKING([if SVR4 needs to be defined])
+AC_EGREP_CPP([I_AM_SVR4],[
+#if defined(SVR4) || defined(__svr4__) || defined(__SVR4)
+ I_AM_SVR4
+#endif
+],[
+AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
+AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
+
+XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
+
+dnl ---------------------------------------------------------------------------
+dnl DDX section.
+dnl ---------------------------------------------------------------------------
+
+dnl Xvfb DDX
+
+AC_MSG_CHECKING([whether to build Xvfb DDX])
+AC_MSG_RESULT([$XVFB])
+AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
+
+if test "x$XVFB" = xyes; then
+ XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB"
+ XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS"
+ AC_SUBST([XVFB_LIBS])
+ AC_SUBST([XVFB_SYS_LIBS])
+fi
+
+
+dnl Xnest DDX
+
+PKG_CHECK_MODULES(XNESTMODULES, [xfont $LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
+AC_MSG_CHECKING([whether to build Xnest DDX])
+if test "x$XNEST" = xauto; then
+ XNEST="$have_xnest"
+fi
+AC_MSG_RESULT([$XNEST])
+AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
+
+if test "x$XNEST" = xyes; then
+ if test "x$have_xnest" = xno; then
+ AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
+ fi
+ XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB $CONFIG_LIB"
+ XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
+ AC_SUBST([XNEST_LIBS])
+ AC_SUBST([XNEST_SYS_LIBS])
+fi
+
+
+dnl Xorg DDX
+
+AC_MSG_CHECKING([whether to build Xorg DDX])
+if test "x$XORG" = xauto; then
+ XORG="yes"
+ case $host_os in
+ cygwin*) XORG="no" ;;
+ darwin*) XORG="no" ;;
+ esac
+fi
+AC_MSG_RESULT([$XORG])
+
+xorg_bus_linuxpci=no
+xorg_bus_bsdpci=no
+xorg_bus_sparc=no
+
+if test "x$XORG" = xyes; then
+ XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
+ XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
+ XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
+ XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
+ XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB"
+
+ dnl ==================================================================
+ dnl symbol visibility
+ symbol_visibility=
+ have_visibility=disabled
+ if test x$SYMBOL_VISIBILITY != xno; then
+ AC_MSG_CHECKING(for symbol visibility support)
+ if test x$GCC = xyes; then
+ VISIBILITY_CFLAGS="-fvisibility=hidden"
+ else
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ if test x$SUNCC = xyes; then
+ VISIBILITY_CFLAGS="-xldscope=hidden"
+ else
+ have_visibility=no
+ fi
+ fi
+ if test x$have_visibility != xno; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
+ AC_TRY_COMPILE(
+ [#include <X11/Xfuncproto.h>
+ extern _X_HIDDEN int hidden_int;
+ extern _X_EXPORT int public_int;
+ extern _X_HIDDEN int hidden_int_func(void);
+ extern _X_EXPORT int public_int_func(void);],
+ [],
+ have_visibility=yes,
+ have_visibility=no)
+ CFLAGS=$save_CFLAGS
+ fi
+ AC_MSG_RESULT([$have_visibility])
+ if test x$have_visibility != xno; then
+ symbol_visibility=$VISIBILITY_CFLAGS
+ XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS"
+ XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS"
+ fi
+ fi
+ dnl added to xorg-server.pc
+ AC_SUBST([symbol_visibility])
+ dnl ===================================================================
+
+ PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
+ SAVE_LIBS=$LIBS
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS=$PCIACCESS_CFLAGS
+ LIBS=$PCIACCESS_LIBS
+ AC_CHECK_FUNCS([pci_system_init_dev_mem])
+ AC_CHECK_FUNCS([pci_device_enable])
+ AC_CHECK_FUNCS([pci_device_is_boot_vga])
+ AC_CHECK_FUNCS([pci_device_vgaarb_init])
+ LIBS=$SAVE_LIBS
+ CFLAGS=$SAVE_CFLAGS
+ XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $SELINUX_LIB"
+ XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+
+ case $host_os in
+ linux*)
+ if test "x$LNXAPM" = xyes; then
+ XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
+ fi
+ XORG_OS="linux"
+ XORG_OS_SUBDIR="linux"
+ xorg_bus_linuxpci="yes"
+ linux_acpi="no"
+ case $host_cpu in
+ ia64*)
+ linux_ia64=yes
+ linux_acpi="yes"
+ ;;
+ alpha*)
+ linux_alpha=yes
+ ;;
+ i*86|amd64*|x86_64*)
+ linux_acpi="yes"
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ XORG_OS="freebsd"
+ XORG_OS_SUBDIR="bsd"
+ xorg_bus_bsdpci="yes"
+ ;;
+ netbsd*)
+ XORG_OS="netbsd"
+ XORG_OS_SUBDIR="bsd"
+ xorg_bus_bsdpci="yes"
+ ;;
+ openbsd*)
+ if test "x$ac_cv_BSD_APM" = xyes \
+ -o "x$ac_cv_BSD_KQUEUE_APM" = xyes; then
+ XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
+ fi
+ XORG_OS="openbsd"
+ XORG_OS_SUBDIR="bsd"
+ xorg_bus_bsdpci="yes"
+ ;;
+ solaris*)
+ XORG_OS="solaris"
+ XORG_OS_SUBDIR="solaris"
+ XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
+ # Use the same stubs as BSD for old functions, since we now
+ # use libpciaccess for PCI
+ xorg_bus_bsdpci="yes"
+ AC_CHECK_HEADERS([sys/kd.h])
+ AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no])
+ # Check for minimum supported release
+ AC_MSG_CHECKING([Solaris version])
+ OS_MINOR=`echo ${host_os}|sed -e 's/^.*solaris2\.//' -e s'/\..*$//'`
+ if test "${OS_MINOR}" -ge 7 ; then
+ AC_MSG_RESULT(Solaris ${OS_MINOR})
+ else
+ AC_MSG_RESULT(Solaris `echo ${host_os}|sed -e 's/^.*solaris//`)
+ fi
+ if test "${OS_MINOR}" -lt 8 ; then
+ AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.])
+ fi
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ if test "x$SUNCC" = "xyes"; then
+ solaris_asm_inline="yes"
+ fi
+ AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"])
+
+ case $host_cpu in
+ sparc*)
+ SOLARIS_INOUT_ARCH="sparcv8plus"
+ ;;
+ i*86)
+ if test x$SOLARIS_64 = xyes ; then
+ SOLARIS_INOUT_ARCH="amd64"
+ else
+ SOLARIS_INOUT_ARCH="ia32"
+ fi
+ ;;
+ *)
+ AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \
+ are supported on Solaris in this release. If you are \
+ interested in porting Xorg to your platform, please email \
+ xorg@lists.freedesktop.org.]) ;;
+ esac
+ AC_SUBST([SOLARIS_INOUT_ARCH])
+ if test x$solaris_asm_inline = xyes ; then
+ SOLARIS_ASM_CFLAGS='$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-$(SOLARIS_INOUT_ARCH).il'
+ XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)'
+ fi
+ AC_SUBST([SOLARIS_ASM_CFLAGS])
+ if test "x$SUPPORT_PC98" = xauto; then
+ SUPPORT_PC98="no"
+ fi
+ ;;
+ gnu*)
+ XORG_OS="gnu"
+ XORG_OS_SUBDIR="hurd"
+ # Use the same stubs as BSD for old functions, since we now
+ # use libpciaccess for PCI
+ xorg_bus_bsdpci="yes"
+ ;;
+ *)
+ XORG_OS="unknown"
+ XORG_OS_SUBDIR="unknown"
+ AC_MSG_ERROR([Your OS is unknown. Xorg currently only supports Linux, \
+ Free/Open/NetBSD, Solaris, and OS X. If you are interested in porting \
+ Xorg to your platform, please email xorg@lists.freedesktop.org.])
+ ;;
+ esac
+
+ case $host_cpu in
+ sparc*)
+ xorg_bus_sparc="yes"
+ ;;
+ i*86)
+ if test "x$SUPPORT_PC98" = xauto; then
+ SUPPORT_PC98="yes"
+ fi
+ ;;
+ esac
+
+ if test "x$SUPPORT_PC98" = xauto; then
+ SUPPORT_PC98="no"
+ fi
+ if test "x$SUPPORT_PC98" = xyes; then
+ AC_DEFINE(SUPPORT_PC98, 1, [Support PC98])
+ fi
+ if test "x$XORG_OS_PCI" = x ; then
+ XORG_OS_PCI=$XORG_OS
+ fi
+ if test "x$DGA" = xauto; then
+ PKG_CHECK_MODULES(DGA, $DGAPROTO, [DGA=yes], [DGA=no])
+ fi
+ if test "x$DGA" = xyes; then
+ XORG_MODULES="$XORG_MODULES $DGAPROTO"
+ PKG_CHECK_MODULES(DGA, $DGAPROTO)
+ AC_DEFINE(DGA, 1, [Support DGA extension])
+ AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
+ fi
+
+ if test "x$XF86VIDMODE" = xauto; then
+ PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no])
+ fi
+ if test "x$XF86VIDMODE" = xyes; then
+ XORG_MODULES="$XORG_MODULES $VIDMODEPROTO"
+ PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO)
+ AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
+ fi
+
+ if test -n "$XORG_MODULES"; then
+ PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES])
+ XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS"
+ XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS"
+ fi
+
+ AC_SUBST([XORG_LIBS])
+ AC_SUBST([XORG_SYS_LIBS])
+ AC_SUBST([XORG_INCS])
+ AC_SUBST([XORG_OS])
+ AC_SUBST([XORG_OS_SUBDIR])
+
+ AC_PATH_PROG(PERL, perl, no)
+ dnl unlikely as this may be ...
+ if test "x$PERL" = xno; then
+ AC_MSG_ERROR([Perl is required to build the XFree86/Xorg DDX.])
+ fi
+ AC_SUBST(PERL)
+
+ AC_SUBST([XORG_CFLAGS])
+
+ dnl these only go in xorg-config.h
+ XF86CONFIGFILE="xorg.conf"
+ XF86CONFIGDIR="xorg.conf.d"
+ CONFIGFILE="$sysconfdir/$XF86CONFIGFILE"
+ LOGPREFIX="$logdir/Xorg."
+ AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
+ AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
+ AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
+ AC_DEFINE(XFree86LOADER, 1, [Building loadable XFree86 server])
+ AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
+ AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
+ AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
+ AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
+ AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file])
+ AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
+ AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory])
+ AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
+ AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
+ AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location])
+ AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
+ AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
+ if test "x$VGAHW" = xyes; then
+ AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module])
+ fi
+
+ driverdir="$moduledir/drivers"
+ AC_SUBST([moduledir])
+ AC_SUBST([driverdir])
+ sdkdir="$includedir/xorg"
+ extdir="$includedir/X11/extensions"
+ AC_SUBST([sdkdir])
+ AC_SUBST([extdir])
+ AC_SUBST([logdir])
+
+ # stuff the ABI versions into the pc file too
+ extract_abi() {
+ grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }'
+ }
+ abi_ansic=`extract_abi ANSIC`
+ abi_videodrv=`extract_abi VIDEODRV`
+ abi_xinput=`extract_abi XINPUT`
+ abi_extension=`extract_abi EXTENSION`
+ AC_SUBST([abi_ansic])
+ AC_SUBST([abi_videodrv])
+ AC_SUBST([abi_xinput])
+ AC_SUBST([abi_extension])
+fi
+AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
+AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
+AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
+AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
+AM_CONDITIONAL([LINUX_IA64], [test "x$linux_ia64" = xyes])
+AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
+AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
+AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
+AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
+AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
+AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
+
+dnl XWin DDX
+
+AC_MSG_CHECKING([whether to build XWin DDX])
+if test "x$XWIN" = xauto; then
+ case $host_os in
+ cygwin*) XWIN="yes" ;;
+ mingw*) XWIN="yes" ;;
+ *) XWIN="no" ;;
+ esac
+fi
+AC_MSG_RESULT([$XWIN])
+
+if test "x$XWIN" = xyes; then
+ PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
+ AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
+ AC_CHECK_TOOL(WINDRES, windres)
+ case $host_os in
+ cygwin*)
+ XWIN_SERVER_NAME=XWin
+ PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont])
+ AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages])
+
+ dnl if we have windowswmproto, build rootless extension for multwindowextwm mode
+ if test "x$WINDOWSWM" = xyes ; then
+ AC_DEFINE(ROOTLESS,1,[Build Rootless code])
+ CFLAGS="$CFLAGS -DROOTLESS_WORKAROUND"
+ fi
+
+ CFLAGS="$CFLAGS -DFD_SETSIZE=256"
+ ;;
+ mingw*)
+ XWIN_SERVER_NAME=Xming
+ PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont])
+ AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location])
+ AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets])
+ XWIN_SYS_LIBS=-lwinsock2
+ ;;
+ esac
+ XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB"
+ XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
+ AC_SUBST(XWIN_LIBS)
+ AC_SUBST(XWIN_SERVER_NAME)
+ AC_SUBST(XWIN_SYS_LIBS)
+
+ if test "x$DEBUGGING" = xyes; then
+ AC_DEFINE(CYGDEBUG, 1, [Simple debug messages])
+ AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling])
+ AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager])
+ fi
+
+ AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF])
+ AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ])
+ if test "x$XF86VIDMODE" = xyes; then
+ AC_MSG_NOTICE([Disabling XF86VidMode extension])
+ XF86VIDMODE=no
+ fi
+fi
+AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
+AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
+AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
+AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes])
+AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && false])
+AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes && false])
+AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes && false])
+AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
+AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
+
+dnl Darwin / OS X DDX
+if test "x$XQUARTZ" = xyes; then
+ AC_DEFINE(XQUARTZ,1,[Have Quartz])
+ AC_DEFINE(ROOTLESS,1,[Build Rootless code])
+
+ DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
+ AC_SUBST([DARWIN_LIBS])
+
+ AC_CHECK_LIB([Xplugin],[xp_init],[:])
+
+ CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
+
+ PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
+
+ if test "x$XQUARTZ_SPARKLE" = xyes ; then
+ AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.])
+ fi
+
+ if test "x$STANDALONE_XPBPROXY" = xyes ; then
+ AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy])
+ fi
+fi
+
+# Support for objc in autotools is minimal and not documented.
+OBJC='$(CC)'
+OBJCLD='$(CCLD)'
+OBJCLINK='$(LINK)'
+OBJCFLAGS='$(CFLAGS)'
+AC_SUBST([OBJC])
+AC_SUBST([OBJCCLD])
+AC_SUBST([OBJCLINK])
+AC_SUBST([OBJCFLAGS])
+# internal, undocumented automake func follows :(
+_AM_DEPENDENCIES([OBJC])
+AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
+AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
+AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
+
+dnl DMX DDX
+PKG_CHECK_MODULES(
+ [DMXMODULES],
+ [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
+ [PKG_CHECK_MODULES(
+ [XDMXCONFIG_DEP],
+ [xaw7 xmu xt xpm x11],
+ [have_dmx=yes],
+ [have_dmx=no])],
+ [have_dmx=no])
+AC_MSG_CHECKING([whether to build Xdmx DDX])
+if test "x$DMX" = xauto; then
+ DMX="$have_dmx"
+ case $host_os in
+ cygwin*) DMX="no" ;;
+ darwin*) DMX="no" ;;
+ esac
+fi
+AC_MSG_RESULT([$DMX])
+AM_CONDITIONAL(DMX, [test "x$DMX" = xyes])
+
+if test "x$DMX" = xyes; then
+ if test "x$have_dmx" = xno; then
+ AC_MSG_ERROR([Xdmx build explicitly requested, but required
+ modules not found.])
+ fi
+ DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
+ XDMX_CFLAGS="$DMXMODULES_CFLAGS"
+ XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
+ XDMX_SYS_LIBS="$DMXMODULES_LIBS"
+ AC_SUBST([XDMX_CFLAGS])
+ AC_SUBST([XDMX_LIBS])
+ AC_SUBST([XDMX_SYS_LIBS])
+
+dnl USB sources in DMX require <linux/input.h>
+ AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes",
+ DMX_BUILD_USB="no")
+dnl Linux sources in DMX require <linux/keyboard.h>
+ AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes",
+ DMX_BUILD_LNX="no")
+ AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
+ AC_SUBST(XDMXCONFIG_DEP_LIBS)
+ PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])
+ AC_SUBST(DMXEXAMPLES_DEP_LIBS)
+ PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11])
+ AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS)
+ PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11])
+ AC_SUBST(DMXXIEXAMPLES_DEP_LIBS)
+ PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11])
+ AC_SUBST(XTSTEXAMPLES_DEP_LIBS)
+ PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11])
+ AC_SUBST(XRESEXAMPLES_DEP_LIBS)
+ PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11])
+ AC_SUBST(X11EXAMPLES_DEP_LIBS)
+
+fi
+AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes])
+AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes])
+
+dnl kdrive DDX
+
+XEPHYR_LIBS=
+XEPHYR_INCS=
+
+AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes])
+
+if test "$KDRIVE" = yes; then
+ AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server])
+ AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx])
+
+ AC_CHECK_HEADERS([linux/fb.h])
+ if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then
+ XFBDEV=yes
+ fi
+
+ if test "x$XFBDEV" = xyes; then
+ KDRIVEFBDEVLIB=yes
+ AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server])
+ fi
+
+
+ PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"])
+ if test "x$HAVE_TSLIB" = xno; then
+ AC_CHECK_LIB(ts, ts_open, [HAVE_TSLIB="yes"])
+ fi
+
+ if test "xTSLIB" = xauto; then
+ TSLIB="$HAVE_TSLIB"
+ fi
+
+ if test "x$TSLIB" = xyes; then
+ if ! test "x$HAVE_TSLIB" = xyes; then
+ AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/])
+ else
+ AC_DEFINE(TSLIB, 1, [Have tslib support])
+ fi
+ fi
+
+ if test "x$KDRIVE_KBD" = xyes; then
+ AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver])
+ fi
+ if test "x$KDRIVE_EVDEV" = xyes; then
+ AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver])
+ fi
+ if test "x$KDRIVE_MOUSE" = xyes; then
+ AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver])
+ fi
+
+ XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xfont xau xdmcp"
+ if test "x$XV" = xyes; then
+ XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv"
+ fi
+ if test "x$DRI" = xyes && test "x$GLX" = xyes; then
+ XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm"
+ fi
+
+ PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])
+ if test "x$XEPHYR" = xauto; then
+ XEPHYR=$xephyr
+ fi
+
+ # Xephyr needs nanosleep() which is in librt on Solaris
+ AC_CHECK_FUNC([nanosleep], [],
+ AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt"))
+
+ # damage shadow extension glx (NOTYET) fb mi
+ KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src'
+ KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC"
+ KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux'
+ KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC"
+
+ KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
+
+ KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB"
+ KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la'
+ case $host_os in
+ *linux*)
+ KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la'
+ KDRIVELINUX=yes
+ if test "x$KDRIVE_EVDEV" = xauto; then
+ KDRIVE_EVDEV=yes
+ fi
+ if test "x$KDRIVE_KBD" = xauto; then
+ KDRIVE_KBD=yes
+ fi
+ if test "x$KDRIVE_MOUSE" = xauto; then
+ KDRIVE_MOUSE=yes
+ fi
+ ;;
+ *)
+ if test "x$KDRIVE_EVDEV" = xauto; then
+ KDRIVE_EVDEV=no
+ fi
+ if test "x$KDRIVE_KBD" = xauto; then
+ KDRIVE_KBD=no
+ fi
+ if test "x$KDRIVE_MOUSE" = xauto; then
+ KDRIVE_MOUSE=no
+ fi
+ ;;
+ esac
+ KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la'
+ KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB $CONFIG_LIB"
+ KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
+ KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB"
+ KDRIVE_LIBS="$TSLIB_LIBS $KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS"
+
+ AC_SUBST([XEPHYR_LIBS])
+ AC_SUBST([XEPHYR_INCS])
+fi
+AC_SUBST([KDRIVE_INCS])
+AC_SUBST([KDRIVE_PURE_INCS])
+AC_SUBST([KDRIVE_CFLAGS])
+AC_SUBST([KDRIVE_PURE_LIBS])
+AC_SUBST([KDRIVE_LOCAL_LIBS])
+AC_SUBST([KDRIVE_LIBS])
+AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes])
+AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes])
+AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes])
+AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes])
+AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes])
+AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes])
+AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
+AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes])
+AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
+
+dnl and the rest of these are generic, so they're in config.h
+dnl
+dnl though, thanks to the passing of some significant amount of time, the
+dnl above is probably a complete fallacy, and you should not rely on it.
+dnl but this is still actually better than imake, honest. -daniels
+
+AC_TRY_COMPILE([
+#include <features.h>
+#ifndef __GLIBC__
+#error not glibc
+#endif
+], [], [AC_DEFINE(_GNU_SOURCE, 1,
+ [ Enable GNU and other extensions to the C environment for glibc])])
+
+AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
+
+BUILD_DATE="`date +'%Y%m%d'`"
+AC_SUBST([BUILD_DATE])
+BUILD_TIME="`date +'1%H%M%S'`"
+AC_SUBST([BUILD_TIME])
+
+DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
+
+AC_SUBST([DIX_CFLAGS])
+
+AC_SUBST([libdir])
+AC_SUBST([exec_prefix])
+AC_SUBST([prefix])
+
+AC_OUTPUT([
+Makefile
+glx/Makefile
+include/Makefile
+composite/Makefile
+damageext/Makefile
+dbe/Makefile
+dix/Makefile
+doc/Makefile
+fb/Makefile
+record/Makefile
+config/Makefile
+mi/Makefile
+miext/Makefile
+miext/damage/Makefile
+miext/shadow/Makefile
+miext/cw/Makefile
+miext/rootless/Makefile
+os/Makefile
+randr/Makefile
+render/Makefile
+xkb/Makefile
+Xext/Makefile
+Xi/Makefile
+xfixes/Makefile
+exa/Makefile
+hw/Makefile
+hw/xfree86/Makefile
+hw/xfree86/common/Makefile
+hw/xfree86/common/xf86Build.h
+hw/xfree86/ddc/Makefile
+hw/xfree86/dixmods/Makefile
+hw/xfree86/dixmods/extmod/Makefile
+hw/xfree86/doc/Makefile
+hw/xfree86/doc/devel/Makefile
+hw/xfree86/doc/man/Makefile
+hw/xfree86/doc/sgml/Makefile
+hw/xfree86/dri/Makefile
+hw/xfree86/dri2/Makefile
+hw/xfree86/exa/Makefile
+hw/xfree86/fbdevhw/Makefile
+hw/xfree86/i2c/Makefile
+hw/xfree86/int10/Makefile
+hw/xfree86/loader/Makefile
+hw/xfree86/modes/Makefile
+hw/xfree86/os-support/Makefile
+hw/xfree86/os-support/bsd/Makefile
+hw/xfree86/os-support/bus/Makefile
+hw/xfree86/os-support/hurd/Makefile
+hw/xfree86/os-support/misc/Makefile
+hw/xfree86/os-support/linux/Makefile
+hw/xfree86/os-support/sco/Makefile
+hw/xfree86/os-support/solaris/Makefile
+hw/xfree86/os-support/sysv/Makefile
+hw/xfree86/parser/Makefile
+hw/xfree86/ramdac/Makefile
+hw/xfree86/shadowfb/Makefile
+hw/xfree86/vbe/Makefile
+hw/xfree86/vgahw/Makefile
+hw/xfree86/x86emu/Makefile
+hw/xfree86/xaa/Makefile
+hw/xfree86/xf8_16bpp/Makefile
+hw/xfree86/utils/Makefile
+hw/xfree86/utils/cvt/Makefile
+hw/xfree86/utils/gtf/Makefile
+hw/dmx/config/Makefile
+hw/dmx/doc/Makefile
+hw/dmx/examples/Makefile
+hw/dmx/input/Makefile
+hw/dmx/glxProxy/Makefile
+hw/dmx/Makefile
+hw/vfb/Makefile
+hw/xnest/Makefile
+hw/xwin/Makefile
+hw/xquartz/Makefile
+hw/xquartz/GL/Makefile
+hw/xquartz/bundle/Makefile
+hw/xquartz/doc/Makefile
+hw/xquartz/mach-startup/Makefile
+hw/xquartz/pbproxy/Makefile
+hw/xquartz/xpr/Makefile
+hw/kdrive/Makefile
+hw/kdrive/ephyr/Makefile
+hw/kdrive/fake/Makefile
+hw/kdrive/fbdev/Makefile
+hw/kdrive/linux/Makefile
+hw/kdrive/src/Makefile
+test/Makefile
+test/xi2/Makefile
+xorg-server.pc
+])
diff --git a/xorg-server/cpprules.in b/xorg-server/cpprules.in index 7219e361f..66c683761 100644 --- a/xorg-server/cpprules.in +++ b/xorg-server/cpprules.in @@ -1,49 +1,50 @@ -# -*- Makefile -*- -# Rules for generating files using the C pre-processor -# (Replaces CppFileTarget from Imake) - -SED = sed - -SUFFIXES = .pre .man .man.pre - -# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM -# to cpp, because that trick does not work on all ANSI C preprocessors. -# Delete line numbers from the cpp output (-P is not portable, I guess). -# Allow XCOMM to be preceded by whitespace and provide a means of generating -# output lines with trailing backslashes. -# Allow XHASH to always be substituted, even in cases where XCOMM isn't. - -CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \ - -e '/^\#line *[0-9][0-9]* *.*$$/d' \ - -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \ - -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \ - -e '/^[ ]*XHASH/s/XHASH/\#/' \ - -e '/\@\@$$/s/\@\@$$/\\/' - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - XSERVERNAME = Xorg - -MANDEFS = \ - -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \ - -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \ - -D__appmansuffix__=$(APP_MAN_SUFFIX) \ - -D__filemansuffix__=$(FILE_MAN_SUFFIX) \ - -D__libmansuffix__=$(LIB_MAN_SUFFIX) \ - -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \ - -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \ - -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \ - -D__mandir__=$(mandir) \ - -D__projectroot__=$(prefix) \ - -D__xconfigfile__=$(__XCONFIGFILE__) \ - -D__xconfigdir__=$(__XCONFIGDIR__) \ - -D__xkbdir__=$(XKB_BASE_DIRECTORY) \ - -D__modulepath__="$(DEFAULT_MODULE_PATH)" \ - -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME) - -.pre: - $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ - -.man.pre.man: - $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ +# -*- Makefile -*-
+# Rules for generating files using the C pre-processor
+# (Replaces CppFileTarget from Imake)
+
+SED = sed
+
+SUFFIXES = .pre .man .man.pre
+
+# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
+# to cpp, because that trick does not work on all ANSI C preprocessors.
+# Delete line numbers from the cpp output (-P is not portable, I guess).
+# Allow XCOMM to be preceded by whitespace and provide a means of generating
+# output lines with trailing backslashes.
+# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
+
+CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
+ -e '/^\#line *[0-9][0-9]* *.*$$/d' \
+ -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
+ -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
+ -e '/^[ ]*XHASH/s/XHASH/\#/' \
+ -e '/\@\@$$/s/\@\@$$/\\/'
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+ XORGMANNAME = X Version 11
+ XSERVERNAME = Xorg
+
+MANDEFS = \
+ -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
+ -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
+ -D__appmansuffix__=$(APP_MAN_SUFFIX) \
+ -D__filemansuffix__=$(FILE_MAN_SUFFIX) \
+ -D__libmansuffix__=$(LIB_MAN_SUFFIX) \
+ -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
+ -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
+ -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
+ -D__mandir__=$(mandir) \
+ -D__projectroot__=$(prefix) \
+ -D__datadir__=$(datadir) \
+ -D__xconfigfile__=$(__XCONFIGFILE__) \
+ -D__xconfigdir__=$(__XCONFIGDIR__) \
+ -D__xkbdir__=$(XKB_BASE_DIRECTORY) \
+ -D__modulepath__="$(DEFAULT_MODULE_PATH)" \
+ -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME)
+
+.pre:
+ $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
+
+.man.pre.man:
+ $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
diff --git a/xorg-server/doc/Makefile.am b/xorg-server/doc/Makefile.am index d3911c9bf..0d24bc257 100644 --- a/xorg-server/doc/Makefile.am +++ b/xorg-server/doc/Makefile.am @@ -1,35 +1,24 @@ -appmandir = $(APP_MAN_DIR) -filemandir = $(FILE_MAN_DIR) - -# Xserver.man covers options generic to all X servers built in this tree -# (i.e. those handled in the os/utils.c options processing instead of in -# the DDX-level options processing) -appman_PRE = Xserver.man.pre -fileman_PRE = - -appman_PROCESSED = $(appman_PRE:man.pre=man) -fileman_PROCESSED = $(fileman_PRE:man.pre=man) - -appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@) -fileman_DATA = $(fileman_PRE:man.pre=@FILE_MAN_SUFFIX@) - -BUILT_SOURCES = $(appman_PROCESSED) $(fileman_PROCESSED) - -CLEANFILES = $(appman_PROCESSED) $(appman_DATA) \ - $(fileman_PROCESSED) $(fileman_DATA) - -include $(top_srcdir)/cpprules.in - -.man.$(APP_MAN_SUFFIX): - cp $< $@ - -.man.$(FILE_MAN_SUFFIX): - cp $< $@ - -EXTRAMANDEFS = -D__default_font_path__="`echo $(COMPILEDDEFAULTFONTPATH) | sed -e 's/,/, /g'`" - -# Docs about X server internals that we ship with source but don't install -DEVEL_DOCS = smartsched - - -EXTRA_DIST = $(DEVEL_DOCS) $(appman_PRE) $(fileman_PRE) +
+# Xserver.man covers options generic to all X servers built in this tree
+# (i.e. those handled in the os/utils.c options processing instead of in
+# the DDX-level options processing)
+appmandir = $(APP_MAN_DIR)
+appman_PRE = Xserver.man.pre
+
+appman_PROCESSED = $(appman_PRE:man.pre=man)
+appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@)
+
+BUILT_SOURCES = $(appman_PROCESSED)
+CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
+
+include $(top_srcdir)/cpprules.in
+
+.man.$(APP_MAN_SUFFIX):
+ cp $< $@
+
+EXTRAMANDEFS = -D__default_font_path__="`echo $(COMPILEDDEFAULTFONTPATH) | sed -e 's/,/, /g'`"
+
+# Docs about X server internals that we ship with source but don't install
+DEVEL_DOCS = smartsched
+
+EXTRA_DIST = $(DEVEL_DOCS) $(appman_PRE) $(fileman_PRE)
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c index 18ac49479..cc7ce738d 100644 --- a/xorg-server/fb/fbpict.c +++ b/xorg-server/fb/fbpict.c @@ -453,6 +453,7 @@ image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff) else if (sp->type == SourcePictTypeConical)
image = create_conical_gradient_image (gradient);
}
+ *xoff = *yoff = 0;
}
if (image)
diff --git a/xorg-server/glx/glapitemp.h b/xorg-server/glx/glapitemp.h index 09259f470..a98401c6d 100644 --- a/xorg-server/glx/glapitemp.h +++ b/xorg-server/glx/glapitemp.h @@ -1,6655 +1,6655 @@ -/* DO NOT EDIT - This file generated automatically by gl_apitemp.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004 - * 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, sub license, - * 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL, IBM, - * AND/OR THEIR SUPPLIERS 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. - */ - - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) -# define HIDDEN __attribute__((visibility("hidden"))) -# else -# define HIDDEN -# endif - -/* - * This file is a template which generates the OpenGL API entry point - * functions. It should be included by a .c file which first defines - * the following macros: - * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32 - * KEYWORD2 - usually nothing, but might be __stdcall on Win32 - * NAME(n) - builds the final function name (usually add "gl" prefix) - * DISPATCH(func, args, msg) - code to do dispatch of named function. - * msg is a printf-style debug message. - * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value - * - * Here is an example which generates the usual OpenGL functions: - * #define KEYWORD1 - * #define KEYWORD2 - * #define NAME(func) gl##func - * #define DISPATCH(func, args, msg) \ - * struct _glapi_table *dispatch = CurrentDispatch; \ - * (*dispatch->func) args - * #define RETURN DISPATCH(func, args, msg) \ - * struct _glapi_table *dispatch = CurrentDispatch; \ - * return (*dispatch->func) args - * - */ - - -#if defined( NAME ) -#ifndef KEYWORD1 -#define KEYWORD1 -#endif - -#ifndef KEYWORD1_ALT -#define KEYWORD1_ALT HIDDEN -#endif - -#ifndef KEYWORD2 -#define KEYWORD2 -#endif - -#ifndef DISPATCH -#error DISPATCH must be defined -#endif - -#ifndef RETURN_DISPATCH -#error RETURN_DISPATCH must be defined -#endif - - -KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode) -{ - DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(EndList)(void) -{ - DISPATCH(EndList, (), (F, "glEndList();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list) -{ - DISPATCH(CallList, (list), (F, "glCallList(%d);\n", list)); -} - -KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid * lists) -{ - DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);\n", n, type, (const void *) lists)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range) -{ - DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%d, %d);\n", list, range)); -} - -KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range) -{ - RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);\n", range)); -} - -KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base) -{ - DISPATCH(ListBase, (base), (F, "glListBase(%d);\n", base)); -} - -KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode) -{ - DISPATCH(Begin, (mode), (F, "glBegin(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap) -{ - DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (F, "glBitmap(%d, %d, %f, %f, %f, %f, %p);\n", width, height, xorig, yorig, xmove, ymove, (const void *) bitmap)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte * v) -{ - DISPATCH(Color3bv, (v), (F, "glColor3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble * v) -{ - DISPATCH(Color3dv, (v), (F, "glColor3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat * v) -{ - DISPATCH(Color3fv, (v), (F, "glColor3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue) -{ - DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint * v) -{ - DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort * v) -{ - DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte * v) -{ - DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint * v) -{ - DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort * v) -{ - DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) -{ - DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte * v) -{ - DISPATCH(Color4bv, (v), (F, "glColor4bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) -{ - DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble * v) -{ - DISPATCH(Color4dv, (v), (F, "glColor4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4f(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat * v) -{ - DISPATCH(Color4fv, (v), (F, "glColor4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha) -{ - DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint * v) -{ - DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha) -{ - DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort * v) -{ - DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) -{ - DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte * v) -{ - DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha) -{ - DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint * v) -{ - DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha) -{ - DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort * v) -{ - DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag) -{ - DISPATCH(EdgeFlag, (flag), (F, "glEdgeFlag(%d);\n", flag)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean * flag) -{ - DISPATCH(EdgeFlagv, (flag), (F, "glEdgeFlagv(%p);\n", (const void *) flag)); -} - -KEYWORD1 void KEYWORD2 NAME(End)(void) -{ - DISPATCH(End, (), (F, "glEnd();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c) -{ - DISPATCH(Indexd, (c), (F, "glIndexd(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble * c) -{ - DISPATCH(Indexdv, (c), (F, "glIndexdv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c) -{ - DISPATCH(Indexf, (c), (F, "glIndexf(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat * c) -{ - DISPATCH(Indexfv, (c), (F, "glIndexfv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c) -{ - DISPATCH(Indexi, (c), (F, "glIndexi(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint * c) -{ - DISPATCH(Indexiv, (c), (F, "glIndexiv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c) -{ - DISPATCH(Indexs, (c), (F, "glIndexs(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort * c) -{ - DISPATCH(Indexsv, (c), (F, "glIndexsv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz) -{ - DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte * v) -{ - DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz) -{ - DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble * v) -{ - DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz) -{ - DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%f, %f, %f);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat * v) -{ - DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz) -{ - DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint * v) -{ - DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz) -{ - DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort * v) -{ - DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y) -{ - DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble * v) -{ - DISPATCH(RasterPos2dv, (v), (F, "glRasterPos2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y) -{ - DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat * v) -{ - DISPATCH(RasterPos2fv, (v), (F, "glRasterPos2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y) -{ - DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint * v) -{ - DISPATCH(RasterPos2iv, (v), (F, "glRasterPos2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y) -{ - DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort * v) -{ - DISPATCH(RasterPos2sv, (v), (F, "glRasterPos2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble * v) -{ - DISPATCH(RasterPos3dv, (v), (F, "glRasterPos3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat * v) -{ - DISPATCH(RasterPos3fv, (v), (F, "glRasterPos3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint * v) -{ - DISPATCH(RasterPos3iv, (v), (F, "glRasterPos3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort * v) -{ - DISPATCH(RasterPos3sv, (v), (F, "glRasterPos3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble * v) -{ - DISPATCH(RasterPos4dv, (v), (F, "glRasterPos4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat * v) -{ - DISPATCH(RasterPos4fv, (v), (F, "glRasterPos4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint * v) -{ - DISPATCH(RasterPos4iv, (v), (F, "glRasterPos4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort * v) -{ - DISPATCH(RasterPos4sv, (v), (F, "glRasterPos4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) -{ - DISPATCH(Rectd, (x1, y1, x2, y2), (F, "glRectd(%f, %f, %f, %f);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble * v1, const GLdouble * v2) -{ - DISPATCH(Rectdv, (v1, v2), (F, "glRectdv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ - DISPATCH(Rectf, (x1, y1, x2, y2), (F, "glRectf(%f, %f, %f, %f);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat * v1, const GLfloat * v2) -{ - DISPATCH(Rectfv, (v1, v2), (F, "glRectfv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2) -{ - DISPATCH(Recti, (x1, y1, x2, y2), (F, "glRecti(%d, %d, %d, %d);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint * v1, const GLint * v2) -{ - DISPATCH(Rectiv, (v1, v2), (F, "glRectiv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2) -{ - DISPATCH(Rects, (x1, y1, x2, y2), (F, "glRects(%d, %d, %d, %d);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort * v1, const GLshort * v2) -{ - DISPATCH(Rectsv, (v1, v2), (F, "glRectsv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s) -{ - DISPATCH(TexCoord1d, (s), (F, "glTexCoord1d(%f);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble * v) -{ - DISPATCH(TexCoord1dv, (v), (F, "glTexCoord1dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s) -{ - DISPATCH(TexCoord1f, (s), (F, "glTexCoord1f(%f);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat * v) -{ - DISPATCH(TexCoord1fv, (v), (F, "glTexCoord1fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s) -{ - DISPATCH(TexCoord1i, (s), (F, "glTexCoord1i(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint * v) -{ - DISPATCH(TexCoord1iv, (v), (F, "glTexCoord1iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s) -{ - DISPATCH(TexCoord1s, (s), (F, "glTexCoord1s(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort * v) -{ - DISPATCH(TexCoord1sv, (v), (F, "glTexCoord1sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t) -{ - DISPATCH(TexCoord2d, (s, t), (F, "glTexCoord2d(%f, %f);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble * v) -{ - DISPATCH(TexCoord2dv, (v), (F, "glTexCoord2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t) -{ - DISPATCH(TexCoord2f, (s, t), (F, "glTexCoord2f(%f, %f);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat * v) -{ - DISPATCH(TexCoord2fv, (v), (F, "glTexCoord2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t) -{ - DISPATCH(TexCoord2i, (s, t), (F, "glTexCoord2i(%d, %d);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint * v) -{ - DISPATCH(TexCoord2iv, (v), (F, "glTexCoord2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t) -{ - DISPATCH(TexCoord2s, (s, t), (F, "glTexCoord2s(%d, %d);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort * v) -{ - DISPATCH(TexCoord2sv, (v), (F, "glTexCoord2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(TexCoord3d, (s, t, r), (F, "glTexCoord3d(%f, %f, %f);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble * v) -{ - DISPATCH(TexCoord3dv, (v), (F, "glTexCoord3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(TexCoord3f, (s, t, r), (F, "glTexCoord3f(%f, %f, %f);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat * v) -{ - DISPATCH(TexCoord3fv, (v), (F, "glTexCoord3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r) -{ - DISPATCH(TexCoord3i, (s, t, r), (F, "glTexCoord3i(%d, %d, %d);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint * v) -{ - DISPATCH(TexCoord3iv, (v), (F, "glTexCoord3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r) -{ - DISPATCH(TexCoord3s, (s, t, r), (F, "glTexCoord3s(%d, %d, %d);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort * v) -{ - DISPATCH(TexCoord3sv, (v), (F, "glTexCoord3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(TexCoord4d, (s, t, r, q), (F, "glTexCoord4d(%f, %f, %f, %f);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble * v) -{ - DISPATCH(TexCoord4dv, (v), (F, "glTexCoord4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(TexCoord4f, (s, t, r, q), (F, "glTexCoord4f(%f, %f, %f, %f);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat * v) -{ - DISPATCH(TexCoord4fv, (v), (F, "glTexCoord4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(TexCoord4i, (s, t, r, q), (F, "glTexCoord4i(%d, %d, %d, %d);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint * v) -{ - DISPATCH(TexCoord4iv, (v), (F, "glTexCoord4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(TexCoord4s, (s, t, r, q), (F, "glTexCoord4s(%d, %d, %d, %d);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort * v) -{ - DISPATCH(TexCoord4sv, (v), (F, "glTexCoord4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y) -{ - DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble * v) -{ - DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y) -{ - DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat * v) -{ - DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y) -{ - DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint * v) -{ - DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y) -{ - DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort * v) -{ - DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble * v) -{ - DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat * v) -{ - DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint * v) -{ - DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort * v) -{ - DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble * v) -{ - DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat * v) -{ - DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint * v) -{ - DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort * v) -{ - DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble * equation) -{ - DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(0x%x, %p);\n", plane, (const void *) equation)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode) -{ - DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);\n", face, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode) -{ - DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param) -{ - DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param) -{ - DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint * params) -{ - DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode) -{ - DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode) -{ - DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);\n", target, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param) -{ - DISPATCH(Lightf, (light, pname, param), (F, "glLightf(0x%x, 0x%x, %f);\n", light, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat * params) -{ - DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param) -{ - DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);\n", light, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint * params) -{ - DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param) -{ - DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param) -{ - DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint * params) -{ - DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern) -{ - DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, %d);\n", factor, pattern)); -} - -KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width) -{ - DISPATCH(LineWidth, (width), (F, "glLineWidth(%f);\n", width)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param) -{ - DISPATCH(Materialf, (face, pname, param), (F, "glMaterialf(0x%x, 0x%x, %f);\n", face, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat * params) -{ - DISPATCH(Materialfv, (face, pname, params), (F, "glMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param) -{ - DISPATCH(Materiali, (face, pname, param), (F, "glMateriali(0x%x, 0x%x, %d);\n", face, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint * params) -{ - DISPATCH(Materialiv, (face, pname, params), (F, "glMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size) -{ - DISPATCH(PointSize, (size), (F, "glPointSize(%f);\n", size)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode) -{ - DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);\n", face, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte * mask) -{ - DISPATCH(PolygonStipple, (mask), (F, "glPolygonStipple(%p);\n", (const void *) mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);\n", x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode) -{ - DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param) -{ - DISPATCH(TexParameterf, (target, pname, param), (F, "glTexParameterf(0x%x, 0x%x, %f);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexParameterfv, (target, pname, params), (F, "glTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param) -{ - DISPATCH(TexParameteri, (target, pname, param), (F, "glTexParameteri(0x%x, 0x%x, %d);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(TexParameteriv, (target, pname, params), (F, "glTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (F, "glTexImage1D(0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (F, "glTexImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param) -{ - DISPATCH(TexEnvf, (target, pname, param), (F, "glTexEnvf(0x%x, 0x%x, %f);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexEnvfv, (target, pname, params), (F, "glTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param) -{ - DISPATCH(TexEnvi, (target, pname, param), (F, "glTexEnvi(0x%x, 0x%x, %d);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(TexEnviv, (target, pname, params), (F, "glTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param) -{ - DISPATCH(TexGend, (coord, pname, param), (F, "glTexGend(0x%x, 0x%x, %f);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble * params) -{ - DISPATCH(TexGendv, (coord, pname, params), (F, "glTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param) -{ - DISPATCH(TexGenf, (coord, pname, param), (F, "glTexGenf(0x%x, 0x%x, %f);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexGenfv, (coord, pname, params), (F, "glTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param) -{ - DISPATCH(TexGeni, (coord, pname, param), (F, "glTexGeni(0x%x, 0x%x, %d);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint * params) -{ - DISPATCH(TexGeniv, (coord, pname, params), (F, "glTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer) -{ - DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);\n", size, type, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint * buffer) -{ - DISPATCH(SelectBuffer, (size, buffer), (F, "glSelectBuffer(%d, %p);\n", size, (const void *) buffer)); -} - -KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode) -{ - RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(InitNames)(void) -{ - DISPATCH(InitNames, (), (F, "glInitNames();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name) -{ - DISPATCH(LoadName, (name), (F, "glLoadName(%d);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token) -{ - DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);\n", token)); -} - -KEYWORD1 void KEYWORD2 NAME(PopName)(void) -{ - DISPATCH(PopName, (), (F, "glPopName();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name) -{ - DISPATCH(PushName, (name), (F, "glPushName(%d);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode) -{ - DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask) -{ - DISPATCH(Clear, (mask), (F, "glClear(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c) -{ - DISPATCH(ClearIndex, (c), (F, "glClearIndex(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s) -{ - DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth) -{ - DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%f);\n", depth)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask) -{ - DISPATCH(StencilMask, (mask), (F, "glStencilMask(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) -{ - DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag) -{ - DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);\n", flag)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask) -{ - DISPATCH(IndexMask, (mask), (F, "glIndexMask(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value) -{ - DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %f);\n", op, value)); -} - -KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap) -{ - DISPATCH(Disable, (cap), (F, "glDisable(0x%x);\n", cap)); -} - -KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap) -{ - DISPATCH(Enable, (cap), (F, "glEnable(0x%x);\n", cap)); -} - -KEYWORD1 void KEYWORD2 NAME(Finish)(void) -{ - DISPATCH(Finish, (), (F, "glFinish();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Flush)(void) -{ - DISPATCH(Flush, (), (F, "glFlush();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void) -{ - DISPATCH(PopAttrib, (), (F, "glPopAttrib();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask) -{ - DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points) -{ - DISPATCH(Map1d, (target, u1, u2, stride, order, points), (F, "glMap1d(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points) -{ - DISPATCH(Map1f, (target, u1, u2, stride, order, points), (F, "glMap1f(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points) -{ - DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2d(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points) -{ - DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2f(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2) -{ - DISPATCH(MapGrid1d, (un, u1, u2), (F, "glMapGrid1d(%d, %f, %f);\n", un, u1, u2)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2) -{ - DISPATCH(MapGrid1f, (un, u1, u2), (F, "glMapGrid1f(%d, %f, %f);\n", un, u1, u2)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) -{ - DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2d(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) -{ - DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2f(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u) -{ - DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%f);\n", u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble * u) -{ - DISPATCH(EvalCoord1dv, (u), (F, "glEvalCoord1dv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u) -{ - DISPATCH(EvalCoord1f, (u), (F, "glEvalCoord1f(%f);\n", u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat * u) -{ - DISPATCH(EvalCoord1fv, (u), (F, "glEvalCoord1fv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v) -{ - DISPATCH(EvalCoord2d, (u, v), (F, "glEvalCoord2d(%f, %f);\n", u, v)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble * u) -{ - DISPATCH(EvalCoord2dv, (u), (F, "glEvalCoord2dv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v) -{ - DISPATCH(EvalCoord2f, (u, v), (F, "glEvalCoord2f(%f, %f);\n", u, v)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat * u) -{ - DISPATCH(EvalCoord2fv, (u), (F, "glEvalCoord2fv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2) -{ - DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh1(0x%x, %d, %d);\n", mode, i1, i2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i) -{ - DISPATCH(EvalPoint1, (i), (F, "glEvalPoint1(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) -{ - DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);\n", mode, i1, i2, j1, j2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j) -{ - DISPATCH(EvalPoint2, (i, j), (F, "glEvalPoint2(%d, %d);\n", i, j)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref) -{ - DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %f);\n", func, ref)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor) -{ - DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);\n", sfactor, dfactor)); -} - -KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode) -{ - DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);\n", opcode)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask) -{ - DISPATCH(StencilFunc, (func, ref, mask), (F, "glStencilFunc(0x%x, %d, %d);\n", func, ref, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOp, (fail, zfail, zpass), (F, "glStencilOp(0x%x, 0x%x, 0x%x);\n", fail, zfail, zpass)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func) -{ - DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);\n", func)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor) -{ - DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);\n", xfactor, yfactor)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param) -{ - DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param) -{ - DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values) -{ - DISPATCH(PixelMapfv, (map, mapsize, values), (F, "glPixelMapfv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values) -{ - DISPATCH(PixelMapuiv, (map, mapsize, values), (F, "glPixelMapuiv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values) -{ - DISPATCH(PixelMapusv, (map, mapsize, values), (F, "glPixelMapusv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode) -{ - DISPATCH(ReadBuffer, (mode), (F, "glReadBuffer(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) -{ - DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x);\n", x, y, width, height, type)); -} - -KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels) -{ - DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (F, "glReadPixels(%d, %d, %d, %d, 0x%x, 0x%x, %p);\n", x, y, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);\n", width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean * params) -{ - DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble * equation) -{ - DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(0x%x, %p);\n", plane, (const void *) equation)); -} - -KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble * params) -{ - DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void) -{ - RETURN_DISPATCH(GetError, (), (F, "glGetError();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat * params) -{ - DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint * params) -{ - DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat * params) -{ - DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint * params) -{ - DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble * v) -{ - DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat * v) -{ - DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint * v) -{ - DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint * params) -{ - DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat * values) -{ - DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint * values) -{ - DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort * values) -{ - DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte * mask) -{ - DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);\n", (const void *) mask)); -} - -KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name) -{ - RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGetTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params) -{ - DISPATCH(GetTexGendv, (coord, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexGenfv, (coord, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum coord, GLenum pname, GLint * params) -{ - DISPATCH(GetTexGeniv, (coord, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) -{ - DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);\n", target, level, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params) -{ - DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap) -{ - RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);\n", cap)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list) -{ - RETURN_DISPATCH(IsList, (list), (F, "glIsList(%d);\n", list)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd zNear, GLclampd zFar) -{ - DISPATCH(DepthRange, (zNear, zFar), (F, "glDepthRange(%f, %f);\n", zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ - DISPATCH(Frustum, (left, right, bottom, top, zNear, zFar), (F, "glFrustum(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void) -{ - DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat * m) -{ - DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble * m) -{ - DISPATCH(LoadMatrixd, (m), (F, "glLoadMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode) -{ - DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat * m) -{ - DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble * m) -{ - DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ - DISPATCH(Ortho, (left, right, bottom, top, zNear, zFar), (F, "glOrtho(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void) -{ - DISPATCH(PopMatrix, (), (F, "glPopMatrix();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void) -{ - DISPATCH(PushMatrix, (), (F, "glPushMatrix();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Rotated, (angle, x, y, z), (F, "glRotated(%f, %f, %f, %f);\n", angle, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%f, %f, %f, %f);\n", angle, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Scaled, (x, y, z), (F, "glScaled(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Scalef, (x, y, z), (F, "glScalef(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Translated, (x, y, z), (F, "glTranslated(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);\n", x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i) -{ - DISPATCH(ArrayElement, (i), (F, "glArrayElement(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i) -{ - DISPATCH(ArrayElement, (i), (F, "glArrayElementEXT(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture) -{ - DISPATCH(BindTexture, (target, texture), (F, "glBindTexture(0x%x, %d);\n", target, texture)); -} - -KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture) -{ - DISPATCH(BindTexture, (target, texture), (F, "glBindTextureEXT(0x%x, %d);\n", target, texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(ColorPointer, (size, type, stride, pointer), (F, "glColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum array) -{ - DISPATCH(DisableClientState, (array), (F, "glDisableClientState(0x%x);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count) -{ - DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);\n", mode, first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count) -{ - DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArraysEXT(0x%x, %d, %d);\n", mode, first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p);\n", mode, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(EdgeFlagPointer, (stride, pointer), (F, "glEdgeFlagPointer(%d, %p);\n", stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum array) -{ - DISPATCH(EnableClientState, (array), (F, "glEnableClientState(0x%x);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(IndexPointer, (type, stride, pointer), (F, "glIndexPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c) -{ - DISPATCH(Indexub, (c), (F, "glIndexub(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte * c) -{ - DISPATCH(Indexubv, (c), (F, "glIndexubv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);\n", format, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(NormalPointer, (type, stride, pointer), (F, "glNormalPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units) -{ - DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%f, %f);\n", factor, units)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(TexCoordPointer, (size, type, stride, pointer), (F, "glTexCoordPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexPointer, (size, type, stride, pointer), (F, "glVertexPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) -{ - DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) -{ - DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) -{ - DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) -{ - DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1D(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1DEXT(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2D(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures) -{ - DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures) -{ - DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params) -{ - DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, GLvoid ** params) -{ - DISPATCH(GetPointerv, (pname, params), (F, "glGetPointervEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture) -{ - RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture) -{ - RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities) -{ - DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); -} - -KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint * textures, const GLclampf * priorities) -{ - DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTexturesEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1D(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1DEXT(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void) -{ - DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask) -{ - DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColor(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColorEXT(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode) -{ - DISPATCH(BlendEquation, (mode), (F, "glBlendEquation(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode) -{ - DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElements(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTable(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTableSGI(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) -{ - DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) -{ - DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTableEXT(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTable(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTableEXT(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1D(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1DEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params) -{ - DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterf(0x%x, 0x%x, %f);\n", target, pname, params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params) -{ - DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterfEXT(0x%x, 0x%x, %f);\n", target, pname, params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params) -{ - DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteri(0x%x, 0x%x, %d);\n", target, pname, params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params) -{ - DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteriEXT(0x%x, 0x%x, %d);\n", target, pname, params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1D(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1DEXT(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2D(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image) -{ - DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image) -{ - DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) -{ - DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) -{ - DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) -{ - DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) -{ - DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); -} - -KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogramEXT(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); -} - -KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmax(0x%x, 0x%x, %d);\n", target, internalformat, sink)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmaxEXT(0x%x, 0x%x, %d);\n", target, internalformat, sink)); -} - -KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target) -{ - DISPATCH(ResetHistogram, (target), (F, "glResetHistogram(0x%x);\n", target)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target) -{ - DISPATCH(ResetHistogram, (target), (F, "glResetHistogramEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target) -{ - DISPATCH(ResetMinmax, (target), (F, "glResetMinmax(0x%x);\n", target)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target) -{ - DISPATCH(ResetMinmax, (target), (F, "glResetMinmaxEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3D(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture) -{ - DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTexture(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture) -{ - DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTextureARB(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture) -{ - DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTexture(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture) -{ - DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTextureARB(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s) -{ - DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1d(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s) -{ - DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1dARB(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s) -{ - DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1f(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s) -{ - DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1fARB(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s) -{ - DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1i(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s) -{ - DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1iARB(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s) -{ - DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1s(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s) -{ - DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1sARB(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t) -{ - DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2d(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t) -{ - DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2dARB(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t) -{ - DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2f(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t) -{ - DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2fARB(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t) -{ - DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2i(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t) -{ - DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2iARB(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t) -{ - DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2s(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t) -{ - DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2sARB(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3d(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3dARB(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3f(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3fARB(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r) -{ - DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3i(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r) -{ - DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3iARB(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r) -{ - DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3s(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r) -{ - DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3sARB(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4d(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4dARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4f(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4fARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4i(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4iARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4s(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4sARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader) -{ - DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader)); -} - -KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void) -{ - RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n")); -} - -KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type) -{ - RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program) -{ - DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program) -{ - DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader) -{ - DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader)); -} - -KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj) -{ - DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) -{ - DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) -{ - DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params) -{ - DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program) -{ - RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader) -{ - RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) -{ - DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilMaskSeparate)(GLenum face, GLuint mask) -{ - DISPATCH(StencilMaskSeparate, (face, mask), (F, "glStencilMaskSeparate(0x%x, %d);\n", face, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparateATI(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m) -{ - DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble * m) -{ - DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixdARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat * m) -{ - DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat * m) -{ - DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble * m) -{ - DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble * m) -{ - DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixdARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat * m) -{ - DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat * m) -{ - DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixfARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverage(%f, %d);\n", value, invert)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1D(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint level, GLvoid * img) -{ - DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImage(0x%x, %d, %p);\n", target, level, (const void *) img)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img) -{ - DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index) -{ - DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index) -{ - DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index) -{ - DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index) -{ - DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params) -{ - DISPATCH(GetProgramEnvParameterdvARB, (target, index, params), (F, "glGetProgramEnvParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params) -{ - DISPATCH(GetProgramEnvParameterfvARB, (target, index, params), (F, "glGetProgramEnvParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params) -{ - DISPATCH(GetProgramLocalParameterdvARB, (target, index, params), (F, "glGetProgramLocalParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params) -{ - DISPATCH(GetProgramLocalParameterfvARB, (target, index, params), (F, "glGetProgramLocalParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string) -{ - DISPATCH(GetProgramStringARB, (target, pname, string), (F, "glGetProgramStringARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) string)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramEnvParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramEnvParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramLocalParameter4dARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramLocalParameter4dvARB, (target, index, params), (F, "glProgramLocalParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramLocalParameter4fARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramLocalParameter4fvARB, (target, index, params), (F, "glProgramLocalParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string) -{ - DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindBuffer)(GLenum target, GLuint buffer) -{ - DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBuffer(0x%x, %d);\n", target, buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindBufferARB)(GLenum target, GLuint buffer) -{ - DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBufferARB(0x%x, %d);\n", target, buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) -{ - DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferData(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage) -{ - DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferDataARB(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) -{ - DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data) -{ - DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteBuffers)(GLsizei n, const GLuint * buffer) -{ - DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffers(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteBuffersARB)(GLsizei n, const GLuint * buffer) -{ - DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffersARB(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GenBuffers)(GLsizei n, GLuint * buffer) -{ - DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffers(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GenBuffersARB)(GLsizei n, GLuint * buffer) -{ - DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffersARB(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameterivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params) -{ - DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointerv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params) -{ - DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointervARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) -{ - DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data) -{ - DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsBuffer)(GLuint buffer) -{ - RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBuffer(%d);\n", buffer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsBufferARB)(GLuint buffer) -{ - RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBufferARB(%d);\n", buffer)); -} - -KEYWORD1 GLvoid * KEYWORD2 NAME(MapBuffer)(GLenum target, GLenum access) -{ - RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBuffer(0x%x, 0x%x);\n", target, access)); -} - -KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferARB)(GLenum target, GLenum access) -{ - RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBufferARB(0x%x, 0x%x);\n", target, access)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBuffer)(GLenum target) -{ - RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBuffer(0x%x);\n", target)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBufferARB)(GLenum target) -{ - RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBufferARB(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginQuery)(GLenum target, GLuint id) -{ - DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQuery(0x%x, %d);\n", target, id)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginQueryARB)(GLenum target, GLuint id) -{ - DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQueryARB(0x%x, %d);\n", target, id)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteQueries)(GLsizei n, const GLuint * ids) -{ - DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueries(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteQueriesARB)(GLsizei n, const GLuint * ids) -{ - DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueriesARB(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(EndQuery)(GLenum target) -{ - DISPATCH(EndQueryARB, (target), (F, "glEndQuery(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(EndQueryARB)(GLenum target) -{ - DISPATCH(EndQueryARB, (target), (F, "glEndQueryARB(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(GenQueries)(GLsizei n, GLuint * ids) -{ - DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueries(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(GenQueriesARB)(GLsizei n, GLuint * ids) -{ - DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueriesARB(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectiv)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectiv(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params) -{ - DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuiv(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params) -{ - DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryiv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsQuery)(GLuint id) -{ - RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQuery(%d);\n", id)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsQueryARB)(GLuint id) -{ - RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQueryARB(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj) -{ - DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj)); -} - -KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader) -{ - DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader)); -} - -KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader) -{ - DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader)); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void) -{ - RETURN_DISPATCH(CreateProgramObjectARB, (), (F, "glCreateProgramObjectARB();\n")); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateShaderObjectARB)(GLenum shaderType) -{ - RETURN_DISPATCH(CreateShaderObjectARB, (shaderType), (F, "glCreateShaderObjectARB(0x%x);\n", shaderType)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteObjectARB)(GLhandleARB obj) -{ - DISPATCH(DeleteObjectARB, (obj), (F, "glDeleteObjectARB(%d);\n", obj)); -} - -KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj) -{ - DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) -{ - DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) -{ - DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog) -{ - DISPATCH(GetAttachedObjectsARB, (containerObj, maxLength, length, infoLog), (F, "glGetAttachedObjectsARB(%d, %d, %p, %p);\n", containerObj, maxLength, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(GetHandleARB)(GLenum pname) -{ - RETURN_DISPATCH(GetHandleARB, (pname), (F, "glGetHandleARB(0x%x);\n", pname)); -} - -KEYWORD1 void KEYWORD2 NAME(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog) -{ - DISPATCH(GetInfoLogARB, (obj, maxLength, length, infoLog), (F, "glGetInfoLogARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params) -{ - DISPATCH(GetObjectParameterfvARB, (obj, pname, params), (F, "glGetObjectParameterfvARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params) -{ - DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) -{ - DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source) -{ - DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name) -{ - RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name) -{ - RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params) -{ - DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params) -{ - DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params) -{ - DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params) -{ - DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program) -{ - DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program) -{ - DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length) -{ - DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); -} - -KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length) -{ - DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0) -{ - DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0) -{ - DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0) -{ - DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0) -{ - DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1) -{ - DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1) -{ - DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1) -{ - DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1) -{ - DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) -{ - DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) -{ - DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2) -{ - DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2) -{ - DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) -{ - DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) -{ - DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) -{ - DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) -{ - DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program) -{ - DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program) -{ - DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program) -{ - DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program) -{ - DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name) -{ - DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name) -{ - DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) -{ - DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) -{ - DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name) -{ - RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name) -{ - RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) -{ - DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params) -{ - DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params) -{ - DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param) -{ - DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params) -{ - DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern) -{ - DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(ColorPointerEXT, (size, type, stride, count, pointer), (F, "glColorPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer) -{ - DISPATCH(EdgeFlagPointerEXT, (stride, count, pointer), (F, "glEdgeFlagPointerEXT(%d, %d, %p);\n", stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(IndexPointerEXT, (type, stride, count, pointer), (F, "glIndexPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(NormalPointerEXT, (type, stride, count, pointer), (F, "glNormalPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(TexCoordPointerEXT, (size, type, stride, count, pointer), (F, "glTexCoordPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(VertexPointerEXT, (size, type, stride, count, pointer), (F, "glVertexPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterf)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfARB)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfARB(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfvARB)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvARB(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count) -{ - DISPATCH(LockArraysEXT, (first, count), (F, "glLockArraysEXT(%d, %d);\n", first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void) -{ - DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n")); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params) -{ - DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params) -{ - DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3b(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bv)(const GLbyte * v) -{ - DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte * v) -{ - DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3d(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dv)(const GLdouble * v) -{ - DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dvEXT)(const GLdouble * v) -{ - DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3f(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fv)(const GLfloat * v) -{ - DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fvEXT)(const GLfloat * v) -{ - DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3i)(GLint red, GLint green, GLint blue) -{ - DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3i(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue) -{ - DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iv)(const GLint * v) -{ - DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ivEXT)(const GLint * v) -{ - DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3s(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sv)(const GLshort * v) -{ - DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3svEXT)(const GLshort * v) -{ - DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ub(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubv)(const GLubyte * v) -{ - DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubvEXT)(const GLubyte * v) -{ - DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3ui(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiv)(const GLuint * v) -{ - DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uivEXT)(const GLuint * v) -{ - DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3us(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usv)(const GLushort * v) -{ - DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usvEXT)(const GLushort * v) -{ - DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawArrays)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) -{ - DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArrays(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) -{ - DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArraysEXT(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawElements)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount) -{ - DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElements(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount) -{ - DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElementsEXT(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordd)(GLdouble coord) -{ - DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoordd(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddEXT)(GLdouble coord) -{ - DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddv)(const GLdouble * coord) -{ - DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddv(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddvEXT)(const GLdouble * coord) -{ - DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordf)(GLfloat coord) -{ - DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordf(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfEXT)(GLfloat coord) -{ - DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfv)(const GLfloat * coord) -{ - DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfv(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord) -{ - DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode) -{ - DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1 void KEYWORD2 NAME(FlushVertexArrayRangeNV)(void) -{ - DISPATCH(FlushVertexArrayRangeNV, (), (F, "glFlushVertexArrayRangeNV();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer) -{ - DISPATCH(VertexArrayRangeNV, (length, pointer), (F, "glVertexArrayRangeNV(%d, %p);\n", length, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) -{ - DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, "glCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\n", stage, portion, variable, input, mapping, componentUsage)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum) -{ - DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, "glCombinerOutputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, %d, %d, %d);\n", stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterfNV)(GLenum pname, GLfloat param) -{ - DISPATCH(CombinerParameterfNV, (pname, param), (F, "glCombinerParameterfNV(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterfvNV)(GLenum pname, const GLfloat * params) -{ - DISPATCH(CombinerParameterfvNV, (pname, params), (F, "glCombinerParameterfvNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameteriNV)(GLenum pname, GLint param) -{ - DISPATCH(CombinerParameteriNV, (pname, param), (F, "glCombinerParameteriNV(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterivNV)(GLenum pname, const GLint * params) -{ - DISPATCH(CombinerParameterivNV, (pname, params), (F, "glCombinerParameterivNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) -{ - DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, "glFinalCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x);\n", variable, input, mapping, componentUsage)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params) -{ - DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterfvNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params) -{ - DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterivNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params) -{ - DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterfvNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params) -{ - DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterivNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params) -{ - DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterfvNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params) -{ - DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterivNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void) -{ - DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2d)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dARB)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dARB(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dMESA(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dv)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dvARB)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2f)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fARB)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fARB(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fMESA(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fv)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fvARB)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2i)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iARB)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iARB(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iMESA(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iv)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2ivARB)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2s)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sARB)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sARB(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sMESA(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sv)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2svARB)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dARB(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dMESA(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dv)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dvARB)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fARB(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fMESA(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fv)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fvARB)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iARB)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iARB(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iMESA(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iv)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3ivARB)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sARB)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sARB(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sMESA(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sv)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3svARB)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, "glWindowPos4dMESA(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos4dvMESA, (v), (F, "glWindowPos4dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, "glWindowPos4fMESA(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos4fvMESA, (v), (F, "glWindowPos4fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, "glWindowPos4iMESA(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos4ivMESA, (v), (F, "glWindowPos4ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, "glWindowPos4sMESA(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences) -{ - DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence) -{ - DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences) -{ - DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params) -{ - DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence) -{ - RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition) -{ - DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence) -{ - RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences) -{ - RETURN_DISPATCH(AreProgramsResidentNV, (n, ids, residences), (F, "glAreProgramsResidentNV(%d, %p, %p);\n", n, (const void *) ids, (const void *) residences)); -} - -KEYWORD1 void KEYWORD2 NAME(BindProgramARB)(GLenum target, GLuint program) -{ - DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramARB(0x%x, %d);\n", target, program)); -} - -KEYWORD1 void KEYWORD2 NAME(BindProgramNV)(GLenum target, GLuint program) -{ - DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramNV(0x%x, %d);\n", target, program)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgramsARB)(GLsizei n, const GLuint * programs) -{ - DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsARB(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgramsNV)(GLsizei n, const GLuint * programs) -{ - DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsNV(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params) -{ - DISPATCH(ExecuteProgramNV, (target, id, params), (F, "glExecuteProgramNV(0x%x, %d, %p);\n", target, id, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GenProgramsARB)(GLsizei n, GLuint * programs) -{ - DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsARB(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(GenProgramsNV)(GLsizei n, GLuint * programs) -{ - DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsNV(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetProgramParameterdvNV, (target, index, pname, params), (F, "glGetProgramParameterdvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetProgramParameterfvNV, (target, index, pname, params), (F, "glGetProgramParameterfvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program) -{ - DISPATCH(GetProgramStringNV, (id, pname, program), (F, "glGetProgramStringNV(%d, 0x%x, %p);\n", id, pname, (const void *) program)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramivNV)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramivNV, (id, pname, params), (F, "glGetProgramivNV(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params) -{ - DISPATCH(GetTrackMatrixivNV, (target, address, pname, params), (F, "glGetTrackMatrixivNV(0x%x, %d, 0x%x, %p);\n", target, address, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointerv(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervARB(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervNV(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvNV, (index, pname, params), (F, "glGetVertexAttribdvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvNV, (index, pname, params), (F, "glGetVertexAttribfvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivNV, (index, pname, params), (F, "glGetVertexAttribivNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramARB)(GLuint program) -{ - RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramARB(%d);\n", program)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramNV)(GLuint program) -{ - RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramNV(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program) -{ - DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (const void *) program)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params) -{ - DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params) -{ - DISPATCH(ProgramParameters4fvNV, (target, index, num, params), (F, "glProgramParameters4fvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(RequestResidentProgramsNV)(GLsizei n, const GLuint * ids) -{ - DISPATCH(RequestResidentProgramsNV, (n, ids), (F, "glRequestResidentProgramsNV(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform) -{ - DISPATCH(TrackMatrixNV, (target, address, matrix, transform), (F, "glTrackMatrixNV(0x%x, %d, 0x%x, 0x%x);\n", target, address, matrix, transform)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dNV)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dNV, (index, x), (F, "glVertexAttrib1dNV(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvNV, (index, v), (F, "glVertexAttrib1dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fNV)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fNV, (index, x), (F, "glVertexAttrib1fNV(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvNV, (index, v), (F, "glVertexAttrib1fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sNV)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sNV, (index, x), (F, "glVertexAttrib1sNV(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svNV, (index, v), (F, "glVertexAttrib1svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dNV, (index, x, y), (F, "glVertexAttrib2dNV(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvNV, (index, v), (F, "glVertexAttrib2dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fNV, (index, x, y), (F, "glVertexAttrib2fNV(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvNV, (index, v), (F, "glVertexAttrib2fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sNV, (index, x, y), (F, "glVertexAttrib2sNV(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svNV, (index, v), (F, "glVertexAttrib2svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dNV, (index, x, y, z), (F, "glVertexAttrib3dNV(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvNV, (index, v), (F, "glVertexAttrib3dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fNV, (index, x, y, z), (F, "glVertexAttrib3fNV(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvNV, (index, v), (F, "glVertexAttrib3fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sNV, (index, x, y, z), (F, "glVertexAttrib3sNV(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svNV, (index, v), (F, "glVertexAttrib3svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dNV, (index, x, y, z, w), (F, "glVertexAttrib4dNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvNV, (index, v), (F, "glVertexAttrib4dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fNV, (index, x, y, z, w), (F, "glVertexAttrib4fNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvNV, (index, v), (F, "glVertexAttrib4fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sNV, (index, x, y, z, w), (F, "glVertexAttrib4sNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svNV, (index, v), (F, "glVertexAttrib4svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4ubNV, (index, x, y, z, w), (F, "glVertexAttrib4ubNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvNV)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvNV, (index, v), (F, "glVertexAttrib4ubvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerNV, (index, size, type, stride, pointer), (F, "glVertexAttribPointerNV(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs1dvNV, (index, n, v), (F, "glVertexAttribs1dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs1fvNV, (index, n, v), (F, "glVertexAttribs1fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs1svNV, (index, n, v), (F, "glVertexAttribs1svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs2dvNV, (index, n, v), (F, "glVertexAttribs2dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs2fvNV, (index, n, v), (F, "glVertexAttribs2fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs2svNV, (index, n, v), (F, "glVertexAttribs2svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs3dvNV, (index, n, v), (F, "glVertexAttribs3dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs3fvNV, (index, n, v), (F, "glVertexAttribs3fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs3svNV, (index, n, v), (F, "glVertexAttribs3svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs4dvNV, (index, n, v), (F, "glVertexAttribs4dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs4fvNV, (index, n, v), (F, "glVertexAttribs4fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs4svNV, (index, n, v), (F, "glVertexAttribs4svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v) -{ - DISPATCH(VertexAttribs4ubvNV, (index, n, v), (F, "glVertexAttribs4ubvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) -{ - DISPATCH(AlphaFragmentOp1ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod), (F, "glAlphaFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) -{ - DISPATCH(AlphaFragmentOp2ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glAlphaFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) -{ - DISPATCH(AlphaFragmentOp3ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glAlphaFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginFragmentShaderATI)(void) -{ - DISPATCH(BeginFragmentShaderATI, (), (F, "glBeginFragmentShaderATI();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(BindFragmentShaderATI)(GLuint id) -{ - DISPATCH(BindFragmentShaderATI, (id), (F, "glBindFragmentShaderATI(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) -{ - DISPATCH(ColorFragmentOp1ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod), (F, "glColorFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) -{ - DISPATCH(ColorFragmentOp2ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glColorFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) -{ - DISPATCH(ColorFragmentOp3ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glColorFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteFragmentShaderATI)(GLuint id) -{ - DISPATCH(DeleteFragmentShaderATI, (id), (F, "glDeleteFragmentShaderATI(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(EndFragmentShaderATI)(void) -{ - DISPATCH(EndFragmentShaderATI, (), (F, "glEndFragmentShaderATI();\n")); -} - -KEYWORD1 GLuint KEYWORD2 NAME(GenFragmentShadersATI)(GLuint range) -{ - RETURN_DISPATCH(GenFragmentShadersATI, (range), (F, "glGenFragmentShadersATI(%d);\n", range)); -} - -KEYWORD1 void KEYWORD2 NAME(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle) -{ - DISPATCH(PassTexCoordATI, (dst, coord, swizzle), (F, "glPassTexCoordATI(%d, %d, 0x%x);\n", dst, coord, swizzle)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle) -{ - DISPATCH(SampleMapATI, (dst, interp, swizzle), (F, "glSampleMapATI(%d, %d, 0x%x);\n", dst, interp, swizzle)); -} - -KEYWORD1 void KEYWORD2 NAME(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value) -{ - DISPATCH(SetFragmentShaderConstantATI, (dst, value), (F, "glSetFragmentShaderConstantATI(%d, %p);\n", dst, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteri)(GLenum pname, GLint param) -{ - DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteri(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteriNV)(GLenum pname, GLint param) -{ - DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteriNV(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteriv)(GLenum pname, const GLint * params) -{ - DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameteriv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * params) -{ - DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face) -{ - DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array) -{ - DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays) -{ - DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays) -{ - DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array) -{ - RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params) -{ - DISPATCH(GetProgramNamedParameterdvNV, (id, len, name, params), (F, "glGetProgramNamedParameterdvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params) -{ - DISPATCH(GetProgramNamedParameterfvNV, (id, len, name, params), (F, "glGetProgramNamedParameterfvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramNamedParameter4dNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4dNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v) -{ - DISPATCH(ProgramNamedParameter4dvNV, (id, len, name, v), (F, "glProgramNamedParameter4dvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramNamedParameter4fNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4fNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v) -{ - DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax) -{ - DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA) -{ - DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA) -{ - DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA)); -} - -KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer) -{ - DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer) -{ - DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer)); -} - -KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target) -{ - RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers) -{ - DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers) -{ - DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) -{ - DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -{ - DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -{ - DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) -{ - DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset)); -} - -KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers) -{ - DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers) -{ - DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target) -{ - DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params) -{ - DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer) -{ - RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer) -{ - RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) -{ - DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) -{ - DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) -{ - DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) -{ - DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) -{ - DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params) -{ - DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params) -{ - DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - - -#endif /* defined( NAME ) */ - -/* - * This is how a dispatch table can be initialized with all the functions - * we generated above. - */ -#ifdef DISPATCH_TABLE_NAME - -#ifndef TABLE_ENTRY -#error TABLE_ENTRY must be defined -#endif - -static _glapi_proc DISPATCH_TABLE_NAME[] = { - TABLE_ENTRY(NewList), - TABLE_ENTRY(EndList), - TABLE_ENTRY(CallList), - TABLE_ENTRY(CallLists), - TABLE_ENTRY(DeleteLists), - TABLE_ENTRY(GenLists), - TABLE_ENTRY(ListBase), - TABLE_ENTRY(Begin), - TABLE_ENTRY(Bitmap), - TABLE_ENTRY(Color3b), - TABLE_ENTRY(Color3bv), - TABLE_ENTRY(Color3d), - TABLE_ENTRY(Color3dv), - TABLE_ENTRY(Color3f), - TABLE_ENTRY(Color3fv), - TABLE_ENTRY(Color3i), - TABLE_ENTRY(Color3iv), - TABLE_ENTRY(Color3s), - TABLE_ENTRY(Color3sv), - TABLE_ENTRY(Color3ub), - TABLE_ENTRY(Color3ubv), - TABLE_ENTRY(Color3ui), - TABLE_ENTRY(Color3uiv), - TABLE_ENTRY(Color3us), - TABLE_ENTRY(Color3usv), - TABLE_ENTRY(Color4b), - TABLE_ENTRY(Color4bv), - TABLE_ENTRY(Color4d), - TABLE_ENTRY(Color4dv), - TABLE_ENTRY(Color4f), - TABLE_ENTRY(Color4fv), - TABLE_ENTRY(Color4i), - TABLE_ENTRY(Color4iv), - TABLE_ENTRY(Color4s), - TABLE_ENTRY(Color4sv), - TABLE_ENTRY(Color4ub), - TABLE_ENTRY(Color4ubv), - TABLE_ENTRY(Color4ui), - TABLE_ENTRY(Color4uiv), - TABLE_ENTRY(Color4us), - TABLE_ENTRY(Color4usv), - TABLE_ENTRY(EdgeFlag), - TABLE_ENTRY(EdgeFlagv), - TABLE_ENTRY(End), - TABLE_ENTRY(Indexd), - TABLE_ENTRY(Indexdv), - TABLE_ENTRY(Indexf), - TABLE_ENTRY(Indexfv), - TABLE_ENTRY(Indexi), - TABLE_ENTRY(Indexiv), - TABLE_ENTRY(Indexs), - TABLE_ENTRY(Indexsv), - TABLE_ENTRY(Normal3b), - TABLE_ENTRY(Normal3bv), - TABLE_ENTRY(Normal3d), - TABLE_ENTRY(Normal3dv), - TABLE_ENTRY(Normal3f), - TABLE_ENTRY(Normal3fv), - TABLE_ENTRY(Normal3i), - TABLE_ENTRY(Normal3iv), - TABLE_ENTRY(Normal3s), - TABLE_ENTRY(Normal3sv), - TABLE_ENTRY(RasterPos2d), - TABLE_ENTRY(RasterPos2dv), - TABLE_ENTRY(RasterPos2f), - TABLE_ENTRY(RasterPos2fv), - TABLE_ENTRY(RasterPos2i), - TABLE_ENTRY(RasterPos2iv), - TABLE_ENTRY(RasterPos2s), - TABLE_ENTRY(RasterPos2sv), - TABLE_ENTRY(RasterPos3d), - TABLE_ENTRY(RasterPos3dv), - TABLE_ENTRY(RasterPos3f), - TABLE_ENTRY(RasterPos3fv), - TABLE_ENTRY(RasterPos3i), - TABLE_ENTRY(RasterPos3iv), - TABLE_ENTRY(RasterPos3s), - TABLE_ENTRY(RasterPos3sv), - TABLE_ENTRY(RasterPos4d), - TABLE_ENTRY(RasterPos4dv), - TABLE_ENTRY(RasterPos4f), - TABLE_ENTRY(RasterPos4fv), - TABLE_ENTRY(RasterPos4i), - TABLE_ENTRY(RasterPos4iv), - TABLE_ENTRY(RasterPos4s), - TABLE_ENTRY(RasterPos4sv), - TABLE_ENTRY(Rectd), - TABLE_ENTRY(Rectdv), - TABLE_ENTRY(Rectf), - TABLE_ENTRY(Rectfv), - TABLE_ENTRY(Recti), - TABLE_ENTRY(Rectiv), - TABLE_ENTRY(Rects), - TABLE_ENTRY(Rectsv), - TABLE_ENTRY(TexCoord1d), - TABLE_ENTRY(TexCoord1dv), - TABLE_ENTRY(TexCoord1f), - TABLE_ENTRY(TexCoord1fv), - TABLE_ENTRY(TexCoord1i), - TABLE_ENTRY(TexCoord1iv), - TABLE_ENTRY(TexCoord1s), - TABLE_ENTRY(TexCoord1sv), - TABLE_ENTRY(TexCoord2d), - TABLE_ENTRY(TexCoord2dv), - TABLE_ENTRY(TexCoord2f), - TABLE_ENTRY(TexCoord2fv), - TABLE_ENTRY(TexCoord2i), - TABLE_ENTRY(TexCoord2iv), - TABLE_ENTRY(TexCoord2s), - TABLE_ENTRY(TexCoord2sv), - TABLE_ENTRY(TexCoord3d), - TABLE_ENTRY(TexCoord3dv), - TABLE_ENTRY(TexCoord3f), - TABLE_ENTRY(TexCoord3fv), - TABLE_ENTRY(TexCoord3i), - TABLE_ENTRY(TexCoord3iv), - TABLE_ENTRY(TexCoord3s), - TABLE_ENTRY(TexCoord3sv), - TABLE_ENTRY(TexCoord4d), - TABLE_ENTRY(TexCoord4dv), - TABLE_ENTRY(TexCoord4f), - TABLE_ENTRY(TexCoord4fv), - TABLE_ENTRY(TexCoord4i), - TABLE_ENTRY(TexCoord4iv), - TABLE_ENTRY(TexCoord4s), - TABLE_ENTRY(TexCoord4sv), - TABLE_ENTRY(Vertex2d), - TABLE_ENTRY(Vertex2dv), - TABLE_ENTRY(Vertex2f), - TABLE_ENTRY(Vertex2fv), - TABLE_ENTRY(Vertex2i), - TABLE_ENTRY(Vertex2iv), - TABLE_ENTRY(Vertex2s), - TABLE_ENTRY(Vertex2sv), - TABLE_ENTRY(Vertex3d), - TABLE_ENTRY(Vertex3dv), - TABLE_ENTRY(Vertex3f), - TABLE_ENTRY(Vertex3fv), - TABLE_ENTRY(Vertex3i), - TABLE_ENTRY(Vertex3iv), - TABLE_ENTRY(Vertex3s), - TABLE_ENTRY(Vertex3sv), - TABLE_ENTRY(Vertex4d), - TABLE_ENTRY(Vertex4dv), - TABLE_ENTRY(Vertex4f), - TABLE_ENTRY(Vertex4fv), - TABLE_ENTRY(Vertex4i), - TABLE_ENTRY(Vertex4iv), - TABLE_ENTRY(Vertex4s), - TABLE_ENTRY(Vertex4sv), - TABLE_ENTRY(ClipPlane), - TABLE_ENTRY(ColorMaterial), - TABLE_ENTRY(CullFace), - TABLE_ENTRY(Fogf), - TABLE_ENTRY(Fogfv), - TABLE_ENTRY(Fogi), - TABLE_ENTRY(Fogiv), - TABLE_ENTRY(FrontFace), - TABLE_ENTRY(Hint), - TABLE_ENTRY(Lightf), - TABLE_ENTRY(Lightfv), - TABLE_ENTRY(Lighti), - TABLE_ENTRY(Lightiv), - TABLE_ENTRY(LightModelf), - TABLE_ENTRY(LightModelfv), - TABLE_ENTRY(LightModeli), - TABLE_ENTRY(LightModeliv), - TABLE_ENTRY(LineStipple), - TABLE_ENTRY(LineWidth), - TABLE_ENTRY(Materialf), - TABLE_ENTRY(Materialfv), - TABLE_ENTRY(Materiali), - TABLE_ENTRY(Materialiv), - TABLE_ENTRY(PointSize), - TABLE_ENTRY(PolygonMode), - TABLE_ENTRY(PolygonStipple), - TABLE_ENTRY(Scissor), - TABLE_ENTRY(ShadeModel), - TABLE_ENTRY(TexParameterf), - TABLE_ENTRY(TexParameterfv), - TABLE_ENTRY(TexParameteri), - TABLE_ENTRY(TexParameteriv), - TABLE_ENTRY(TexImage1D), - TABLE_ENTRY(TexImage2D), - TABLE_ENTRY(TexEnvf), - TABLE_ENTRY(TexEnvfv), - TABLE_ENTRY(TexEnvi), - TABLE_ENTRY(TexEnviv), - TABLE_ENTRY(TexGend), - TABLE_ENTRY(TexGendv), - TABLE_ENTRY(TexGenf), - TABLE_ENTRY(TexGenfv), - TABLE_ENTRY(TexGeni), - TABLE_ENTRY(TexGeniv), - TABLE_ENTRY(FeedbackBuffer), - TABLE_ENTRY(SelectBuffer), - TABLE_ENTRY(RenderMode), - TABLE_ENTRY(InitNames), - TABLE_ENTRY(LoadName), - TABLE_ENTRY(PassThrough), - TABLE_ENTRY(PopName), - TABLE_ENTRY(PushName), - TABLE_ENTRY(DrawBuffer), - TABLE_ENTRY(Clear), - TABLE_ENTRY(ClearAccum), - TABLE_ENTRY(ClearIndex), - TABLE_ENTRY(ClearColor), - TABLE_ENTRY(ClearStencil), - TABLE_ENTRY(ClearDepth), - TABLE_ENTRY(StencilMask), - TABLE_ENTRY(ColorMask), - TABLE_ENTRY(DepthMask), - TABLE_ENTRY(IndexMask), - TABLE_ENTRY(Accum), - TABLE_ENTRY(Disable), - TABLE_ENTRY(Enable), - TABLE_ENTRY(Finish), - TABLE_ENTRY(Flush), - TABLE_ENTRY(PopAttrib), - TABLE_ENTRY(PushAttrib), - TABLE_ENTRY(Map1d), - TABLE_ENTRY(Map1f), - TABLE_ENTRY(Map2d), - TABLE_ENTRY(Map2f), - TABLE_ENTRY(MapGrid1d), - TABLE_ENTRY(MapGrid1f), - TABLE_ENTRY(MapGrid2d), - TABLE_ENTRY(MapGrid2f), - TABLE_ENTRY(EvalCoord1d), - TABLE_ENTRY(EvalCoord1dv), - TABLE_ENTRY(EvalCoord1f), - TABLE_ENTRY(EvalCoord1fv), - TABLE_ENTRY(EvalCoord2d), - TABLE_ENTRY(EvalCoord2dv), - TABLE_ENTRY(EvalCoord2f), - TABLE_ENTRY(EvalCoord2fv), - TABLE_ENTRY(EvalMesh1), - TABLE_ENTRY(EvalPoint1), - TABLE_ENTRY(EvalMesh2), - TABLE_ENTRY(EvalPoint2), - TABLE_ENTRY(AlphaFunc), - TABLE_ENTRY(BlendFunc), - TABLE_ENTRY(LogicOp), - TABLE_ENTRY(StencilFunc), - TABLE_ENTRY(StencilOp), - TABLE_ENTRY(DepthFunc), - TABLE_ENTRY(PixelZoom), - TABLE_ENTRY(PixelTransferf), - TABLE_ENTRY(PixelTransferi), - TABLE_ENTRY(PixelStoref), - TABLE_ENTRY(PixelStorei), - TABLE_ENTRY(PixelMapfv), - TABLE_ENTRY(PixelMapuiv), - TABLE_ENTRY(PixelMapusv), - TABLE_ENTRY(ReadBuffer), - TABLE_ENTRY(CopyPixels), - TABLE_ENTRY(ReadPixels), - TABLE_ENTRY(DrawPixels), - TABLE_ENTRY(GetBooleanv), - TABLE_ENTRY(GetClipPlane), - TABLE_ENTRY(GetDoublev), - TABLE_ENTRY(GetError), - TABLE_ENTRY(GetFloatv), - TABLE_ENTRY(GetIntegerv), - TABLE_ENTRY(GetLightfv), - TABLE_ENTRY(GetLightiv), - TABLE_ENTRY(GetMapdv), - TABLE_ENTRY(GetMapfv), - TABLE_ENTRY(GetMapiv), - TABLE_ENTRY(GetMaterialfv), - TABLE_ENTRY(GetMaterialiv), - TABLE_ENTRY(GetPixelMapfv), - TABLE_ENTRY(GetPixelMapuiv), - TABLE_ENTRY(GetPixelMapusv), - TABLE_ENTRY(GetPolygonStipple), - TABLE_ENTRY(GetString), - TABLE_ENTRY(GetTexEnvfv), - TABLE_ENTRY(GetTexEnviv), - TABLE_ENTRY(GetTexGendv), - TABLE_ENTRY(GetTexGenfv), - TABLE_ENTRY(GetTexGeniv), - TABLE_ENTRY(GetTexImage), - TABLE_ENTRY(GetTexParameterfv), - TABLE_ENTRY(GetTexParameteriv), - TABLE_ENTRY(GetTexLevelParameterfv), - TABLE_ENTRY(GetTexLevelParameteriv), - TABLE_ENTRY(IsEnabled), - TABLE_ENTRY(IsList), - TABLE_ENTRY(DepthRange), - TABLE_ENTRY(Frustum), - TABLE_ENTRY(LoadIdentity), - TABLE_ENTRY(LoadMatrixf), - TABLE_ENTRY(LoadMatrixd), - TABLE_ENTRY(MatrixMode), - TABLE_ENTRY(MultMatrixf), - TABLE_ENTRY(MultMatrixd), - TABLE_ENTRY(Ortho), - TABLE_ENTRY(PopMatrix), - TABLE_ENTRY(PushMatrix), - TABLE_ENTRY(Rotated), - TABLE_ENTRY(Rotatef), - TABLE_ENTRY(Scaled), - TABLE_ENTRY(Scalef), - TABLE_ENTRY(Translated), - TABLE_ENTRY(Translatef), - TABLE_ENTRY(Viewport), - TABLE_ENTRY(ArrayElement), - TABLE_ENTRY(BindTexture), - TABLE_ENTRY(ColorPointer), - TABLE_ENTRY(DisableClientState), - TABLE_ENTRY(DrawArrays), - TABLE_ENTRY(DrawElements), - TABLE_ENTRY(EdgeFlagPointer), - TABLE_ENTRY(EnableClientState), - TABLE_ENTRY(IndexPointer), - TABLE_ENTRY(Indexub), - TABLE_ENTRY(Indexubv), - TABLE_ENTRY(InterleavedArrays), - TABLE_ENTRY(NormalPointer), - TABLE_ENTRY(PolygonOffset), - TABLE_ENTRY(TexCoordPointer), - TABLE_ENTRY(VertexPointer), - TABLE_ENTRY(AreTexturesResident), - TABLE_ENTRY(CopyTexImage1D), - TABLE_ENTRY(CopyTexImage2D), - TABLE_ENTRY(CopyTexSubImage1D), - TABLE_ENTRY(CopyTexSubImage2D), - TABLE_ENTRY(DeleteTextures), - TABLE_ENTRY(GenTextures), - TABLE_ENTRY(GetPointerv), - TABLE_ENTRY(IsTexture), - TABLE_ENTRY(PrioritizeTextures), - TABLE_ENTRY(TexSubImage1D), - TABLE_ENTRY(TexSubImage2D), - TABLE_ENTRY(PopClientAttrib), - TABLE_ENTRY(PushClientAttrib), - TABLE_ENTRY(BlendColor), - TABLE_ENTRY(BlendEquation), - TABLE_ENTRY(DrawRangeElements), - TABLE_ENTRY(ColorTable), - TABLE_ENTRY(ColorTableParameterfv), - TABLE_ENTRY(ColorTableParameteriv), - TABLE_ENTRY(CopyColorTable), - TABLE_ENTRY(GetColorTable), - TABLE_ENTRY(GetColorTableParameterfv), - TABLE_ENTRY(GetColorTableParameteriv), - TABLE_ENTRY(ColorSubTable), - TABLE_ENTRY(CopyColorSubTable), - TABLE_ENTRY(ConvolutionFilter1D), - TABLE_ENTRY(ConvolutionFilter2D), - TABLE_ENTRY(ConvolutionParameterf), - TABLE_ENTRY(ConvolutionParameterfv), - TABLE_ENTRY(ConvolutionParameteri), - TABLE_ENTRY(ConvolutionParameteriv), - TABLE_ENTRY(CopyConvolutionFilter1D), - TABLE_ENTRY(CopyConvolutionFilter2D), - TABLE_ENTRY(GetConvolutionFilter), - TABLE_ENTRY(GetConvolutionParameterfv), - TABLE_ENTRY(GetConvolutionParameteriv), - TABLE_ENTRY(GetSeparableFilter), - TABLE_ENTRY(SeparableFilter2D), - TABLE_ENTRY(GetHistogram), - TABLE_ENTRY(GetHistogramParameterfv), - TABLE_ENTRY(GetHistogramParameteriv), - TABLE_ENTRY(GetMinmax), - TABLE_ENTRY(GetMinmaxParameterfv), - TABLE_ENTRY(GetMinmaxParameteriv), - TABLE_ENTRY(Histogram), - TABLE_ENTRY(Minmax), - TABLE_ENTRY(ResetHistogram), - TABLE_ENTRY(ResetMinmax), - TABLE_ENTRY(TexImage3D), - TABLE_ENTRY(TexSubImage3D), - TABLE_ENTRY(CopyTexSubImage3D), - TABLE_ENTRY(ActiveTextureARB), - TABLE_ENTRY(ClientActiveTextureARB), - TABLE_ENTRY(MultiTexCoord1dARB), - TABLE_ENTRY(MultiTexCoord1dvARB), - TABLE_ENTRY(MultiTexCoord1fARB), - TABLE_ENTRY(MultiTexCoord1fvARB), - TABLE_ENTRY(MultiTexCoord1iARB), - TABLE_ENTRY(MultiTexCoord1ivARB), - TABLE_ENTRY(MultiTexCoord1sARB), - TABLE_ENTRY(MultiTexCoord1svARB), - TABLE_ENTRY(MultiTexCoord2dARB), - TABLE_ENTRY(MultiTexCoord2dvARB), - TABLE_ENTRY(MultiTexCoord2fARB), - TABLE_ENTRY(MultiTexCoord2fvARB), - TABLE_ENTRY(MultiTexCoord2iARB), - TABLE_ENTRY(MultiTexCoord2ivARB), - TABLE_ENTRY(MultiTexCoord2sARB), - TABLE_ENTRY(MultiTexCoord2svARB), - TABLE_ENTRY(MultiTexCoord3dARB), - TABLE_ENTRY(MultiTexCoord3dvARB), - TABLE_ENTRY(MultiTexCoord3fARB), - TABLE_ENTRY(MultiTexCoord3fvARB), - TABLE_ENTRY(MultiTexCoord3iARB), - TABLE_ENTRY(MultiTexCoord3ivARB), - TABLE_ENTRY(MultiTexCoord3sARB), - TABLE_ENTRY(MultiTexCoord3svARB), - TABLE_ENTRY(MultiTexCoord4dARB), - TABLE_ENTRY(MultiTexCoord4dvARB), - TABLE_ENTRY(MultiTexCoord4fARB), - TABLE_ENTRY(MultiTexCoord4fvARB), - TABLE_ENTRY(MultiTexCoord4iARB), - TABLE_ENTRY(MultiTexCoord4ivARB), - TABLE_ENTRY(MultiTexCoord4sARB), - TABLE_ENTRY(MultiTexCoord4svARB), - TABLE_ENTRY(AttachShader), - TABLE_ENTRY(CreateProgram), - TABLE_ENTRY(CreateShader), - TABLE_ENTRY(DeleteProgram), - TABLE_ENTRY(DeleteShader), - TABLE_ENTRY(DetachShader), - TABLE_ENTRY(GetAttachedShaders), - TABLE_ENTRY(GetProgramInfoLog), - TABLE_ENTRY(GetProgramiv), - TABLE_ENTRY(GetShaderInfoLog), - TABLE_ENTRY(GetShaderiv), - TABLE_ENTRY(IsProgram), - TABLE_ENTRY(IsShader), - TABLE_ENTRY(StencilFuncSeparate), - TABLE_ENTRY(StencilMaskSeparate), - TABLE_ENTRY(StencilOpSeparate), - TABLE_ENTRY(UniformMatrix2x3fv), - TABLE_ENTRY(UniformMatrix2x4fv), - TABLE_ENTRY(UniformMatrix3x2fv), - TABLE_ENTRY(UniformMatrix3x4fv), - TABLE_ENTRY(UniformMatrix4x2fv), - TABLE_ENTRY(UniformMatrix4x3fv), - TABLE_ENTRY(LoadTransposeMatrixdARB), - TABLE_ENTRY(LoadTransposeMatrixfARB), - TABLE_ENTRY(MultTransposeMatrixdARB), - TABLE_ENTRY(MultTransposeMatrixfARB), - TABLE_ENTRY(SampleCoverageARB), - TABLE_ENTRY(CompressedTexImage1DARB), - TABLE_ENTRY(CompressedTexImage2DARB), - TABLE_ENTRY(CompressedTexImage3DARB), - TABLE_ENTRY(CompressedTexSubImage1DARB), - TABLE_ENTRY(CompressedTexSubImage2DARB), - TABLE_ENTRY(CompressedTexSubImage3DARB), - TABLE_ENTRY(GetCompressedTexImageARB), - TABLE_ENTRY(DisableVertexAttribArrayARB), - TABLE_ENTRY(EnableVertexAttribArrayARB), - TABLE_ENTRY(GetProgramEnvParameterdvARB), - TABLE_ENTRY(GetProgramEnvParameterfvARB), - TABLE_ENTRY(GetProgramLocalParameterdvARB), - TABLE_ENTRY(GetProgramLocalParameterfvARB), - TABLE_ENTRY(GetProgramStringARB), - TABLE_ENTRY(GetProgramivARB), - TABLE_ENTRY(GetVertexAttribdvARB), - TABLE_ENTRY(GetVertexAttribfvARB), - TABLE_ENTRY(GetVertexAttribivARB), - TABLE_ENTRY(ProgramEnvParameter4dARB), - TABLE_ENTRY(ProgramEnvParameter4dvARB), - TABLE_ENTRY(ProgramEnvParameter4fARB), - TABLE_ENTRY(ProgramEnvParameter4fvARB), - TABLE_ENTRY(ProgramLocalParameter4dARB), - TABLE_ENTRY(ProgramLocalParameter4dvARB), - TABLE_ENTRY(ProgramLocalParameter4fARB), - TABLE_ENTRY(ProgramLocalParameter4fvARB), - TABLE_ENTRY(ProgramStringARB), - TABLE_ENTRY(VertexAttrib1dARB), - TABLE_ENTRY(VertexAttrib1dvARB), - TABLE_ENTRY(VertexAttrib1fARB), - TABLE_ENTRY(VertexAttrib1fvARB), - TABLE_ENTRY(VertexAttrib1sARB), - TABLE_ENTRY(VertexAttrib1svARB), - TABLE_ENTRY(VertexAttrib2dARB), - TABLE_ENTRY(VertexAttrib2dvARB), - TABLE_ENTRY(VertexAttrib2fARB), - TABLE_ENTRY(VertexAttrib2fvARB), - TABLE_ENTRY(VertexAttrib2sARB), - TABLE_ENTRY(VertexAttrib2svARB), - TABLE_ENTRY(VertexAttrib3dARB), - TABLE_ENTRY(VertexAttrib3dvARB), - TABLE_ENTRY(VertexAttrib3fARB), - TABLE_ENTRY(VertexAttrib3fvARB), - TABLE_ENTRY(VertexAttrib3sARB), - TABLE_ENTRY(VertexAttrib3svARB), - TABLE_ENTRY(VertexAttrib4NbvARB), - TABLE_ENTRY(VertexAttrib4NivARB), - TABLE_ENTRY(VertexAttrib4NsvARB), - TABLE_ENTRY(VertexAttrib4NubARB), - TABLE_ENTRY(VertexAttrib4NubvARB), - TABLE_ENTRY(VertexAttrib4NuivARB), - TABLE_ENTRY(VertexAttrib4NusvARB), - TABLE_ENTRY(VertexAttrib4bvARB), - TABLE_ENTRY(VertexAttrib4dARB), - TABLE_ENTRY(VertexAttrib4dvARB), - TABLE_ENTRY(VertexAttrib4fARB), - TABLE_ENTRY(VertexAttrib4fvARB), - TABLE_ENTRY(VertexAttrib4ivARB), - TABLE_ENTRY(VertexAttrib4sARB), - TABLE_ENTRY(VertexAttrib4svARB), - TABLE_ENTRY(VertexAttrib4ubvARB), - TABLE_ENTRY(VertexAttrib4uivARB), - TABLE_ENTRY(VertexAttrib4usvARB), - TABLE_ENTRY(VertexAttribPointerARB), - TABLE_ENTRY(BindBufferARB), - TABLE_ENTRY(BufferDataARB), - TABLE_ENTRY(BufferSubDataARB), - TABLE_ENTRY(DeleteBuffersARB), - TABLE_ENTRY(GenBuffersARB), - TABLE_ENTRY(GetBufferParameterivARB), - TABLE_ENTRY(GetBufferPointervARB), - TABLE_ENTRY(GetBufferSubDataARB), - TABLE_ENTRY(IsBufferARB), - TABLE_ENTRY(MapBufferARB), - TABLE_ENTRY(UnmapBufferARB), - TABLE_ENTRY(BeginQueryARB), - TABLE_ENTRY(DeleteQueriesARB), - TABLE_ENTRY(EndQueryARB), - TABLE_ENTRY(GenQueriesARB), - TABLE_ENTRY(GetQueryObjectivARB), - TABLE_ENTRY(GetQueryObjectuivARB), - TABLE_ENTRY(GetQueryivARB), - TABLE_ENTRY(IsQueryARB), - TABLE_ENTRY(AttachObjectARB), - TABLE_ENTRY(CompileShaderARB), - TABLE_ENTRY(CreateProgramObjectARB), - TABLE_ENTRY(CreateShaderObjectARB), - TABLE_ENTRY(DeleteObjectARB), - TABLE_ENTRY(DetachObjectARB), - TABLE_ENTRY(GetActiveUniformARB), - TABLE_ENTRY(GetAttachedObjectsARB), - TABLE_ENTRY(GetHandleARB), - TABLE_ENTRY(GetInfoLogARB), - TABLE_ENTRY(GetObjectParameterfvARB), - TABLE_ENTRY(GetObjectParameterivARB), - TABLE_ENTRY(GetShaderSourceARB), - TABLE_ENTRY(GetUniformLocationARB), - TABLE_ENTRY(GetUniformfvARB), - TABLE_ENTRY(GetUniformivARB), - TABLE_ENTRY(LinkProgramARB), - TABLE_ENTRY(ShaderSourceARB), - TABLE_ENTRY(Uniform1fARB), - TABLE_ENTRY(Uniform1fvARB), - TABLE_ENTRY(Uniform1iARB), - TABLE_ENTRY(Uniform1ivARB), - TABLE_ENTRY(Uniform2fARB), - TABLE_ENTRY(Uniform2fvARB), - TABLE_ENTRY(Uniform2iARB), - TABLE_ENTRY(Uniform2ivARB), - TABLE_ENTRY(Uniform3fARB), - TABLE_ENTRY(Uniform3fvARB), - TABLE_ENTRY(Uniform3iARB), - TABLE_ENTRY(Uniform3ivARB), - TABLE_ENTRY(Uniform4fARB), - TABLE_ENTRY(Uniform4fvARB), - TABLE_ENTRY(Uniform4iARB), - TABLE_ENTRY(Uniform4ivARB), - TABLE_ENTRY(UniformMatrix2fvARB), - TABLE_ENTRY(UniformMatrix3fvARB), - TABLE_ENTRY(UniformMatrix4fvARB), - TABLE_ENTRY(UseProgramObjectARB), - TABLE_ENTRY(ValidateProgramARB), - TABLE_ENTRY(BindAttribLocationARB), - TABLE_ENTRY(GetActiveAttribARB), - TABLE_ENTRY(GetAttribLocationARB), - TABLE_ENTRY(DrawBuffersARB), - TABLE_ENTRY(PolygonOffsetEXT), - TABLE_ENTRY(_dispatch_stub_562), - TABLE_ENTRY(_dispatch_stub_563), - TABLE_ENTRY(_dispatch_stub_564), - TABLE_ENTRY(_dispatch_stub_565), - TABLE_ENTRY(_dispatch_stub_566), - TABLE_ENTRY(_dispatch_stub_567), - TABLE_ENTRY(_dispatch_stub_568), - TABLE_ENTRY(_dispatch_stub_569), - TABLE_ENTRY(ColorPointerEXT), - TABLE_ENTRY(EdgeFlagPointerEXT), - TABLE_ENTRY(IndexPointerEXT), - TABLE_ENTRY(NormalPointerEXT), - TABLE_ENTRY(TexCoordPointerEXT), - TABLE_ENTRY(VertexPointerEXT), - TABLE_ENTRY(PointParameterfEXT), - TABLE_ENTRY(PointParameterfvEXT), - TABLE_ENTRY(LockArraysEXT), - TABLE_ENTRY(UnlockArraysEXT), - TABLE_ENTRY(_dispatch_stub_580), - TABLE_ENTRY(_dispatch_stub_581), - TABLE_ENTRY(SecondaryColor3bEXT), - TABLE_ENTRY(SecondaryColor3bvEXT), - TABLE_ENTRY(SecondaryColor3dEXT), - TABLE_ENTRY(SecondaryColor3dvEXT), - TABLE_ENTRY(SecondaryColor3fEXT), - TABLE_ENTRY(SecondaryColor3fvEXT), - TABLE_ENTRY(SecondaryColor3iEXT), - TABLE_ENTRY(SecondaryColor3ivEXT), - TABLE_ENTRY(SecondaryColor3sEXT), - TABLE_ENTRY(SecondaryColor3svEXT), - TABLE_ENTRY(SecondaryColor3ubEXT), - TABLE_ENTRY(SecondaryColor3ubvEXT), - TABLE_ENTRY(SecondaryColor3uiEXT), - TABLE_ENTRY(SecondaryColor3uivEXT), - TABLE_ENTRY(SecondaryColor3usEXT), - TABLE_ENTRY(SecondaryColor3usvEXT), - TABLE_ENTRY(SecondaryColorPointerEXT), - TABLE_ENTRY(MultiDrawArraysEXT), - TABLE_ENTRY(MultiDrawElementsEXT), - TABLE_ENTRY(FogCoordPointerEXT), - TABLE_ENTRY(FogCoorddEXT), - TABLE_ENTRY(FogCoorddvEXT), - TABLE_ENTRY(FogCoordfEXT), - TABLE_ENTRY(FogCoordfvEXT), - TABLE_ENTRY(_dispatch_stub_606), - TABLE_ENTRY(BlendFuncSeparateEXT), - TABLE_ENTRY(FlushVertexArrayRangeNV), - TABLE_ENTRY(VertexArrayRangeNV), - TABLE_ENTRY(CombinerInputNV), - TABLE_ENTRY(CombinerOutputNV), - TABLE_ENTRY(CombinerParameterfNV), - TABLE_ENTRY(CombinerParameterfvNV), - TABLE_ENTRY(CombinerParameteriNV), - TABLE_ENTRY(CombinerParameterivNV), - TABLE_ENTRY(FinalCombinerInputNV), - TABLE_ENTRY(GetCombinerInputParameterfvNV), - TABLE_ENTRY(GetCombinerInputParameterivNV), - TABLE_ENTRY(GetCombinerOutputParameterfvNV), - TABLE_ENTRY(GetCombinerOutputParameterivNV), - TABLE_ENTRY(GetFinalCombinerInputParameterfvNV), - TABLE_ENTRY(GetFinalCombinerInputParameterivNV), - TABLE_ENTRY(ResizeBuffersMESA), - TABLE_ENTRY(WindowPos2dMESA), - TABLE_ENTRY(WindowPos2dvMESA), - TABLE_ENTRY(WindowPos2fMESA), - TABLE_ENTRY(WindowPos2fvMESA), - TABLE_ENTRY(WindowPos2iMESA), - TABLE_ENTRY(WindowPos2ivMESA), - TABLE_ENTRY(WindowPos2sMESA), - TABLE_ENTRY(WindowPos2svMESA), - TABLE_ENTRY(WindowPos3dMESA), - TABLE_ENTRY(WindowPos3dvMESA), - TABLE_ENTRY(WindowPos3fMESA), - TABLE_ENTRY(WindowPos3fvMESA), - TABLE_ENTRY(WindowPos3iMESA), - TABLE_ENTRY(WindowPos3ivMESA), - TABLE_ENTRY(WindowPos3sMESA), - TABLE_ENTRY(WindowPos3svMESA), - TABLE_ENTRY(WindowPos4dMESA), - TABLE_ENTRY(WindowPos4dvMESA), - TABLE_ENTRY(WindowPos4fMESA), - TABLE_ENTRY(WindowPos4fvMESA), - TABLE_ENTRY(WindowPos4iMESA), - TABLE_ENTRY(WindowPos4ivMESA), - TABLE_ENTRY(WindowPos4sMESA), - TABLE_ENTRY(WindowPos4svMESA), - TABLE_ENTRY(_dispatch_stub_648), - TABLE_ENTRY(_dispatch_stub_649), - TABLE_ENTRY(_dispatch_stub_650), - TABLE_ENTRY(_dispatch_stub_651), - TABLE_ENTRY(_dispatch_stub_652), - TABLE_ENTRY(_dispatch_stub_653), - TABLE_ENTRY(_dispatch_stub_654), - TABLE_ENTRY(_dispatch_stub_655), - TABLE_ENTRY(_dispatch_stub_656), - TABLE_ENTRY(AreProgramsResidentNV), - TABLE_ENTRY(BindProgramNV), - TABLE_ENTRY(DeleteProgramsNV), - TABLE_ENTRY(ExecuteProgramNV), - TABLE_ENTRY(GenProgramsNV), - TABLE_ENTRY(GetProgramParameterdvNV), - TABLE_ENTRY(GetProgramParameterfvNV), - TABLE_ENTRY(GetProgramStringNV), - TABLE_ENTRY(GetProgramivNV), - TABLE_ENTRY(GetTrackMatrixivNV), - TABLE_ENTRY(GetVertexAttribPointervNV), - TABLE_ENTRY(GetVertexAttribdvNV), - TABLE_ENTRY(GetVertexAttribfvNV), - TABLE_ENTRY(GetVertexAttribivNV), - TABLE_ENTRY(IsProgramNV), - TABLE_ENTRY(LoadProgramNV), - TABLE_ENTRY(ProgramParameters4dvNV), - TABLE_ENTRY(ProgramParameters4fvNV), - TABLE_ENTRY(RequestResidentProgramsNV), - TABLE_ENTRY(TrackMatrixNV), - TABLE_ENTRY(VertexAttrib1dNV), - TABLE_ENTRY(VertexAttrib1dvNV), - TABLE_ENTRY(VertexAttrib1fNV), - TABLE_ENTRY(VertexAttrib1fvNV), - TABLE_ENTRY(VertexAttrib1sNV), - TABLE_ENTRY(VertexAttrib1svNV), - TABLE_ENTRY(VertexAttrib2dNV), - TABLE_ENTRY(VertexAttrib2dvNV), - TABLE_ENTRY(VertexAttrib2fNV), - TABLE_ENTRY(VertexAttrib2fvNV), - TABLE_ENTRY(VertexAttrib2sNV), - TABLE_ENTRY(VertexAttrib2svNV), - TABLE_ENTRY(VertexAttrib3dNV), - TABLE_ENTRY(VertexAttrib3dvNV), - TABLE_ENTRY(VertexAttrib3fNV), - TABLE_ENTRY(VertexAttrib3fvNV), - TABLE_ENTRY(VertexAttrib3sNV), - TABLE_ENTRY(VertexAttrib3svNV), - TABLE_ENTRY(VertexAttrib4dNV), - TABLE_ENTRY(VertexAttrib4dvNV), - TABLE_ENTRY(VertexAttrib4fNV), - TABLE_ENTRY(VertexAttrib4fvNV), - TABLE_ENTRY(VertexAttrib4sNV), - TABLE_ENTRY(VertexAttrib4svNV), - TABLE_ENTRY(VertexAttrib4ubNV), - TABLE_ENTRY(VertexAttrib4ubvNV), - TABLE_ENTRY(VertexAttribPointerNV), - TABLE_ENTRY(VertexAttribs1dvNV), - TABLE_ENTRY(VertexAttribs1fvNV), - TABLE_ENTRY(VertexAttribs1svNV), - TABLE_ENTRY(VertexAttribs2dvNV), - TABLE_ENTRY(VertexAttribs2fvNV), - TABLE_ENTRY(VertexAttribs2svNV), - TABLE_ENTRY(VertexAttribs3dvNV), - TABLE_ENTRY(VertexAttribs3fvNV), - TABLE_ENTRY(VertexAttribs3svNV), - TABLE_ENTRY(VertexAttribs4dvNV), - TABLE_ENTRY(VertexAttribs4fvNV), - TABLE_ENTRY(VertexAttribs4svNV), - TABLE_ENTRY(VertexAttribs4ubvNV), - TABLE_ENTRY(AlphaFragmentOp1ATI), - TABLE_ENTRY(AlphaFragmentOp2ATI), - TABLE_ENTRY(AlphaFragmentOp3ATI), - TABLE_ENTRY(BeginFragmentShaderATI), - TABLE_ENTRY(BindFragmentShaderATI), - TABLE_ENTRY(ColorFragmentOp1ATI), - TABLE_ENTRY(ColorFragmentOp2ATI), - TABLE_ENTRY(ColorFragmentOp3ATI), - TABLE_ENTRY(DeleteFragmentShaderATI), - TABLE_ENTRY(EndFragmentShaderATI), - TABLE_ENTRY(GenFragmentShadersATI), - TABLE_ENTRY(PassTexCoordATI), - TABLE_ENTRY(SampleMapATI), - TABLE_ENTRY(SetFragmentShaderConstantATI), - TABLE_ENTRY(PointParameteriNV), - TABLE_ENTRY(PointParameterivNV), - TABLE_ENTRY(_dispatch_stub_733), - TABLE_ENTRY(_dispatch_stub_734), - TABLE_ENTRY(_dispatch_stub_735), - TABLE_ENTRY(_dispatch_stub_736), - TABLE_ENTRY(_dispatch_stub_737), - TABLE_ENTRY(GetProgramNamedParameterdvNV), - TABLE_ENTRY(GetProgramNamedParameterfvNV), - TABLE_ENTRY(ProgramNamedParameter4dNV), - TABLE_ENTRY(ProgramNamedParameter4dvNV), - TABLE_ENTRY(ProgramNamedParameter4fNV), - TABLE_ENTRY(ProgramNamedParameter4fvNV), - TABLE_ENTRY(_dispatch_stub_744), - TABLE_ENTRY(_dispatch_stub_745), - TABLE_ENTRY(BindFramebufferEXT), - TABLE_ENTRY(BindRenderbufferEXT), - TABLE_ENTRY(CheckFramebufferStatusEXT), - TABLE_ENTRY(DeleteFramebuffersEXT), - TABLE_ENTRY(DeleteRenderbuffersEXT), - TABLE_ENTRY(FramebufferRenderbufferEXT), - TABLE_ENTRY(FramebufferTexture1DEXT), - TABLE_ENTRY(FramebufferTexture2DEXT), - TABLE_ENTRY(FramebufferTexture3DEXT), - TABLE_ENTRY(GenFramebuffersEXT), - TABLE_ENTRY(GenRenderbuffersEXT), - TABLE_ENTRY(GenerateMipmapEXT), - TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT), - TABLE_ENTRY(GetRenderbufferParameterivEXT), - TABLE_ENTRY(IsFramebufferEXT), - TABLE_ENTRY(IsRenderbufferEXT), - TABLE_ENTRY(RenderbufferStorageEXT), - TABLE_ENTRY(_dispatch_stub_763), - TABLE_ENTRY(FramebufferTextureLayerEXT), - TABLE_ENTRY(_dispatch_stub_765), - TABLE_ENTRY(_dispatch_stub_766), - TABLE_ENTRY(_dispatch_stub_767), - TABLE_ENTRY(_dispatch_stub_768), - TABLE_ENTRY(_dispatch_stub_769), - /* A whole bunch of no-op functions. These might be called - * when someone tries to call a dynamically-registered - * extension function without a current rendering context. - */ - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), -}; -#endif /* DISPATCH_TABLE_NAME */ - - -/* - * This is just used to silence compiler warnings. - * We list the functions which are not otherwise used. - */ -#ifdef UNUSED_TABLE_NAME -static _glapi_proc UNUSED_TABLE_NAME[] = { - TABLE_ENTRY(ArrayElementEXT), - TABLE_ENTRY(BindTextureEXT), - TABLE_ENTRY(DrawArraysEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(AreTexturesResidentEXT), -#endif - TABLE_ENTRY(CopyTexImage1DEXT), - TABLE_ENTRY(CopyTexImage2DEXT), - TABLE_ENTRY(CopyTexSubImage1DEXT), - TABLE_ENTRY(CopyTexSubImage2DEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(DeleteTexturesEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GenTexturesEXT), -#endif - TABLE_ENTRY(GetPointervEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(IsTextureEXT), -#endif - TABLE_ENTRY(PrioritizeTexturesEXT), - TABLE_ENTRY(TexSubImage1DEXT), - TABLE_ENTRY(TexSubImage2DEXT), - TABLE_ENTRY(BlendColorEXT), - TABLE_ENTRY(BlendEquationEXT), - TABLE_ENTRY(DrawRangeElementsEXT), - TABLE_ENTRY(ColorTableEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterfvEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterivEXT), -#endif - TABLE_ENTRY(TexImage3DEXT), - TABLE_ENTRY(TexSubImage3DEXT), - TABLE_ENTRY(CopyTexSubImage3DEXT), - TABLE_ENTRY(ActiveTexture), - TABLE_ENTRY(ClientActiveTexture), - TABLE_ENTRY(MultiTexCoord1d), - TABLE_ENTRY(MultiTexCoord1dv), - TABLE_ENTRY(MultiTexCoord1f), - TABLE_ENTRY(MultiTexCoord1fv), - TABLE_ENTRY(MultiTexCoord1i), - TABLE_ENTRY(MultiTexCoord1iv), - TABLE_ENTRY(MultiTexCoord1s), - TABLE_ENTRY(MultiTexCoord1sv), - TABLE_ENTRY(MultiTexCoord2d), - TABLE_ENTRY(MultiTexCoord2dv), - TABLE_ENTRY(MultiTexCoord2f), - TABLE_ENTRY(MultiTexCoord2fv), - TABLE_ENTRY(MultiTexCoord2i), - TABLE_ENTRY(MultiTexCoord2iv), - TABLE_ENTRY(MultiTexCoord2s), - TABLE_ENTRY(MultiTexCoord2sv), - TABLE_ENTRY(MultiTexCoord3d), - TABLE_ENTRY(MultiTexCoord3dv), - TABLE_ENTRY(MultiTexCoord3f), - TABLE_ENTRY(MultiTexCoord3fv), - TABLE_ENTRY(MultiTexCoord3i), - TABLE_ENTRY(MultiTexCoord3iv), - TABLE_ENTRY(MultiTexCoord3s), - TABLE_ENTRY(MultiTexCoord3sv), - TABLE_ENTRY(MultiTexCoord4d), - TABLE_ENTRY(MultiTexCoord4dv), - TABLE_ENTRY(MultiTexCoord4f), - TABLE_ENTRY(MultiTexCoord4fv), - TABLE_ENTRY(MultiTexCoord4i), - TABLE_ENTRY(MultiTexCoord4iv), - TABLE_ENTRY(MultiTexCoord4s), - TABLE_ENTRY(MultiTexCoord4sv), - TABLE_ENTRY(LoadTransposeMatrixd), - TABLE_ENTRY(LoadTransposeMatrixf), - TABLE_ENTRY(MultTransposeMatrixd), - TABLE_ENTRY(MultTransposeMatrixf), - TABLE_ENTRY(SampleCoverage), - TABLE_ENTRY(CompressedTexImage1D), - TABLE_ENTRY(CompressedTexImage2D), - TABLE_ENTRY(CompressedTexImage3D), - TABLE_ENTRY(CompressedTexSubImage1D), - TABLE_ENTRY(CompressedTexSubImage2D), - TABLE_ENTRY(CompressedTexSubImage3D), - TABLE_ENTRY(GetCompressedTexImage), - TABLE_ENTRY(DisableVertexAttribArray), - TABLE_ENTRY(EnableVertexAttribArray), - TABLE_ENTRY(GetVertexAttribdv), - TABLE_ENTRY(GetVertexAttribfv), - TABLE_ENTRY(GetVertexAttribiv), - TABLE_ENTRY(ProgramParameter4dNV), - TABLE_ENTRY(ProgramParameter4dvNV), - TABLE_ENTRY(ProgramParameter4fNV), - TABLE_ENTRY(ProgramParameter4fvNV), - TABLE_ENTRY(VertexAttrib1d), - TABLE_ENTRY(VertexAttrib1dv), - TABLE_ENTRY(VertexAttrib1f), - TABLE_ENTRY(VertexAttrib1fv), - TABLE_ENTRY(VertexAttrib1s), - TABLE_ENTRY(VertexAttrib1sv), - TABLE_ENTRY(VertexAttrib2d), - TABLE_ENTRY(VertexAttrib2dv), - TABLE_ENTRY(VertexAttrib2f), - TABLE_ENTRY(VertexAttrib2fv), - TABLE_ENTRY(VertexAttrib2s), - TABLE_ENTRY(VertexAttrib2sv), - TABLE_ENTRY(VertexAttrib3d), - TABLE_ENTRY(VertexAttrib3dv), - TABLE_ENTRY(VertexAttrib3f), - TABLE_ENTRY(VertexAttrib3fv), - TABLE_ENTRY(VertexAttrib3s), - TABLE_ENTRY(VertexAttrib3sv), - TABLE_ENTRY(VertexAttrib4Nbv), - TABLE_ENTRY(VertexAttrib4Niv), - TABLE_ENTRY(VertexAttrib4Nsv), - TABLE_ENTRY(VertexAttrib4Nub), - TABLE_ENTRY(VertexAttrib4Nubv), - TABLE_ENTRY(VertexAttrib4Nuiv), - TABLE_ENTRY(VertexAttrib4Nusv), - TABLE_ENTRY(VertexAttrib4bv), - TABLE_ENTRY(VertexAttrib4d), - TABLE_ENTRY(VertexAttrib4dv), - TABLE_ENTRY(VertexAttrib4f), - TABLE_ENTRY(VertexAttrib4fv), - TABLE_ENTRY(VertexAttrib4iv), - TABLE_ENTRY(VertexAttrib4s), - TABLE_ENTRY(VertexAttrib4sv), - TABLE_ENTRY(VertexAttrib4ubv), - TABLE_ENTRY(VertexAttrib4uiv), - TABLE_ENTRY(VertexAttrib4usv), - TABLE_ENTRY(VertexAttribPointer), - TABLE_ENTRY(BindBuffer), - TABLE_ENTRY(BufferData), - TABLE_ENTRY(BufferSubData), - TABLE_ENTRY(DeleteBuffers), - TABLE_ENTRY(GenBuffers), - TABLE_ENTRY(GetBufferParameteriv), - TABLE_ENTRY(GetBufferPointerv), - TABLE_ENTRY(GetBufferSubData), - TABLE_ENTRY(IsBuffer), - TABLE_ENTRY(MapBuffer), - TABLE_ENTRY(UnmapBuffer), - TABLE_ENTRY(BeginQuery), - TABLE_ENTRY(DeleteQueries), - TABLE_ENTRY(EndQuery), - TABLE_ENTRY(GenQueries), - TABLE_ENTRY(GetQueryObjectiv), - TABLE_ENTRY(GetQueryObjectuiv), - TABLE_ENTRY(GetQueryiv), - TABLE_ENTRY(IsQuery), - TABLE_ENTRY(CompileShader), - TABLE_ENTRY(GetActiveUniform), - TABLE_ENTRY(GetShaderSource), - TABLE_ENTRY(GetUniformLocation), - TABLE_ENTRY(GetUniformfv), - TABLE_ENTRY(GetUniformiv), - TABLE_ENTRY(LinkProgram), - TABLE_ENTRY(ShaderSource), - TABLE_ENTRY(Uniform1f), - TABLE_ENTRY(Uniform1fv), - TABLE_ENTRY(Uniform1i), - TABLE_ENTRY(Uniform1iv), - TABLE_ENTRY(Uniform2f), - TABLE_ENTRY(Uniform2fv), - TABLE_ENTRY(Uniform2i), - TABLE_ENTRY(Uniform2iv), - TABLE_ENTRY(Uniform3f), - TABLE_ENTRY(Uniform3fv), - TABLE_ENTRY(Uniform3i), - TABLE_ENTRY(Uniform3iv), - TABLE_ENTRY(Uniform4f), - TABLE_ENTRY(Uniform4fv), - TABLE_ENTRY(Uniform4i), - TABLE_ENTRY(Uniform4iv), - TABLE_ENTRY(UniformMatrix2fv), - TABLE_ENTRY(UniformMatrix3fv), - TABLE_ENTRY(UniformMatrix4fv), - TABLE_ENTRY(UseProgram), - TABLE_ENTRY(ValidateProgram), - TABLE_ENTRY(BindAttribLocation), - TABLE_ENTRY(GetActiveAttrib), - TABLE_ENTRY(GetAttribLocation), - TABLE_ENTRY(DrawBuffers), - TABLE_ENTRY(DrawBuffersATI), - TABLE_ENTRY(PointParameterf), - TABLE_ENTRY(PointParameterfARB), - TABLE_ENTRY(PointParameterfv), - TABLE_ENTRY(PointParameterfvARB), - TABLE_ENTRY(SecondaryColor3b), - TABLE_ENTRY(SecondaryColor3bv), - TABLE_ENTRY(SecondaryColor3d), - TABLE_ENTRY(SecondaryColor3dv), - TABLE_ENTRY(SecondaryColor3f), - TABLE_ENTRY(SecondaryColor3fv), - TABLE_ENTRY(SecondaryColor3i), - TABLE_ENTRY(SecondaryColor3iv), - TABLE_ENTRY(SecondaryColor3s), - TABLE_ENTRY(SecondaryColor3sv), - TABLE_ENTRY(SecondaryColor3ub), - TABLE_ENTRY(SecondaryColor3ubv), - TABLE_ENTRY(SecondaryColor3ui), - TABLE_ENTRY(SecondaryColor3uiv), - TABLE_ENTRY(SecondaryColor3us), - TABLE_ENTRY(SecondaryColor3usv), - TABLE_ENTRY(SecondaryColorPointer), - TABLE_ENTRY(MultiDrawArrays), - TABLE_ENTRY(MultiDrawElements), - TABLE_ENTRY(FogCoordPointer), - TABLE_ENTRY(FogCoordd), - TABLE_ENTRY(FogCoorddv), - TABLE_ENTRY(FogCoordf), - TABLE_ENTRY(FogCoordfv), - TABLE_ENTRY(BlendFuncSeparate), - TABLE_ENTRY(WindowPos2d), - TABLE_ENTRY(WindowPos2dARB), - TABLE_ENTRY(WindowPos2dv), - TABLE_ENTRY(WindowPos2dvARB), - TABLE_ENTRY(WindowPos2f), - TABLE_ENTRY(WindowPos2fARB), - TABLE_ENTRY(WindowPos2fv), - TABLE_ENTRY(WindowPos2fvARB), - TABLE_ENTRY(WindowPos2i), - TABLE_ENTRY(WindowPos2iARB), - TABLE_ENTRY(WindowPos2iv), - TABLE_ENTRY(WindowPos2ivARB), - TABLE_ENTRY(WindowPos2s), - TABLE_ENTRY(WindowPos2sARB), - TABLE_ENTRY(WindowPos2sv), - TABLE_ENTRY(WindowPos2svARB), - TABLE_ENTRY(WindowPos3d), - TABLE_ENTRY(WindowPos3dARB), - TABLE_ENTRY(WindowPos3dv), - TABLE_ENTRY(WindowPos3dvARB), - TABLE_ENTRY(WindowPos3f), - TABLE_ENTRY(WindowPos3fARB), - TABLE_ENTRY(WindowPos3fv), - TABLE_ENTRY(WindowPos3fvARB), - TABLE_ENTRY(WindowPos3i), - TABLE_ENTRY(WindowPos3iARB), - TABLE_ENTRY(WindowPos3iv), - TABLE_ENTRY(WindowPos3ivARB), - TABLE_ENTRY(WindowPos3s), - TABLE_ENTRY(WindowPos3sARB), - TABLE_ENTRY(WindowPos3sv), - TABLE_ENTRY(WindowPos3svARB), - TABLE_ENTRY(BindProgramARB), - TABLE_ENTRY(DeleteProgramsARB), - TABLE_ENTRY(GenProgramsARB), - TABLE_ENTRY(GetVertexAttribPointerv), - TABLE_ENTRY(GetVertexAttribPointervARB), - TABLE_ENTRY(IsProgramARB), - TABLE_ENTRY(PointParameteri), - TABLE_ENTRY(PointParameteriv), - TABLE_ENTRY(BlendEquationSeparate), -}; -#endif /*UNUSED_TABLE_NAME*/ - - -# undef KEYWORD1 -# undef KEYWORD1_ALT -# undef KEYWORD2 -# undef NAME -# undef DISPATCH -# undef RETURN_DISPATCH -# undef DISPATCH_TABLE_NAME -# undef UNUSED_TABLE_NAME -# undef TABLE_ENTRY -# undef HIDDEN +/* DO NOT EDIT - This file generated automatically by gl_apitemp.py (from Mesa) script */
+
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * (C) Copyright IBM Corporation 2004
+ * 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, sub license,
+ * 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 (including the next
+ * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL, IBM,
+ * AND/OR THEIR SUPPLIERS 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.
+ */
+
+
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# define HIDDEN __attribute__((visibility("hidden")))
+# else
+# define HIDDEN
+# endif
+
+/*
+ * This file is a template which generates the OpenGL API entry point
+ * functions. It should be included by a .c file which first defines
+ * the following macros:
+ * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32
+ * KEYWORD2 - usually nothing, but might be __stdcall on Win32
+ * NAME(n) - builds the final function name (usually add "gl" prefix)
+ * DISPATCH(func, args, msg) - code to do dispatch of named function.
+ * msg is a printf-style debug message.
+ * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value
+ *
+ * Here is an example which generates the usual OpenGL functions:
+ * #define KEYWORD1
+ * #define KEYWORD2
+ * #define NAME(func) gl##func
+ * #define DISPATCH(func, args, msg) \
+ * struct _glapi_table *dispatch = CurrentDispatch; \
+ * (*dispatch->func) args
+ * #define RETURN DISPATCH(func, args, msg) \
+ * struct _glapi_table *dispatch = CurrentDispatch; \
+ * return (*dispatch->func) args
+ *
+ */
+
+
+#if defined( NAME )
+#ifndef KEYWORD1
+#define KEYWORD1
+#endif
+
+#ifndef KEYWORD1_ALT
+#define KEYWORD1_ALT HIDDEN
+#endif
+
+#ifndef KEYWORD2
+#define KEYWORD2
+#endif
+
+#ifndef DISPATCH
+#error DISPATCH must be defined
+#endif
+
+#ifndef RETURN_DISPATCH
+#error RETURN_DISPATCH must be defined
+#endif
+
+
+KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode)
+{
+ DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndList)(void)
+{
+ DISPATCH(EndList, (), (F, "glEndList();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list)
+{
+ DISPATCH(CallList, (list), (F, "glCallList(%d);\n", list));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid * lists)
+{
+ DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);\n", n, type, (const void *) lists));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range)
+{
+ DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%d, %d);\n", list, range));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range)
+{
+ RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);\n", range));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base)
+{
+ DISPATCH(ListBase, (base), (F, "glListBase(%d);\n", base));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode)
+{
+ DISPATCH(Begin, (mode), (F, "glBegin(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
+{
+ DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (F, "glBitmap(%d, %d, %f, %f, %f, %f, %p);\n", width, height, xorig, yorig, xmove, ymove, (const void *) bitmap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte * v)
+{
+ DISPATCH(Color3bv, (v), (F, "glColor3bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble * v)
+{
+ DISPATCH(Color3dv, (v), (F, "glColor3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat * v)
+{
+ DISPATCH(Color3fv, (v), (F, "glColor3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint * v)
+{
+ DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort * v)
+{
+ DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte * v)
+{
+ DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint * v)
+{
+ DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort * v)
+{
+ DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+{
+ DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte * v)
+{
+ DISPATCH(Color4bv, (v), (F, "glColor4bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+{
+ DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble * v)
+{
+ DISPATCH(Color4dv, (v), (F, "glColor4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4f(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat * v)
+{
+ DISPATCH(Color4fv, (v), (F, "glColor4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
+{
+ DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint * v)
+{
+ DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha)
+{
+ DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort * v)
+{
+ DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+ DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte * v)
+{
+ DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+ DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint * v)
+{
+ DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+{
+ DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort * v)
+{
+ DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag)
+{
+ DISPATCH(EdgeFlag, (flag), (F, "glEdgeFlag(%d);\n", flag));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean * flag)
+{
+ DISPATCH(EdgeFlagv, (flag), (F, "glEdgeFlagv(%p);\n", (const void *) flag));
+}
+
+KEYWORD1 void KEYWORD2 NAME(End)(void)
+{
+ DISPATCH(End, (), (F, "glEnd();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c)
+{
+ DISPATCH(Indexd, (c), (F, "glIndexd(%f);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble * c)
+{
+ DISPATCH(Indexdv, (c), (F, "glIndexdv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c)
+{
+ DISPATCH(Indexf, (c), (F, "glIndexf(%f);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat * c)
+{
+ DISPATCH(Indexfv, (c), (F, "glIndexfv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c)
+{
+ DISPATCH(Indexi, (c), (F, "glIndexi(%d);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint * c)
+{
+ DISPATCH(Indexiv, (c), (F, "glIndexiv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c)
+{
+ DISPATCH(Indexs, (c), (F, "glIndexs(%d);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort * c)
+{
+ DISPATCH(Indexsv, (c), (F, "glIndexsv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
+{
+ DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte * v)
+{
+ DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
+{
+ DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble * v)
+{
+ DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%f, %f, %f);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat * v)
+{
+ DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz)
+{
+ DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint * v)
+{
+ DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
+{
+ DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort * v)
+{
+ DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble * v)
+{
+ DISPATCH(RasterPos2dv, (v), (F, "glRasterPos2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat * v)
+{
+ DISPATCH(RasterPos2fv, (v), (F, "glRasterPos2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y)
+{
+ DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint * v)
+{
+ DISPATCH(RasterPos2iv, (v), (F, "glRasterPos2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y)
+{
+ DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort * v)
+{
+ DISPATCH(RasterPos2sv, (v), (F, "glRasterPos2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble * v)
+{
+ DISPATCH(RasterPos3dv, (v), (F, "glRasterPos3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat * v)
+{
+ DISPATCH(RasterPos3fv, (v), (F, "glRasterPos3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint * v)
+{
+ DISPATCH(RasterPos3iv, (v), (F, "glRasterPos3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort * v)
+{
+ DISPATCH(RasterPos3sv, (v), (F, "glRasterPos3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble * v)
+{
+ DISPATCH(RasterPos4dv, (v), (F, "glRasterPos4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat * v)
+{
+ DISPATCH(RasterPos4fv, (v), (F, "glRasterPos4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint * v)
+{
+ DISPATCH(RasterPos4iv, (v), (F, "glRasterPos4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort * v)
+{
+ DISPATCH(RasterPos4sv, (v), (F, "glRasterPos4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+ DISPATCH(Rectd, (x1, y1, x2, y2), (F, "glRectd(%f, %f, %f, %f);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble * v1, const GLdouble * v2)
+{
+ DISPATCH(Rectdv, (v1, v2), (F, "glRectdv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+{
+ DISPATCH(Rectf, (x1, y1, x2, y2), (F, "glRectf(%f, %f, %f, %f);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat * v1, const GLfloat * v2)
+{
+ DISPATCH(Rectfv, (v1, v2), (F, "glRectfv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+ DISPATCH(Recti, (x1, y1, x2, y2), (F, "glRecti(%d, %d, %d, %d);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint * v1, const GLint * v2)
+{
+ DISPATCH(Rectiv, (v1, v2), (F, "glRectiv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+ DISPATCH(Rects, (x1, y1, x2, y2), (F, "glRects(%d, %d, %d, %d);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort * v1, const GLshort * v2)
+{
+ DISPATCH(Rectsv, (v1, v2), (F, "glRectsv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s)
+{
+ DISPATCH(TexCoord1d, (s), (F, "glTexCoord1d(%f);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord1dv, (v), (F, "glTexCoord1dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s)
+{
+ DISPATCH(TexCoord1f, (s), (F, "glTexCoord1f(%f);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord1fv, (v), (F, "glTexCoord1fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s)
+{
+ DISPATCH(TexCoord1i, (s), (F, "glTexCoord1i(%d);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint * v)
+{
+ DISPATCH(TexCoord1iv, (v), (F, "glTexCoord1iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s)
+{
+ DISPATCH(TexCoord1s, (s), (F, "glTexCoord1s(%d);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord1sv, (v), (F, "glTexCoord1sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t)
+{
+ DISPATCH(TexCoord2d, (s, t), (F, "glTexCoord2d(%f, %f);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord2dv, (v), (F, "glTexCoord2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t)
+{
+ DISPATCH(TexCoord2f, (s, t), (F, "glTexCoord2f(%f, %f);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord2fv, (v), (F, "glTexCoord2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t)
+{
+ DISPATCH(TexCoord2i, (s, t), (F, "glTexCoord2i(%d, %d);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint * v)
+{
+ DISPATCH(TexCoord2iv, (v), (F, "glTexCoord2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t)
+{
+ DISPATCH(TexCoord2s, (s, t), (F, "glTexCoord2s(%d, %d);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord2sv, (v), (F, "glTexCoord2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(TexCoord3d, (s, t, r), (F, "glTexCoord3d(%f, %f, %f);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord3dv, (v), (F, "glTexCoord3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(TexCoord3f, (s, t, r), (F, "glTexCoord3f(%f, %f, %f);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord3fv, (v), (F, "glTexCoord3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r)
+{
+ DISPATCH(TexCoord3i, (s, t, r), (F, "glTexCoord3i(%d, %d, %d);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint * v)
+{
+ DISPATCH(TexCoord3iv, (v), (F, "glTexCoord3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(TexCoord3s, (s, t, r), (F, "glTexCoord3s(%d, %d, %d);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord3sv, (v), (F, "glTexCoord3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(TexCoord4d, (s, t, r, q), (F, "glTexCoord4d(%f, %f, %f, %f);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord4dv, (v), (F, "glTexCoord4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(TexCoord4f, (s, t, r, q), (F, "glTexCoord4f(%f, %f, %f, %f);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord4fv, (v), (F, "glTexCoord4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(TexCoord4i, (s, t, r, q), (F, "glTexCoord4i(%d, %d, %d, %d);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint * v)
+{
+ DISPATCH(TexCoord4iv, (v), (F, "glTexCoord4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(TexCoord4s, (s, t, r, q), (F, "glTexCoord4s(%d, %d, %d, %d);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord4sv, (v), (F, "glTexCoord4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble * v)
+{
+ DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat * v)
+{
+ DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y)
+{
+ DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint * v)
+{
+ DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y)
+{
+ DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort * v)
+{
+ DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble * v)
+{
+ DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat * v)
+{
+ DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint * v)
+{
+ DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort * v)
+{
+ DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble * v)
+{
+ DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat * v)
+{
+ DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint * v)
+{
+ DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort * v)
+{
+ DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble * equation)
+{
+ DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(0x%x, %p);\n", plane, (const void *) equation));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode)
+{
+ DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);\n", face, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode)
+{
+ DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param)
+{
+ DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint * params)
+{
+ DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode)
+{
+ DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode)
+{
+ DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);\n", target, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param)
+{
+ DISPATCH(Lightf, (light, pname, param), (F, "glLightf(0x%x, 0x%x, %f);\n", light, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param)
+{
+ DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);\n", light, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint * params)
+{
+ DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param)
+{
+ DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint * params)
+{
+ DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern)
+{
+ DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, %d);\n", factor, pattern));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width)
+{
+ DISPATCH(LineWidth, (width), (F, "glLineWidth(%f);\n", width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param)
+{
+ DISPATCH(Materialf, (face, pname, param), (F, "glMaterialf(0x%x, 0x%x, %f);\n", face, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(Materialfv, (face, pname, params), (F, "glMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param)
+{
+ DISPATCH(Materiali, (face, pname, param), (F, "glMateriali(0x%x, 0x%x, %d);\n", face, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint * params)
+{
+ DISPATCH(Materialiv, (face, pname, params), (F, "glMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size)
+{
+ DISPATCH(PointSize, (size), (F, "glPointSize(%f);\n", size));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode)
+{
+ DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);\n", face, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte * mask)
+{
+ DISPATCH(PolygonStipple, (mask), (F, "glPolygonStipple(%p);\n", (const void *) mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);\n", x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode)
+{
+ DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexParameterf, (target, pname, param), (F, "glTexParameterf(0x%x, 0x%x, %f);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(TexParameterfv, (target, pname, params), (F, "glTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param)
+{
+ DISPATCH(TexParameteri, (target, pname, param), (F, "glTexParameteri(0x%x, 0x%x, %d);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexParameteriv, (target, pname, params), (F, "glTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (F, "glTexImage1D(0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (F, "glTexImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexEnvf, (target, pname, param), (F, "glTexEnvf(0x%x, 0x%x, %f);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(TexEnvfv, (target, pname, params), (F, "glTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param)
+{
+ DISPATCH(TexEnvi, (target, pname, param), (F, "glTexEnvi(0x%x, 0x%x, %d);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexEnviv, (target, pname, params), (F, "glTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param)
+{
+ DISPATCH(TexGend, (coord, pname, param), (F, "glTexGend(0x%x, 0x%x, %f);\n", coord, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble * params)
+{
+ DISPATCH(TexGendv, (coord, pname, params), (F, "glTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexGenf, (coord, pname, param), (F, "glTexGenf(0x%x, 0x%x, %f);\n", coord, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(TexGenfv, (coord, pname, params), (F, "glTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param)
+{
+ DISPATCH(TexGeni, (coord, pname, param), (F, "glTexGeni(0x%x, 0x%x, %d);\n", coord, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexGeniv, (coord, pname, params), (F, "glTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer)
+{
+ DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);\n", size, type, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint * buffer)
+{
+ DISPATCH(SelectBuffer, (size, buffer), (F, "glSelectBuffer(%d, %p);\n", size, (const void *) buffer));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode)
+{
+ RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(InitNames)(void)
+{
+ DISPATCH(InitNames, (), (F, "glInitNames();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name)
+{
+ DISPATCH(LoadName, (name), (F, "glLoadName(%d);\n", name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token)
+{
+ DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);\n", token));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopName)(void)
+{
+ DISPATCH(PopName, (), (F, "glPopName();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name)
+{
+ DISPATCH(PushName, (name), (F, "glPushName(%d);\n", name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode)
+{
+ DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask)
+{
+ DISPATCH(Clear, (mask), (F, "glClear(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c)
+{
+ DISPATCH(ClearIndex, (c), (F, "glClearIndex(%f);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s)
+{
+ DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth)
+{
+ DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%f);\n", depth));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask)
+{
+ DISPATCH(StencilMask, (mask), (F, "glStencilMask(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+ DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag)
+{
+ DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);\n", flag));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask)
+{
+ DISPATCH(IndexMask, (mask), (F, "glIndexMask(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value)
+{
+ DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %f);\n", op, value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap)
+{
+ DISPATCH(Disable, (cap), (F, "glDisable(0x%x);\n", cap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap)
+{
+ DISPATCH(Enable, (cap), (F, "glEnable(0x%x);\n", cap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Finish)(void)
+{
+ DISPATCH(Finish, (), (F, "glFinish();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Flush)(void)
+{
+ DISPATCH(Flush, (), (F, "glFlush();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void)
+{
+ DISPATCH(PopAttrib, (), (F, "glPopAttrib();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask)
+{
+ DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points)
+{
+ DISPATCH(Map1d, (target, u1, u2, stride, order, points), (F, "glMap1d(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points)
+{
+ DISPATCH(Map1f, (target, u1, u2, stride, order, points), (F, "glMap1f(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points)
+{
+ DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2d(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points)
+{
+ DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2f(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
+{
+ DISPATCH(MapGrid1d, (un, u1, u2), (F, "glMapGrid1d(%d, %f, %f);\n", un, u1, u2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
+{
+ DISPATCH(MapGrid1f, (un, u1, u2), (F, "glMapGrid1f(%d, %f, %f);\n", un, u1, u2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+{
+ DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2d(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2f(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u)
+{
+ DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%f);\n", u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble * u)
+{
+ DISPATCH(EvalCoord1dv, (u), (F, "glEvalCoord1dv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u)
+{
+ DISPATCH(EvalCoord1f, (u), (F, "glEvalCoord1f(%f);\n", u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat * u)
+{
+ DISPATCH(EvalCoord1fv, (u), (F, "glEvalCoord1fv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v)
+{
+ DISPATCH(EvalCoord2d, (u, v), (F, "glEvalCoord2d(%f, %f);\n", u, v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble * u)
+{
+ DISPATCH(EvalCoord2dv, (u), (F, "glEvalCoord2dv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v)
+{
+ DISPATCH(EvalCoord2f, (u, v), (F, "glEvalCoord2f(%f, %f);\n", u, v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat * u)
+{
+ DISPATCH(EvalCoord2fv, (u), (F, "glEvalCoord2fv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
+{
+ DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh1(0x%x, %d, %d);\n", mode, i1, i2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i)
+{
+ DISPATCH(EvalPoint1, (i), (F, "glEvalPoint1(%d);\n", i));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+ DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);\n", mode, i1, i2, j1, j2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j)
+{
+ DISPATCH(EvalPoint2, (i, j), (F, "glEvalPoint2(%d, %d);\n", i, j));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref)
+{
+ DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %f);\n", func, ref));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor)
+{
+ DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);\n", sfactor, dfactor));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode)
+{
+ DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);\n", opcode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask)
+{
+ DISPATCH(StencilFunc, (func, ref, mask), (F, "glStencilFunc(0x%x, %d, %d);\n", func, ref, mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ DISPATCH(StencilOp, (fail, zfail, zpass), (F, "glStencilOp(0x%x, 0x%x, 0x%x);\n", fail, zfail, zpass));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func)
+{
+ DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);\n", func));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
+{
+ DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);\n", xfactor, yfactor));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values)
+{
+ DISPATCH(PixelMapfv, (map, mapsize, values), (F, "glPixelMapfv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values)
+{
+ DISPATCH(PixelMapuiv, (map, mapsize, values), (F, "glPixelMapuiv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values)
+{
+ DISPATCH(PixelMapusv, (map, mapsize, values), (F, "glPixelMapusv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode)
+{
+ DISPATCH(ReadBuffer, (mode), (F, "glReadBuffer(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+ DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x);\n", x, y, width, height, type));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
+{
+ DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (F, "glReadPixels(%d, %d, %d, %d, 0x%x, 0x%x, %p);\n", x, y, width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);\n", width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean * params)
+{
+ DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble * equation)
+{
+ DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(0x%x, %p);\n", plane, (const void *) equation));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void)
+{
+ RETURN_DISPATCH(GetError, (), (F, "glGetError();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint * params)
+{
+ DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint * params)
+{
+ DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble * v)
+{
+ DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat * v)
+{
+ DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint * v)
+{
+ DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat * values)
+{
+ DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);\n", map, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint * values)
+{
+ DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);\n", map, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort * values)
+{
+ DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);\n", map, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte * mask)
+{
+ DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);\n", (const void *) mask));
+}
+
+KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name)
+{
+ RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);\n", name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGetTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetTexGendv, (coord, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexGenfv, (coord, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum coord, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexGeniv, (coord, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
+{
+ DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);\n", target, level, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap)
+{
+ RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);\n", cap));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list)
+{
+ RETURN_DISPATCH(IsList, (list), (F, "glIsList(%d);\n", list));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd zNear, GLclampd zFar)
+{
+ DISPATCH(DepthRange, (zNear, zFar), (F, "glDepthRange(%f, %f);\n", zNear, zFar));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+ DISPATCH(Frustum, (left, right, bottom, top, zNear, zFar), (F, "glFrustum(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void)
+{
+ DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat * m)
+{
+ DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble * m)
+{
+ DISPATCH(LoadMatrixd, (m), (F, "glLoadMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode)
+{
+ DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat * m)
+{
+ DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble * m)
+{
+ DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+ DISPATCH(Ortho, (left, right, bottom, top, zNear, zFar), (F, "glOrtho(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void)
+{
+ DISPATCH(PopMatrix, (), (F, "glPopMatrix();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void)
+{
+ DISPATCH(PushMatrix, (), (F, "glPushMatrix();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Rotated, (angle, x, y, z), (F, "glRotated(%f, %f, %f, %f);\n", angle, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%f, %f, %f, %f);\n", angle, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Scaled, (x, y, z), (F, "glScaled(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Scalef, (x, y, z), (F, "glScalef(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Translated, (x, y, z), (F, "glTranslated(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);\n", x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i)
+{
+ DISPATCH(ArrayElement, (i), (F, "glArrayElement(%d);\n", i));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i)
+{
+ DISPATCH(ArrayElement, (i), (F, "glArrayElementEXT(%d);\n", i));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture)
+{
+ DISPATCH(BindTexture, (target, texture), (F, "glBindTexture(0x%x, %d);\n", target, texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture)
+{
+ DISPATCH(BindTexture, (target, texture), (F, "glBindTextureEXT(0x%x, %d);\n", target, texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(ColorPointer, (size, type, stride, pointer), (F, "glColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum array)
+{
+ DISPATCH(DisableClientState, (array), (F, "glDisableClientState(0x%x);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count)
+{
+ DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);\n", mode, first, count));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
+{
+ DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArraysEXT(0x%x, %d, %d);\n", mode, first, count));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
+{
+ DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p);\n", mode, count, type, (const void *) indices));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(EdgeFlagPointer, (stride, pointer), (F, "glEdgeFlagPointer(%d, %p);\n", stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum array)
+{
+ DISPATCH(EnableClientState, (array), (F, "glEnableClientState(0x%x);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(IndexPointer, (type, stride, pointer), (F, "glIndexPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c)
+{
+ DISPATCH(Indexub, (c), (F, "glIndexub(%d);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte * c)
+{
+ DISPATCH(Indexubv, (c), (F, "glIndexubv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);\n", format, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(NormalPointer, (type, stride, pointer), (F, "glNormalPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units)
+{
+ DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%f, %f);\n", factor, units));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(TexCoordPointer, (size, type, stride, pointer), (F, "glTexCoordPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexPointer, (size, type, stride, pointer), (F, "glVertexPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1D(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1DEXT(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2D(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures)
+{
+ DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures)
+{
+ DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures)
+{
+ DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
+{
+ DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetPointerv, (pname, params), (F, "glGetPointervEXT(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
+{
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
+{
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTexturesEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1D(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1DEXT(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void)
+{
+ DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask)
+{
+ DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColorEXT(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode)
+{
+ DISPATCH(BlendEquation, (mode), (F, "glBlendEquation(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode)
+{
+ DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
+{
+ DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElements(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
+{
+ DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTable(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTableSGI(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
+{
+ DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
+{
+ DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTableEXT(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTable(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTableEXT(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1D(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1DEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
+{
+ DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterf(0x%x, 0x%x, %f);\n", target, pname, params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params)
+{
+ DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterfEXT(0x%x, 0x%x, %f);\n", target, pname, params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteri(0x%x, 0x%x, %d);\n", target, pname, params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteriEXT(0x%x, 0x%x, %d);\n", target, pname, params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1D(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1DEXT(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2D(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image)
+{
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image)
+{
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
+{
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
+{
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
+{
+ DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
+{
+ DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+#ifndef GLX_INDIRECT_RENDERING
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+#endif /* GLX_INDIRECT_RENDERING */
+
+KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogramEXT(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmax(0x%x, 0x%x, %d);\n", target, internalformat, sink));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmaxEXT(0x%x, 0x%x, %d);\n", target, internalformat, sink));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target)
+{
+ DISPATCH(ResetHistogram, (target), (F, "glResetHistogram(0x%x);\n", target));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target)
+{
+ DISPATCH(ResetHistogram, (target), (F, "glResetHistogramEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target)
+{
+ DISPATCH(ResetMinmax, (target), (F, "glResetMinmax(0x%x);\n", target));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target)
+{
+ DISPATCH(ResetMinmax, (target), (F, "glResetMinmaxEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3D(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture)
+{
+ DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTexture(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture)
+{
+ DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTextureARB(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture)
+{
+ DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTexture(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture)
+{
+ DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTextureARB(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s)
+{
+ DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1d(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s)
+{
+ DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1dARB(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s)
+{
+ DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1f(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s)
+{
+ DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1fARB(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s)
+{
+ DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1i(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s)
+{
+ DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1iARB(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s)
+{
+ DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1s(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s)
+{
+ DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1sARB(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
+{
+ DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2d(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
+{
+ DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2dARB(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t)
+{
+ DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2f(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
+{
+ DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2fARB(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
+{
+ DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2i(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
+{
+ DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2iARB(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
+{
+ DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2s(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
+{
+ DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2sARB(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3d(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3dARB(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3f(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3fARB(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
+{
+ DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3i(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
+{
+ DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3iARB(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3s(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3sARB(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4d(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4dARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4f(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4fARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4i(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4iARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4s(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4sARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void)
+{
+ RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n"));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type)
+{
+ RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program)
+{
+ DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program)
+{
+ DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj)
+{
+ DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params)
+{
+ DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader)
+{
+ RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+ DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilMaskSeparate)(GLenum face, GLuint mask)
+{
+ DISPATCH(StencilMaskSeparate, (face, mask), (F, "glStencilMaskSeparate(0x%x, %d);\n", face, mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
+{
+ DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
+{
+ DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparateATI(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m)
+{
+ DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble * m)
+{
+ DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixdARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat * m)
+{
+ DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat * m)
+{
+ DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble * m)
+{
+ DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble * m)
+{
+ DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixdARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat * m)
+{
+ DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat * m)
+{
+ DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixfARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert)
+{
+ DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverage(%f, %d);\n", value, invert));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert)
+{
+ DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1D(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint level, GLvoid * img)
+{
+ DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImage(0x%x, %d, %p);\n", target, level, (const void *) img));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img)
+{
+ DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index)
+{
+ DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index)
+{
+ DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params)
+{
+ DISPATCH(GetProgramEnvParameterdvARB, (target, index, params), (F, "glGetProgramEnvParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params)
+{
+ DISPATCH(GetProgramEnvParameterfvARB, (target, index, params), (F, "glGetProgramEnvParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params)
+{
+ DISPATCH(GetProgramLocalParameterdvARB, (target, index, params), (F, "glGetProgramLocalParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params)
+{
+ DISPATCH(GetProgramLocalParameterfvARB, (target, index, params), (F, "glGetProgramLocalParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string)
+{
+ DISPATCH(GetProgramStringARB, (target, pname, string), (F, "glGetProgramStringARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) string));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params)
+{
+ DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramEnvParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params)
+{
+ DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params)
+{
+ DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramEnvParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params)
+{
+ DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramLocalParameter4dARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params)
+{
+ DISPATCH(ProgramLocalParameter4dvARB, (target, index, params), (F, "glProgramLocalParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramLocalParameter4fARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params)
+{
+ DISPATCH(ProgramLocalParameter4fvARB, (target, index, params), (F, "glProgramLocalParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string)
+{
+ DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBuffer)(GLenum target, GLuint buffer)
+{
+ DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBuffer(0x%x, %d);\n", target, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBufferARB)(GLenum target, GLuint buffer)
+{
+ DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBufferARB(0x%x, %d);\n", target, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
+{
+ DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferData(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage)
+{
+ DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferDataARB(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
+{
+ DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data)
+{
+ DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteBuffers)(GLsizei n, const GLuint * buffer)
+{
+ DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffers(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteBuffersARB)(GLsizei n, const GLuint * buffer)
+{
+ DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffersARB(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenBuffers)(GLsizei n, GLuint * buffer)
+{
+ DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffers(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenBuffersARB)(GLsizei n, GLuint * buffer)
+{
+ DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffersARB(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameterivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointerv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointervARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data)
+{
+ DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data)
+{
+ DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsBuffer)(GLuint buffer)
+{
+ RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBuffer(%d);\n", buffer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsBufferARB)(GLuint buffer)
+{
+ RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBufferARB(%d);\n", buffer));
+}
+
+KEYWORD1 GLvoid * KEYWORD2 NAME(MapBuffer)(GLenum target, GLenum access)
+{
+ RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBuffer(0x%x, 0x%x);\n", target, access));
+}
+
+KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferARB)(GLenum target, GLenum access)
+{
+ RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBufferARB(0x%x, 0x%x);\n", target, access));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBuffer)(GLenum target)
+{
+ RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBuffer(0x%x);\n", target));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBufferARB)(GLenum target)
+{
+ RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBufferARB(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginQuery)(GLenum target, GLuint id)
+{
+ DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQuery(0x%x, %d);\n", target, id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginQueryARB)(GLenum target, GLuint id)
+{
+ DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQueryARB(0x%x, %d);\n", target, id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteQueries)(GLsizei n, const GLuint * ids)
+{
+ DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueries(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteQueriesARB)(GLsizei n, const GLuint * ids)
+{
+ DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueriesARB(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndQuery)(GLenum target)
+{
+ DISPATCH(EndQueryARB, (target), (F, "glEndQuery(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndQueryARB)(GLenum target)
+{
+ DISPATCH(EndQueryARB, (target), (F, "glEndQueryARB(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenQueries)(GLsizei n, GLuint * ids)
+{
+ DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueries(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenQueriesARB)(GLsizei n, GLuint * ids)
+{
+ DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueriesARB(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectiv)(GLuint id, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectiv(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuiv(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryiv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryivARB)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsQuery)(GLuint id)
+{
+ RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQuery(%d);\n", id));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsQueryARB)(GLuint id)
+{
+ RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQueryARB(%d);\n", id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj)
+{
+ DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader)
+{
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader)
+{
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader));
+}
+
+KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void)
+{
+ RETURN_DISPATCH(CreateProgramObjectARB, (), (F, "glCreateProgramObjectARB();\n"));
+}
+
+KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateShaderObjectARB)(GLenum shaderType)
+{
+ RETURN_DISPATCH(CreateShaderObjectARB, (shaderType), (F, "glCreateShaderObjectARB(0x%x);\n", shaderType));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteObjectARB)(GLhandleARB obj)
+{
+ DISPATCH(DeleteObjectARB, (obj), (F, "glDeleteObjectARB(%d);\n", obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj)
+{
+ DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
+{
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+{
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog)
+{
+ DISPATCH(GetAttachedObjectsARB, (containerObj, maxLength, length, infoLog), (F, "glGetAttachedObjectsARB(%d, %d, %p, %p);\n", containerObj, maxLength, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 GLhandleARB KEYWORD2 NAME(GetHandleARB)(GLenum pname)
+{
+ RETURN_DISPATCH(GetHandleARB, (pname), (F, "glGetHandleARB(0x%x);\n", pname));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
+{
+ DISPATCH(GetInfoLogARB, (obj, maxLength, length, infoLog), (F, "glGetInfoLogARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetObjectParameterfvARB, (obj, pname, params), (F, "glGetObjectParameterfvARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params)
+{
+ DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params)
+{
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params)
+{
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params)
+{
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params)
+{
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program)
+{
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program)
+{
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length)
+{
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length)
+{
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0)
+{
+ DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0)
+{
+ DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0)
+{
+ DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0)
+{
+ DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1)
+{
+ DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1)
+{
+ DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1)
+{
+ DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1)
+{
+ DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program)
+{
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program)
+{
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program)
+{
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program)
+{
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name)
+{
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name)
+{
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
+{
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+{
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name)
+{
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs)
+{
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs)
+{
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
+{
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
+{
+ DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params)
+{
+ DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params)
+{
+ DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert)
+{
+ DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern)
+{
+ DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(ColorPointerEXT, (size, type, stride, count, pointer), (F, "glColorPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer)
+{
+ DISPATCH(EdgeFlagPointerEXT, (stride, count, pointer), (F, "glEdgeFlagPointerEXT(%d, %d, %p);\n", stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(IndexPointerEXT, (type, stride, count, pointer), (F, "glIndexPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(NormalPointerEXT, (type, stride, count, pointer), (F, "glNormalPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(TexCoordPointerEXT, (size, type, stride, count, pointer), (F, "glTexCoordPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(VertexPointerEXT, (size, type, stride, count, pointer), (F, "glVertexPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfARB)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfARB(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvARB)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvARB(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count)
+{
+ DISPATCH(LockArraysEXT, (first, count), (F, "glLockArraysEXT(%d, %d);\n", first, count));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
+{
+ DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n"));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params)
+{
+ DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params)
+{
+ DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3b(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bv)(const GLbyte * v)
+{
+ DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte * v)
+{
+ DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3d(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dv)(const GLdouble * v)
+{
+ DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dvEXT)(const GLdouble * v)
+{
+ DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3f(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fv)(const GLfloat * v)
+{
+ DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fvEXT)(const GLfloat * v)
+{
+ DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3i)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3i(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iv)(const GLint * v)
+{
+ DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ivEXT)(const GLint * v)
+{
+ DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3s(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sv)(const GLshort * v)
+{
+ DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3svEXT)(const GLshort * v)
+{
+ DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ub(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubv)(const GLubyte * v)
+{
+ DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubvEXT)(const GLubyte * v)
+{
+ DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3ui(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiv)(const GLuint * v)
+{
+ DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uiv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uivEXT)(const GLuint * v)
+{
+ DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3us(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usv)(const GLushort * v)
+{
+ DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usvEXT)(const GLushort * v)
+{
+ DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawArrays)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount)
+{
+ DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArrays(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount)
+{
+ DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArraysEXT(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawElements)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
+{
+ DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElements(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
+{
+ DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElementsEXT(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordd)(GLdouble coord)
+{
+ DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoordd(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoorddEXT)(GLdouble coord)
+{
+ DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoorddv)(const GLdouble * coord)
+{
+ DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddv(%p);\n", (const void *) coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoorddvEXT)(const GLdouble * coord)
+{
+ DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);\n", (const void *) coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordf)(GLfloat coord)
+{
+ DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordf(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordfEXT)(GLfloat coord)
+{
+ DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordfv)(const GLfloat * coord)
+{
+ DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfv(%p);\n", (const void *) coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord)
+{
+ DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode)
+{
+ DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FlushVertexArrayRangeNV)(void)
+{
+ DISPATCH(FlushVertexArrayRangeNV, (), (F, "glFlushVertexArrayRangeNV();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer)
+{
+ DISPATCH(VertexArrayRangeNV, (length, pointer), (F, "glVertexArrayRangeNV(%d, %p);\n", length, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
+{
+ DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, "glCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\n", stage, portion, variable, input, mapping, componentUsage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)
+{
+ DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, "glCombinerOutputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, %d, %d, %d);\n", stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameterfNV)(GLenum pname, GLfloat param)
+{
+ DISPATCH(CombinerParameterfNV, (pname, param), (F, "glCombinerParameterfNV(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameterfvNV)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(CombinerParameterfvNV, (pname, params), (F, "glCombinerParameterfvNV(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameteriNV)(GLenum pname, GLint param)
+{
+ DISPATCH(CombinerParameteriNV, (pname, param), (F, "glCombinerParameteriNV(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameterivNV)(GLenum pname, const GLint * params)
+{
+ DISPATCH(CombinerParameterivNV, (pname, params), (F, "glCombinerParameterivNV(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
+{
+ DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, "glFinalCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x);\n", variable, input, mapping, componentUsage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterfvNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params)
+{
+ DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterivNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterfvNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params)
+{
+ DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterivNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterfvNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterivNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void)
+{
+ DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2d(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dARB)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dARB(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dMESA(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dv)(const GLdouble * v)
+{
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dvARB)(const GLdouble * v)
+{
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble * v)
+{
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2f(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fARB)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fARB(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fMESA(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fv)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fvARB)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2i)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2i(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iARB)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iARB(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iMESA(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iv)(const GLint * v)
+{
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2ivARB)(const GLint * v)
+{
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint * v)
+{
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2s)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2s(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sARB)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sARB(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sMESA(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sv)(const GLshort * v)
+{
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2svARB)(const GLshort * v)
+{
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort * v)
+{
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3d(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dARB(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dMESA(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dv)(const GLdouble * v)
+{
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dvARB)(const GLdouble * v)
+{
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble * v)
+{
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3f(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fARB(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fMESA(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fv)(const GLfloat * v)
+{
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fvARB)(const GLfloat * v)
+{
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat * v)
+{
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iARB)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iARB(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iMESA(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iv)(const GLint * v)
+{
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3ivARB)(const GLint * v)
+{
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint * v)
+{
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sARB)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sARB(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sMESA(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sv)(const GLshort * v)
+{
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3svARB)(const GLshort * v)
+{
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort * v)
+{
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, "glWindowPos4dMESA(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble * v)
+{
+ DISPATCH(WindowPos4dvMESA, (v), (F, "glWindowPos4dvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, "glWindowPos4fMESA(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat * v)
+{
+ DISPATCH(WindowPos4fvMESA, (v), (F, "glWindowPos4fvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, "glWindowPos4iMESA(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint * v)
+{
+ DISPATCH(WindowPos4ivMESA, (v), (F, "glWindowPos4ivMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, "glWindowPos4sMESA(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v)
+{
+ DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
+{
+ DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
+{
+ DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences)
+{
+ DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence)
+{
+ DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences)
+{
+ DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params));
+}
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence);
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence)
+{
+ RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition)
+{
+ DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition));
+}
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence);
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence)
+{
+ RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreProgramsResidentNV, (n, ids, residences), (F, "glAreProgramsResidentNV(%d, %p, %p);\n", n, (const void *) ids, (const void *) residences));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindProgramARB)(GLenum target, GLuint program)
+{
+ DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramARB(0x%x, %d);\n", target, program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindProgramNV)(GLenum target, GLuint program)
+{
+ DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramNV(0x%x, %d);\n", target, program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgramsARB)(GLsizei n, const GLuint * programs)
+{
+ DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsARB(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgramsNV)(GLsizei n, const GLuint * programs)
+{
+ DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsNV(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params)
+{
+ DISPATCH(ExecuteProgramNV, (target, id, params), (F, "glExecuteProgramNV(0x%x, %d, %p);\n", target, id, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenProgramsARB)(GLsizei n, GLuint * programs)
+{
+ DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsARB(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenProgramsNV)(GLsizei n, GLuint * programs)
+{
+ DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsNV(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetProgramParameterdvNV, (target, index, pname, params), (F, "glGetProgramParameterdvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetProgramParameterfvNV, (target, index, pname, params), (F, "glGetProgramParameterfvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program)
+{
+ DISPATCH(GetProgramStringNV, (id, pname, program), (F, "glGetProgramStringNV(%d, 0x%x, %p);\n", id, pname, (const void *) program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramivNV)(GLuint id, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramivNV, (id, pname, params), (F, "glGetProgramivNV(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTrackMatrixivNV, (target, address, pname, params), (F, "glGetTrackMatrixivNV(0x%x, %d, 0x%x, %p);\n", target, address, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer)
+{
+ DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointerv(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid ** pointer)
+{
+ DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervARB(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer)
+{
+ DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervNV(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvNV, (index, pname, params), (F, "glGetVertexAttribdvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvNV, (index, pname, params), (F, "glGetVertexAttribfvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivNV, (index, pname, params), (F, "glGetVertexAttribivNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramARB)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramARB(%d);\n", program));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramNV)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramNV(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program)
+{
+ DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (const void *) program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params)
+{
+ DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params)
+{
+ DISPATCH(ProgramParameters4fvNV, (target, index, num, params), (F, "glProgramParameters4fvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RequestResidentProgramsNV)(GLsizei n, const GLuint * ids)
+{
+ DISPATCH(RequestResidentProgramsNV, (n, ids), (F, "glRequestResidentProgramsNV(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform)
+{
+ DISPATCH(TrackMatrixNV, (target, address, matrix, transform), (F, "glTrackMatrixNV(0x%x, %d, 0x%x, 0x%x);\n", target, address, matrix, transform));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dNV)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dNV, (index, x), (F, "glVertexAttrib1dNV(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvNV, (index, v), (F, "glVertexAttrib1dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fNV)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fNV, (index, x), (F, "glVertexAttrib1fNV(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvNV, (index, v), (F, "glVertexAttrib1fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sNV)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sNV, (index, x), (F, "glVertexAttrib1sNV(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svNV, (index, v), (F, "glVertexAttrib1svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dNV, (index, x, y), (F, "glVertexAttrib2dNV(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvNV, (index, v), (F, "glVertexAttrib2dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fNV, (index, x, y), (F, "glVertexAttrib2fNV(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvNV, (index, v), (F, "glVertexAttrib2fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sNV, (index, x, y), (F, "glVertexAttrib2sNV(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svNV, (index, v), (F, "glVertexAttrib2svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dNV, (index, x, y, z), (F, "glVertexAttrib3dNV(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvNV, (index, v), (F, "glVertexAttrib3dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fNV, (index, x, y, z), (F, "glVertexAttrib3fNV(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvNV, (index, v), (F, "glVertexAttrib3fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sNV, (index, x, y, z), (F, "glVertexAttrib3sNV(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svNV, (index, v), (F, "glVertexAttrib3svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dNV, (index, x, y, z, w), (F, "glVertexAttrib4dNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvNV, (index, v), (F, "glVertexAttrib4dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fNV, (index, x, y, z, w), (F, "glVertexAttrib4fNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvNV, (index, v), (F, "glVertexAttrib4fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sNV, (index, x, y, z, w), (F, "glVertexAttrib4sNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svNV, (index, v), (F, "glVertexAttrib4svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4ubNV, (index, x, y, z, w), (F, "glVertexAttrib4ubNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvNV)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4ubvNV, (index, v), (F, "glVertexAttrib4ubvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerNV, (index, size, type, stride, pointer), (F, "glVertexAttribPointerNV(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs1dvNV, (index, n, v), (F, "glVertexAttribs1dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs1fvNV, (index, n, v), (F, "glVertexAttribs1fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs1svNV, (index, n, v), (F, "glVertexAttribs1svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs2dvNV, (index, n, v), (F, "glVertexAttribs2dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs2fvNV, (index, n, v), (F, "glVertexAttribs2fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs2svNV, (index, n, v), (F, "glVertexAttribs2svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs3dvNV, (index, n, v), (F, "glVertexAttribs3dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs3fvNV, (index, n, v), (F, "glVertexAttribs3fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs3svNV, (index, n, v), (F, "glVertexAttribs3svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs4dvNV, (index, n, v), (F, "glVertexAttribs4dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs4fvNV, (index, n, v), (F, "glVertexAttribs4fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs4svNV, (index, n, v), (F, "glVertexAttribs4svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v)
+{
+ DISPATCH(VertexAttribs4ubvNV, (index, n, v), (F, "glVertexAttribs4ubvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
+{
+ DISPATCH(AlphaFragmentOp1ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod), (F, "glAlphaFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
+{
+ DISPATCH(AlphaFragmentOp2ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glAlphaFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
+{
+ DISPATCH(AlphaFragmentOp3ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glAlphaFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginFragmentShaderATI)(void)
+{
+ DISPATCH(BeginFragmentShaderATI, (), (F, "glBeginFragmentShaderATI();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindFragmentShaderATI)(GLuint id)
+{
+ DISPATCH(BindFragmentShaderATI, (id), (F, "glBindFragmentShaderATI(%d);\n", id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
+{
+ DISPATCH(ColorFragmentOp1ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod), (F, "glColorFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
+{
+ DISPATCH(ColorFragmentOp2ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glColorFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
+{
+ DISPATCH(ColorFragmentOp3ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glColorFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteFragmentShaderATI)(GLuint id)
+{
+ DISPATCH(DeleteFragmentShaderATI, (id), (F, "glDeleteFragmentShaderATI(%d);\n", id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndFragmentShaderATI)(void)
+{
+ DISPATCH(EndFragmentShaderATI, (), (F, "glEndFragmentShaderATI();\n"));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(GenFragmentShadersATI)(GLuint range)
+{
+ RETURN_DISPATCH(GenFragmentShadersATI, (range), (F, "glGenFragmentShadersATI(%d);\n", range));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle)
+{
+ DISPATCH(PassTexCoordATI, (dst, coord, swizzle), (F, "glPassTexCoordATI(%d, %d, 0x%x);\n", dst, coord, swizzle));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle)
+{
+ DISPATCH(SampleMapATI, (dst, interp, swizzle), (F, "glSampleMapATI(%d, %d, 0x%x);\n", dst, interp, swizzle));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value)
+{
+ DISPATCH(SetFragmentShaderConstantATI, (dst, value), (F, "glSetFragmentShaderConstantATI(%d, %p);\n", dst, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameteri)(GLenum pname, GLint param)
+{
+ DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteri(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameteriNV)(GLenum pname, GLint param)
+{
+ DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteriNV(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameteriv)(GLenum pname, const GLint * params)
+{
+ DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameteriv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * params)
+{
+ DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face)
+{
+ DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array)
+{
+ DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays)
+{
+ DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays)
+{
+ DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
+}
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array);
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array)
+{
+ RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params)
+{
+ DISPATCH(GetProgramNamedParameterdvNV, (id, len, name, params), (F, "glGetProgramNamedParameterdvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params)
+{
+ DISPATCH(GetProgramNamedParameterfvNV, (id, len, name, params), (F, "glGetProgramNamedParameterfvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramNamedParameter4dNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4dNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v)
+{
+ DISPATCH(ProgramNamedParameter4dvNV, (id, len, name, v), (F, "glProgramNamedParameter4dvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramNamedParameter4fNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4fNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v)
+{
+ DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax)
+{
+ DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
+{
+ DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA)
+{
+ DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer)
+{
+ DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer)
+{
+ DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target)
+{
+ RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers)
+{
+ DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers)
+{
+ DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+ DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+ DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers)
+{
+ DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers)
+{
+ DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target)
+{
+ DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer)
+{
+ RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer)
+{
+ RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
+{
+ DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+{
+ DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+{
+ DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params)
+{
+ DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params)
+{
+ DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+
+#endif /* defined( NAME ) */
+
+/*
+ * This is how a dispatch table can be initialized with all the functions
+ * we generated above.
+ */
+#ifdef DISPATCH_TABLE_NAME
+
+#ifndef TABLE_ENTRY
+#error TABLE_ENTRY must be defined
+#endif
+
+static _glapi_proc DISPATCH_TABLE_NAME[] = {
+ TABLE_ENTRY(NewList),
+ TABLE_ENTRY(EndList),
+ TABLE_ENTRY(CallList),
+ TABLE_ENTRY(CallLists),
+ TABLE_ENTRY(DeleteLists),
+ TABLE_ENTRY(GenLists),
+ TABLE_ENTRY(ListBase),
+ TABLE_ENTRY(Begin),
+ TABLE_ENTRY(Bitmap),
+ TABLE_ENTRY(Color3b),
+ TABLE_ENTRY(Color3bv),
+ TABLE_ENTRY(Color3d),
+ TABLE_ENTRY(Color3dv),
+ TABLE_ENTRY(Color3f),
+ TABLE_ENTRY(Color3fv),
+ TABLE_ENTRY(Color3i),
+ TABLE_ENTRY(Color3iv),
+ TABLE_ENTRY(Color3s),
+ TABLE_ENTRY(Color3sv),
+ TABLE_ENTRY(Color3ub),
+ TABLE_ENTRY(Color3ubv),
+ TABLE_ENTRY(Color3ui),
+ TABLE_ENTRY(Color3uiv),
+ TABLE_ENTRY(Color3us),
+ TABLE_ENTRY(Color3usv),
+ TABLE_ENTRY(Color4b),
+ TABLE_ENTRY(Color4bv),
+ TABLE_ENTRY(Color4d),
+ TABLE_ENTRY(Color4dv),
+ TABLE_ENTRY(Color4f),
+ TABLE_ENTRY(Color4fv),
+ TABLE_ENTRY(Color4i),
+ TABLE_ENTRY(Color4iv),
+ TABLE_ENTRY(Color4s),
+ TABLE_ENTRY(Color4sv),
+ TABLE_ENTRY(Color4ub),
+ TABLE_ENTRY(Color4ubv),
+ TABLE_ENTRY(Color4ui),
+ TABLE_ENTRY(Color4uiv),
+ TABLE_ENTRY(Color4us),
+ TABLE_ENTRY(Color4usv),
+ TABLE_ENTRY(EdgeFlag),
+ TABLE_ENTRY(EdgeFlagv),
+ TABLE_ENTRY(End),
+ TABLE_ENTRY(Indexd),
+ TABLE_ENTRY(Indexdv),
+ TABLE_ENTRY(Indexf),
+ TABLE_ENTRY(Indexfv),
+ TABLE_ENTRY(Indexi),
+ TABLE_ENTRY(Indexiv),
+ TABLE_ENTRY(Indexs),
+ TABLE_ENTRY(Indexsv),
+ TABLE_ENTRY(Normal3b),
+ TABLE_ENTRY(Normal3bv),
+ TABLE_ENTRY(Normal3d),
+ TABLE_ENTRY(Normal3dv),
+ TABLE_ENTRY(Normal3f),
+ TABLE_ENTRY(Normal3fv),
+ TABLE_ENTRY(Normal3i),
+ TABLE_ENTRY(Normal3iv),
+ TABLE_ENTRY(Normal3s),
+ TABLE_ENTRY(Normal3sv),
+ TABLE_ENTRY(RasterPos2d),
+ TABLE_ENTRY(RasterPos2dv),
+ TABLE_ENTRY(RasterPos2f),
+ TABLE_ENTRY(RasterPos2fv),
+ TABLE_ENTRY(RasterPos2i),
+ TABLE_ENTRY(RasterPos2iv),
+ TABLE_ENTRY(RasterPos2s),
+ TABLE_ENTRY(RasterPos2sv),
+ TABLE_ENTRY(RasterPos3d),
+ TABLE_ENTRY(RasterPos3dv),
+ TABLE_ENTRY(RasterPos3f),
+ TABLE_ENTRY(RasterPos3fv),
+ TABLE_ENTRY(RasterPos3i),
+ TABLE_ENTRY(RasterPos3iv),
+ TABLE_ENTRY(RasterPos3s),
+ TABLE_ENTRY(RasterPos3sv),
+ TABLE_ENTRY(RasterPos4d),
+ TABLE_ENTRY(RasterPos4dv),
+ TABLE_ENTRY(RasterPos4f),
+ TABLE_ENTRY(RasterPos4fv),
+ TABLE_ENTRY(RasterPos4i),
+ TABLE_ENTRY(RasterPos4iv),
+ TABLE_ENTRY(RasterPos4s),
+ TABLE_ENTRY(RasterPos4sv),
+ TABLE_ENTRY(Rectd),
+ TABLE_ENTRY(Rectdv),
+ TABLE_ENTRY(Rectf),
+ TABLE_ENTRY(Rectfv),
+ TABLE_ENTRY(Recti),
+ TABLE_ENTRY(Rectiv),
+ TABLE_ENTRY(Rects),
+ TABLE_ENTRY(Rectsv),
+ TABLE_ENTRY(TexCoord1d),
+ TABLE_ENTRY(TexCoord1dv),
+ TABLE_ENTRY(TexCoord1f),
+ TABLE_ENTRY(TexCoord1fv),
+ TABLE_ENTRY(TexCoord1i),
+ TABLE_ENTRY(TexCoord1iv),
+ TABLE_ENTRY(TexCoord1s),
+ TABLE_ENTRY(TexCoord1sv),
+ TABLE_ENTRY(TexCoord2d),
+ TABLE_ENTRY(TexCoord2dv),
+ TABLE_ENTRY(TexCoord2f),
+ TABLE_ENTRY(TexCoord2fv),
+ TABLE_ENTRY(TexCoord2i),
+ TABLE_ENTRY(TexCoord2iv),
+ TABLE_ENTRY(TexCoord2s),
+ TABLE_ENTRY(TexCoord2sv),
+ TABLE_ENTRY(TexCoord3d),
+ TABLE_ENTRY(TexCoord3dv),
+ TABLE_ENTRY(TexCoord3f),
+ TABLE_ENTRY(TexCoord3fv),
+ TABLE_ENTRY(TexCoord3i),
+ TABLE_ENTRY(TexCoord3iv),
+ TABLE_ENTRY(TexCoord3s),
+ TABLE_ENTRY(TexCoord3sv),
+ TABLE_ENTRY(TexCoord4d),
+ TABLE_ENTRY(TexCoord4dv),
+ TABLE_ENTRY(TexCoord4f),
+ TABLE_ENTRY(TexCoord4fv),
+ TABLE_ENTRY(TexCoord4i),
+ TABLE_ENTRY(TexCoord4iv),
+ TABLE_ENTRY(TexCoord4s),
+ TABLE_ENTRY(TexCoord4sv),
+ TABLE_ENTRY(Vertex2d),
+ TABLE_ENTRY(Vertex2dv),
+ TABLE_ENTRY(Vertex2f),
+ TABLE_ENTRY(Vertex2fv),
+ TABLE_ENTRY(Vertex2i),
+ TABLE_ENTRY(Vertex2iv),
+ TABLE_ENTRY(Vertex2s),
+ TABLE_ENTRY(Vertex2sv),
+ TABLE_ENTRY(Vertex3d),
+ TABLE_ENTRY(Vertex3dv),
+ TABLE_ENTRY(Vertex3f),
+ TABLE_ENTRY(Vertex3fv),
+ TABLE_ENTRY(Vertex3i),
+ TABLE_ENTRY(Vertex3iv),
+ TABLE_ENTRY(Vertex3s),
+ TABLE_ENTRY(Vertex3sv),
+ TABLE_ENTRY(Vertex4d),
+ TABLE_ENTRY(Vertex4dv),
+ TABLE_ENTRY(Vertex4f),
+ TABLE_ENTRY(Vertex4fv),
+ TABLE_ENTRY(Vertex4i),
+ TABLE_ENTRY(Vertex4iv),
+ TABLE_ENTRY(Vertex4s),
+ TABLE_ENTRY(Vertex4sv),
+ TABLE_ENTRY(ClipPlane),
+ TABLE_ENTRY(ColorMaterial),
+ TABLE_ENTRY(CullFace),
+ TABLE_ENTRY(Fogf),
+ TABLE_ENTRY(Fogfv),
+ TABLE_ENTRY(Fogi),
+ TABLE_ENTRY(Fogiv),
+ TABLE_ENTRY(FrontFace),
+ TABLE_ENTRY(Hint),
+ TABLE_ENTRY(Lightf),
+ TABLE_ENTRY(Lightfv),
+ TABLE_ENTRY(Lighti),
+ TABLE_ENTRY(Lightiv),
+ TABLE_ENTRY(LightModelf),
+ TABLE_ENTRY(LightModelfv),
+ TABLE_ENTRY(LightModeli),
+ TABLE_ENTRY(LightModeliv),
+ TABLE_ENTRY(LineStipple),
+ TABLE_ENTRY(LineWidth),
+ TABLE_ENTRY(Materialf),
+ TABLE_ENTRY(Materialfv),
+ TABLE_ENTRY(Materiali),
+ TABLE_ENTRY(Materialiv),
+ TABLE_ENTRY(PointSize),
+ TABLE_ENTRY(PolygonMode),
+ TABLE_ENTRY(PolygonStipple),
+ TABLE_ENTRY(Scissor),
+ TABLE_ENTRY(ShadeModel),
+ TABLE_ENTRY(TexParameterf),
+ TABLE_ENTRY(TexParameterfv),
+ TABLE_ENTRY(TexParameteri),
+ TABLE_ENTRY(TexParameteriv),
+ TABLE_ENTRY(TexImage1D),
+ TABLE_ENTRY(TexImage2D),
+ TABLE_ENTRY(TexEnvf),
+ TABLE_ENTRY(TexEnvfv),
+ TABLE_ENTRY(TexEnvi),
+ TABLE_ENTRY(TexEnviv),
+ TABLE_ENTRY(TexGend),
+ TABLE_ENTRY(TexGendv),
+ TABLE_ENTRY(TexGenf),
+ TABLE_ENTRY(TexGenfv),
+ TABLE_ENTRY(TexGeni),
+ TABLE_ENTRY(TexGeniv),
+ TABLE_ENTRY(FeedbackBuffer),
+ TABLE_ENTRY(SelectBuffer),
+ TABLE_ENTRY(RenderMode),
+ TABLE_ENTRY(InitNames),
+ TABLE_ENTRY(LoadName),
+ TABLE_ENTRY(PassThrough),
+ TABLE_ENTRY(PopName),
+ TABLE_ENTRY(PushName),
+ TABLE_ENTRY(DrawBuffer),
+ TABLE_ENTRY(Clear),
+ TABLE_ENTRY(ClearAccum),
+ TABLE_ENTRY(ClearIndex),
+ TABLE_ENTRY(ClearColor),
+ TABLE_ENTRY(ClearStencil),
+ TABLE_ENTRY(ClearDepth),
+ TABLE_ENTRY(StencilMask),
+ TABLE_ENTRY(ColorMask),
+ TABLE_ENTRY(DepthMask),
+ TABLE_ENTRY(IndexMask),
+ TABLE_ENTRY(Accum),
+ TABLE_ENTRY(Disable),
+ TABLE_ENTRY(Enable),
+ TABLE_ENTRY(Finish),
+ TABLE_ENTRY(Flush),
+ TABLE_ENTRY(PopAttrib),
+ TABLE_ENTRY(PushAttrib),
+ TABLE_ENTRY(Map1d),
+ TABLE_ENTRY(Map1f),
+ TABLE_ENTRY(Map2d),
+ TABLE_ENTRY(Map2f),
+ TABLE_ENTRY(MapGrid1d),
+ TABLE_ENTRY(MapGrid1f),
+ TABLE_ENTRY(MapGrid2d),
+ TABLE_ENTRY(MapGrid2f),
+ TABLE_ENTRY(EvalCoord1d),
+ TABLE_ENTRY(EvalCoord1dv),
+ TABLE_ENTRY(EvalCoord1f),
+ TABLE_ENTRY(EvalCoord1fv),
+ TABLE_ENTRY(EvalCoord2d),
+ TABLE_ENTRY(EvalCoord2dv),
+ TABLE_ENTRY(EvalCoord2f),
+ TABLE_ENTRY(EvalCoord2fv),
+ TABLE_ENTRY(EvalMesh1),
+ TABLE_ENTRY(EvalPoint1),
+ TABLE_ENTRY(EvalMesh2),
+ TABLE_ENTRY(EvalPoint2),
+ TABLE_ENTRY(AlphaFunc),
+ TABLE_ENTRY(BlendFunc),
+ TABLE_ENTRY(LogicOp),
+ TABLE_ENTRY(StencilFunc),
+ TABLE_ENTRY(StencilOp),
+ TABLE_ENTRY(DepthFunc),
+ TABLE_ENTRY(PixelZoom),
+ TABLE_ENTRY(PixelTransferf),
+ TABLE_ENTRY(PixelTransferi),
+ TABLE_ENTRY(PixelStoref),
+ TABLE_ENTRY(PixelStorei),
+ TABLE_ENTRY(PixelMapfv),
+ TABLE_ENTRY(PixelMapuiv),
+ TABLE_ENTRY(PixelMapusv),
+ TABLE_ENTRY(ReadBuffer),
+ TABLE_ENTRY(CopyPixels),
+ TABLE_ENTRY(ReadPixels),
+ TABLE_ENTRY(DrawPixels),
+ TABLE_ENTRY(GetBooleanv),
+ TABLE_ENTRY(GetClipPlane),
+ TABLE_ENTRY(GetDoublev),
+ TABLE_ENTRY(GetError),
+ TABLE_ENTRY(GetFloatv),
+ TABLE_ENTRY(GetIntegerv),
+ TABLE_ENTRY(GetLightfv),
+ TABLE_ENTRY(GetLightiv),
+ TABLE_ENTRY(GetMapdv),
+ TABLE_ENTRY(GetMapfv),
+ TABLE_ENTRY(GetMapiv),
+ TABLE_ENTRY(GetMaterialfv),
+ TABLE_ENTRY(GetMaterialiv),
+ TABLE_ENTRY(GetPixelMapfv),
+ TABLE_ENTRY(GetPixelMapuiv),
+ TABLE_ENTRY(GetPixelMapusv),
+ TABLE_ENTRY(GetPolygonStipple),
+ TABLE_ENTRY(GetString),
+ TABLE_ENTRY(GetTexEnvfv),
+ TABLE_ENTRY(GetTexEnviv),
+ TABLE_ENTRY(GetTexGendv),
+ TABLE_ENTRY(GetTexGenfv),
+ TABLE_ENTRY(GetTexGeniv),
+ TABLE_ENTRY(GetTexImage),
+ TABLE_ENTRY(GetTexParameterfv),
+ TABLE_ENTRY(GetTexParameteriv),
+ TABLE_ENTRY(GetTexLevelParameterfv),
+ TABLE_ENTRY(GetTexLevelParameteriv),
+ TABLE_ENTRY(IsEnabled),
+ TABLE_ENTRY(IsList),
+ TABLE_ENTRY(DepthRange),
+ TABLE_ENTRY(Frustum),
+ TABLE_ENTRY(LoadIdentity),
+ TABLE_ENTRY(LoadMatrixf),
+ TABLE_ENTRY(LoadMatrixd),
+ TABLE_ENTRY(MatrixMode),
+ TABLE_ENTRY(MultMatrixf),
+ TABLE_ENTRY(MultMatrixd),
+ TABLE_ENTRY(Ortho),
+ TABLE_ENTRY(PopMatrix),
+ TABLE_ENTRY(PushMatrix),
+ TABLE_ENTRY(Rotated),
+ TABLE_ENTRY(Rotatef),
+ TABLE_ENTRY(Scaled),
+ TABLE_ENTRY(Scalef),
+ TABLE_ENTRY(Translated),
+ TABLE_ENTRY(Translatef),
+ TABLE_ENTRY(Viewport),
+ TABLE_ENTRY(ArrayElement),
+ TABLE_ENTRY(BindTexture),
+ TABLE_ENTRY(ColorPointer),
+ TABLE_ENTRY(DisableClientState),
+ TABLE_ENTRY(DrawArrays),
+ TABLE_ENTRY(DrawElements),
+ TABLE_ENTRY(EdgeFlagPointer),
+ TABLE_ENTRY(EnableClientState),
+ TABLE_ENTRY(IndexPointer),
+ TABLE_ENTRY(Indexub),
+ TABLE_ENTRY(Indexubv),
+ TABLE_ENTRY(InterleavedArrays),
+ TABLE_ENTRY(NormalPointer),
+ TABLE_ENTRY(PolygonOffset),
+ TABLE_ENTRY(TexCoordPointer),
+ TABLE_ENTRY(VertexPointer),
+ TABLE_ENTRY(AreTexturesResident),
+ TABLE_ENTRY(CopyTexImage1D),
+ TABLE_ENTRY(CopyTexImage2D),
+ TABLE_ENTRY(CopyTexSubImage1D),
+ TABLE_ENTRY(CopyTexSubImage2D),
+ TABLE_ENTRY(DeleteTextures),
+ TABLE_ENTRY(GenTextures),
+ TABLE_ENTRY(GetPointerv),
+ TABLE_ENTRY(IsTexture),
+ TABLE_ENTRY(PrioritizeTextures),
+ TABLE_ENTRY(TexSubImage1D),
+ TABLE_ENTRY(TexSubImage2D),
+ TABLE_ENTRY(PopClientAttrib),
+ TABLE_ENTRY(PushClientAttrib),
+ TABLE_ENTRY(BlendColor),
+ TABLE_ENTRY(BlendEquation),
+ TABLE_ENTRY(DrawRangeElements),
+ TABLE_ENTRY(ColorTable),
+ TABLE_ENTRY(ColorTableParameterfv),
+ TABLE_ENTRY(ColorTableParameteriv),
+ TABLE_ENTRY(CopyColorTable),
+ TABLE_ENTRY(GetColorTable),
+ TABLE_ENTRY(GetColorTableParameterfv),
+ TABLE_ENTRY(GetColorTableParameteriv),
+ TABLE_ENTRY(ColorSubTable),
+ TABLE_ENTRY(CopyColorSubTable),
+ TABLE_ENTRY(ConvolutionFilter1D),
+ TABLE_ENTRY(ConvolutionFilter2D),
+ TABLE_ENTRY(ConvolutionParameterf),
+ TABLE_ENTRY(ConvolutionParameterfv),
+ TABLE_ENTRY(ConvolutionParameteri),
+ TABLE_ENTRY(ConvolutionParameteriv),
+ TABLE_ENTRY(CopyConvolutionFilter1D),
+ TABLE_ENTRY(CopyConvolutionFilter2D),
+ TABLE_ENTRY(GetConvolutionFilter),
+ TABLE_ENTRY(GetConvolutionParameterfv),
+ TABLE_ENTRY(GetConvolutionParameteriv),
+ TABLE_ENTRY(GetSeparableFilter),
+ TABLE_ENTRY(SeparableFilter2D),
+ TABLE_ENTRY(GetHistogram),
+ TABLE_ENTRY(GetHistogramParameterfv),
+ TABLE_ENTRY(GetHistogramParameteriv),
+ TABLE_ENTRY(GetMinmax),
+ TABLE_ENTRY(GetMinmaxParameterfv),
+ TABLE_ENTRY(GetMinmaxParameteriv),
+ TABLE_ENTRY(Histogram),
+ TABLE_ENTRY(Minmax),
+ TABLE_ENTRY(ResetHistogram),
+ TABLE_ENTRY(ResetMinmax),
+ TABLE_ENTRY(TexImage3D),
+ TABLE_ENTRY(TexSubImage3D),
+ TABLE_ENTRY(CopyTexSubImage3D),
+ TABLE_ENTRY(ActiveTextureARB),
+ TABLE_ENTRY(ClientActiveTextureARB),
+ TABLE_ENTRY(MultiTexCoord1dARB),
+ TABLE_ENTRY(MultiTexCoord1dvARB),
+ TABLE_ENTRY(MultiTexCoord1fARB),
+ TABLE_ENTRY(MultiTexCoord1fvARB),
+ TABLE_ENTRY(MultiTexCoord1iARB),
+ TABLE_ENTRY(MultiTexCoord1ivARB),
+ TABLE_ENTRY(MultiTexCoord1sARB),
+ TABLE_ENTRY(MultiTexCoord1svARB),
+ TABLE_ENTRY(MultiTexCoord2dARB),
+ TABLE_ENTRY(MultiTexCoord2dvARB),
+ TABLE_ENTRY(MultiTexCoord2fARB),
+ TABLE_ENTRY(MultiTexCoord2fvARB),
+ TABLE_ENTRY(MultiTexCoord2iARB),
+ TABLE_ENTRY(MultiTexCoord2ivARB),
+ TABLE_ENTRY(MultiTexCoord2sARB),
+ TABLE_ENTRY(MultiTexCoord2svARB),
+ TABLE_ENTRY(MultiTexCoord3dARB),
+ TABLE_ENTRY(MultiTexCoord3dvARB),
+ TABLE_ENTRY(MultiTexCoord3fARB),
+ TABLE_ENTRY(MultiTexCoord3fvARB),
+ TABLE_ENTRY(MultiTexCoord3iARB),
+ TABLE_ENTRY(MultiTexCoord3ivARB),
+ TABLE_ENTRY(MultiTexCoord3sARB),
+ TABLE_ENTRY(MultiTexCoord3svARB),
+ TABLE_ENTRY(MultiTexCoord4dARB),
+ TABLE_ENTRY(MultiTexCoord4dvARB),
+ TABLE_ENTRY(MultiTexCoord4fARB),
+ TABLE_ENTRY(MultiTexCoord4fvARB),
+ TABLE_ENTRY(MultiTexCoord4iARB),
+ TABLE_ENTRY(MultiTexCoord4ivARB),
+ TABLE_ENTRY(MultiTexCoord4sARB),
+ TABLE_ENTRY(MultiTexCoord4svARB),
+ TABLE_ENTRY(AttachShader),
+ TABLE_ENTRY(CreateProgram),
+ TABLE_ENTRY(CreateShader),
+ TABLE_ENTRY(DeleteProgram),
+ TABLE_ENTRY(DeleteShader),
+ TABLE_ENTRY(DetachShader),
+ TABLE_ENTRY(GetAttachedShaders),
+ TABLE_ENTRY(GetProgramInfoLog),
+ TABLE_ENTRY(GetProgramiv),
+ TABLE_ENTRY(GetShaderInfoLog),
+ TABLE_ENTRY(GetShaderiv),
+ TABLE_ENTRY(IsProgram),
+ TABLE_ENTRY(IsShader),
+ TABLE_ENTRY(StencilFuncSeparate),
+ TABLE_ENTRY(StencilMaskSeparate),
+ TABLE_ENTRY(StencilOpSeparate),
+ TABLE_ENTRY(UniformMatrix2x3fv),
+ TABLE_ENTRY(UniformMatrix2x4fv),
+ TABLE_ENTRY(UniformMatrix3x2fv),
+ TABLE_ENTRY(UniformMatrix3x4fv),
+ TABLE_ENTRY(UniformMatrix4x2fv),
+ TABLE_ENTRY(UniformMatrix4x3fv),
+ TABLE_ENTRY(LoadTransposeMatrixdARB),
+ TABLE_ENTRY(LoadTransposeMatrixfARB),
+ TABLE_ENTRY(MultTransposeMatrixdARB),
+ TABLE_ENTRY(MultTransposeMatrixfARB),
+ TABLE_ENTRY(SampleCoverageARB),
+ TABLE_ENTRY(CompressedTexImage1DARB),
+ TABLE_ENTRY(CompressedTexImage2DARB),
+ TABLE_ENTRY(CompressedTexImage3DARB),
+ TABLE_ENTRY(CompressedTexSubImage1DARB),
+ TABLE_ENTRY(CompressedTexSubImage2DARB),
+ TABLE_ENTRY(CompressedTexSubImage3DARB),
+ TABLE_ENTRY(GetCompressedTexImageARB),
+ TABLE_ENTRY(DisableVertexAttribArrayARB),
+ TABLE_ENTRY(EnableVertexAttribArrayARB),
+ TABLE_ENTRY(GetProgramEnvParameterdvARB),
+ TABLE_ENTRY(GetProgramEnvParameterfvARB),
+ TABLE_ENTRY(GetProgramLocalParameterdvARB),
+ TABLE_ENTRY(GetProgramLocalParameterfvARB),
+ TABLE_ENTRY(GetProgramStringARB),
+ TABLE_ENTRY(GetProgramivARB),
+ TABLE_ENTRY(GetVertexAttribdvARB),
+ TABLE_ENTRY(GetVertexAttribfvARB),
+ TABLE_ENTRY(GetVertexAttribivARB),
+ TABLE_ENTRY(ProgramEnvParameter4dARB),
+ TABLE_ENTRY(ProgramEnvParameter4dvARB),
+ TABLE_ENTRY(ProgramEnvParameter4fARB),
+ TABLE_ENTRY(ProgramEnvParameter4fvARB),
+ TABLE_ENTRY(ProgramLocalParameter4dARB),
+ TABLE_ENTRY(ProgramLocalParameter4dvARB),
+ TABLE_ENTRY(ProgramLocalParameter4fARB),
+ TABLE_ENTRY(ProgramLocalParameter4fvARB),
+ TABLE_ENTRY(ProgramStringARB),
+ TABLE_ENTRY(VertexAttrib1dARB),
+ TABLE_ENTRY(VertexAttrib1dvARB),
+ TABLE_ENTRY(VertexAttrib1fARB),
+ TABLE_ENTRY(VertexAttrib1fvARB),
+ TABLE_ENTRY(VertexAttrib1sARB),
+ TABLE_ENTRY(VertexAttrib1svARB),
+ TABLE_ENTRY(VertexAttrib2dARB),
+ TABLE_ENTRY(VertexAttrib2dvARB),
+ TABLE_ENTRY(VertexAttrib2fARB),
+ TABLE_ENTRY(VertexAttrib2fvARB),
+ TABLE_ENTRY(VertexAttrib2sARB),
+ TABLE_ENTRY(VertexAttrib2svARB),
+ TABLE_ENTRY(VertexAttrib3dARB),
+ TABLE_ENTRY(VertexAttrib3dvARB),
+ TABLE_ENTRY(VertexAttrib3fARB),
+ TABLE_ENTRY(VertexAttrib3fvARB),
+ TABLE_ENTRY(VertexAttrib3sARB),
+ TABLE_ENTRY(VertexAttrib3svARB),
+ TABLE_ENTRY(VertexAttrib4NbvARB),
+ TABLE_ENTRY(VertexAttrib4NivARB),
+ TABLE_ENTRY(VertexAttrib4NsvARB),
+ TABLE_ENTRY(VertexAttrib4NubARB),
+ TABLE_ENTRY(VertexAttrib4NubvARB),
+ TABLE_ENTRY(VertexAttrib4NuivARB),
+ TABLE_ENTRY(VertexAttrib4NusvARB),
+ TABLE_ENTRY(VertexAttrib4bvARB),
+ TABLE_ENTRY(VertexAttrib4dARB),
+ TABLE_ENTRY(VertexAttrib4dvARB),
+ TABLE_ENTRY(VertexAttrib4fARB),
+ TABLE_ENTRY(VertexAttrib4fvARB),
+ TABLE_ENTRY(VertexAttrib4ivARB),
+ TABLE_ENTRY(VertexAttrib4sARB),
+ TABLE_ENTRY(VertexAttrib4svARB),
+ TABLE_ENTRY(VertexAttrib4ubvARB),
+ TABLE_ENTRY(VertexAttrib4uivARB),
+ TABLE_ENTRY(VertexAttrib4usvARB),
+ TABLE_ENTRY(VertexAttribPointerARB),
+ TABLE_ENTRY(BindBufferARB),
+ TABLE_ENTRY(BufferDataARB),
+ TABLE_ENTRY(BufferSubDataARB),
+ TABLE_ENTRY(DeleteBuffersARB),
+ TABLE_ENTRY(GenBuffersARB),
+ TABLE_ENTRY(GetBufferParameterivARB),
+ TABLE_ENTRY(GetBufferPointervARB),
+ TABLE_ENTRY(GetBufferSubDataARB),
+ TABLE_ENTRY(IsBufferARB),
+ TABLE_ENTRY(MapBufferARB),
+ TABLE_ENTRY(UnmapBufferARB),
+ TABLE_ENTRY(BeginQueryARB),
+ TABLE_ENTRY(DeleteQueriesARB),
+ TABLE_ENTRY(EndQueryARB),
+ TABLE_ENTRY(GenQueriesARB),
+ TABLE_ENTRY(GetQueryObjectivARB),
+ TABLE_ENTRY(GetQueryObjectuivARB),
+ TABLE_ENTRY(GetQueryivARB),
+ TABLE_ENTRY(IsQueryARB),
+ TABLE_ENTRY(AttachObjectARB),
+ TABLE_ENTRY(CompileShaderARB),
+ TABLE_ENTRY(CreateProgramObjectARB),
+ TABLE_ENTRY(CreateShaderObjectARB),
+ TABLE_ENTRY(DeleteObjectARB),
+ TABLE_ENTRY(DetachObjectARB),
+ TABLE_ENTRY(GetActiveUniformARB),
+ TABLE_ENTRY(GetAttachedObjectsARB),
+ TABLE_ENTRY(GetHandleARB),
+ TABLE_ENTRY(GetInfoLogARB),
+ TABLE_ENTRY(GetObjectParameterfvARB),
+ TABLE_ENTRY(GetObjectParameterivARB),
+ TABLE_ENTRY(GetShaderSourceARB),
+ TABLE_ENTRY(GetUniformLocationARB),
+ TABLE_ENTRY(GetUniformfvARB),
+ TABLE_ENTRY(GetUniformivARB),
+ TABLE_ENTRY(LinkProgramARB),
+ TABLE_ENTRY(ShaderSourceARB),
+ TABLE_ENTRY(Uniform1fARB),
+ TABLE_ENTRY(Uniform1fvARB),
+ TABLE_ENTRY(Uniform1iARB),
+ TABLE_ENTRY(Uniform1ivARB),
+ TABLE_ENTRY(Uniform2fARB),
+ TABLE_ENTRY(Uniform2fvARB),
+ TABLE_ENTRY(Uniform2iARB),
+ TABLE_ENTRY(Uniform2ivARB),
+ TABLE_ENTRY(Uniform3fARB),
+ TABLE_ENTRY(Uniform3fvARB),
+ TABLE_ENTRY(Uniform3iARB),
+ TABLE_ENTRY(Uniform3ivARB),
+ TABLE_ENTRY(Uniform4fARB),
+ TABLE_ENTRY(Uniform4fvARB),
+ TABLE_ENTRY(Uniform4iARB),
+ TABLE_ENTRY(Uniform4ivARB),
+ TABLE_ENTRY(UniformMatrix2fvARB),
+ TABLE_ENTRY(UniformMatrix3fvARB),
+ TABLE_ENTRY(UniformMatrix4fvARB),
+ TABLE_ENTRY(UseProgramObjectARB),
+ TABLE_ENTRY(ValidateProgramARB),
+ TABLE_ENTRY(BindAttribLocationARB),
+ TABLE_ENTRY(GetActiveAttribARB),
+ TABLE_ENTRY(GetAttribLocationARB),
+ TABLE_ENTRY(DrawBuffersARB),
+ TABLE_ENTRY(PolygonOffsetEXT),
+ TABLE_ENTRY(_dispatch_stub_562),
+ TABLE_ENTRY(_dispatch_stub_563),
+ TABLE_ENTRY(_dispatch_stub_564),
+ TABLE_ENTRY(_dispatch_stub_565),
+ TABLE_ENTRY(_dispatch_stub_566),
+ TABLE_ENTRY(_dispatch_stub_567),
+ TABLE_ENTRY(_dispatch_stub_568),
+ TABLE_ENTRY(_dispatch_stub_569),
+ TABLE_ENTRY(ColorPointerEXT),
+ TABLE_ENTRY(EdgeFlagPointerEXT),
+ TABLE_ENTRY(IndexPointerEXT),
+ TABLE_ENTRY(NormalPointerEXT),
+ TABLE_ENTRY(TexCoordPointerEXT),
+ TABLE_ENTRY(VertexPointerEXT),
+ TABLE_ENTRY(PointParameterfEXT),
+ TABLE_ENTRY(PointParameterfvEXT),
+ TABLE_ENTRY(LockArraysEXT),
+ TABLE_ENTRY(UnlockArraysEXT),
+ TABLE_ENTRY(_dispatch_stub_580),
+ TABLE_ENTRY(_dispatch_stub_581),
+ TABLE_ENTRY(SecondaryColor3bEXT),
+ TABLE_ENTRY(SecondaryColor3bvEXT),
+ TABLE_ENTRY(SecondaryColor3dEXT),
+ TABLE_ENTRY(SecondaryColor3dvEXT),
+ TABLE_ENTRY(SecondaryColor3fEXT),
+ TABLE_ENTRY(SecondaryColor3fvEXT),
+ TABLE_ENTRY(SecondaryColor3iEXT),
+ TABLE_ENTRY(SecondaryColor3ivEXT),
+ TABLE_ENTRY(SecondaryColor3sEXT),
+ TABLE_ENTRY(SecondaryColor3svEXT),
+ TABLE_ENTRY(SecondaryColor3ubEXT),
+ TABLE_ENTRY(SecondaryColor3ubvEXT),
+ TABLE_ENTRY(SecondaryColor3uiEXT),
+ TABLE_ENTRY(SecondaryColor3uivEXT),
+ TABLE_ENTRY(SecondaryColor3usEXT),
+ TABLE_ENTRY(SecondaryColor3usvEXT),
+ TABLE_ENTRY(SecondaryColorPointerEXT),
+ TABLE_ENTRY(MultiDrawArraysEXT),
+ TABLE_ENTRY(MultiDrawElementsEXT),
+ TABLE_ENTRY(FogCoordPointerEXT),
+ TABLE_ENTRY(FogCoorddEXT),
+ TABLE_ENTRY(FogCoorddvEXT),
+ TABLE_ENTRY(FogCoordfEXT),
+ TABLE_ENTRY(FogCoordfvEXT),
+ TABLE_ENTRY(_dispatch_stub_606),
+ TABLE_ENTRY(BlendFuncSeparateEXT),
+ TABLE_ENTRY(FlushVertexArrayRangeNV),
+ TABLE_ENTRY(VertexArrayRangeNV),
+ TABLE_ENTRY(CombinerInputNV),
+ TABLE_ENTRY(CombinerOutputNV),
+ TABLE_ENTRY(CombinerParameterfNV),
+ TABLE_ENTRY(CombinerParameterfvNV),
+ TABLE_ENTRY(CombinerParameteriNV),
+ TABLE_ENTRY(CombinerParameterivNV),
+ TABLE_ENTRY(FinalCombinerInputNV),
+ TABLE_ENTRY(GetCombinerInputParameterfvNV),
+ TABLE_ENTRY(GetCombinerInputParameterivNV),
+ TABLE_ENTRY(GetCombinerOutputParameterfvNV),
+ TABLE_ENTRY(GetCombinerOutputParameterivNV),
+ TABLE_ENTRY(GetFinalCombinerInputParameterfvNV),
+ TABLE_ENTRY(GetFinalCombinerInputParameterivNV),
+ TABLE_ENTRY(ResizeBuffersMESA),
+ TABLE_ENTRY(WindowPos2dMESA),
+ TABLE_ENTRY(WindowPos2dvMESA),
+ TABLE_ENTRY(WindowPos2fMESA),
+ TABLE_ENTRY(WindowPos2fvMESA),
+ TABLE_ENTRY(WindowPos2iMESA),
+ TABLE_ENTRY(WindowPos2ivMESA),
+ TABLE_ENTRY(WindowPos2sMESA),
+ TABLE_ENTRY(WindowPos2svMESA),
+ TABLE_ENTRY(WindowPos3dMESA),
+ TABLE_ENTRY(WindowPos3dvMESA),
+ TABLE_ENTRY(WindowPos3fMESA),
+ TABLE_ENTRY(WindowPos3fvMESA),
+ TABLE_ENTRY(WindowPos3iMESA),
+ TABLE_ENTRY(WindowPos3ivMESA),
+ TABLE_ENTRY(WindowPos3sMESA),
+ TABLE_ENTRY(WindowPos3svMESA),
+ TABLE_ENTRY(WindowPos4dMESA),
+ TABLE_ENTRY(WindowPos4dvMESA),
+ TABLE_ENTRY(WindowPos4fMESA),
+ TABLE_ENTRY(WindowPos4fvMESA),
+ TABLE_ENTRY(WindowPos4iMESA),
+ TABLE_ENTRY(WindowPos4ivMESA),
+ TABLE_ENTRY(WindowPos4sMESA),
+ TABLE_ENTRY(WindowPos4svMESA),
+ TABLE_ENTRY(_dispatch_stub_648),
+ TABLE_ENTRY(_dispatch_stub_649),
+ TABLE_ENTRY(_dispatch_stub_650),
+ TABLE_ENTRY(_dispatch_stub_651),
+ TABLE_ENTRY(_dispatch_stub_652),
+ TABLE_ENTRY(_dispatch_stub_653),
+ TABLE_ENTRY(_dispatch_stub_654),
+ TABLE_ENTRY(_dispatch_stub_655),
+ TABLE_ENTRY(_dispatch_stub_656),
+ TABLE_ENTRY(AreProgramsResidentNV),
+ TABLE_ENTRY(BindProgramNV),
+ TABLE_ENTRY(DeleteProgramsNV),
+ TABLE_ENTRY(ExecuteProgramNV),
+ TABLE_ENTRY(GenProgramsNV),
+ TABLE_ENTRY(GetProgramParameterdvNV),
+ TABLE_ENTRY(GetProgramParameterfvNV),
+ TABLE_ENTRY(GetProgramStringNV),
+ TABLE_ENTRY(GetProgramivNV),
+ TABLE_ENTRY(GetTrackMatrixivNV),
+ TABLE_ENTRY(GetVertexAttribPointervNV),
+ TABLE_ENTRY(GetVertexAttribdvNV),
+ TABLE_ENTRY(GetVertexAttribfvNV),
+ TABLE_ENTRY(GetVertexAttribivNV),
+ TABLE_ENTRY(IsProgramNV),
+ TABLE_ENTRY(LoadProgramNV),
+ TABLE_ENTRY(ProgramParameters4dvNV),
+ TABLE_ENTRY(ProgramParameters4fvNV),
+ TABLE_ENTRY(RequestResidentProgramsNV),
+ TABLE_ENTRY(TrackMatrixNV),
+ TABLE_ENTRY(VertexAttrib1dNV),
+ TABLE_ENTRY(VertexAttrib1dvNV),
+ TABLE_ENTRY(VertexAttrib1fNV),
+ TABLE_ENTRY(VertexAttrib1fvNV),
+ TABLE_ENTRY(VertexAttrib1sNV),
+ TABLE_ENTRY(VertexAttrib1svNV),
+ TABLE_ENTRY(VertexAttrib2dNV),
+ TABLE_ENTRY(VertexAttrib2dvNV),
+ TABLE_ENTRY(VertexAttrib2fNV),
+ TABLE_ENTRY(VertexAttrib2fvNV),
+ TABLE_ENTRY(VertexAttrib2sNV),
+ TABLE_ENTRY(VertexAttrib2svNV),
+ TABLE_ENTRY(VertexAttrib3dNV),
+ TABLE_ENTRY(VertexAttrib3dvNV),
+ TABLE_ENTRY(VertexAttrib3fNV),
+ TABLE_ENTRY(VertexAttrib3fvNV),
+ TABLE_ENTRY(VertexAttrib3sNV),
+ TABLE_ENTRY(VertexAttrib3svNV),
+ TABLE_ENTRY(VertexAttrib4dNV),
+ TABLE_ENTRY(VertexAttrib4dvNV),
+ TABLE_ENTRY(VertexAttrib4fNV),
+ TABLE_ENTRY(VertexAttrib4fvNV),
+ TABLE_ENTRY(VertexAttrib4sNV),
+ TABLE_ENTRY(VertexAttrib4svNV),
+ TABLE_ENTRY(VertexAttrib4ubNV),
+ TABLE_ENTRY(VertexAttrib4ubvNV),
+ TABLE_ENTRY(VertexAttribPointerNV),
+ TABLE_ENTRY(VertexAttribs1dvNV),
+ TABLE_ENTRY(VertexAttribs1fvNV),
+ TABLE_ENTRY(VertexAttribs1svNV),
+ TABLE_ENTRY(VertexAttribs2dvNV),
+ TABLE_ENTRY(VertexAttribs2fvNV),
+ TABLE_ENTRY(VertexAttribs2svNV),
+ TABLE_ENTRY(VertexAttribs3dvNV),
+ TABLE_ENTRY(VertexAttribs3fvNV),
+ TABLE_ENTRY(VertexAttribs3svNV),
+ TABLE_ENTRY(VertexAttribs4dvNV),
+ TABLE_ENTRY(VertexAttribs4fvNV),
+ TABLE_ENTRY(VertexAttribs4svNV),
+ TABLE_ENTRY(VertexAttribs4ubvNV),
+ TABLE_ENTRY(AlphaFragmentOp1ATI),
+ TABLE_ENTRY(AlphaFragmentOp2ATI),
+ TABLE_ENTRY(AlphaFragmentOp3ATI),
+ TABLE_ENTRY(BeginFragmentShaderATI),
+ TABLE_ENTRY(BindFragmentShaderATI),
+ TABLE_ENTRY(ColorFragmentOp1ATI),
+ TABLE_ENTRY(ColorFragmentOp2ATI),
+ TABLE_ENTRY(ColorFragmentOp3ATI),
+ TABLE_ENTRY(DeleteFragmentShaderATI),
+ TABLE_ENTRY(EndFragmentShaderATI),
+ TABLE_ENTRY(GenFragmentShadersATI),
+ TABLE_ENTRY(PassTexCoordATI),
+ TABLE_ENTRY(SampleMapATI),
+ TABLE_ENTRY(SetFragmentShaderConstantATI),
+ TABLE_ENTRY(PointParameteriNV),
+ TABLE_ENTRY(PointParameterivNV),
+ TABLE_ENTRY(_dispatch_stub_733),
+ TABLE_ENTRY(_dispatch_stub_734),
+ TABLE_ENTRY(_dispatch_stub_735),
+ TABLE_ENTRY(_dispatch_stub_736),
+ TABLE_ENTRY(_dispatch_stub_737),
+ TABLE_ENTRY(GetProgramNamedParameterdvNV),
+ TABLE_ENTRY(GetProgramNamedParameterfvNV),
+ TABLE_ENTRY(ProgramNamedParameter4dNV),
+ TABLE_ENTRY(ProgramNamedParameter4dvNV),
+ TABLE_ENTRY(ProgramNamedParameter4fNV),
+ TABLE_ENTRY(ProgramNamedParameter4fvNV),
+ TABLE_ENTRY(_dispatch_stub_744),
+ TABLE_ENTRY(_dispatch_stub_745),
+ TABLE_ENTRY(BindFramebufferEXT),
+ TABLE_ENTRY(BindRenderbufferEXT),
+ TABLE_ENTRY(CheckFramebufferStatusEXT),
+ TABLE_ENTRY(DeleteFramebuffersEXT),
+ TABLE_ENTRY(DeleteRenderbuffersEXT),
+ TABLE_ENTRY(FramebufferRenderbufferEXT),
+ TABLE_ENTRY(FramebufferTexture1DEXT),
+ TABLE_ENTRY(FramebufferTexture2DEXT),
+ TABLE_ENTRY(FramebufferTexture3DEXT),
+ TABLE_ENTRY(GenFramebuffersEXT),
+ TABLE_ENTRY(GenRenderbuffersEXT),
+ TABLE_ENTRY(GenerateMipmapEXT),
+ TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT),
+ TABLE_ENTRY(GetRenderbufferParameterivEXT),
+ TABLE_ENTRY(IsFramebufferEXT),
+ TABLE_ENTRY(IsRenderbufferEXT),
+ TABLE_ENTRY(RenderbufferStorageEXT),
+ TABLE_ENTRY(_dispatch_stub_763),
+ TABLE_ENTRY(FramebufferTextureLayerEXT),
+ TABLE_ENTRY(_dispatch_stub_765),
+ TABLE_ENTRY(_dispatch_stub_766),
+ TABLE_ENTRY(_dispatch_stub_767),
+ TABLE_ENTRY(_dispatch_stub_768),
+ TABLE_ENTRY(_dispatch_stub_769),
+ /* A whole bunch of no-op functions. These might be called
+ * when someone tries to call a dynamically-registered
+ * extension function without a current rendering context.
+ */
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+};
+#endif /* DISPATCH_TABLE_NAME */
+
+
+/*
+ * This is just used to silence compiler warnings.
+ * We list the functions which are not otherwise used.
+ */
+#ifdef UNUSED_TABLE_NAME
+static _glapi_proc UNUSED_TABLE_NAME[] = {
+ TABLE_ENTRY(ArrayElementEXT),
+ TABLE_ENTRY(BindTextureEXT),
+ TABLE_ENTRY(DrawArraysEXT),
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(AreTexturesResidentEXT),
+#endif
+ TABLE_ENTRY(CopyTexImage1DEXT),
+ TABLE_ENTRY(CopyTexImage2DEXT),
+ TABLE_ENTRY(CopyTexSubImage1DEXT),
+ TABLE_ENTRY(CopyTexSubImage2DEXT),
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(DeleteTexturesEXT),
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GenTexturesEXT),
+#endif
+ TABLE_ENTRY(GetPointervEXT),
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(IsTextureEXT),
+#endif
+ TABLE_ENTRY(PrioritizeTexturesEXT),
+ TABLE_ENTRY(TexSubImage1DEXT),
+ TABLE_ENTRY(TexSubImage2DEXT),
+ TABLE_ENTRY(BlendColorEXT),
+ TABLE_ENTRY(BlendEquationEXT),
+ TABLE_ENTRY(DrawRangeElementsEXT),
+ TABLE_ENTRY(ColorTableEXT),
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GetColorTableEXT),
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GetColorTableParameterfvEXT),
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ TABLE_ENTRY(GetColorTableParameterivEXT),
+#endif
+ TABLE_ENTRY(TexImage3DEXT),
+ TABLE_ENTRY(TexSubImage3DEXT),
+ TABLE_ENTRY(CopyTexSubImage3DEXT),
+ TABLE_ENTRY(ActiveTexture),
+ TABLE_ENTRY(ClientActiveTexture),
+ TABLE_ENTRY(MultiTexCoord1d),
+ TABLE_ENTRY(MultiTexCoord1dv),
+ TABLE_ENTRY(MultiTexCoord1f),
+ TABLE_ENTRY(MultiTexCoord1fv),
+ TABLE_ENTRY(MultiTexCoord1i),
+ TABLE_ENTRY(MultiTexCoord1iv),
+ TABLE_ENTRY(MultiTexCoord1s),
+ TABLE_ENTRY(MultiTexCoord1sv),
+ TABLE_ENTRY(MultiTexCoord2d),
+ TABLE_ENTRY(MultiTexCoord2dv),
+ TABLE_ENTRY(MultiTexCoord2f),
+ TABLE_ENTRY(MultiTexCoord2fv),
+ TABLE_ENTRY(MultiTexCoord2i),
+ TABLE_ENTRY(MultiTexCoord2iv),
+ TABLE_ENTRY(MultiTexCoord2s),
+ TABLE_ENTRY(MultiTexCoord2sv),
+ TABLE_ENTRY(MultiTexCoord3d),
+ TABLE_ENTRY(MultiTexCoord3dv),
+ TABLE_ENTRY(MultiTexCoord3f),
+ TABLE_ENTRY(MultiTexCoord3fv),
+ TABLE_ENTRY(MultiTexCoord3i),
+ TABLE_ENTRY(MultiTexCoord3iv),
+ TABLE_ENTRY(MultiTexCoord3s),
+ TABLE_ENTRY(MultiTexCoord3sv),
+ TABLE_ENTRY(MultiTexCoord4d),
+ TABLE_ENTRY(MultiTexCoord4dv),
+ TABLE_ENTRY(MultiTexCoord4f),
+ TABLE_ENTRY(MultiTexCoord4fv),
+ TABLE_ENTRY(MultiTexCoord4i),
+ TABLE_ENTRY(MultiTexCoord4iv),
+ TABLE_ENTRY(MultiTexCoord4s),
+ TABLE_ENTRY(MultiTexCoord4sv),
+ TABLE_ENTRY(LoadTransposeMatrixd),
+ TABLE_ENTRY(LoadTransposeMatrixf),
+ TABLE_ENTRY(MultTransposeMatrixd),
+ TABLE_ENTRY(MultTransposeMatrixf),
+ TABLE_ENTRY(SampleCoverage),
+ TABLE_ENTRY(CompressedTexImage1D),
+ TABLE_ENTRY(CompressedTexImage2D),
+ TABLE_ENTRY(CompressedTexImage3D),
+ TABLE_ENTRY(CompressedTexSubImage1D),
+ TABLE_ENTRY(CompressedTexSubImage2D),
+ TABLE_ENTRY(CompressedTexSubImage3D),
+ TABLE_ENTRY(GetCompressedTexImage),
+ TABLE_ENTRY(DisableVertexAttribArray),
+ TABLE_ENTRY(EnableVertexAttribArray),
+ TABLE_ENTRY(GetVertexAttribdv),
+ TABLE_ENTRY(GetVertexAttribfv),
+ TABLE_ENTRY(GetVertexAttribiv),
+ TABLE_ENTRY(ProgramParameter4dNV),
+ TABLE_ENTRY(ProgramParameter4dvNV),
+ TABLE_ENTRY(ProgramParameter4fNV),
+ TABLE_ENTRY(ProgramParameter4fvNV),
+ TABLE_ENTRY(VertexAttrib1d),
+ TABLE_ENTRY(VertexAttrib1dv),
+ TABLE_ENTRY(VertexAttrib1f),
+ TABLE_ENTRY(VertexAttrib1fv),
+ TABLE_ENTRY(VertexAttrib1s),
+ TABLE_ENTRY(VertexAttrib1sv),
+ TABLE_ENTRY(VertexAttrib2d),
+ TABLE_ENTRY(VertexAttrib2dv),
+ TABLE_ENTRY(VertexAttrib2f),
+ TABLE_ENTRY(VertexAttrib2fv),
+ TABLE_ENTRY(VertexAttrib2s),
+ TABLE_ENTRY(VertexAttrib2sv),
+ TABLE_ENTRY(VertexAttrib3d),
+ TABLE_ENTRY(VertexAttrib3dv),
+ TABLE_ENTRY(VertexAttrib3f),
+ TABLE_ENTRY(VertexAttrib3fv),
+ TABLE_ENTRY(VertexAttrib3s),
+ TABLE_ENTRY(VertexAttrib3sv),
+ TABLE_ENTRY(VertexAttrib4Nbv),
+ TABLE_ENTRY(VertexAttrib4Niv),
+ TABLE_ENTRY(VertexAttrib4Nsv),
+ TABLE_ENTRY(VertexAttrib4Nub),
+ TABLE_ENTRY(VertexAttrib4Nubv),
+ TABLE_ENTRY(VertexAttrib4Nuiv),
+ TABLE_ENTRY(VertexAttrib4Nusv),
+ TABLE_ENTRY(VertexAttrib4bv),
+ TABLE_ENTRY(VertexAttrib4d),
+ TABLE_ENTRY(VertexAttrib4dv),
+ TABLE_ENTRY(VertexAttrib4f),
+ TABLE_ENTRY(VertexAttrib4fv),
+ TABLE_ENTRY(VertexAttrib4iv),
+ TABLE_ENTRY(VertexAttrib4s),
+ TABLE_ENTRY(VertexAttrib4sv),
+ TABLE_ENTRY(VertexAttrib4ubv),
+ TABLE_ENTRY(VertexAttrib4uiv),
+ TABLE_ENTRY(VertexAttrib4usv),
+ TABLE_ENTRY(VertexAttribPointer),
+ TABLE_ENTRY(BindBuffer),
+ TABLE_ENTRY(BufferData),
+ TABLE_ENTRY(BufferSubData),
+ TABLE_ENTRY(DeleteBuffers),
+ TABLE_ENTRY(GenBuffers),
+ TABLE_ENTRY(GetBufferParameteriv),
+ TABLE_ENTRY(GetBufferPointerv),
+ TABLE_ENTRY(GetBufferSubData),
+ TABLE_ENTRY(IsBuffer),
+ TABLE_ENTRY(MapBuffer),
+ TABLE_ENTRY(UnmapBuffer),
+ TABLE_ENTRY(BeginQuery),
+ TABLE_ENTRY(DeleteQueries),
+ TABLE_ENTRY(EndQuery),
+ TABLE_ENTRY(GenQueries),
+ TABLE_ENTRY(GetQueryObjectiv),
+ TABLE_ENTRY(GetQueryObjectuiv),
+ TABLE_ENTRY(GetQueryiv),
+ TABLE_ENTRY(IsQuery),
+ TABLE_ENTRY(CompileShader),
+ TABLE_ENTRY(GetActiveUniform),
+ TABLE_ENTRY(GetShaderSource),
+ TABLE_ENTRY(GetUniformLocation),
+ TABLE_ENTRY(GetUniformfv),
+ TABLE_ENTRY(GetUniformiv),
+ TABLE_ENTRY(LinkProgram),
+ TABLE_ENTRY(ShaderSource),
+ TABLE_ENTRY(Uniform1f),
+ TABLE_ENTRY(Uniform1fv),
+ TABLE_ENTRY(Uniform1i),
+ TABLE_ENTRY(Uniform1iv),
+ TABLE_ENTRY(Uniform2f),
+ TABLE_ENTRY(Uniform2fv),
+ TABLE_ENTRY(Uniform2i),
+ TABLE_ENTRY(Uniform2iv),
+ TABLE_ENTRY(Uniform3f),
+ TABLE_ENTRY(Uniform3fv),
+ TABLE_ENTRY(Uniform3i),
+ TABLE_ENTRY(Uniform3iv),
+ TABLE_ENTRY(Uniform4f),
+ TABLE_ENTRY(Uniform4fv),
+ TABLE_ENTRY(Uniform4i),
+ TABLE_ENTRY(Uniform4iv),
+ TABLE_ENTRY(UniformMatrix2fv),
+ TABLE_ENTRY(UniformMatrix3fv),
+ TABLE_ENTRY(UniformMatrix4fv),
+ TABLE_ENTRY(UseProgram),
+ TABLE_ENTRY(ValidateProgram),
+ TABLE_ENTRY(BindAttribLocation),
+ TABLE_ENTRY(GetActiveAttrib),
+ TABLE_ENTRY(GetAttribLocation),
+ TABLE_ENTRY(DrawBuffers),
+ TABLE_ENTRY(DrawBuffersATI),
+ TABLE_ENTRY(PointParameterf),
+ TABLE_ENTRY(PointParameterfARB),
+ TABLE_ENTRY(PointParameterfv),
+ TABLE_ENTRY(PointParameterfvARB),
+ TABLE_ENTRY(SecondaryColor3b),
+ TABLE_ENTRY(SecondaryColor3bv),
+ TABLE_ENTRY(SecondaryColor3d),
+ TABLE_ENTRY(SecondaryColor3dv),
+ TABLE_ENTRY(SecondaryColor3f),
+ TABLE_ENTRY(SecondaryColor3fv),
+ TABLE_ENTRY(SecondaryColor3i),
+ TABLE_ENTRY(SecondaryColor3iv),
+ TABLE_ENTRY(SecondaryColor3s),
+ TABLE_ENTRY(SecondaryColor3sv),
+ TABLE_ENTRY(SecondaryColor3ub),
+ TABLE_ENTRY(SecondaryColor3ubv),
+ TABLE_ENTRY(SecondaryColor3ui),
+ TABLE_ENTRY(SecondaryColor3uiv),
+ TABLE_ENTRY(SecondaryColor3us),
+ TABLE_ENTRY(SecondaryColor3usv),
+ TABLE_ENTRY(SecondaryColorPointer),
+ TABLE_ENTRY(MultiDrawArrays),
+ TABLE_ENTRY(MultiDrawElements),
+ TABLE_ENTRY(FogCoordPointer),
+ TABLE_ENTRY(FogCoordd),
+ TABLE_ENTRY(FogCoorddv),
+ TABLE_ENTRY(FogCoordf),
+ TABLE_ENTRY(FogCoordfv),
+ TABLE_ENTRY(BlendFuncSeparate),
+ TABLE_ENTRY(WindowPos2d),
+ TABLE_ENTRY(WindowPos2dARB),
+ TABLE_ENTRY(WindowPos2dv),
+ TABLE_ENTRY(WindowPos2dvARB),
+ TABLE_ENTRY(WindowPos2f),
+ TABLE_ENTRY(WindowPos2fARB),
+ TABLE_ENTRY(WindowPos2fv),
+ TABLE_ENTRY(WindowPos2fvARB),
+ TABLE_ENTRY(WindowPos2i),
+ TABLE_ENTRY(WindowPos2iARB),
+ TABLE_ENTRY(WindowPos2iv),
+ TABLE_ENTRY(WindowPos2ivARB),
+ TABLE_ENTRY(WindowPos2s),
+ TABLE_ENTRY(WindowPos2sARB),
+ TABLE_ENTRY(WindowPos2sv),
+ TABLE_ENTRY(WindowPos2svARB),
+ TABLE_ENTRY(WindowPos3d),
+ TABLE_ENTRY(WindowPos3dARB),
+ TABLE_ENTRY(WindowPos3dv),
+ TABLE_ENTRY(WindowPos3dvARB),
+ TABLE_ENTRY(WindowPos3f),
+ TABLE_ENTRY(WindowPos3fARB),
+ TABLE_ENTRY(WindowPos3fv),
+ TABLE_ENTRY(WindowPos3fvARB),
+ TABLE_ENTRY(WindowPos3i),
+ TABLE_ENTRY(WindowPos3iARB),
+ TABLE_ENTRY(WindowPos3iv),
+ TABLE_ENTRY(WindowPos3ivARB),
+ TABLE_ENTRY(WindowPos3s),
+ TABLE_ENTRY(WindowPos3sARB),
+ TABLE_ENTRY(WindowPos3sv),
+ TABLE_ENTRY(WindowPos3svARB),
+ TABLE_ENTRY(BindProgramARB),
+ TABLE_ENTRY(DeleteProgramsARB),
+ TABLE_ENTRY(GenProgramsARB),
+ TABLE_ENTRY(GetVertexAttribPointerv),
+ TABLE_ENTRY(GetVertexAttribPointervARB),
+ TABLE_ENTRY(IsProgramARB),
+ TABLE_ENTRY(PointParameteri),
+ TABLE_ENTRY(PointParameteriv),
+ TABLE_ENTRY(BlendEquationSeparate),
+};
+#endif /*UNUSED_TABLE_NAME*/
+
+
+# undef KEYWORD1
+# undef KEYWORD1_ALT
+# undef KEYWORD2
+# undef NAME
+# undef DISPATCH
+# undef RETURN_DISPATCH
+# undef DISPATCH_TABLE_NAME
+# undef UNUSED_TABLE_NAME
+# undef TABLE_ENTRY
+# undef HIDDEN
diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c index 69fd39b3b..cf1d43452 100644 --- a/xorg-server/glx/glxdri2.c +++ b/xorg-server/glx/glxdri2.c @@ -1,805 +1,805 @@ -/* - * Copyright © 2007 Red Hat, Inc - * - * 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 name of Red Hat, - * Inc not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. Red Hat, Inc makes no representations about the - * suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * RED HAT, INC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN - * NO EVENT SHALL RED HAT, INC 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_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <stdint.h> -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <dlfcn.h> - -#include <drm.h> -#include <GL/gl.h> -#include <GL/internal/dri_interface.h> -#include <GL/glxtokens.h> - -#include <windowstr.h> -#include <os.h> - -#define _XF86DRI_SERVER_ -#include <xf86drm.h> -#include <xf86.h> -#include <dri2.h> - -#include "glxserver.h" -#include "glxutil.h" -#include "glxdricommon.h" - -#include "g_disptab.h" -#include "glapitable.h" -#include "glapi.h" -#include "glthread.h" -#include "dispatch.h" -#include "extension_string.h" - -typedef struct __GLXDRIscreen __GLXDRIscreen; -typedef struct __GLXDRIcontext __GLXDRIcontext; -typedef struct __GLXDRIdrawable __GLXDRIdrawable; - -struct __GLXDRIscreen { - __GLXscreen base; - __DRIscreen *driScreen; - void *driver; - int fd; - - xf86EnterVTProc *enterVT; - xf86LeaveVTProc *leaveVT; - - const __DRIcoreExtension *core; - const __DRIdri2Extension *dri2; - const __DRI2flushExtension *flush; - const __DRIcopySubBufferExtension *copySubBuffer; - const __DRIswapControlExtension *swapControl; - const __DRItexBufferExtension *texBuffer; - - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; -}; - -struct __GLXDRIcontext { - __GLXcontext base; - __DRIcontext *driContext; -}; - -#define MAX_DRAWABLE_BUFFERS 5 - -struct __GLXDRIdrawable { - __GLXdrawable base; - __DRIdrawable *driDrawable; - __GLXDRIscreen *screen; - - /* Dimensions as last reported by DRI2GetBuffers. */ - int width; - int height; - __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS]; - int count; -}; - -static void -__glXDRIdrawableDestroy(__GLXdrawable *drawable) -{ - __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - const __DRIcoreExtension *core = private->screen->core; - - (*core->destroyDrawable)(private->driDrawable); - - /* If the X window was destroyed, the dri DestroyWindow hook will - * aready have taken care of this, so only call if pDraw isn't NULL. */ - if (drawable->pDraw != NULL) - DRI2DestroyDrawable(drawable->pDraw); - - __glXDrawableRelease(drawable); - - xfree(private); -} - -static void -__glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable, - int x, int y, int w, int h) -{ - __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - BoxRec box; - RegionRec region; - - box.x1 = x; - box.y1 = private->height - y - h; - box.x2 = x + w; - box.y2 = private->height - y; - REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0); - - DRI2CopyRegion(drawable->pDraw, ®ion, - DRI2BufferFrontLeft, DRI2BufferBackLeft); -} - -static void -__glXDRIdrawableWaitX(__GLXdrawable *drawable) -{ - __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - BoxRec box; - RegionRec region; - - box.x1 = 0; - box.y1 = 0; - box.x2 = private->width; - box.y2 = private->height; - REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0); - - DRI2CopyRegion(drawable->pDraw, ®ion, - DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); -} - -static void -__glXDRIdrawableWaitGL(__GLXdrawable *drawable) -{ - __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - BoxRec box; - RegionRec region; - - box.x1 = 0; - box.y1 = 0; - box.x2 = private->width; - box.y2 = private->height; - REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0); - - DRI2CopyRegion(drawable->pDraw, ®ion, - DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); -} - -static void -__glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, - CARD64 msc, CARD64 sbc) -{ - __GLXdrawable *drawable = data; - xGLXBufferSwapComplete wire; - - if (!drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK) - return; - - wire.type = __glXEventBase + GLX_BufferSwapComplete; - switch (type) { - case DRI2_EXCHANGE_COMPLETE: - wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL; - break; - case DRI2_BLIT_COMPLETE: - wire.event_type = GLX_BLIT_COMPLETE_INTEL; - break; - case DRI2_FLIP_COMPLETE: - wire.event_type = GLX_FLIP_COMPLETE_INTEL; - break; - default: - /* unknown swap completion type */ - break; - } - wire.sequenceNumber = client->sequence; - wire.drawable = drawable->drawId; - wire.ust_hi = ust >> 32; - wire.ust_lo = ust & 0xffffffff; - wire.msc_hi = msc >> 32; - wire.msc_lo = msc & 0xffffffff; - wire.sbc_hi = sbc >> 32; - wire.sbc_lo = sbc & 0xffffffff; - - WriteEventsToClient(client, 1, (xEvent *) &wire); -} - -/* - * Copy or flip back to front, honoring the swap interval if possible. - * - * If the kernel supports it, we request an event for the frame when the - * swap should happen, then perform the copy when we receive it. - */ -static GLboolean -__glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable) -{ - __GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable; - __GLXDRIscreen *screen = priv->screen; - CARD64 unused; - - if (screen->flush) - (*screen->flush->flushInvalidate)(priv->driDrawable); - - if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused, - __glXdriSwapEvent, drawable->pDraw) != Success) - return FALSE; - - return TRUE; -} - -static int -__glXDRIdrawableSwapInterval(__GLXdrawable *drawable, int interval) -{ - if (interval <= 0) /* || interval > BIGNUM? */ - return GLX_BAD_VALUE; - - DRI2SwapInterval(drawable->pDraw, interval); - - return 0; -} - -static void -__glXDRIcontextDestroy(__GLXcontext *baseContext) -{ - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; - - (*screen->core->destroyContext)(context->driContext); - __glXContextDestroy(&context->base); - xfree(context); -} - -static int -__glXDRIcontextMakeCurrent(__GLXcontext *baseContext) -{ - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv; - __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv; - __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; - - return (*screen->core->bindContext)(context->driContext, - draw->driDrawable, - read->driDrawable); -} - -static int -__glXDRIcontextLoseCurrent(__GLXcontext *baseContext) -{ - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; - - return (*screen->core->unbindContext)(context->driContext); -} - -static int -__glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, - unsigned long mask) -{ - __GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst; - __GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc; - __GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen; - - return (*screen->core->copyContext)(dst->driContext, - src->driContext, mask); -} - -static int -__glXDRIcontextForceCurrent(__GLXcontext *baseContext) -{ - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv; - __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv; - __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; - - return (*screen->core->bindContext)(context->driContext, - draw->driDrawable, - read->driDrawable); -} - -static Bool -__glXDRIcontextWait(__GLXcontext *baseContext, - __GLXclientState *cl, int *error) -{ - if (DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw)) { - *error = cl->client->noClientException; - return TRUE; - } - - return FALSE; -} - -#ifdef __DRI_TEX_BUFFER - -static int -__glXDRIbindTexImage(__GLXcontext *baseContext, - int buffer, - __GLXdrawable *glxPixmap) -{ - __GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap; - const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer; - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - - if (texBuffer == NULL) - return Success; - -#if __DRI_TEX_BUFFER_VERSION >= 2 - if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) { - (*texBuffer->setTexBuffer2)(context->driContext, - glxPixmap->target, - glxPixmap->format, - drawable->driDrawable); - } else -#endif - { - texBuffer->setTexBuffer(context->driContext, - glxPixmap->target, - drawable->driDrawable); - } - - return Success; -} - -static int -__glXDRIreleaseTexImage(__GLXcontext *baseContext, - int buffer, - __GLXdrawable *pixmap) -{ - /* FIXME: Just unbind the texture? */ - return Success; -} - -#else - -static int -__glXDRIbindTexImage(__GLXcontext *baseContext, - int buffer, - __GLXdrawable *glxPixmap) -{ - return Success; -} - -static int -__glXDRIreleaseTexImage(__GLXcontext *baseContext, - int buffer, - __GLXdrawable *pixmap) -{ - return Success; -} - -#endif - -static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { - __glXDRIbindTexImage, - __glXDRIreleaseTexImage -}; - -static void -__glXDRIscreenDestroy(__GLXscreen *baseScreen) -{ - __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; - - (*screen->core->destroyScreen)(screen->driScreen); - - dlclose(screen->driver); - - __glXScreenDestroy(baseScreen); - - xfree(screen); -} - -static __GLXcontext * -__glXDRIscreenCreateContext(__GLXscreen *baseScreen, - __GLXconfig *glxConfig, - __GLXcontext *baseShareContext) -{ - __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; - __GLXDRIcontext *context, *shareContext; - __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; - __DRIcontext *driShare; - - shareContext = (__GLXDRIcontext *) baseShareContext; - if (shareContext) - driShare = shareContext->driContext; - else - driShare = NULL; - - context = xcalloc(1, sizeof *context); - if (context == NULL) - return NULL; - - context->base.destroy = __glXDRIcontextDestroy; - context->base.makeCurrent = __glXDRIcontextMakeCurrent; - context->base.loseCurrent = __glXDRIcontextLoseCurrent; - context->base.copy = __glXDRIcontextCopy; - context->base.forceCurrent = __glXDRIcontextForceCurrent; - context->base.textureFromPixmap = &__glXDRItextureFromPixmap; - context->base.wait = __glXDRIcontextWait; - - context->driContext = - (*screen->dri2->createNewContext)(screen->driScreen, - config->driConfig, - driShare, context); - if (context->driContext == NULL) { - xfree(context); - return NULL; - } - - return &context->base; -} - -static __GLXdrawable * -__glXDRIscreenCreateDrawable(__GLXscreen *screen, - DrawablePtr pDraw, - int type, - XID drawId, - __GLXconfig *glxConfig) -{ - __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; - __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; - __GLXDRIdrawable *private; - - private = xcalloc(1, sizeof *private); - if (private == NULL) - return NULL; - - private->screen = driScreen; - if (!__glXDrawableInit(&private->base, screen, - pDraw, type, drawId, glxConfig)) { - xfree(private); - return NULL; - } - - private->base.destroy = __glXDRIdrawableDestroy; - private->base.swapBuffers = __glXDRIdrawableSwapBuffers; - private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer; - private->base.waitGL = __glXDRIdrawableWaitGL; - private->base.waitX = __glXDRIdrawableWaitX; - - if (DRI2CreateDrawable(pDraw)) { - xfree(private); - return NULL; - } - - private->driDrawable = - (*driScreen->dri2->createNewDrawable)(driScreen->driScreen, - config->driConfig, private); - - return &private->base; -} - -static __DRIbuffer * -dri2GetBuffers(__DRIdrawable *driDrawable, - int *width, int *height, - unsigned int *attachments, int count, - int *out_count, void *loaderPrivate) -{ - __GLXDRIdrawable *private = loaderPrivate; - DRI2BufferPtr *buffers; - int i; - int j; - - buffers = DRI2GetBuffers(private->base.pDraw, - width, height, attachments, count, out_count); - if (*out_count > MAX_DRAWABLE_BUFFERS) { - *out_count = 0; - return NULL; - } - - private->width = *width; - private->height = *height; - - /* This assumes the DRI2 buffer attachment tokens matches the - * __DRIbuffer tokens. */ - j = 0; - for (i = 0; i < *out_count; i++) { - /* Do not send the real front buffer of a window to the client. - */ - if ((private->base.pDraw->type == DRAWABLE_WINDOW) - && (buffers[i]->attachment == DRI2BufferFrontLeft)) { - continue; - } - - private->buffers[j].attachment = buffers[i]->attachment; - private->buffers[j].name = buffers[i]->name; - private->buffers[j].pitch = buffers[i]->pitch; - private->buffers[j].cpp = buffers[i]->cpp; - private->buffers[j].flags = buffers[i]->flags; - j++; - } - - *out_count = j; - return private->buffers; -} - -static __DRIbuffer * -dri2GetBuffersWithFormat(__DRIdrawable *driDrawable, - int *width, int *height, - unsigned int *attachments, int count, - int *out_count, void *loaderPrivate) -{ - __GLXDRIdrawable *private = loaderPrivate; - DRI2BufferPtr *buffers; - int i; - int j = 0; - - buffers = DRI2GetBuffersWithFormat(private->base.pDraw, - width, height, attachments, count, - out_count); - if (*out_count > MAX_DRAWABLE_BUFFERS) { - *out_count = 0; - return NULL; - } - - private->width = *width; - private->height = *height; - - /* This assumes the DRI2 buffer attachment tokens matches the - * __DRIbuffer tokens. */ - for (i = 0; i < *out_count; i++) { - /* Do not send the real front buffer of a window to the client. - */ - if ((private->base.pDraw->type == DRAWABLE_WINDOW) - && (buffers[i]->attachment == DRI2BufferFrontLeft)) { - continue; - } - - private->buffers[j].attachment = buffers[i]->attachment; - private->buffers[j].name = buffers[i]->name; - private->buffers[j].pitch = buffers[i]->pitch; - private->buffers[j].cpp = buffers[i]->cpp; - private->buffers[j].flags = buffers[i]->flags; - j++; - } - - *out_count = j; - return private->buffers; -} - -static void -dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate) -{ - (void) driDrawable; - __glXDRIdrawableWaitGL((__GLXdrawable *) loaderPrivate); -} - -static const __DRIdri2LoaderExtension loaderExtension = { - { __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION }, - dri2GetBuffers, - dri2FlushFrontBuffer, - dri2GetBuffersWithFormat, -}; - -static const __DRIextension *loader_extensions[] = { - &systemTimeExtension.base, - &loaderExtension.base, - NULL -}; - -static const char dri_driver_path[] = DRI_DRIVER_PATH; - -static Bool -glxDRIEnterVT (int index, int flags) -{ - __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); - - LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n"); - - if (!(*screen->enterVT) (index, flags)) - return FALSE; - - glxResumeClients(); - - return TRUE; -} - -static void -glxDRILeaveVT (int index, int flags) -{ - __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); - - LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n"); - - glxSuspendClients(); - - return (*screen->leaveVT) (index, flags); -} - -static void -initializeExtensions(__GLXDRIscreen *screen) -{ - const __DRIextension **extensions; - int i; - - extensions = screen->core->getExtensions(screen->driScreen); - - __glXEnableExtension(screen->glx_enable_bits, - "GLX_MESA_copy_sub_buffer"); - LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); - - /* FIXME: only if DDX supports it */ - __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event"); - LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n"); - - for (i = 0; extensions[i]; i++) { -#ifdef __DRI_READ_DRAWABLE - if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) { - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGI_make_current_read"); - - LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n"); - } -#endif - -#ifdef __DRI_SWAP_CONTROL - if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) { - screen->swapControl = - (const __DRIswapControlExtension *) extensions[i]; - __glXEnableExtension(screen->glx_enable_bits, - "GLX_SGI_swap_control"); - __glXEnableExtension(screen->glx_enable_bits, - "GLX_MESA_swap_control"); - - LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n"); - } -#endif - -#ifdef __DRI_TEX_BUFFER - if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { - screen->texBuffer = - (const __DRItexBufferExtension *) extensions[i]; - /* GLX_EXT_texture_from_pixmap is always enabled. */ - LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n"); - } -#endif - -#ifdef __DRI2_FLUSH - if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 && - extensions[i]->version >= __DRI2_FLUSH_VERSION) { - screen->flush = (__DRI2flushExtension *) extensions[i]; - } -#endif - - /* Ignore unknown extensions */ - } -} - -static __GLXscreen * -__glXDRIscreenProbe(ScreenPtr pScreen) -{ - const char *driverName, *deviceName; - __GLXDRIscreen *screen; - char filename[128]; - size_t buffer_size; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - const __DRIextension **extensions; - const __DRIconfig **driConfigs; - int i; - - screen = xcalloc(1, sizeof *screen); - if (screen == NULL) - return NULL; - - if (!xf86LoaderCheckSymbol("DRI2Connect") || - !DRI2Connect(pScreen, DRI2DriverDRI, - &screen->fd, &driverName, &deviceName)) { - LogMessage(X_INFO, - "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum); - return NULL; - } - - screen->base.destroy = __glXDRIscreenDestroy; - screen->base.createContext = __glXDRIscreenCreateContext; - screen->base.createDrawable = __glXDRIscreenCreateDrawable; - screen->base.swapInterval = __glXDRIdrawableSwapInterval; - screen->base.pScreen = pScreen; - - __glXInitExtensionEnableBits(screen->glx_enable_bits); - - snprintf(filename, sizeof filename, - "%s/%s_dri.so", dri_driver_path, driverName); - - screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); - if (screen->driver == NULL) { - LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", - filename, dlerror()); - goto handle_error; - } - - extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS); - if (extensions == NULL) { - LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", - driverName, dlerror()); - goto handle_error; - } - - for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_CORE) == 0 && - extensions[i]->version >= __DRI_CORE_VERSION) { - screen->core = (const __DRIcoreExtension *) extensions[i]; - } - if (strcmp(extensions[i]->name, __DRI_DRI2) == 0 && - extensions[i]->version >= __DRI_DRI2_VERSION) { - screen->dri2 = (const __DRIdri2Extension *) extensions[i]; - } - } - - if (screen->core == NULL || screen->dri2 == NULL) { - LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n", - driverName); - goto handle_error; - } - - screen->driScreen = - (*screen->dri2->createNewScreen)(pScreen->myNum, - screen->fd, - loader_extensions, - &driConfigs, - screen); - - if (screen->driScreen == NULL) { - LogMessage(X_ERROR, - "AIGLX error: Calling driver entry point failed\n"); - goto handle_error; - } - - initializeExtensions(screen); - - screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs); - - __glXScreenInit(&screen->base, pScreen); - - /* The first call simply determines the length of the extension string. - * This allows us to allocate some memory to hold the extension string, - * but it requires that we call __glXGetExtensionString a second time. - */ - buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); - if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) { - xfree(screen->base.GLXextensions); - } - - screen->base.GLXextensions = xnfalloc(buffer_size); - (void) __glXGetExtensionString(screen->glx_enable_bits, - screen->base.GLXextensions); - } - - /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled - * drivers support the required extensions for GLX 1.4. The extensions - * we're assuming are: - * - * - GLX_SGI_make_current_read (1.3) - * - GLX_SGIX_fbconfig (1.3) - * - GLX_SGIX_pbuffer (1.3) - * - GLX_ARB_multisample (1.4) - */ - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - - screen->enterVT = pScrn->EnterVT; - pScrn->EnterVT = glxDRIEnterVT; - screen->leaveVT = pScrn->LeaveVT; - pScrn->LeaveVT = glxDRILeaveVT; - - LogMessage(X_INFO, - "AIGLX: Loaded and initialized %s\n", filename); - - return &screen->base; - - handle_error: - if (screen->driver) - dlclose(screen->driver); - - xfree(screen); - - LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n"); - - return NULL; -} - -_X_EXPORT __GLXprovider __glXDRI2Provider = { - __glXDRIscreenProbe, - "DRI2", - NULL -}; +/*
+ * Copyright © 2007 Red Hat, Inc
+ *
+ * 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 name of Red Hat,
+ * Inc not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL RED HAT, INC 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_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <dlfcn.h>
+
+#include <drm.h>
+#include <GL/gl.h>
+#include <GL/internal/dri_interface.h>
+#include <GL/glxtokens.h>
+
+#include <windowstr.h>
+#include <os.h>
+
+#define _XF86DRI_SERVER_
+#include <xf86drm.h>
+#include <xf86.h>
+#include <dri2.h>
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "glxdricommon.h"
+
+#include "g_disptab.h"
+#include "glapitable.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "dispatch.h"
+#include "extension_string.h"
+
+typedef struct __GLXDRIscreen __GLXDRIscreen;
+typedef struct __GLXDRIcontext __GLXDRIcontext;
+typedef struct __GLXDRIdrawable __GLXDRIdrawable;
+
+struct __GLXDRIscreen {
+ __GLXscreen base;
+ __DRIscreen *driScreen;
+ void *driver;
+ int fd;
+
+ xf86EnterVTProc *enterVT;
+ xf86LeaveVTProc *leaveVT;
+
+ const __DRIcoreExtension *core;
+ const __DRIdri2Extension *dri2;
+ const __DRI2flushExtension *flush;
+ const __DRIcopySubBufferExtension *copySubBuffer;
+ const __DRIswapControlExtension *swapControl;
+ const __DRItexBufferExtension *texBuffer;
+
+ unsigned char glx_enable_bits[__GLX_EXT_BYTES];
+};
+
+struct __GLXDRIcontext {
+ __GLXcontext base;
+ __DRIcontext *driContext;
+};
+
+#define MAX_DRAWABLE_BUFFERS 5
+
+struct __GLXDRIdrawable {
+ __GLXdrawable base;
+ __DRIdrawable *driDrawable;
+ __GLXDRIscreen *screen;
+
+ /* Dimensions as last reported by DRI2GetBuffers. */
+ int width;
+ int height;
+ __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
+ int count;
+};
+
+static void
+__glXDRIdrawableDestroy(__GLXdrawable *drawable)
+{
+ __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
+ const __DRIcoreExtension *core = private->screen->core;
+
+ (*core->destroyDrawable)(private->driDrawable);
+
+ /* If the X window was destroyed, the dri DestroyWindow hook will
+ * aready have taken care of this, so only call if pDraw isn't NULL. */
+ if (drawable->pDraw != NULL)
+ DRI2DestroyDrawable(drawable->pDraw);
+
+ __glXDrawableRelease(drawable);
+
+ xfree(private);
+}
+
+static void
+__glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable,
+ int x, int y, int w, int h)
+{
+ __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
+ BoxRec box;
+ RegionRec region;
+
+ box.x1 = x;
+ box.y1 = private->height - y - h;
+ box.x2 = x + w;
+ box.y2 = private->height - y;
+ REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0);
+
+ DRI2CopyRegion(drawable->pDraw, ®ion,
+ DRI2BufferFrontLeft, DRI2BufferBackLeft);
+}
+
+static void
+__glXDRIdrawableWaitX(__GLXdrawable *drawable)
+{
+ __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
+ BoxRec box;
+ RegionRec region;
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = private->width;
+ box.y2 = private->height;
+ REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0);
+
+ DRI2CopyRegion(drawable->pDraw, ®ion,
+ DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
+}
+
+static void
+__glXDRIdrawableWaitGL(__GLXdrawable *drawable)
+{
+ __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
+ BoxRec box;
+ RegionRec region;
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = private->width;
+ box.y2 = private->height;
+ REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0);
+
+ DRI2CopyRegion(drawable->pDraw, ®ion,
+ DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);
+}
+
+static void
+__glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
+ CARD64 msc, CARD64 sbc)
+{
+ __GLXdrawable *drawable = data;
+ xGLXBufferSwapComplete wire;
+
+ if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
+ return;
+
+ wire.type = __glXEventBase + GLX_BufferSwapComplete;
+ switch (type) {
+ case DRI2_EXCHANGE_COMPLETE:
+ wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL;
+ break;
+ case DRI2_BLIT_COMPLETE:
+ wire.event_type = GLX_BLIT_COMPLETE_INTEL;
+ break;
+ case DRI2_FLIP_COMPLETE:
+ wire.event_type = GLX_FLIP_COMPLETE_INTEL;
+ break;
+ default:
+ /* unknown swap completion type */
+ break;
+ }
+ wire.sequenceNumber = client->sequence;
+ wire.drawable = drawable->drawId;
+ wire.ust_hi = ust >> 32;
+ wire.ust_lo = ust & 0xffffffff;
+ wire.msc_hi = msc >> 32;
+ wire.msc_lo = msc & 0xffffffff;
+ wire.sbc_hi = sbc >> 32;
+ wire.sbc_lo = sbc & 0xffffffff;
+
+ WriteEventsToClient(client, 1, (xEvent *) &wire);
+}
+
+/*
+ * Copy or flip back to front, honoring the swap interval if possible.
+ *
+ * If the kernel supports it, we request an event for the frame when the
+ * swap should happen, then perform the copy when we receive it.
+ */
+static GLboolean
+__glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)
+{
+ __GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable;
+ __GLXDRIscreen *screen = priv->screen;
+ CARD64 unused;
+
+ if (screen->flush)
+ (*screen->flush->flushInvalidate)(priv->driDrawable);
+
+ if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
+ __glXdriSwapEvent, drawable->pDraw) != Success)
+ return FALSE;
+
+ return TRUE;
+}
+
+static int
+__glXDRIdrawableSwapInterval(__GLXdrawable *drawable, int interval)
+{
+ if (interval <= 0) /* || interval > BIGNUM? */
+ return GLX_BAD_VALUE;
+
+ DRI2SwapInterval(drawable->pDraw, interval);
+
+ return 0;
+}
+
+static void
+__glXDRIcontextDestroy(__GLXcontext *baseContext)
+{
+ __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
+
+ (*screen->core->destroyContext)(context->driContext);
+ __glXContextDestroy(&context->base);
+ xfree(context);
+}
+
+static int
+__glXDRIcontextMakeCurrent(__GLXcontext *baseContext)
+{
+ __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+ __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
+ __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
+
+ return (*screen->core->bindContext)(context->driContext,
+ draw->driDrawable,
+ read->driDrawable);
+}
+
+static int
+__glXDRIcontextLoseCurrent(__GLXcontext *baseContext)
+{
+ __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
+
+ return (*screen->core->unbindContext)(context->driContext);
+}
+
+static int
+__glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
+ unsigned long mask)
+{
+ __GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst;
+ __GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc;
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen;
+
+ return (*screen->core->copyContext)(dst->driContext,
+ src->driContext, mask);
+}
+
+static int
+__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
+{
+ __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+ __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
+ __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
+
+ return (*screen->core->bindContext)(context->driContext,
+ draw->driDrawable,
+ read->driDrawable);
+}
+
+static Bool
+__glXDRIcontextWait(__GLXcontext *baseContext,
+ __GLXclientState *cl, int *error)
+{
+ if (DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw)) {
+ *error = cl->client->noClientException;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+#ifdef __DRI_TEX_BUFFER
+
+static int
+__glXDRIbindTexImage(__GLXcontext *baseContext,
+ int buffer,
+ __GLXdrawable *glxPixmap)
+{
+ __GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap;
+ const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer;
+ __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
+
+ if (texBuffer == NULL)
+ return Success;
+
+#if __DRI_TEX_BUFFER_VERSION >= 2
+ if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
+ (*texBuffer->setTexBuffer2)(context->driContext,
+ glxPixmap->target,
+ glxPixmap->format,
+ drawable->driDrawable);
+ } else
+#endif
+ {
+ texBuffer->setTexBuffer(context->driContext,
+ glxPixmap->target,
+ drawable->driDrawable);
+ }
+
+ return Success;
+}
+
+static int
+__glXDRIreleaseTexImage(__GLXcontext *baseContext,
+ int buffer,
+ __GLXdrawable *pixmap)
+{
+ /* FIXME: Just unbind the texture? */
+ return Success;
+}
+
+#else
+
+static int
+__glXDRIbindTexImage(__GLXcontext *baseContext,
+ int buffer,
+ __GLXdrawable *glxPixmap)
+{
+ return Success;
+}
+
+static int
+__glXDRIreleaseTexImage(__GLXcontext *baseContext,
+ int buffer,
+ __GLXdrawable *pixmap)
+{
+ return Success;
+}
+
+#endif
+
+static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
+ __glXDRIbindTexImage,
+ __glXDRIreleaseTexImage
+};
+
+static void
+__glXDRIscreenDestroy(__GLXscreen *baseScreen)
+{
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
+
+ (*screen->core->destroyScreen)(screen->driScreen);
+
+ dlclose(screen->driver);
+
+ __glXScreenDestroy(baseScreen);
+
+ xfree(screen);
+}
+
+static __GLXcontext *
+__glXDRIscreenCreateContext(__GLXscreen *baseScreen,
+ __GLXconfig *glxConfig,
+ __GLXcontext *baseShareContext)
+{
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
+ __GLXDRIcontext *context, *shareContext;
+ __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
+ __DRIcontext *driShare;
+
+ shareContext = (__GLXDRIcontext *) baseShareContext;
+ if (shareContext)
+ driShare = shareContext->driContext;
+ else
+ driShare = NULL;
+
+ context = xcalloc(1, sizeof *context);
+ if (context == NULL)
+ return NULL;
+
+ context->base.destroy = __glXDRIcontextDestroy;
+ context->base.makeCurrent = __glXDRIcontextMakeCurrent;
+ context->base.loseCurrent = __glXDRIcontextLoseCurrent;
+ context->base.copy = __glXDRIcontextCopy;
+ context->base.forceCurrent = __glXDRIcontextForceCurrent;
+ context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
+ context->base.wait = __glXDRIcontextWait;
+
+ context->driContext =
+ (*screen->dri2->createNewContext)(screen->driScreen,
+ config->driConfig,
+ driShare, context);
+ if (context->driContext == NULL) {
+ xfree(context);
+ return NULL;
+ }
+
+ return &context->base;
+}
+
+static __GLXdrawable *
+__glXDRIscreenCreateDrawable(__GLXscreen *screen,
+ DrawablePtr pDraw,
+ int type,
+ XID drawId,
+ __GLXconfig *glxConfig)
+{
+ __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
+ __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
+ __GLXDRIdrawable *private;
+
+ private = xcalloc(1, sizeof *private);
+ if (private == NULL)
+ return NULL;
+
+ private->screen = driScreen;
+ if (!__glXDrawableInit(&private->base, screen,
+ pDraw, type, drawId, glxConfig)) {
+ xfree(private);
+ return NULL;
+ }
+
+ private->base.destroy = __glXDRIdrawableDestroy;
+ private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
+ private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
+ private->base.waitGL = __glXDRIdrawableWaitGL;
+ private->base.waitX = __glXDRIdrawableWaitX;
+
+ if (DRI2CreateDrawable(pDraw)) {
+ xfree(private);
+ return NULL;
+ }
+
+ private->driDrawable =
+ (*driScreen->dri2->createNewDrawable)(driScreen->driScreen,
+ config->driConfig, private);
+
+ return &private->base;
+}
+
+static __DRIbuffer *
+dri2GetBuffers(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate)
+{
+ __GLXDRIdrawable *private = loaderPrivate;
+ DRI2BufferPtr *buffers;
+ int i;
+ int j;
+
+ buffers = DRI2GetBuffers(private->base.pDraw,
+ width, height, attachments, count, out_count);
+ if (*out_count > MAX_DRAWABLE_BUFFERS) {
+ *out_count = 0;
+ return NULL;
+ }
+
+ private->width = *width;
+ private->height = *height;
+
+ /* This assumes the DRI2 buffer attachment tokens matches the
+ * __DRIbuffer tokens. */
+ j = 0;
+ for (i = 0; i < *out_count; i++) {
+ /* Do not send the real front buffer of a window to the client.
+ */
+ if ((private->base.pDraw->type == DRAWABLE_WINDOW)
+ && (buffers[i]->attachment == DRI2BufferFrontLeft)) {
+ continue;
+ }
+
+ private->buffers[j].attachment = buffers[i]->attachment;
+ private->buffers[j].name = buffers[i]->name;
+ private->buffers[j].pitch = buffers[i]->pitch;
+ private->buffers[j].cpp = buffers[i]->cpp;
+ private->buffers[j].flags = buffers[i]->flags;
+ j++;
+ }
+
+ *out_count = j;
+ return private->buffers;
+}
+
+static __DRIbuffer *
+dri2GetBuffersWithFormat(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate)
+{
+ __GLXDRIdrawable *private = loaderPrivate;
+ DRI2BufferPtr *buffers;
+ int i;
+ int j = 0;
+
+ buffers = DRI2GetBuffersWithFormat(private->base.pDraw,
+ width, height, attachments, count,
+ out_count);
+ if (*out_count > MAX_DRAWABLE_BUFFERS) {
+ *out_count = 0;
+ return NULL;
+ }
+
+ private->width = *width;
+ private->height = *height;
+
+ /* This assumes the DRI2 buffer attachment tokens matches the
+ * __DRIbuffer tokens. */
+ for (i = 0; i < *out_count; i++) {
+ /* Do not send the real front buffer of a window to the client.
+ */
+ if ((private->base.pDraw->type == DRAWABLE_WINDOW)
+ && (buffers[i]->attachment == DRI2BufferFrontLeft)) {
+ continue;
+ }
+
+ private->buffers[j].attachment = buffers[i]->attachment;
+ private->buffers[j].name = buffers[i]->name;
+ private->buffers[j].pitch = buffers[i]->pitch;
+ private->buffers[j].cpp = buffers[i]->cpp;
+ private->buffers[j].flags = buffers[i]->flags;
+ j++;
+ }
+
+ *out_count = j;
+ return private->buffers;
+}
+
+static void
+dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate)
+{
+ (void) driDrawable;
+ __glXDRIdrawableWaitGL((__GLXdrawable *) loaderPrivate);
+}
+
+static const __DRIdri2LoaderExtension loaderExtension = {
+ { __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION },
+ dri2GetBuffers,
+ dri2FlushFrontBuffer,
+ dri2GetBuffersWithFormat,
+};
+
+static const __DRIextension *loader_extensions[] = {
+ &systemTimeExtension.base,
+ &loaderExtension.base,
+ NULL
+};
+
+static const char dri_driver_path[] = DRI_DRIVER_PATH;
+
+static Bool
+glxDRIEnterVT (int index, int flags)
+{
+ __GLXDRIscreen *screen = (__GLXDRIscreen *)
+ glxGetScreen(screenInfo.screens[index]);
+
+ LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
+
+ if (!(*screen->enterVT) (index, flags))
+ return FALSE;
+
+ glxResumeClients();
+
+ return TRUE;
+}
+
+static void
+glxDRILeaveVT (int index, int flags)
+{
+ __GLXDRIscreen *screen = (__GLXDRIscreen *)
+ glxGetScreen(screenInfo.screens[index]);
+
+ LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
+
+ glxSuspendClients();
+
+ return (*screen->leaveVT) (index, flags);
+}
+
+static void
+initializeExtensions(__GLXDRIscreen *screen)
+{
+ const __DRIextension **extensions;
+ int i;
+
+ extensions = screen->core->getExtensions(screen->driScreen);
+
+ __glXEnableExtension(screen->glx_enable_bits,
+ "GLX_MESA_copy_sub_buffer");
+ LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
+
+ /* FIXME: only if DDX supports it */
+ __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
+ LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
+
+ for (i = 0; extensions[i]; i++) {
+#ifdef __DRI_READ_DRAWABLE
+ if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
+ __glXEnableExtension(screen->glx_enable_bits,
+ "GLX_SGI_make_current_read");
+
+ LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n");
+ }
+#endif
+
+#ifdef __DRI_SWAP_CONTROL
+ if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) {
+ screen->swapControl =
+ (const __DRIswapControlExtension *) extensions[i];
+ __glXEnableExtension(screen->glx_enable_bits,
+ "GLX_SGI_swap_control");
+ __glXEnableExtension(screen->glx_enable_bits,
+ "GLX_MESA_swap_control");
+
+ LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n");
+ }
+#endif
+
+#ifdef __DRI_TEX_BUFFER
+ if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
+ screen->texBuffer =
+ (const __DRItexBufferExtension *) extensions[i];
+ /* GLX_EXT_texture_from_pixmap is always enabled. */
+ LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
+ }
+#endif
+
+#ifdef __DRI2_FLUSH
+ if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
+ extensions[i]->version >= __DRI2_FLUSH_VERSION) {
+ screen->flush = (__DRI2flushExtension *) extensions[i];
+ }
+#endif
+
+ /* Ignore unknown extensions */
+ }
+}
+
+static __GLXscreen *
+__glXDRIscreenProbe(ScreenPtr pScreen)
+{
+ const char *driverName, *deviceName;
+ __GLXDRIscreen *screen;
+ char filename[128];
+ size_t buffer_size;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ const __DRIextension **extensions;
+ const __DRIconfig **driConfigs;
+ int i;
+
+ screen = xcalloc(1, sizeof *screen);
+ if (screen == NULL)
+ return NULL;
+
+ if (!xf86LoaderCheckSymbol("DRI2Connect") ||
+ !DRI2Connect(pScreen, DRI2DriverDRI,
+ &screen->fd, &driverName, &deviceName)) {
+ LogMessage(X_INFO,
+ "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
+ return NULL;
+ }
+
+ screen->base.destroy = __glXDRIscreenDestroy;
+ screen->base.createContext = __glXDRIscreenCreateContext;
+ screen->base.createDrawable = __glXDRIscreenCreateDrawable;
+ screen->base.swapInterval = __glXDRIdrawableSwapInterval;
+ screen->base.pScreen = pScreen;
+
+ __glXInitExtensionEnableBits(screen->glx_enable_bits);
+
+ snprintf(filename, sizeof filename,
+ "%s/%s_dri.so", dri_driver_path, driverName);
+
+ screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+ if (screen->driver == NULL) {
+ LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
+ filename, dlerror());
+ goto handle_error;
+ }
+
+ extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
+ if (extensions == NULL) {
+ LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
+ driverName, dlerror());
+ goto handle_error;
+ }
+
+ for (i = 0; extensions[i]; i++) {
+ if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
+ extensions[i]->version >= __DRI_CORE_VERSION) {
+ screen->core = (const __DRIcoreExtension *) extensions[i];
+ }
+ if (strcmp(extensions[i]->name, __DRI_DRI2) == 0 &&
+ extensions[i]->version >= __DRI_DRI2_VERSION) {
+ screen->dri2 = (const __DRIdri2Extension *) extensions[i];
+ }
+ }
+
+ if (screen->core == NULL || screen->dri2 == NULL) {
+ LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
+ driverName);
+ goto handle_error;
+ }
+
+ screen->driScreen =
+ (*screen->dri2->createNewScreen)(pScreen->myNum,
+ screen->fd,
+ loader_extensions,
+ &driConfigs,
+ screen);
+
+ if (screen->driScreen == NULL) {
+ LogMessage(X_ERROR,
+ "AIGLX error: Calling driver entry point failed\n");
+ goto handle_error;
+ }
+
+ initializeExtensions(screen);
+
+ screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
+
+ __glXScreenInit(&screen->base, pScreen);
+
+ /* The first call simply determines the length of the extension string.
+ * This allows us to allocate some memory to hold the extension string,
+ * but it requires that we call __glXGetExtensionString a second time.
+ */
+ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
+ if (buffer_size > 0) {
+ if (screen->base.GLXextensions != NULL) {
+ xfree(screen->base.GLXextensions);
+ }
+
+ screen->base.GLXextensions = xnfalloc(buffer_size);
+ (void) __glXGetExtensionString(screen->glx_enable_bits,
+ screen->base.GLXextensions);
+ }
+
+ /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled
+ * drivers support the required extensions for GLX 1.4. The extensions
+ * we're assuming are:
+ *
+ * - GLX_SGI_make_current_read (1.3)
+ * - GLX_SGIX_fbconfig (1.3)
+ * - GLX_SGIX_pbuffer (1.3)
+ * - GLX_ARB_multisample (1.4)
+ */
+ screen->base.GLXmajor = 1;
+ screen->base.GLXminor = 4;
+
+ screen->enterVT = pScrn->EnterVT;
+ pScrn->EnterVT = glxDRIEnterVT;
+ screen->leaveVT = pScrn->LeaveVT;
+ pScrn->LeaveVT = glxDRILeaveVT;
+
+ LogMessage(X_INFO,
+ "AIGLX: Loaded and initialized %s\n", filename);
+
+ return &screen->base;
+
+ handle_error:
+ if (screen->driver)
+ dlclose(screen->driver);
+
+ xfree(screen);
+
+ LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
+
+ return NULL;
+}
+
+_X_EXPORT __GLXprovider __glXDRI2Provider = {
+ __glXDRIscreenProbe,
+ "DRI2",
+ NULL
+};
diff --git a/xorg-server/glx/indirect_dispatch.h b/xorg-server/glx/indirect_dispatch.h index 014e417c9..47490ea3e 100644 --- a/xorg-server/glx/indirect_dispatch.h +++ b/xorg-server/glx/indirect_dispatch.h @@ -1,1047 +1,1047 @@ -/* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2005 - * 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, sub license, - * 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS 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. - */ - -#if !defined( _INDIRECT_DISPATCH_H_ ) -# define _INDIRECT_DISPATCH_H_ - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) -# define HIDDEN __attribute__((visibility("hidden"))) -# else -# define HIDDEN -# endif -struct __GLXclientStateRec; - -extern HIDDEN void __glXDisp_MapGrid1d(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MapGrid1d(GLbyte * pc); -extern HIDDEN void __glXDisp_MapGrid1f(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MapGrid1f(GLbyte * pc); -extern HIDDEN int __glXDisp_NewList(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_NewList(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_LoadIdentity(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LoadIdentity(GLbyte * pc); -extern HIDDEN void __glXDisp_SampleCoverageARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SampleCoverageARB(GLbyte * pc); -extern HIDDEN void __glXDisp_ConvolutionFilter1D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ConvolutionFilter1D(GLbyte * pc); -extern HIDDEN void __glXDisp_BeginQueryARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BeginQueryARB(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos3dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos3dv(GLbyte * pc); -extern HIDDEN void __glXDisp_PointParameteriNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PointParameteriNV(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord1iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord1iv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord4sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord4sv(GLbyte * pc); -extern HIDDEN void __glXDisp_ActiveTextureARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ActiveTextureARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4ubvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4ubvNV(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramNamedParameterdvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramNamedParameterdvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Histogram(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Histogram(GLbyte * pc); -extern HIDDEN int __glXDisp_GetMapfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMapfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_RasterPos4dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos4dv(GLbyte * pc); -extern HIDDEN void __glXDisp_PolygonStipple(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PolygonStipple(GLbyte * pc); -extern HIDDEN void __glXDisp_BlendEquationSeparateEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BlendEquationSeparateEXT(GLbyte * pc); -extern HIDDEN int __glXDisp_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Color3uiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3uiv(GLbyte * pc); -extern HIDDEN int __glXDisp_IsEnabled(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsEnabled(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib4svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4svNV(GLbyte * pc); -extern HIDDEN void __glXDisp_EvalCoord2fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalCoord2fv(GLbyte * pc); -extern HIDDEN int __glXDisp_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetMapiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMapiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_SwapBuffers(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_SwapBuffers(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Indexubv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Indexubv(GLbyte * pc); -extern HIDDEN int __glXDisp_Render(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_Render(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetQueryivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetQueryivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_TexImage3D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexImage3D(GLbyte * pc); -extern HIDDEN int __glXDisp_MakeContextCurrent(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_MakeContextCurrent(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetFBConfigs(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetFBConfigs(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Color3ubv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3ubv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetQueryObjectivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetQueryObjectivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Vertex3dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex3dv(GLbyte * pc); -extern HIDDEN void __glXDisp_CompressedTexSubImage2DARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CompressedTexSubImage2DARB(GLbyte * pc); -extern HIDDEN void __glXDisp_LightModeliv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LightModeliv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib1svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib1svARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs1dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Normal3bv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Normal3bv(GLbyte * pc); -extern HIDDEN int __glXDisp_VendorPrivate(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_VendorPrivate(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex3iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex3iv(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyConvolutionFilter1D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyConvolutionFilter1D(GLbyte * pc); -extern HIDDEN void __glXDisp_BlendColor(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BlendColor(GLbyte * pc); -extern HIDDEN void __glXDisp_Scalef(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Scalef(GLbyte * pc); -extern HIDDEN void __glXDisp_Normal3iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Normal3iv(GLbyte * pc); -extern HIDDEN void __glXDisp_PassThrough(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PassThrough(GLbyte * pc); -extern HIDDEN void __glXDisp_Viewport(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Viewport(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4NusvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4NusvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyTexSubImage2D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyTexSubImage2D(GLbyte * pc); -extern HIDDEN void __glXDisp_DepthRange(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DepthRange(GLbyte * pc); -extern HIDDEN void __glXDisp_ResetHistogram(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ResetHistogram(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramNamedParameterfvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramNamedParameterfvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_PointParameterfEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PointParameterfEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord2sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord2sv(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex4dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex4dv(GLbyte * pc); -extern HIDDEN void __glXDisp_CompressedTexImage3DARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CompressedTexImage3DARB(GLbyte * pc); -extern HIDDEN void __glXDisp_Color3sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3sv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetConvolutionParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetConvolutionParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Vertex2dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex2dv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetVisualConfigs(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetVisualConfigs(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_MultiTexCoord1fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord3iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord3iv(GLbyte * pc); -extern HIDDEN int __glXDisp_CopyContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CopyContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Color3fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3fv(GLbyte * pc); -extern HIDDEN void __glXDisp_PointSize(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PointSize(GLbyte * pc); -extern HIDDEN void __glXDisp_PopName(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PopName(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4NbvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4NbvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex4sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex4sv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetTexEnvfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexEnvfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_LineStipple(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LineStipple(GLbyte * pc); -extern HIDDEN void __glXDisp_TexEnvi(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexEnvi(GLbyte * pc); -extern HIDDEN int __glXDisp_GetClipPlane(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetClipPlane(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttribs3dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_LightModeli(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LightModeli(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs4fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs4fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Scaled(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Scaled(GLbyte * pc); -extern HIDDEN void __glXDisp_CallLists(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CallLists(GLbyte * pc); -extern HIDDEN void __glXDisp_AlphaFunc(GLbyte * pc); -extern HIDDEN void __glXDispSwap_AlphaFunc(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord2iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord2iv(GLbyte * pc); -extern HIDDEN void __glXDisp_CompressedTexImage1DARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CompressedTexImage1DARB(GLbyte * pc); -extern HIDDEN void __glXDisp_Rotated(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Rotated(GLbyte * pc); -extern HIDDEN int __glXDisp_ReadPixels(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_ReadPixels(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_EdgeFlagv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EdgeFlagv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexParameterf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexParameterf(GLbyte * pc); -extern HIDDEN void __glXDisp_TexParameteri(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexParameteri(GLbyte * pc); -extern HIDDEN int __glXDisp_DestroyContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DestroyContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_DrawPixels(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DrawPixels(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord2svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord2svARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs3fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs3fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_GenerateMipmapEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_GenerateMipmapEXT(GLbyte * pc); -extern HIDDEN int __glXDisp_GenLists(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GenLists(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_MapGrid2d(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MapGrid2d(GLbyte * pc); -extern HIDDEN void __glXDisp_MapGrid2f(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MapGrid2f(GLbyte * pc); -extern HIDDEN void __glXDisp_Scissor(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Scissor(GLbyte * pc); -extern HIDDEN void __glXDisp_Fogf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Fogf(GLbyte * pc); -extern HIDDEN void __glXDisp_TexSubImage1D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexSubImage1D(GLbyte * pc); -extern HIDDEN void __glXDisp_Color4usv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4usv(GLbyte * pc); -extern HIDDEN void __glXDisp_Fogi(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Fogi(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos3iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos3iv(GLbyte * pc); -extern HIDDEN void __glXDisp_PixelMapfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PixelMapfv(GLbyte * pc); -extern HIDDEN void __glXDisp_Color3usv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3usv(GLbyte * pc); -extern HIDDEN int __glXDisp_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_PointParameterfvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PointParameterfvEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_Color3bv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3bv(GLbyte * pc); -extern HIDDEN void __glXDisp_SecondaryColor3bvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3bvEXT(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramLocalParameterfvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramLocalParameterfvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_RenderbufferStorageEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RenderbufferStorageEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_ColorTable(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ColorTable(GLbyte * pc); -extern HIDDEN void __glXDisp_Accum(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Accum(GLbyte * pc); -extern HIDDEN int __glXDisp_GetTexImage(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexImage(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ConvolutionFilter2D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ConvolutionFilter2D(GLbyte * pc); -extern HIDDEN int __glXDisp_Finish(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_Finish(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ClearStencil(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ClearStencil(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib3dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib3dvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_ConvolutionParameteriv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ConvolutionParameteriv(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos2fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos2fv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord1fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord1fv(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramEnvParameter4fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramEnvParameter4fvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos4fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos4fv(GLbyte * pc); -extern HIDDEN void __glXDisp_ClearIndex(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ClearIndex(GLbyte * pc); -extern HIDDEN void __glXDisp_LoadMatrixd(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LoadMatrixd(GLbyte * pc); -extern HIDDEN void __glXDisp_PushMatrix(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PushMatrix(GLbyte * pc); -extern HIDDEN void __glXDisp_ConvolutionParameterfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ConvolutionParameterfv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetTexGendv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexGendv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_LoadProgramNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LoadProgramNV(GLbyte * pc); -extern HIDDEN int __glXDisp_EndList(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_EndList(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib4fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_EvalCoord1fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalCoord1fv(GLbyte * pc); -extern HIDDEN void __glXDisp_EvalMesh2(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalMesh2(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex4fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex4fv(GLbyte * pc); -extern HIDDEN int __glXDisp_CheckFramebufferStatusEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CheckFramebufferStatusEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetVertexAttribivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetVertexAttribivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetFBConfigsSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetFBConfigsSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_CreateNewContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreateNewContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetMinmax(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMinmax(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetMinmaxEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMinmaxEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetVertexAttribdvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetVertexAttribdvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Normal3fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Normal3fv(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4ivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4ivARB(GLbyte * pc); -extern HIDDEN void __glXDisp_End(GLbyte * pc); -extern HIDDEN void __glXDispSwap_End(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs2dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord3fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramParameterfvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramParameterfvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_BindTexture(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BindTexture(GLbyte * pc); -extern HIDDEN void __glXDisp_TexSubImage2D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexSubImage2D(GLbyte * pc); -extern HIDDEN void __glXDisp_DeleteRenderbuffersEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DeleteRenderbuffersEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_TexGenfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexGenfv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4bvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4bvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_CreateContextWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreateContextWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_FramebufferTexture3DEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_FramebufferTexture3DEXT(GLbyte * pc); -extern HIDDEN int __glXDisp_CopySubBufferMESA(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CopySubBufferMESA(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_BlendEquation(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BlendEquation(GLbyte * pc); -extern HIDDEN int __glXDisp_GetError(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetError(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_TexCoord3dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord3dv(GLbyte * pc); -extern HIDDEN void __glXDisp_Indexdv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Indexdv(GLbyte * pc); -extern HIDDEN void __glXDisp_PushName(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PushName(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord2dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord2dvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramNamedParameter4fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramNamedParameter4fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4fvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_CreateGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreateGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_MultiTexCoord1svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord1svARB(GLbyte * pc); -extern HIDDEN void __glXDisp_EndQueryARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EndQueryARB(GLbyte * pc); -extern HIDDEN void __glXDisp_DepthMask(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DepthMask(GLbyte * pc); -extern HIDDEN void __glXDisp_Color4iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_StencilOp(GLbyte * pc); -extern HIDDEN void __glXDispSwap_StencilOp(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord3svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord3svARB(GLbyte * pc); -extern HIDDEN void __glXDisp_TexEnvfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexEnvfv(GLbyte * pc); -extern HIDDEN int __glXDisp_QueryServerString(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_QueryServerString(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_LoadMatrixf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LoadMatrixf(GLbyte * pc); -extern HIDDEN void __glXDisp_Color4bv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4bv(GLbyte * pc); -extern HIDDEN void __glXDisp_SecondaryColor3usvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3usvEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib2fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib2fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_DeleteLists(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DeleteLists(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_LogicOp(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LogicOp(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord4fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord4fv(GLbyte * pc); -extern HIDDEN int __glXDisp_WaitX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_WaitX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_SecondaryColor3uivEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3uivEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_FramebufferRenderbufferEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_FramebufferRenderbufferEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib1dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc); -extern HIDDEN int __glXDisp_GenTextures(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GenTextures(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GenTexturesEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GenTexturesEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_FramebufferTexture1DEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_FramebufferTexture1DEXT(GLbyte * pc); -extern HIDDEN int __glXDisp_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_RasterPos2sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos2sv(GLbyte * pc); -extern HIDDEN void __glXDisp_Color4ubv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4ubv(GLbyte * pc); -extern HIDDEN void __glXDisp_DrawBuffer(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DrawBuffer(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord2fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord2fv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord1sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord1sv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexGeniv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexGeniv(GLbyte * pc); -extern HIDDEN void __glXDisp_DepthFunc(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DepthFunc(GLbyte * pc); -extern HIDDEN void __glXDisp_PixelMapusv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PixelMapusv(GLbyte * pc); -extern HIDDEN void __glXDisp_PointParameterivNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PointParameterivNV(GLbyte * pc); -extern HIDDEN void __glXDisp_BlendFunc(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BlendFunc(GLbyte * pc); -extern HIDDEN int __glXDisp_WaitGL(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_WaitGL(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_MultiTexCoord3dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord3dvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramNamedParameter4dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramNamedParameter4dvNV(GLbyte * pc); -extern HIDDEN int __glXDisp_Flush(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_Flush(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Color4uiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4uiv(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos3sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos3sv(GLbyte * pc); -extern HIDDEN void __glXDisp_BindFramebufferEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BindFramebufferEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_PushAttrib(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PushAttrib(GLbyte * pc); -extern HIDDEN int __glXDisp_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_TexParameteriv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexParameteriv(GLbyte * pc); -extern HIDDEN void __glXDisp_WindowPos3fvMESA(GLbyte * pc); -extern HIDDEN void __glXDispSwap_WindowPos3fvMESA(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib1svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib1svNV(GLbyte * pc); -extern HIDDEN int __glXDisp_QueryExtensionsString(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_QueryExtensionsString(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_RasterPos3fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos3fv(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyTexSubImage3D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyTexSubImage3D(GLbyte * pc); -extern HIDDEN int __glXDisp_GetColorTable(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetColorTable(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetColorTableSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetColorTableSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Indexiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Indexiv(GLbyte * pc); -extern HIDDEN int __glXDisp_CreateContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreateContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_CopyColorTable(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyColorTable(GLbyte * pc); -extern HIDDEN int __glXDisp_GetHistogramParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetHistogramParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetHistogramParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetHistogramParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Frustum(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Frustum(GLbyte * pc); -extern HIDDEN int __glXDisp_GetString(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetString(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_CreateGLXPixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreateGLXPixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_TexEnvf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexEnvf(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_MultiTexCoord3ivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord3ivARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib1dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib1dvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_DeleteTextures(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DeleteTextures(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_DeleteTexturesEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DeleteTexturesEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetTexLevelParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexLevelParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ClearAccum(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ClearAccum(GLbyte * pc); -extern HIDDEN int __glXDisp_QueryVersion(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_QueryVersion(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetVertexAttribfvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetVertexAttribfvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_SecondaryColor3ivEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3ivEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord4iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord4iv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_SampleMaskSGIS(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SampleMaskSGIS(GLbyte * pc); -extern HIDDEN void __glXDisp_ColorTableParameteriv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ColorTableParameteriv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4ubvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4ubvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyTexImage2D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyTexImage2D(GLbyte * pc); -extern HIDDEN void __glXDisp_Lightfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Lightfv(GLbyte * pc); -extern HIDDEN void __glXDisp_ClearDepth(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ClearDepth(GLbyte * pc); -extern HIDDEN void __glXDisp_ColorSubTable(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ColorSubTable(GLbyte * pc); -extern HIDDEN void __glXDisp_Color4fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4fv(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord4ivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord4ivARB(GLbyte * pc); -extern HIDDEN int __glXDisp_CreatePixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreatePixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Lightiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Lightiv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetQueryObjectuivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetQueryObjectuivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GenRenderbuffersEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GenRenderbuffersEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib2dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib2dvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs2svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs2svNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Rectdv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Rectdv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4NivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4NivARB(GLbyte * pc); -extern HIDDEN void __glXDisp_Materialiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Materialiv(GLbyte * pc); -extern HIDDEN void __glXDisp_SecondaryColor3fvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3fvEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_PolygonMode(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PolygonMode(GLbyte * pc); -extern HIDDEN void __glXDisp_CompressedTexSubImage1DARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CompressedTexSubImage1DARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib2dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc); -extern HIDDEN int __glXDisp_GetVertexAttribivNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetVertexAttribivNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_IsQueryARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsQueryARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_TexGeni(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexGeni(GLbyte * pc); -extern HIDDEN void __glXDisp_TexGenf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexGenf(GLbyte * pc); -extern HIDDEN void __glXDisp_TexGend(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexGend(GLbyte * pc); -extern HIDDEN int __glXDisp_GetPolygonStipple(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetPolygonStipple(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetVertexAttribfvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetVertexAttribfvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib2svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib2svNV(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs1fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs1fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4NuivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4NuivARB(GLbyte * pc); -extern HIDDEN int __glXDisp_DestroyWindow(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DestroyWindow(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Color4sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4sv(GLbyte * pc); -extern HIDDEN int __glXDisp_IsProgramNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsProgramNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_PixelZoom(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PixelZoom(GLbyte * pc); -extern HIDDEN void __glXDisp_ColorTableParameterfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ColorTableParameterfv(GLbyte * pc); -extern HIDDEN void __glXDisp_PixelMapuiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PixelMapuiv(GLbyte * pc); -extern HIDDEN void __glXDisp_Color3dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3dv(GLbyte * pc); -extern HIDDEN int __glXDisp_IsTexture(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsTexture(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_IsTextureEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsTextureEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_DeleteQueriesARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DeleteQueriesARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetMapdv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMapdv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_DestroyGLXPixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DestroyGLXPixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_SamplePatternSGIS(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SamplePatternSGIS(GLbyte * pc); -extern HIDDEN int __glXDisp_PixelStoref(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_PixelStoref(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_PrioritizeTextures(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PrioritizeTextures(GLbyte * pc); -extern HIDDEN int __glXDisp_PixelStorei(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_PixelStorei(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib4usvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4usvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_DestroyGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DestroyGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_EvalCoord2dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalCoord2dv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib3svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib3svARB(GLbyte * pc); -extern HIDDEN void __glXDisp_ColorMaterial(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ColorMaterial(GLbyte * pc); -extern HIDDEN void __glXDisp_CompressedTexSubImage3DARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CompressedTexSubImage3DARB(GLbyte * pc); -extern HIDDEN int __glXDisp_IsFramebufferEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsFramebufferEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetVertexAttribdvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetVertexAttribdvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetSeparableFilter(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetSeparableFilter(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetSeparableFilterEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetSeparableFilterEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_RequestResidentProgramsNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RequestResidentProgramsNV(GLbyte * pc); -extern HIDDEN int __glXDisp_FeedbackBuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_FeedbackBuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_RasterPos2iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos2iv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexImage1D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexImage1D(GLbyte * pc); -extern HIDDEN void __glXDisp_FrontFace(GLbyte * pc); -extern HIDDEN void __glXDispSwap_FrontFace(GLbyte * pc); -extern HIDDEN int __glXDisp_RenderLarge(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_RenderLarge(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib4dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4dvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_PolygonOffset(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PolygonOffset(GLbyte * pc); -extern HIDDEN void __glXDisp_ExecuteProgramNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ExecuteProgramNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Normal3dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Normal3dv(GLbyte * pc); -extern HIDDEN void __glXDisp_Lightf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Lightf(GLbyte * pc); -extern HIDDEN void __glXDisp_MatrixMode(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MatrixMode(GLbyte * pc); -extern HIDDEN void __glXDisp_FramebufferTexture2DEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_FramebufferTexture2DEXT(GLbyte * pc); -extern HIDDEN int __glXDisp_GetPixelMapusv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetPixelMapusv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Lighti(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Lighti(GLbyte * pc); -extern HIDDEN int __glXDisp_GetFramebufferAttachmentParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetFramebufferAttachmentParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_ChangeDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_ChangeDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_MultiTexCoord4dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord4dvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_CreatePbuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreatePbuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetDoublev(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetDoublev(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_MultMatrixd(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultMatrixd(GLbyte * pc); -extern HIDDEN void __glXDisp_MultMatrixf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultMatrixf(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord4fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_TrackMatrixNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TrackMatrixNV(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos4sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos4sv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4NsvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4NsvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib3fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib3fvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_ClearColor(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ClearColor(GLbyte * pc); -extern HIDDEN int __glXDisp_IsDirect(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsDirect(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_DeleteFramebuffersEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DeleteFramebuffersEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_TexEnviv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexEnviv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexSubImage3D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexSubImage3D(GLbyte * pc); -extern HIDDEN int __glXDisp_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetColorTableParameterfvSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetColorTableParameterfvSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Bitmap(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Bitmap(GLbyte * pc); -extern HIDDEN int __glXDisp_GetTexLevelParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexLevelParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GenFramebuffersEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GenFramebuffersEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetProgramParameterdvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramParameterdvNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Vertex2sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex2sv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetIntegerv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetIntegerv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetProgramEnvParameterfvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramEnvParameterfvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetTrackMatrixivNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTrackMatrixivNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib3svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib3svNV(GLbyte * pc); -extern HIDDEN int __glXDisp_GetTexEnviv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexEnviv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_VendorPrivateWithReply(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_VendorPrivateWithReply(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_SeparableFilter2D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SeparableFilter2D(GLbyte * pc); -extern HIDDEN void __glXDisp_Map1d(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Map1d(GLbyte * pc); -extern HIDDEN void __glXDisp_Map1f(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Map1f(GLbyte * pc); -extern HIDDEN void __glXDisp_CompressedTexImage2DARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CompressedTexImage2DARB(GLbyte * pc); -extern HIDDEN void __glXDisp_TexImage2D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexImage2D(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramParameters4fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramParameters4fvNV(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramivNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramivNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_ChangeDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_ChangeDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetMinmaxParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMinmaxParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetMinmaxParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMinmaxParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_PixelTransferf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PixelTransferf(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyTexImage1D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyTexImage1D(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos2dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos2dv(GLbyte * pc); -extern HIDDEN void __glXDisp_Fogiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Fogiv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord1dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord1dv(GLbyte * pc); -extern HIDDEN void __glXDisp_PixelTransferi(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PixelTransferi(GLbyte * pc); -extern HIDDEN void __glXDisp_SecondaryColor3ubvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3ubvEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib3fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib3fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Clear(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Clear(GLbyte * pc); -extern HIDDEN void __glXDisp_ReadBuffer(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ReadBuffer(GLbyte * pc); -extern HIDDEN void __glXDisp_ConvolutionParameteri(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ConvolutionParameteri(GLbyte * pc); -extern HIDDEN void __glXDisp_Ortho(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Ortho(GLbyte * pc); -extern HIDDEN void __glXDisp_ListBase(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ListBase(GLbyte * pc); -extern HIDDEN void __glXDisp_ConvolutionParameterf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ConvolutionParameterf(GLbyte * pc); -extern HIDDEN int __glXDisp_GetColorTableParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetColorTableParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetColorTableParameterivSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetColorTableParameterivSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_ReleaseTexImageEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_ReleaseTexImageEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_CallList(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CallList(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs2fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Rectiv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Rectiv(GLbyte * pc); -extern HIDDEN void __glXDisp_SecondaryColor3dvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3dvEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex2fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex2fv(GLbyte * pc); -extern HIDDEN void __glXDisp_BindRenderbufferEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BindRenderbufferEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex3sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex3sv(GLbyte * pc); -extern HIDDEN int __glXDisp_BindTexImageEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_BindTexImageEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ProgramLocalParameter4fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramLocalParameter4fvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_DeleteProgramsNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_DeleteProgramsNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_EvalMesh1(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalMesh1(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord1dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord1dvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex2iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex2iv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramStringNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramStringNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_LineWidth(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LineWidth(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib2fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib2fvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_TexGendv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexGendv(GLbyte * pc); -extern HIDDEN void __glXDisp_ResetMinmax(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ResetMinmax(GLbyte * pc); -extern HIDDEN int __glXDisp_GetConvolutionParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetConvolutionParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttribs4dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc); -extern HIDDEN int __glXDisp_GetMaterialfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMaterialfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_UseXFont(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_UseXFont(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ShadeModel(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ShadeModel(GLbyte * pc); -extern HIDDEN void __glXDisp_Materialfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Materialfv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord3fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord3fv(GLbyte * pc); -extern HIDDEN void __glXDisp_FogCoordfvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_FogCoordfvEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord1ivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord1ivARB(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord2ivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord2ivARB(GLbyte * pc); -extern HIDDEN void __glXDisp_DrawArrays(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DrawArrays(GLbyte * pc); -extern HIDDEN void __glXDisp_Color3iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color3iv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramLocalParameterdvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramLocalParameterdvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Rotatef(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Rotatef(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_BlendFuncSeparateEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BlendFuncSeparateEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramParameters4dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramParameters4dvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_EvalPoint2(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalPoint2(GLbyte * pc); -extern HIDDEN void __glXDisp_EvalPoint1(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalPoint1(GLbyte * pc); -extern HIDDEN void __glXDisp_PopMatrix(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PopMatrix(GLbyte * pc); -extern HIDDEN int __glXDisp_MakeCurrentReadSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_MakeCurrentReadSGI(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetTexGeniv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexGeniv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_MakeCurrent(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_MakeCurrent(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Map2d(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Map2d(GLbyte * pc); -extern HIDDEN void __glXDisp_Map2f(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Map2f(GLbyte * pc); -extern HIDDEN void __glXDisp_ProgramStringARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramStringARB(GLbyte * pc); -extern HIDDEN int __glXDisp_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetHistogram(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetHistogram(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetHistogramEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetHistogramEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ActiveStencilFaceEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_Materialf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Materialf(GLbyte * pc); -extern HIDDEN void __glXDisp_Materiali(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Materiali(GLbyte * pc); -extern HIDDEN void __glXDisp_Indexsv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Indexsv(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord4svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord4svARB(GLbyte * pc); -extern HIDDEN void __glXDisp_LightModelfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LightModelfv(GLbyte * pc); -extern HIDDEN void __glXDisp_TexCoord2dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord2dv(GLbyte * pc); -extern HIDDEN int __glXDisp_GenQueriesARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GenQueriesARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_EvalCoord1dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_EvalCoord1dv(GLbyte * pc); -extern HIDDEN void __glXDisp_Translated(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Translated(GLbyte * pc); -extern HIDDEN void __glXDisp_Translatef(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Translatef(GLbyte * pc); -extern HIDDEN void __glXDisp_StencilMask(GLbyte * pc); -extern HIDDEN void __glXDispSwap_StencilMask(GLbyte * pc); -extern HIDDEN int __glXDisp_CreateWindow(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_CreateWindow(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetLightiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetLightiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_IsList(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsList(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_RenderMode(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_RenderMode(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_DrawBuffersARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_DrawBuffersARB(GLbyte * pc); -extern HIDDEN void __glXDisp_LoadName(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LoadName(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyTexSubImage1D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyTexSubImage1D(GLbyte * pc); -extern HIDDEN void __glXDisp_CullFace(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CullFace(GLbyte * pc); -extern HIDDEN int __glXDisp_QueryContextInfoEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_QueryContextInfoEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttribs3svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs3svNV(GLbyte * pc); -extern HIDDEN void __glXDisp_StencilFunc(GLbyte * pc); -extern HIDDEN void __glXDispSwap_StencilFunc(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyPixels(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyPixels(GLbyte * pc); -extern HIDDEN void __glXDisp_Rectsv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Rectsv(GLbyte * pc); -extern HIDDEN void __glXDisp_CopyConvolutionFilter2D(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyConvolutionFilter2D(GLbyte * pc); -extern HIDDEN void __glXDisp_TexParameterfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexParameterfv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4uivARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4uivARB(GLbyte * pc); -extern HIDDEN void __glXDisp_ClipPlane(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ClipPlane(GLbyte * pc); -extern HIDDEN int __glXDisp_GetPixelMapuiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetPixelMapuiv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Indexfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Indexfv(GLbyte * pc); -extern HIDDEN int __glXDisp_QueryContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_QueryContext(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_SecondaryColor3svEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3svEXT(GLbyte * pc); -extern HIDDEN void __glXDisp_IndexMask(GLbyte * pc); -extern HIDDEN void __glXDispSwap_IndexMask(GLbyte * pc); -extern HIDDEN void __glXDisp_BindProgramNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_BindProgramNV(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4svARB(GLbyte * pc); -extern HIDDEN int __glXDisp_GetFloatv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetFloatv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_TexCoord3sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord3sv(GLbyte * pc); -extern HIDDEN void __glXDisp_PopAttrib(GLbyte * pc); -extern HIDDEN void __glXDispSwap_PopAttrib(GLbyte * pc); -extern HIDDEN void __glXDisp_Fogfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Fogfv(GLbyte * pc); -extern HIDDEN void __glXDisp_InitNames(GLbyte * pc); -extern HIDDEN void __glXDispSwap_InitNames(GLbyte * pc); -extern HIDDEN void __glXDisp_Normal3sv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Normal3sv(GLbyte * pc); -extern HIDDEN void __glXDisp_Minmax(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Minmax(GLbyte * pc); -extern HIDDEN void __glXDisp_FogCoorddvEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_FogCoorddvEXT(GLbyte * pc); -extern HIDDEN int __glXDisp_GetBooleanv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetBooleanv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Hint(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Hint(GLbyte * pc); -extern HIDDEN void __glXDisp_Color4dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Color4dv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib2svARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib2svARB(GLbyte * pc); -extern HIDDEN int __glXDisp_AreProgramsResidentNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_AreProgramsResidentNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_CopyColorSubTable(GLbyte * pc); -extern HIDDEN void __glXDispSwap_CopyColorSubTable(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4NubvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4NubvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib3dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex4iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex4iv(GLbyte * pc); -extern HIDDEN int __glXDisp_GetProgramEnvParameterdvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetProgramEnvParameterdvARB(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_TexCoord4dv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_TexCoord4dv(GLbyte * pc); -extern HIDDEN void __glXDisp_Begin(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Begin(GLbyte * pc); -extern HIDDEN int __glXDisp_ClientInfo(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_ClientInfo(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Rectfv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Rectfv(GLbyte * pc); -extern HIDDEN void __glXDisp_LightModelf(GLbyte * pc); -extern HIDDEN void __glXDispSwap_LightModelf(GLbyte * pc); -extern HIDDEN int __glXDisp_GetTexParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetTexParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetLightfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetLightfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_Disable(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Disable(GLbyte * pc); -extern HIDDEN void __glXDisp_MultiTexCoord2fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc); -extern HIDDEN int __glXDisp_GetRenderbufferParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetRenderbufferParameterivEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_SelectBuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_SelectBuffer(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ColorMask(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ColorMask(GLbyte * pc); -extern HIDDEN void __glXDisp_RasterPos4iv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_RasterPos4iv(GLbyte * pc); -extern HIDDEN void __glXDisp_Enable(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Enable(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs4svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs4svNV(GLbyte * pc); -extern HIDDEN int __glXDisp_GetMinmaxParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMinmaxParameterfv(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_GetMinmaxParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GetMinmaxParameterfvEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib1fvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib1fvARB(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs1svNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs1svNV(GLbyte * pc); -extern HIDDEN void __glXDisp_Vertex3fv(GLbyte * pc); -extern HIDDEN void __glXDispSwap_Vertex3fv(GLbyte * pc); -extern HIDDEN int __glXDisp_GenProgramsNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_GenProgramsNV(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib4dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc); - -# undef HIDDEN - -#endif /* !defined( _INDIRECT_DISPATCH_H_ ) */ +/* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2005
+ * 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, sub license,
+ * 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 (including the next
+ * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS 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.
+ */
+
+#if !defined( _INDIRECT_DISPATCH_H_ )
+# define _INDIRECT_DISPATCH_H_
+
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# define HIDDEN __attribute__((visibility("hidden")))
+# else
+# define HIDDEN
+# endif
+struct __GLXclientStateRec;
+
+extern HIDDEN void __glXDisp_MapGrid1d(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MapGrid1d(GLbyte * pc);
+extern HIDDEN void __glXDisp_MapGrid1f(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MapGrid1f(GLbyte * pc);
+extern HIDDEN int __glXDisp_NewList(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_NewList(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_LoadIdentity(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LoadIdentity(GLbyte * pc);
+extern HIDDEN void __glXDisp_SampleCoverageARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SampleCoverageARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_ConvolutionFilter1D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ConvolutionFilter1D(GLbyte * pc);
+extern HIDDEN void __glXDisp_BeginQueryARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BeginQueryARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos3dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos3dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PointParameteriNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PointParameteriNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord1iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord1iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord4sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord4sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_ActiveTextureARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ActiveTextureARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4ubvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4ubvNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramNamedParameterdvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramNamedParameterdvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Histogram(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Histogram(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetMapfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMapfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_RasterPos4dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos4dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PolygonStipple(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PolygonStipple(GLbyte * pc);
+extern HIDDEN void __glXDisp_BlendEquationSeparateEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BlendEquationSeparateEXT(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Color3uiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3uiv(GLbyte * pc);
+extern HIDDEN int __glXDisp_IsEnabled(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsEnabled(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib4svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4svNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_EvalCoord2fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalCoord2fv(GLbyte * pc);
+extern HIDDEN int __glXDisp_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetMapiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMapiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_SwapBuffers(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_SwapBuffers(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Indexubv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Indexubv(GLbyte * pc);
+extern HIDDEN int __glXDisp_Render(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_Render(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetQueryivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetQueryivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_TexImage3D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexImage3D(GLbyte * pc);
+extern HIDDEN int __glXDisp_MakeContextCurrent(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_MakeContextCurrent(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetFBConfigs(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetFBConfigs(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Color3ubv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3ubv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetQueryObjectivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetQueryObjectivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Vertex3dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex3dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_CompressedTexSubImage2DARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CompressedTexSubImage2DARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_LightModeliv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LightModeliv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib1svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib1svARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs1dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Normal3bv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Normal3bv(GLbyte * pc);
+extern HIDDEN int __glXDisp_VendorPrivate(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_VendorPrivate(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex3iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex3iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyConvolutionFilter1D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyConvolutionFilter1D(GLbyte * pc);
+extern HIDDEN void __glXDisp_BlendColor(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BlendColor(GLbyte * pc);
+extern HIDDEN void __glXDisp_Scalef(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Scalef(GLbyte * pc);
+extern HIDDEN void __glXDisp_Normal3iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Normal3iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PassThrough(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PassThrough(GLbyte * pc);
+extern HIDDEN void __glXDisp_Viewport(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Viewport(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4NusvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4NusvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyTexSubImage2D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyTexSubImage2D(GLbyte * pc);
+extern HIDDEN void __glXDisp_DepthRange(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DepthRange(GLbyte * pc);
+extern HIDDEN void __glXDisp_ResetHistogram(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ResetHistogram(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramNamedParameterfvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramNamedParameterfvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_PointParameterfEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PointParameterfEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord2sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord2sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex4dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex4dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_CompressedTexImage3DARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CompressedTexImage3DARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color3sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3sv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetConvolutionParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetConvolutionParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetConvolutionParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetConvolutionParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Vertex2dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex2dv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetVisualConfigs(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetVisualConfigs(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_MultiTexCoord1fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord3iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord3iv(GLbyte * pc);
+extern HIDDEN int __glXDisp_CopyContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CopyContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Color3fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PointSize(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PointSize(GLbyte * pc);
+extern HIDDEN void __glXDisp_PopName(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PopName(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4NbvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4NbvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex4sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex4sv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetTexEnvfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexEnvfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_LineStipple(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LineStipple(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexEnvi(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexEnvi(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetClipPlane(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetClipPlane(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttribs3dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_LightModeli(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LightModeli(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs4fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs4fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Scaled(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Scaled(GLbyte * pc);
+extern HIDDEN void __glXDisp_CallLists(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CallLists(GLbyte * pc);
+extern HIDDEN void __glXDisp_AlphaFunc(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_AlphaFunc(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord2iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord2iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_CompressedTexImage1DARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CompressedTexImage1DARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_Rotated(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Rotated(GLbyte * pc);
+extern HIDDEN int __glXDisp_ReadPixels(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_ReadPixels(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_EdgeFlagv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EdgeFlagv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexParameterf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexParameterf(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexParameteri(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexParameteri(GLbyte * pc);
+extern HIDDEN int __glXDisp_DestroyContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DestroyContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_DrawPixels(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DrawPixels(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord2svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord2svARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs3fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs3fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_GenerateMipmapEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_GenerateMipmapEXT(GLbyte * pc);
+extern HIDDEN int __glXDisp_GenLists(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GenLists(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_MapGrid2d(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MapGrid2d(GLbyte * pc);
+extern HIDDEN void __glXDisp_MapGrid2f(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MapGrid2f(GLbyte * pc);
+extern HIDDEN void __glXDisp_Scissor(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Scissor(GLbyte * pc);
+extern HIDDEN void __glXDisp_Fogf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Fogf(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexSubImage1D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexSubImage1D(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color4usv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4usv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Fogi(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Fogi(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos3iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos3iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PixelMapfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PixelMapfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color3usv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3usv(GLbyte * pc);
+extern HIDDEN int __glXDisp_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_PointParameterfvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PointParameterfvEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color3bv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3bv(GLbyte * pc);
+extern HIDDEN void __glXDisp_SecondaryColor3bvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3bvEXT(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramLocalParameterfvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramLocalParameterfvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_RenderbufferStorageEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RenderbufferStorageEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_ColorTable(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ColorTable(GLbyte * pc);
+extern HIDDEN void __glXDisp_Accum(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Accum(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetTexImage(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexImage(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_ConvolutionFilter2D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ConvolutionFilter2D(GLbyte * pc);
+extern HIDDEN int __glXDisp_Finish(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_Finish(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_ClearStencil(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ClearStencil(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib3dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib3dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_ConvolutionParameteriv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ConvolutionParameteriv(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos2fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos2fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord1fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord1fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramEnvParameter4fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramEnvParameter4fvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos4fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos4fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_ClearIndex(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ClearIndex(GLbyte * pc);
+extern HIDDEN void __glXDisp_LoadMatrixd(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LoadMatrixd(GLbyte * pc);
+extern HIDDEN void __glXDisp_PushMatrix(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PushMatrix(GLbyte * pc);
+extern HIDDEN void __glXDisp_ConvolutionParameterfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ConvolutionParameterfv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetTexGendv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexGendv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_LoadProgramNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LoadProgramNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_EndList(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_EndList(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib4fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_EvalCoord1fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalCoord1fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_EvalMesh2(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalMesh2(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex4fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex4fv(GLbyte * pc);
+extern HIDDEN int __glXDisp_CheckFramebufferStatusEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CheckFramebufferStatusEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetVertexAttribivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetVertexAttribivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetFBConfigsSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetFBConfigsSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_CreateNewContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreateNewContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetMinmax(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMinmax(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetMinmaxEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMinmaxEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetVertexAttribdvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetVertexAttribdvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Normal3fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Normal3fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4ivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4ivARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_End(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_End(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs2dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord3fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramParameterfvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramParameterfvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_BindTexture(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BindTexture(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexSubImage2D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexSubImage2D(GLbyte * pc);
+extern HIDDEN void __glXDisp_DeleteRenderbuffersEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DeleteRenderbuffersEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexGenfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexGenfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4bvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4bvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_CreateContextWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreateContextWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_FramebufferTexture3DEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_FramebufferTexture3DEXT(GLbyte * pc);
+extern HIDDEN int __glXDisp_CopySubBufferMESA(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CopySubBufferMESA(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_BlendEquation(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BlendEquation(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetError(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetError(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_TexCoord3dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord3dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Indexdv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Indexdv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PushName(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PushName(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord2dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord2dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramNamedParameter4fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramNamedParameter4fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4fvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_CreateGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreateGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_MultiTexCoord1svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord1svARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_EndQueryARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EndQueryARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_DepthMask(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DepthMask(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color4iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_StencilOp(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_StencilOp(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord3svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord3svARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexEnvfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexEnvfv(GLbyte * pc);
+extern HIDDEN int __glXDisp_QueryServerString(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_QueryServerString(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_LoadMatrixf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LoadMatrixf(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color4bv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4bv(GLbyte * pc);
+extern HIDDEN void __glXDisp_SecondaryColor3usvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3usvEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib2fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib2fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_DeleteLists(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DeleteLists(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_LogicOp(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LogicOp(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord4fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord4fv(GLbyte * pc);
+extern HIDDEN int __glXDisp_WaitX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_WaitX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_SecondaryColor3uivEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3uivEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_FramebufferRenderbufferEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_FramebufferRenderbufferEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib1dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_GenTextures(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GenTextures(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GenTexturesEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GenTexturesEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_FramebufferTexture1DEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_FramebufferTexture1DEXT(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_RasterPos2sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos2sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color4ubv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4ubv(GLbyte * pc);
+extern HIDDEN void __glXDisp_DrawBuffer(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DrawBuffer(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord2fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord2fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord1sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord1sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexGeniv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexGeniv(GLbyte * pc);
+extern HIDDEN void __glXDisp_DepthFunc(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DepthFunc(GLbyte * pc);
+extern HIDDEN void __glXDisp_PixelMapusv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PixelMapusv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PointParameterivNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PointParameterivNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_BlendFunc(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BlendFunc(GLbyte * pc);
+extern HIDDEN int __glXDisp_WaitGL(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_WaitGL(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_MultiTexCoord3dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord3dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramNamedParameter4dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramNamedParameter4dvNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_Flush(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_Flush(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Color4uiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4uiv(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos3sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos3sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_BindFramebufferEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BindFramebufferEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_PushAttrib(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PushAttrib(GLbyte * pc);
+extern HIDDEN int __glXDisp_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_TexParameteriv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexParameteriv(GLbyte * pc);
+extern HIDDEN void __glXDisp_WindowPos3fvMESA(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_WindowPos3fvMESA(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib1svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib1svNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_QueryExtensionsString(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_QueryExtensionsString(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_RasterPos3fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos3fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyTexSubImage3D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyTexSubImage3D(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetColorTable(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetColorTable(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetColorTableSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetColorTableSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Indexiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Indexiv(GLbyte * pc);
+extern HIDDEN int __glXDisp_CreateContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreateContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_CopyColorTable(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyColorTable(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetHistogramParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetHistogramParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetHistogramParameterfvEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetHistogramParameterfvEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Frustum(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Frustum(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetString(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetString(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_CreateGLXPixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreateGLXPixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_TexEnvf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexEnvf(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_MultiTexCoord3ivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord3ivARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib1dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib1dvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_DeleteTextures(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DeleteTextures(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_DeleteTexturesEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DeleteTexturesEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetTexLevelParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexLevelParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_ClearAccum(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ClearAccum(GLbyte * pc);
+extern HIDDEN int __glXDisp_QueryVersion(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_QueryVersion(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetVertexAttribfvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetVertexAttribfvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_SecondaryColor3ivEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3ivEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord4iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord4iv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_SampleMaskSGIS(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SampleMaskSGIS(GLbyte * pc);
+extern HIDDEN void __glXDisp_ColorTableParameteriv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ColorTableParameteriv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4ubvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4ubvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyTexImage2D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyTexImage2D(GLbyte * pc);
+extern HIDDEN void __glXDisp_Lightfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Lightfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_ClearDepth(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ClearDepth(GLbyte * pc);
+extern HIDDEN void __glXDisp_ColorSubTable(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ColorSubTable(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color4fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord4ivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord4ivARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_CreatePixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreatePixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Lightiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Lightiv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetQueryObjectuivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetQueryObjectuivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GenRenderbuffersEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GenRenderbuffersEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib2dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib2dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs2svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs2svNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Rectdv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Rectdv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4NivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4NivARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_Materialiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Materialiv(GLbyte * pc);
+extern HIDDEN void __glXDisp_SecondaryColor3fvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3fvEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_PolygonMode(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PolygonMode(GLbyte * pc);
+extern HIDDEN void __glXDisp_CompressedTexSubImage1DARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CompressedTexSubImage1DARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib2dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetVertexAttribivNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetVertexAttribivNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_IsQueryARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsQueryARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_TexGeni(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexGeni(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexGenf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexGenf(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexGend(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexGend(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetPolygonStipple(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetPolygonStipple(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetVertexAttribfvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetVertexAttribfvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib2svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib2svNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs1fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs1fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4NuivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4NuivARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_DestroyWindow(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DestroyWindow(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Color4sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4sv(GLbyte * pc);
+extern HIDDEN int __glXDisp_IsProgramNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsProgramNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_PixelZoom(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PixelZoom(GLbyte * pc);
+extern HIDDEN void __glXDisp_ColorTableParameterfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ColorTableParameterfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PixelMapuiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PixelMapuiv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color3dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3dv(GLbyte * pc);
+extern HIDDEN int __glXDisp_IsTexture(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsTexture(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_IsTextureEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsTextureEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_DeleteQueriesARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DeleteQueriesARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetMapdv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMapdv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_DestroyGLXPixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DestroyGLXPixmap(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_SamplePatternSGIS(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SamplePatternSGIS(GLbyte * pc);
+extern HIDDEN int __glXDisp_PixelStoref(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_PixelStoref(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_PrioritizeTextures(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PrioritizeTextures(GLbyte * pc);
+extern HIDDEN int __glXDisp_PixelStorei(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_PixelStorei(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib4usvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4usvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_DestroyGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DestroyGLXPbufferSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_EvalCoord2dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalCoord2dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib3svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib3svARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_ColorMaterial(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ColorMaterial(GLbyte * pc);
+extern HIDDEN void __glXDisp_CompressedTexSubImage3DARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CompressedTexSubImage3DARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_IsFramebufferEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsFramebufferEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetVertexAttribdvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetVertexAttribdvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetSeparableFilter(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetSeparableFilter(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetSeparableFilterEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetSeparableFilterEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_RequestResidentProgramsNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RequestResidentProgramsNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_FeedbackBuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_FeedbackBuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_RasterPos2iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos2iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexImage1D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexImage1D(GLbyte * pc);
+extern HIDDEN void __glXDisp_FrontFace(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_FrontFace(GLbyte * pc);
+extern HIDDEN int __glXDisp_RenderLarge(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_RenderLarge(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib4dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_PolygonOffset(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PolygonOffset(GLbyte * pc);
+extern HIDDEN void __glXDisp_ExecuteProgramNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ExecuteProgramNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Normal3dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Normal3dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Lightf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Lightf(GLbyte * pc);
+extern HIDDEN void __glXDisp_MatrixMode(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MatrixMode(GLbyte * pc);
+extern HIDDEN void __glXDisp_FramebufferTexture2DEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_FramebufferTexture2DEXT(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetPixelMapusv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetPixelMapusv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Lighti(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Lighti(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetFramebufferAttachmentParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetFramebufferAttachmentParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_ChangeDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_ChangeDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_MultiTexCoord4dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord4dvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_CreatePbuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreatePbuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetDoublev(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetDoublev(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_MultMatrixd(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultMatrixd(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultMatrixf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultMatrixf(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord4fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_TrackMatrixNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TrackMatrixNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos4sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos4sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4NsvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4NsvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib3fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib3fvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_ClearColor(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ClearColor(GLbyte * pc);
+extern HIDDEN int __glXDisp_IsDirect(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsDirect(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_DeleteFramebuffersEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DeleteFramebuffersEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexEnviv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexEnviv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexSubImage3D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexSubImage3D(GLbyte * pc);
+extern HIDDEN int __glXDisp_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetColorTableParameterfvSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetColorTableParameterfvSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Bitmap(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Bitmap(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetTexLevelParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexLevelParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GenFramebuffersEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GenFramebuffersEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetProgramParameterdvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramParameterdvNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Vertex2sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex2sv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetIntegerv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetIntegerv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetProgramEnvParameterfvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramEnvParameterfvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetTrackMatrixivNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTrackMatrixivNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib3svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib3svNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetTexEnviv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexEnviv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_VendorPrivateWithReply(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_VendorPrivateWithReply(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_SeparableFilter2D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SeparableFilter2D(GLbyte * pc);
+extern HIDDEN void __glXDisp_Map1d(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Map1d(GLbyte * pc);
+extern HIDDEN void __glXDisp_Map1f(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Map1f(GLbyte * pc);
+extern HIDDEN void __glXDisp_CompressedTexImage2DARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CompressedTexImage2DARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexImage2D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexImage2D(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramParameters4fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramParameters4fvNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramivNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramivNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_ChangeDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_ChangeDrawableAttributes(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetMinmaxParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMinmaxParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetMinmaxParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMinmaxParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_PixelTransferf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PixelTransferf(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyTexImage1D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyTexImage1D(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos2dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos2dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Fogiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Fogiv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord1dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord1dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PixelTransferi(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PixelTransferi(GLbyte * pc);
+extern HIDDEN void __glXDisp_SecondaryColor3ubvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3ubvEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib3fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib3fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Clear(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Clear(GLbyte * pc);
+extern HIDDEN void __glXDisp_ReadBuffer(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ReadBuffer(GLbyte * pc);
+extern HIDDEN void __glXDisp_ConvolutionParameteri(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ConvolutionParameteri(GLbyte * pc);
+extern HIDDEN void __glXDisp_Ortho(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Ortho(GLbyte * pc);
+extern HIDDEN void __glXDisp_ListBase(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ListBase(GLbyte * pc);
+extern HIDDEN void __glXDisp_ConvolutionParameterf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ConvolutionParameterf(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetColorTableParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetColorTableParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetColorTableParameterivSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetColorTableParameterivSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_ReleaseTexImageEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_ReleaseTexImageEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_CallList(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CallList(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs2fvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Rectiv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Rectiv(GLbyte * pc);
+extern HIDDEN void __glXDisp_SecondaryColor3dvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3dvEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex2fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex2fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_BindRenderbufferEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BindRenderbufferEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex3sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex3sv(GLbyte * pc);
+extern HIDDEN int __glXDisp_BindTexImageEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_BindTexImageEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_ProgramLocalParameter4fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramLocalParameter4fvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_DeleteProgramsNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_DeleteProgramsNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_EvalMesh1(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalMesh1(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord1dvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord1dvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex2iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex2iv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramStringNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramStringNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_LineWidth(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LineWidth(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib2fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib2fvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexGendv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexGendv(GLbyte * pc);
+extern HIDDEN void __glXDisp_ResetMinmax(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ResetMinmax(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetConvolutionParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetConvolutionParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetConvolutionParameterfvEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetConvolutionParameterfvEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttribs4dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetMaterialfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMaterialfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_UseXFont(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_UseXFont(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_ShadeModel(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ShadeModel(GLbyte * pc);
+extern HIDDEN void __glXDisp_Materialfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Materialfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord3fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord3fv(GLbyte * pc);
+extern HIDDEN void __glXDisp_FogCoordfvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_FogCoordfvEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord1ivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord1ivARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord2ivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord2ivARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_DrawArrays(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DrawArrays(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color3iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color3iv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramLocalParameterdvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramLocalParameterdvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Rotatef(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Rotatef(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_BlendFuncSeparateEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BlendFuncSeparateEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramParameters4dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramParameters4dvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_EvalPoint2(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalPoint2(GLbyte * pc);
+extern HIDDEN void __glXDisp_EvalPoint1(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalPoint1(GLbyte * pc);
+extern HIDDEN void __glXDisp_PopMatrix(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PopMatrix(GLbyte * pc);
+extern HIDDEN int __glXDisp_MakeCurrentReadSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_MakeCurrentReadSGI(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetTexGeniv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexGeniv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_MakeCurrent(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_MakeCurrent(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Map2d(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Map2d(GLbyte * pc);
+extern HIDDEN void __glXDisp_Map2f(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Map2f(GLbyte * pc);
+extern HIDDEN void __glXDisp_ProgramStringARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ProgramStringARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetHistogram(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetHistogram(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetHistogramEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetHistogramEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_ActiveStencilFaceEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_Materialf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Materialf(GLbyte * pc);
+extern HIDDEN void __glXDisp_Materiali(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Materiali(GLbyte * pc);
+extern HIDDEN void __glXDisp_Indexsv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Indexsv(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord4svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord4svARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_LightModelfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LightModelfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexCoord2dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord2dv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GenQueriesARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GenQueriesARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_EvalCoord1dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_EvalCoord1dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Translated(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Translated(GLbyte * pc);
+extern HIDDEN void __glXDisp_Translatef(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Translatef(GLbyte * pc);
+extern HIDDEN void __glXDisp_StencilMask(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_StencilMask(GLbyte * pc);
+extern HIDDEN int __glXDisp_CreateWindow(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_CreateWindow(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetLightiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetLightiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_IsList(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_IsList(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_RenderMode(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_RenderMode(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_DrawBuffersARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DrawBuffersARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_LoadName(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LoadName(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyTexSubImage1D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyTexSubImage1D(GLbyte * pc);
+extern HIDDEN void __glXDisp_CullFace(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CullFace(GLbyte * pc);
+extern HIDDEN int __glXDisp_QueryContextInfoEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_QueryContextInfoEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttribs3svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs3svNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_StencilFunc(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_StencilFunc(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyPixels(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyPixels(GLbyte * pc);
+extern HIDDEN void __glXDisp_Rectsv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Rectsv(GLbyte * pc);
+extern HIDDEN void __glXDisp_CopyConvolutionFilter2D(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyConvolutionFilter2D(GLbyte * pc);
+extern HIDDEN void __glXDisp_TexParameterfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexParameterfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4uivARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4uivARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_ClipPlane(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ClipPlane(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetPixelMapuiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetPixelMapuiv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Indexfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Indexfv(GLbyte * pc);
+extern HIDDEN int __glXDisp_QueryContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_QueryContext(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_SecondaryColor3svEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_SecondaryColor3svEXT(GLbyte * pc);
+extern HIDDEN void __glXDisp_IndexMask(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_IndexMask(GLbyte * pc);
+extern HIDDEN void __glXDisp_BindProgramNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BindProgramNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4svARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetFloatv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetFloatv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_TexCoord3sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord3sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_PopAttrib(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_PopAttrib(GLbyte * pc);
+extern HIDDEN void __glXDisp_Fogfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Fogfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_InitNames(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_InitNames(GLbyte * pc);
+extern HIDDEN void __glXDisp_Normal3sv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Normal3sv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Minmax(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Minmax(GLbyte * pc);
+extern HIDDEN void __glXDisp_FogCoorddvEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_FogCoorddvEXT(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetBooleanv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetBooleanv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Hint(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Hint(GLbyte * pc);
+extern HIDDEN void __glXDisp_Color4dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Color4dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib2svARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib2svARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_AreProgramsResidentNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_AreProgramsResidentNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_CopyColorSubTable(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_CopyColorSubTable(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib4NubvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4NubvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttrib3dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex4iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex4iv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetProgramEnvParameterdvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetProgramEnvParameterdvARB(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_TexCoord4dv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_TexCoord4dv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Begin(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Begin(GLbyte * pc);
+extern HIDDEN int __glXDisp_ClientInfo(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_ClientInfo(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Rectfv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Rectfv(GLbyte * pc);
+extern HIDDEN void __glXDisp_LightModelf(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_LightModelf(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetTexParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetTexParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetLightfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetLightfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_Disable(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Disable(GLbyte * pc);
+extern HIDDEN void __glXDisp_MultiTexCoord2fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetRenderbufferParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetRenderbufferParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_SelectBuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_SelectBuffer(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_ColorMask(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_ColorMask(GLbyte * pc);
+extern HIDDEN void __glXDisp_RasterPos4iv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_RasterPos4iv(GLbyte * pc);
+extern HIDDEN void __glXDisp_Enable(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Enable(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs4svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs4svNV(GLbyte * pc);
+extern HIDDEN int __glXDisp_GetMinmaxParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMinmaxParameterfv(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDisp_GetMinmaxParameterfvEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GetMinmaxParameterfvEXT(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib1fvARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib1fvARB(GLbyte * pc);
+extern HIDDEN void __glXDisp_VertexAttribs1svNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttribs1svNV(GLbyte * pc);
+extern HIDDEN void __glXDisp_Vertex3fv(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_Vertex3fv(GLbyte * pc);
+extern HIDDEN int __glXDisp_GenProgramsNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN int __glXDispSwap_GenProgramsNV(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_VertexAttrib4dvNV(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc);
+
+# undef HIDDEN
+
+#endif /* !defined( _INDIRECT_DISPATCH_H_ ) */
diff --git a/xorg-server/glx/indirect_reqsize.h b/xorg-server/glx/indirect_reqsize.h index 26211ee5c..812705c05 100644 --- a/xorg-server/glx/indirect_reqsize.h +++ b/xorg-server/glx/indirect_reqsize.h @@ -1,121 +1,121 @@ -/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2005 - * 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, sub license, - * 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS 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. - */ - -#if !defined( _INDIRECT_REQSIZE_H_ ) -# define _INDIRECT_REQSIZE_H_ - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) -# define HIDDEN __attribute__((visibility("hidden"))) -# else -# define HIDDEN -# endif - -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif - -extern PURE HIDDEN int __glXCallListsReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXBitmapReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXFogfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXFogivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXLightfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXLightivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXLightModelfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXLightModelivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXMaterialfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXMaterialivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXPolygonStippleReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexParameterfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexParameterivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexImage1DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexImage2DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexEnvfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexEnvivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexGendvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexGenfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexGenivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXMap1dReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXMap1fReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXMap2dReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXMap2fReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXPixelMapfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXPixelMapuivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXPixelMapusvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXDrawPixelsReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXDrawArraysReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXColorTableReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXColorTableParameterivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXColorSubTableReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexImage3DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXLoadProgramNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXRequestResidentProgramsNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXPointParameterivNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte *pc, Bool swap); -extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap); - -# undef HIDDEN -# undef PURE - -#endif /* !defined( _INDIRECT_REQSIZE_H_ ) */ +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2005
+ * 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, sub license,
+ * 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 (including the next
+ * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS 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.
+ */
+
+#if !defined( _INDIRECT_REQSIZE_H_ )
+# define _INDIRECT_REQSIZE_H_
+
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# define HIDDEN __attribute__((visibility("hidden")))
+# else
+# define HIDDEN
+# endif
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PURE __attribute__((pure))
+# else
+# define PURE
+# endif
+
+extern PURE HIDDEN int __glXCallListsReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXBitmapReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXFogfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXFogivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXLightfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXLightivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXLightModelfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXLightModelivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXMaterialfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXMaterialivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPolygonStippleReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexParameterfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexParameterivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexImage1DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexImage2DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexEnvfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexEnvivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexGendvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexGenfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexGenivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXMap1dReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXMap1fReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXMap2dReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXMap2fReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPixelMapfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPixelMapuivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPixelMapusvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXDrawPixelsReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXDrawArraysReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXColorTableReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXColorTableParameterivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXColorSubTableReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexImage3DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXLoadProgramNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXRequestResidentProgramsNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPointParameterivNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap);
+
+# undef HIDDEN
+# undef PURE
+
+#endif /* !defined( _INDIRECT_REQSIZE_H_ ) */
diff --git a/xorg-server/glx/indirect_size.h b/xorg-server/glx/indirect_size.h index 9ba0bd690..0eb5ef63e 100644 --- a/xorg-server/glx/indirect_size.h +++ b/xorg-server/glx/indirect_size.h @@ -1,88 +1,88 @@ -/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2004 - * 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, sub license, - * 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS 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. - */ - -#if !defined( _INDIRECT_SIZE_H_ ) -# define _INDIRECT_SIZE_H_ - -/** - * \file - * Prototypes for functions used to determine the number of data elements in - * various GLX protocol messages. - * - * \author Ian Romanick <idr@us.ibm.com> - */ - -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif - -# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define FASTCALL __attribute__((fastcall)) -# else -# define FASTCALL -# endif - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) -# define INTERNAL __attribute__((visibility("internal"))) -# else -# define INTERNAL -# endif - -extern INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glLightiv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glLightModeliv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glMaterialiv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glTexParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glTexEnviv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glTexGenfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glTexGeniv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glMap1f_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glMap2f_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glColorTableParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glConvolutionParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glPointParameterfvEXT_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glPointParameterivNV_size(GLenum); - -# undef PURE -# undef FASTCALL -# undef INTERNAL - -#endif /* !defined( _INDIRECT_SIZE_H_ ) */ +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2004
+ * 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, sub license,
+ * 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 (including the next
+ * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS 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.
+ */
+
+#if !defined( _INDIRECT_SIZE_H_ )
+# define _INDIRECT_SIZE_H_
+
+/**
+ * \file
+ * Prototypes for functions used to determine the number of data elements in
+ * various GLX protocol messages.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PURE __attribute__((pure))
+# else
+# define PURE
+# endif
+
+# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define FASTCALL __attribute__((fastcall))
+# else
+# define FASTCALL
+# endif
+
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# define INTERNAL __attribute__((visibility("internal")))
+# else
+# define INTERNAL
+# endif
+
+extern INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glLightfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glLightiv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glLightModelfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glLightModeliv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glMaterialfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glMaterialiv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glTexParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glTexParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glTexEnvfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glTexEnviv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glTexGendv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glTexGenfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glTexGeniv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glMap1d_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glMap1f_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glMap2d_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glMap2f_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glColorTableParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glColorTableParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glConvolutionParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glConvolutionParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glPointParameterfvEXT_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glPointParameterivNV_size(GLenum);
+
+# undef PURE
+# undef FASTCALL
+# undef INTERNAL
+
+#endif /* !defined( _INDIRECT_SIZE_H_ ) */
diff --git a/xorg-server/glx/indirect_size_get.c b/xorg-server/glx/indirect_size_get.c index 7b8fa49cd..af4ec9e8e 100644 --- a/xorg-server/glx/indirect_size_get.c +++ b/xorg-server/glx/indirect_size_get.c @@ -1,1231 +1,1231 @@ -/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2004 - * 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, sub license, - * 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#else - -#include "glheader.h" - -#endif - -#include <GL/gl.h> -#include "indirect_size_get.h" -#include "glxserver.h" -#include "indirect_util.h" -#include "indirect_size.h" - -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif - -# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define FASTCALL __attribute__((fastcall)) -# else -# define FASTCALL -# endif - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) -# define INTERNAL __attribute__((visibility("internal"))) -# else -# define INTERNAL -# endif - - -#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) -# undef HAVE_ALIAS -#endif -#ifdef HAVE_ALIAS -# define ALIAS2(from,to) \ - INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \ - __attribute__ ((alias( # to ))); -# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size ) -#else -# define ALIAS(from,to) \ - INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \ - { return __gl ## to ## _size( e ); } -#endif - - -INTERNAL PURE FASTCALL GLint -__glCallLists_size(GLenum e) -{ - switch (e) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - return 1; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_2_BYTES: - return 2; - case GL_3_BYTES: - return 3; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - case GL_4_BYTES: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glFogfv_size(GLenum e) -{ - switch (e) { - case GL_FOG_INDEX: - case GL_FOG_DENSITY: - case GL_FOG_START: - case GL_FOG_END: - case GL_FOG_MODE: - case GL_FOG_OFFSET_VALUE_SGIX: - case GL_FOG_DISTANCE_MODE_NV: - return 1; - case GL_FOG_COLOR: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glLightfv_size(GLenum e) -{ - switch (e) { - case GL_SPOT_EXPONENT: - case GL_SPOT_CUTOFF: - case GL_CONSTANT_ATTENUATION: - case GL_LINEAR_ATTENUATION: - case GL_QUADRATIC_ATTENUATION: - return 1; - case GL_SPOT_DIRECTION: - return 3; - case GL_AMBIENT: - case GL_DIFFUSE: - case GL_SPECULAR: - case GL_POSITION: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glLightModelfv_size(GLenum e) -{ - switch (e) { - case GL_LIGHT_MODEL_LOCAL_VIEWER: - case GL_LIGHT_MODEL_TWO_SIDE: - case GL_LIGHT_MODEL_COLOR_CONTROL: -/* case GL_LIGHT_MODEL_COLOR_CONTROL_EXT:*/ - return 1; - case GL_LIGHT_MODEL_AMBIENT: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glMaterialfv_size(GLenum e) -{ - switch (e) { - case GL_SHININESS: - return 1; - case GL_COLOR_INDEXES: - return 3; - case GL_AMBIENT: - case GL_DIFFUSE: - case GL_SPECULAR: - case GL_EMISSION: - case GL_AMBIENT_AND_DIFFUSE: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glTexParameterfv_size(GLenum e) -{ - switch (e) { - case GL_TEXTURE_MAG_FILTER: - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - case GL_TEXTURE_PRIORITY: - case GL_TEXTURE_WRAP_R: - case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: -/* case GL_SHADOW_AMBIENT_SGIX:*/ - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_CLIPMAP_FRAME_SGIX: - case GL_TEXTURE_LOD_BIAS_S_SGIX: - case GL_TEXTURE_LOD_BIAS_T_SGIX: - case GL_TEXTURE_LOD_BIAS_R_SGIX: - case GL_GENERATE_MIPMAP: -/* case GL_GENERATE_MIPMAP_SGIS:*/ - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - case GL_TEXTURE_MAX_CLAMP_S_SGIX: - case GL_TEXTURE_MAX_CLAMP_T_SGIX: - case GL_TEXTURE_MAX_CLAMP_R_SGIX: - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - case GL_TEXTURE_LOD_BIAS: -/* case GL_TEXTURE_LOD_BIAS_EXT:*/ - case GL_DEPTH_TEXTURE_MODE: -/* case GL_DEPTH_TEXTURE_MODE_ARB:*/ - case GL_TEXTURE_COMPARE_MODE: -/* case GL_TEXTURE_COMPARE_MODE_ARB:*/ - case GL_TEXTURE_COMPARE_FUNC: -/* case GL_TEXTURE_COMPARE_FUNC_ARB:*/ - case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: - return 1; - case GL_TEXTURE_CLIPMAP_CENTER_SGIX: - case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: - return 2; - case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: - return 3; - case GL_TEXTURE_BORDER_COLOR: - case GL_POST_TEXTURE_FILTER_BIAS_SGIX: - case GL_POST_TEXTURE_FILTER_SCALE_SGIX: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glTexEnvfv_size(GLenum e) -{ - switch (e) { - case GL_ALPHA_SCALE: - case GL_TEXTURE_ENV_MODE: - case GL_TEXTURE_LOD_BIAS: - case GL_COMBINE_RGB: - case GL_COMBINE_ALPHA: - case GL_RGB_SCALE: - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - case GL_SOURCE3_RGB_NV: - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - case GL_SOURCE3_ALPHA_NV: - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - case GL_OPERAND3_RGB_NV: - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - case GL_OPERAND3_ALPHA_NV: - case GL_COORD_REPLACE_ARB: -/* case GL_COORD_REPLACE_NV:*/ - return 1; - case GL_TEXTURE_ENV_COLOR: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glTexGendv_size(GLenum e) -{ - switch (e) { - case GL_TEXTURE_GEN_MODE: - return 1; - case GL_OBJECT_PLANE: - case GL_EYE_PLANE: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glMap1d_size(GLenum e) -{ - switch (e) { - case GL_MAP1_INDEX: - case GL_MAP1_TEXTURE_COORD_1: - return 1; - case GL_MAP1_TEXTURE_COORD_2: - return 2; - case GL_MAP1_NORMAL: - case GL_MAP1_TEXTURE_COORD_3: - case GL_MAP1_VERTEX_3: - return 3; - case GL_MAP1_COLOR_4: - case GL_MAP1_TEXTURE_COORD_4: - case GL_MAP1_VERTEX_4: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glMap2d_size(GLenum e) -{ - switch (e) { - case GL_MAP2_INDEX: - case GL_MAP2_TEXTURE_COORD_1: - return 1; - case GL_MAP2_TEXTURE_COORD_2: - return 2; - case GL_MAP2_NORMAL: - case GL_MAP2_TEXTURE_COORD_3: - case GL_MAP2_VERTEX_3: - return 3; - case GL_MAP2_COLOR_4: - case GL_MAP2_TEXTURE_COORD_4: - case GL_MAP2_VERTEX_4: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetBooleanv_size(GLenum e) -{ - switch (e) { - case GL_CURRENT_INDEX: - case GL_CURRENT_RASTER_INDEX: - case GL_CURRENT_RASTER_POSITION_VALID: - case GL_CURRENT_RASTER_DISTANCE: - case GL_POINT_SMOOTH: - case GL_POINT_SIZE: - case GL_SMOOTH_POINT_SIZE_GRANULARITY: - case GL_LINE_SMOOTH: - case GL_LINE_WIDTH: - case GL_LINE_WIDTH_GRANULARITY: - case GL_LINE_STIPPLE: - case GL_LINE_STIPPLE_PATTERN: - case GL_LINE_STIPPLE_REPEAT: - case GL_LIST_MODE: - case GL_MAX_LIST_NESTING: - case GL_LIST_BASE: - case GL_LIST_INDEX: - case GL_POLYGON_SMOOTH: - case GL_POLYGON_STIPPLE: - case GL_EDGE_FLAG: - case GL_CULL_FACE: - case GL_CULL_FACE_MODE: - case GL_FRONT_FACE: - case GL_LIGHTING: - case GL_LIGHT_MODEL_LOCAL_VIEWER: - case GL_LIGHT_MODEL_TWO_SIDE: - case GL_SHADE_MODEL: - case GL_COLOR_MATERIAL_FACE: - case GL_COLOR_MATERIAL_PARAMETER: - case GL_COLOR_MATERIAL: - case GL_FOG: - case GL_FOG_INDEX: - case GL_FOG_DENSITY: - case GL_FOG_START: - case GL_FOG_END: - case GL_FOG_MODE: - case GL_DEPTH_TEST: - case GL_DEPTH_WRITEMASK: - case GL_DEPTH_CLEAR_VALUE: - case GL_DEPTH_FUNC: - case GL_STENCIL_TEST: - case GL_STENCIL_CLEAR_VALUE: - case GL_STENCIL_FUNC: - case GL_STENCIL_VALUE_MASK: - case GL_STENCIL_FAIL: - case GL_STENCIL_PASS_DEPTH_FAIL: - case GL_STENCIL_PASS_DEPTH_PASS: - case GL_STENCIL_REF: - case GL_STENCIL_WRITEMASK: - case GL_MATRIX_MODE: - case GL_NORMALIZE: - case GL_MODELVIEW_STACK_DEPTH: - case GL_PROJECTION_STACK_DEPTH: - case GL_TEXTURE_STACK_DEPTH: - case GL_ATTRIB_STACK_DEPTH: - case GL_CLIENT_ATTRIB_STACK_DEPTH: - case GL_ALPHA_TEST: - case GL_ALPHA_TEST_FUNC: - case GL_ALPHA_TEST_REF: - case GL_DITHER: - case GL_BLEND_DST: - case GL_BLEND_SRC: - case GL_BLEND: - case GL_LOGIC_OP_MODE: - case GL_LOGIC_OP: - case GL_AUX_BUFFERS: - case GL_DRAW_BUFFER: - case GL_READ_BUFFER: - case GL_SCISSOR_TEST: - case GL_INDEX_CLEAR_VALUE: - case GL_INDEX_WRITEMASK: - case GL_INDEX_MODE: - case GL_RGBA_MODE: - case GL_DOUBLEBUFFER: - case GL_STEREO: - case GL_RENDER_MODE: - case GL_PERSPECTIVE_CORRECTION_HINT: - case GL_POINT_SMOOTH_HINT: - case GL_LINE_SMOOTH_HINT: - case GL_POLYGON_SMOOTH_HINT: - case GL_FOG_HINT: - case GL_TEXTURE_GEN_S: - case GL_TEXTURE_GEN_T: - case GL_TEXTURE_GEN_R: - case GL_TEXTURE_GEN_Q: - case GL_PIXEL_MAP_I_TO_I: - case GL_PIXEL_MAP_I_TO_I_SIZE: - case GL_PIXEL_MAP_S_TO_S_SIZE: - case GL_PIXEL_MAP_I_TO_R_SIZE: - case GL_PIXEL_MAP_I_TO_G_SIZE: - case GL_PIXEL_MAP_I_TO_B_SIZE: - case GL_PIXEL_MAP_I_TO_A_SIZE: - case GL_PIXEL_MAP_R_TO_R_SIZE: - case GL_PIXEL_MAP_G_TO_G_SIZE: - case GL_PIXEL_MAP_B_TO_B_SIZE: - case GL_PIXEL_MAP_A_TO_A_SIZE: - case GL_UNPACK_SWAP_BYTES: - case GL_UNPACK_LSB_FIRST: - case GL_UNPACK_ROW_LENGTH: - case GL_UNPACK_SKIP_ROWS: - case GL_UNPACK_SKIP_PIXELS: - case GL_UNPACK_ALIGNMENT: - case GL_PACK_SWAP_BYTES: - case GL_PACK_LSB_FIRST: - case GL_PACK_ROW_LENGTH: - case GL_PACK_SKIP_ROWS: - case GL_PACK_SKIP_PIXELS: - case GL_PACK_ALIGNMENT: - case GL_MAP_COLOR: - case GL_MAP_STENCIL: - case GL_INDEX_SHIFT: - case GL_INDEX_OFFSET: - case GL_RED_SCALE: - case GL_RED_BIAS: - case GL_ZOOM_X: - case GL_ZOOM_Y: - case GL_GREEN_SCALE: - case GL_GREEN_BIAS: - case GL_BLUE_SCALE: - case GL_BLUE_BIAS: - case GL_ALPHA_SCALE: - case GL_ALPHA_BIAS: - case GL_DEPTH_SCALE: - case GL_DEPTH_BIAS: - case GL_MAX_EVAL_ORDER: - case GL_MAX_LIGHTS: - case GL_MAX_CLIP_PLANES: - case GL_MAX_TEXTURE_SIZE: - case GL_MAX_PIXEL_MAP_TABLE: - case GL_MAX_ATTRIB_STACK_DEPTH: - case GL_MAX_MODELVIEW_STACK_DEPTH: - case GL_MAX_NAME_STACK_DEPTH: - case GL_MAX_PROJECTION_STACK_DEPTH: - case GL_MAX_TEXTURE_STACK_DEPTH: - case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - case GL_SUBPIXEL_BITS: - case GL_INDEX_BITS: - case GL_RED_BITS: - case GL_GREEN_BITS: - case GL_BLUE_BITS: - case GL_ALPHA_BITS: - case GL_DEPTH_BITS: - case GL_STENCIL_BITS: - case GL_ACCUM_RED_BITS: - case GL_ACCUM_GREEN_BITS: - case GL_ACCUM_BLUE_BITS: - case GL_ACCUM_ALPHA_BITS: - case GL_NAME_STACK_DEPTH: - case GL_AUTO_NORMAL: - case GL_MAP1_COLOR_4: - case GL_MAP1_INDEX: - case GL_MAP1_NORMAL: - case GL_MAP1_TEXTURE_COORD_1: - case GL_MAP1_TEXTURE_COORD_2: - case GL_MAP1_TEXTURE_COORD_3: - case GL_MAP1_TEXTURE_COORD_4: - case GL_MAP1_VERTEX_3: - case GL_MAP1_VERTEX_4: - case GL_MAP2_COLOR_4: - case GL_MAP2_INDEX: - case GL_MAP2_NORMAL: - case GL_MAP2_TEXTURE_COORD_1: - case GL_MAP2_TEXTURE_COORD_2: - case GL_MAP2_TEXTURE_COORD_3: - case GL_MAP2_TEXTURE_COORD_4: - case GL_MAP2_VERTEX_3: - case GL_MAP2_VERTEX_4: - case GL_MAP1_GRID_SEGMENTS: - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_POLYGON_OFFSET_UNITS: - case GL_CLIP_PLANE0: - case GL_CLIP_PLANE1: - case GL_CLIP_PLANE2: - case GL_CLIP_PLANE3: - case GL_CLIP_PLANE4: - case GL_CLIP_PLANE5: - case GL_LIGHT0: - case GL_LIGHT1: - case GL_LIGHT2: - case GL_LIGHT3: - case GL_LIGHT4: - case GL_LIGHT5: - case GL_LIGHT6: - case GL_LIGHT7: - case GL_BLEND_EQUATION: -/* case GL_BLEND_EQUATION_EXT:*/ - case GL_CONVOLUTION_1D: - case GL_CONVOLUTION_2D: - case GL_SEPARABLE_2D: - case GL_MAX_CONVOLUTION_WIDTH: -/* case GL_MAX_CONVOLUTION_WIDTH_EXT:*/ - case GL_MAX_CONVOLUTION_HEIGHT: -/* case GL_MAX_CONVOLUTION_HEIGHT_EXT:*/ - case GL_POST_CONVOLUTION_RED_SCALE: -/* case GL_POST_CONVOLUTION_RED_SCALE_EXT:*/ - case GL_POST_CONVOLUTION_GREEN_SCALE: -/* case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:*/ - case GL_POST_CONVOLUTION_BLUE_SCALE: -/* case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:*/ - case GL_POST_CONVOLUTION_ALPHA_SCALE: -/* case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:*/ - case GL_POST_CONVOLUTION_RED_BIAS: -/* case GL_POST_CONVOLUTION_RED_BIAS_EXT:*/ - case GL_POST_CONVOLUTION_GREEN_BIAS: -/* case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:*/ - case GL_POST_CONVOLUTION_BLUE_BIAS: -/* case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:*/ - case GL_POST_CONVOLUTION_ALPHA_BIAS: -/* case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:*/ - case GL_HISTOGRAM: - case GL_MINMAX: - case GL_POLYGON_OFFSET_FACTOR: - case GL_RESCALE_NORMAL: -/* case GL_RESCALE_NORMAL_EXT:*/ - case GL_TEXTURE_BINDING_1D: - case GL_TEXTURE_BINDING_2D: - case GL_TEXTURE_BINDING_3D: - case GL_PACK_SKIP_IMAGES: - case GL_PACK_IMAGE_HEIGHT: - case GL_UNPACK_SKIP_IMAGES: - case GL_UNPACK_IMAGE_HEIGHT: - case GL_TEXTURE_3D: - case GL_MAX_3D_TEXTURE_SIZE: - case GL_VERTEX_ARRAY: - case GL_NORMAL_ARRAY: - case GL_COLOR_ARRAY: - case GL_INDEX_ARRAY: - case GL_TEXTURE_COORD_ARRAY: - case GL_EDGE_FLAG_ARRAY: - case GL_VERTEX_ARRAY_SIZE: - case GL_VERTEX_ARRAY_TYPE: - case GL_VERTEX_ARRAY_STRIDE: - case GL_NORMAL_ARRAY_TYPE: - case GL_NORMAL_ARRAY_STRIDE: - case GL_COLOR_ARRAY_SIZE: - case GL_COLOR_ARRAY_TYPE: - case GL_COLOR_ARRAY_STRIDE: - case GL_INDEX_ARRAY_TYPE: - case GL_INDEX_ARRAY_STRIDE: - case GL_TEXTURE_COORD_ARRAY_SIZE: - case GL_TEXTURE_COORD_ARRAY_TYPE: - case GL_TEXTURE_COORD_ARRAY_STRIDE: - case GL_EDGE_FLAG_ARRAY_STRIDE: - case GL_MULTISAMPLE: -/* case GL_MULTISAMPLE_ARB:*/ - case GL_SAMPLE_ALPHA_TO_COVERAGE: -/* case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:*/ - case GL_SAMPLE_ALPHA_TO_ONE: -/* case GL_SAMPLE_ALPHA_TO_ONE_ARB:*/ - case GL_SAMPLE_COVERAGE: -/* case GL_SAMPLE_COVERAGE_ARB:*/ - case GL_SAMPLE_BUFFERS: -/* case GL_SAMPLE_BUFFERS_ARB:*/ - case GL_SAMPLES: -/* case GL_SAMPLES_ARB:*/ - case GL_SAMPLE_COVERAGE_VALUE: -/* case GL_SAMPLE_COVERAGE_VALUE_ARB:*/ - case GL_SAMPLE_COVERAGE_INVERT: -/* case GL_SAMPLE_COVERAGE_INVERT_ARB:*/ - case GL_COLOR_MATRIX_STACK_DEPTH: - case GL_MAX_COLOR_MATRIX_STACK_DEPTH: - case GL_POST_COLOR_MATRIX_RED_SCALE: - case GL_POST_COLOR_MATRIX_GREEN_SCALE: - case GL_POST_COLOR_MATRIX_BLUE_SCALE: - case GL_POST_COLOR_MATRIX_ALPHA_SCALE: - case GL_POST_COLOR_MATRIX_RED_BIAS: - case GL_POST_COLOR_MATRIX_GREEN_BIAS: - case GL_POST_COLOR_MATRIX_BLUE_BIAS: - case GL_POST_COLOR_MATRIX_ALPHA_BIAS: - case GL_BLEND_DST_RGB: - case GL_BLEND_SRC_RGB: - case GL_BLEND_DST_ALPHA: - case GL_BLEND_SRC_ALPHA: - case GL_COLOR_TABLE: - case GL_POST_CONVOLUTION_COLOR_TABLE: - case GL_POST_COLOR_MATRIX_COLOR_TABLE: - case GL_MAX_ELEMENTS_VERTICES: - case GL_MAX_ELEMENTS_INDICES: - case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: - case GL_POINT_SIZE_MIN: - case GL_POINT_SIZE_MAX: - case GL_POINT_FADE_THRESHOLD_SIZE: - case GL_OCCLUSION_TEST_HP: - case GL_OCCLUSION_TEST_RESULT_HP: - case GL_LIGHT_MODEL_COLOR_CONTROL: - case GL_CURRENT_FOG_COORD: - case GL_FOG_COORDINATE_ARRAY_TYPE: - case GL_FOG_COORDINATE_ARRAY_STRIDE: - case GL_FOG_COORD_ARRAY: - case GL_COLOR_SUM_ARB: - case GL_SECONDARY_COLOR_ARRAY_SIZE: - case GL_SECONDARY_COLOR_ARRAY_TYPE: - case GL_SECONDARY_COLOR_ARRAY_STRIDE: - case GL_SECONDARY_COLOR_ARRAY: - case GL_ACTIVE_TEXTURE: -/* case GL_ACTIVE_TEXTURE_ARB:*/ - case GL_CLIENT_ACTIVE_TEXTURE: -/* case GL_CLIENT_ACTIVE_TEXTURE_ARB:*/ - case GL_MAX_TEXTURE_UNITS: -/* case GL_MAX_TEXTURE_UNITS_ARB:*/ - case GL_MAX_RENDERBUFFER_SIZE_EXT: - case GL_TEXTURE_COMPRESSION_HINT: -/* case GL_TEXTURE_COMPRESSION_HINT_ARB:*/ - case GL_TEXTURE_RECTANGLE_ARB: -/* case GL_TEXTURE_RECTANGLE_NV:*/ - case GL_TEXTURE_BINDING_RECTANGLE_ARB: -/* case GL_TEXTURE_BINDING_RECTANGLE_NV:*/ - case GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB: -/* case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:*/ - case GL_MAX_TEXTURE_LOD_BIAS: - case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: - case GL_MAX_SHININESS_NV: - case GL_MAX_SPOT_EXPONENT_NV: - case GL_TEXTURE_CUBE_MAP: -/* case GL_TEXTURE_CUBE_MAP_ARB:*/ - case GL_TEXTURE_BINDING_CUBE_MAP: -/* case GL_TEXTURE_BINDING_CUBE_MAP_ARB:*/ - case GL_MAX_CUBE_MAP_TEXTURE_SIZE: -/* case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:*/ - case GL_MULTISAMPLE_FILTER_HINT_NV: - case GL_FOG_DISTANCE_MODE_NV: - case GL_VERTEX_PROGRAM_ARB: - case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: - case GL_MAX_PROGRAM_MATRICES_ARB: - case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - case GL_PROGRAM_ERROR_POSITION_ARB: - case GL_DEPTH_CLAMP_NV: - case GL_NUM_COMPRESSED_TEXTURE_FORMATS: -/* case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:*/ - case GL_MAX_VERTEX_UNITS_ARB: - case GL_ACTIVE_VERTEX_UNITS_ARB: - case GL_WEIGHT_SUM_UNITY_ARB: - case GL_VERTEX_BLEND_ARB: - case GL_CURRENT_WEIGHT_ARB: - case GL_WEIGHT_ARRAY_TYPE_ARB: - case GL_WEIGHT_ARRAY_STRIDE_ARB: - case GL_WEIGHT_ARRAY_SIZE_ARB: - case GL_WEIGHT_ARRAY_ARB: - case GL_PACK_INVERT_MESA: - case GL_STENCIL_BACK_FUNC_ATI: - case GL_STENCIL_BACK_FAIL_ATI: - case GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI: - case GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI: - case GL_FRAGMENT_PROGRAM_ARB: - case GL_MAX_DRAW_BUFFERS_ARB: -/* case GL_MAX_DRAW_BUFFERS_ATI:*/ - case GL_DRAW_BUFFER0_ARB: -/* case GL_DRAW_BUFFER0_ATI:*/ - case GL_DRAW_BUFFER1_ARB: -/* case GL_DRAW_BUFFER1_ATI:*/ - case GL_DRAW_BUFFER2_ARB: -/* case GL_DRAW_BUFFER2_ATI:*/ - case GL_DRAW_BUFFER3_ARB: -/* case GL_DRAW_BUFFER3_ATI:*/ - case GL_DRAW_BUFFER4_ARB: -/* case GL_DRAW_BUFFER4_ATI:*/ - case GL_DRAW_BUFFER5_ARB: -/* case GL_DRAW_BUFFER5_ATI:*/ - case GL_DRAW_BUFFER6_ARB: -/* case GL_DRAW_BUFFER6_ATI:*/ - case GL_DRAW_BUFFER7_ARB: -/* case GL_DRAW_BUFFER7_ATI:*/ - case GL_DRAW_BUFFER8_ARB: -/* case GL_DRAW_BUFFER8_ATI:*/ - case GL_DRAW_BUFFER9_ARB: -/* case GL_DRAW_BUFFER9_ATI:*/ - case GL_DRAW_BUFFER10_ARB: -/* case GL_DRAW_BUFFER10_ATI:*/ - case GL_DRAW_BUFFER11_ARB: -/* case GL_DRAW_BUFFER11_ATI:*/ - case GL_DRAW_BUFFER12_ARB: -/* case GL_DRAW_BUFFER12_ATI:*/ - case GL_DRAW_BUFFER13_ARB: -/* case GL_DRAW_BUFFER13_ATI:*/ - case GL_DRAW_BUFFER14_ARB: -/* case GL_DRAW_BUFFER14_ATI:*/ - case GL_DRAW_BUFFER15_ARB: -/* case GL_DRAW_BUFFER15_ATI:*/ - case GL_BLEND_EQUATION_ALPHA_EXT: - case GL_MATRIX_PALETTE_ARB: - case GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB: - case GL_MAX_PALETTE_MATRICES_ARB: - case GL_CURRENT_PALETTE_MATRIX_ARB: - case GL_MATRIX_INDEX_ARRAY_ARB: - case GL_CURRENT_MATRIX_INDEX_ARB: - case GL_MATRIX_INDEX_ARRAY_SIZE_ARB: - case GL_MATRIX_INDEX_ARRAY_TYPE_ARB: - case GL_MATRIX_INDEX_ARRAY_STRIDE_ARB: - case GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT: - case GL_POINT_SPRITE_ARB: -/* case GL_POINT_SPRITE_NV:*/ - case GL_POINT_SPRITE_R_MODE_NV: - case GL_MAX_VERTEX_ATTRIBS_ARB: - case GL_MAX_TEXTURE_COORDS_ARB: - case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: - case GL_DEPTH_BOUNDS_TEST_EXT: - case GL_ARRAY_BUFFER_BINDING_ARB: - case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT: - case GL_STENCIL_TEST_TWO_SIDE_EXT: - case GL_ACTIVE_STENCIL_FACE_EXT: - case GL_TEXTURE_BINDING_1D_ARRAY_EXT: - case GL_TEXTURE_BINDING_2D_ARRAY_EXT: - case GL_DRAW_FRAMEBUFFER_BINDING_EXT: - case GL_RENDERBUFFER_BINDING_EXT: - case GL_READ_FRAMEBUFFER_BINDING_EXT: - case GL_MAX_COLOR_ATTACHMENTS_EXT: - case GL_RASTER_POSITION_UNCLIPPED_IBM: - return 1; - case GL_SMOOTH_POINT_SIZE_RANGE: - case GL_LINE_WIDTH_RANGE: - case GL_POLYGON_MODE: - case GL_DEPTH_RANGE: - case GL_MAX_VIEWPORT_DIMS: - case GL_MAP1_GRID_DOMAIN: - case GL_MAP2_GRID_SEGMENTS: - case GL_ALIASED_POINT_SIZE_RANGE: - case GL_ALIASED_LINE_WIDTH_RANGE: - case GL_DEPTH_BOUNDS_EXT: - return 2; - case GL_CURRENT_NORMAL: - case GL_POINT_DISTANCE_ATTENUATION: - return 3; - case GL_CURRENT_COLOR: - case GL_CURRENT_TEXTURE_COORDS: - case GL_CURRENT_RASTER_COLOR: - case GL_CURRENT_RASTER_TEXTURE_COORDS: - case GL_CURRENT_RASTER_POSITION: - case GL_LIGHT_MODEL_AMBIENT: - case GL_FOG_COLOR: - case GL_ACCUM_CLEAR_VALUE: - case GL_VIEWPORT: - case GL_SCISSOR_BOX: - case GL_COLOR_CLEAR_VALUE: - case GL_COLOR_WRITEMASK: - case GL_MAP2_GRID_DOMAIN: - case GL_BLEND_COLOR: -/* case GL_BLEND_COLOR_EXT:*/ - case GL_CURRENT_SECONDARY_COLOR: - return 4; - case GL_MODELVIEW_MATRIX: - case GL_PROJECTION_MATRIX: - case GL_TEXTURE_MATRIX: - case GL_MODELVIEW0_ARB: - case GL_COLOR_MATRIX: - case GL_MODELVIEW1_ARB: - case GL_CURRENT_MATRIX_ARB: - case GL_MODELVIEW2_ARB: - case GL_MODELVIEW3_ARB: - case GL_MODELVIEW4_ARB: - case GL_MODELVIEW5_ARB: - case GL_MODELVIEW6_ARB: - case GL_MODELVIEW7_ARB: - case GL_MODELVIEW8_ARB: - case GL_MODELVIEW9_ARB: - case GL_MODELVIEW10_ARB: - case GL_MODELVIEW11_ARB: - case GL_MODELVIEW12_ARB: - case GL_MODELVIEW13_ARB: - case GL_MODELVIEW14_ARB: - case GL_MODELVIEW15_ARB: - case GL_MODELVIEW16_ARB: - case GL_MODELVIEW17_ARB: - case GL_MODELVIEW18_ARB: - case GL_MODELVIEW19_ARB: - case GL_MODELVIEW20_ARB: - case GL_MODELVIEW21_ARB: - case GL_MODELVIEW22_ARB: - case GL_MODELVIEW23_ARB: - case GL_MODELVIEW24_ARB: - case GL_MODELVIEW25_ARB: - case GL_MODELVIEW26_ARB: - case GL_MODELVIEW27_ARB: - case GL_MODELVIEW28_ARB: - case GL_MODELVIEW29_ARB: - case GL_MODELVIEW30_ARB: - case GL_MODELVIEW31_ARB: - case GL_TRANSPOSE_CURRENT_MATRIX_ARB: - return 16; - case GL_FOG_COORDINATE_SOURCE: - case GL_COMPRESSED_TEXTURE_FORMATS: - return __glGetBooleanv_variable_size(e); - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetTexParameterfv_size(GLenum e) -{ - switch (e) { - case GL_TEXTURE_MAG_FILTER: - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - case GL_TEXTURE_PRIORITY: - case GL_TEXTURE_RESIDENT: - case GL_TEXTURE_WRAP_R: - case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: -/* case GL_SHADOW_AMBIENT_SGIX:*/ - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_CLIPMAP_FRAME_SGIX: - case GL_TEXTURE_LOD_BIAS_S_SGIX: - case GL_TEXTURE_LOD_BIAS_T_SGIX: - case GL_TEXTURE_LOD_BIAS_R_SGIX: - case GL_GENERATE_MIPMAP: -/* case GL_GENERATE_MIPMAP_SGIS:*/ - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - case GL_TEXTURE_MAX_CLAMP_S_SGIX: - case GL_TEXTURE_MAX_CLAMP_T_SGIX: - case GL_TEXTURE_MAX_CLAMP_R_SGIX: - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - case GL_TEXTURE_LOD_BIAS: -/* case GL_TEXTURE_LOD_BIAS_EXT:*/ - case GL_DEPTH_TEXTURE_MODE: -/* case GL_DEPTH_TEXTURE_MODE_ARB:*/ - case GL_TEXTURE_COMPARE_MODE: -/* case GL_TEXTURE_COMPARE_MODE_ARB:*/ - case GL_TEXTURE_COMPARE_FUNC: -/* case GL_TEXTURE_COMPARE_FUNC_ARB:*/ - case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: - return 1; - case GL_TEXTURE_CLIPMAP_CENTER_SGIX: - case GL_TEXTURE_CLIPMAP_OFFSET_SGIX: - return 2; - case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: - return 3; - case GL_TEXTURE_BORDER_COLOR: - case GL_POST_TEXTURE_FILTER_BIAS_SGIX: - case GL_POST_TEXTURE_FILTER_SCALE_SGIX: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetTexLevelParameterfv_size(GLenum e) -{ - switch (e) { - case GL_TEXTURE_WIDTH: - case GL_TEXTURE_HEIGHT: - case GL_TEXTURE_COMPONENTS: - case GL_TEXTURE_BORDER: - case GL_TEXTURE_RED_SIZE: -/* case GL_TEXTURE_RED_SIZE_EXT:*/ - case GL_TEXTURE_GREEN_SIZE: -/* case GL_TEXTURE_GREEN_SIZE_EXT:*/ - case GL_TEXTURE_BLUE_SIZE: -/* case GL_TEXTURE_BLUE_SIZE_EXT:*/ - case GL_TEXTURE_ALPHA_SIZE: -/* case GL_TEXTURE_ALPHA_SIZE_EXT:*/ - case GL_TEXTURE_LUMINANCE_SIZE: -/* case GL_TEXTURE_LUMINANCE_SIZE_EXT:*/ - case GL_TEXTURE_INTENSITY_SIZE: -/* case GL_TEXTURE_INTENSITY_SIZE_EXT:*/ - case GL_TEXTURE_DEPTH: -#ifndef _MSC_VER - case GL_TEXTURE_INDEX_SIZE_EXT: -#endif - case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: -/* case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:*/ - case GL_TEXTURE_COMPRESSED: -/* case GL_TEXTURE_COMPRESSED_ARB:*/ - case GL_TEXTURE_DEPTH_SIZE: -/* case GL_TEXTURE_DEPTH_SIZE_ARB:*/ - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glColorTableParameterfv_size(GLenum e) -{ - switch (e) { - case GL_COLOR_TABLE_SCALE: - case GL_COLOR_TABLE_BIAS: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetColorTableParameterfv_size(GLenum e) -{ - switch (e) { - case GL_COLOR_TABLE_FORMAT: -/* case GL_COLOR_TABLE_FORMAT_EXT:*/ - case GL_COLOR_TABLE_WIDTH: -/* case GL_COLOR_TABLE_WIDTH_EXT:*/ - case GL_COLOR_TABLE_RED_SIZE: -/* case GL_COLOR_TABLE_RED_SIZE_EXT:*/ - case GL_COLOR_TABLE_GREEN_SIZE: -/* case GL_COLOR_TABLE_GREEN_SIZE_EXT:*/ - case GL_COLOR_TABLE_BLUE_SIZE: -/* case GL_COLOR_TABLE_BLUE_SIZE_EXT:*/ - case GL_COLOR_TABLE_ALPHA_SIZE: -/* case GL_COLOR_TABLE_ALPHA_SIZE_EXT:*/ - case GL_COLOR_TABLE_LUMINANCE_SIZE: -/* case GL_COLOR_TABLE_LUMINANCE_SIZE_EXT:*/ - case GL_COLOR_TABLE_INTENSITY_SIZE: -/* case GL_COLOR_TABLE_INTENSITY_SIZE_EXT:*/ - return 1; - case GL_COLOR_TABLE_SCALE: - case GL_COLOR_TABLE_BIAS: - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glConvolutionParameterfv_size(GLenum e) -{ - switch (e) { - case GL_CONVOLUTION_BORDER_MODE: -/* case GL_CONVOLUTION_BORDER_MODE_EXT:*/ - return 1; - case GL_CONVOLUTION_FILTER_SCALE: -/* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/ - case GL_CONVOLUTION_FILTER_BIAS: -/* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/ - case GL_CONVOLUTION_BORDER_COLOR: -/* case GL_CONVOLUTION_BORDER_COLOR_HP:*/ - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetConvolutionParameterfv_size(GLenum e) -{ - switch (e) { - case GL_CONVOLUTION_BORDER_MODE: -/* case GL_CONVOLUTION_BORDER_MODE_EXT:*/ - case GL_CONVOLUTION_FORMAT: -/* case GL_CONVOLUTION_FORMAT_EXT:*/ - case GL_CONVOLUTION_WIDTH: -/* case GL_CONVOLUTION_WIDTH_EXT:*/ - case GL_CONVOLUTION_HEIGHT: -/* case GL_CONVOLUTION_HEIGHT_EXT:*/ - case GL_MAX_CONVOLUTION_WIDTH: -/* case GL_MAX_CONVOLUTION_WIDTH_EXT:*/ - case GL_MAX_CONVOLUTION_HEIGHT: -/* case GL_MAX_CONVOLUTION_HEIGHT_EXT:*/ - return 1; - case GL_CONVOLUTION_FILTER_SCALE: -/* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/ - case GL_CONVOLUTION_FILTER_BIAS: -/* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/ - case GL_CONVOLUTION_BORDER_COLOR: -/* case GL_CONVOLUTION_BORDER_COLOR_HP:*/ - return 4; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetHistogramParameterfv_size(GLenum e) -{ - switch (e) { - case GL_HISTOGRAM_WIDTH: - case GL_HISTOGRAM_FORMAT: - case GL_HISTOGRAM_RED_SIZE: - case GL_HISTOGRAM_GREEN_SIZE: - case GL_HISTOGRAM_BLUE_SIZE: - case GL_HISTOGRAM_ALPHA_SIZE: - case GL_HISTOGRAM_LUMINANCE_SIZE: - case GL_HISTOGRAM_SINK: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetMinmaxParameterfv_size(GLenum e) -{ - switch (e) { - case GL_MINMAX_FORMAT: - case GL_MINMAX_SINK: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetProgramivARB_size(GLenum e) -{ - switch (e) { - case GL_PROGRAM_LENGTH_ARB: - case GL_PROGRAM_BINDING_ARB: - case GL_PROGRAM_ALU_INSTRUCTIONS_ARB: - case GL_PROGRAM_TEX_INSTRUCTIONS_ARB: - case GL_PROGRAM_TEX_INDIRECTIONS_ARB: - case GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: - case GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: - case GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: - case GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB: - case GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: - case GL_PROGRAM_FORMAT_ARB: - case GL_PROGRAM_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_INSTRUCTIONS_ARB: - case GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB: - case GL_PROGRAM_TEMPORARIES_ARB: - case GL_MAX_PROGRAM_TEMPORARIES_ARB: - case GL_PROGRAM_NATIVE_TEMPORARIES_ARB: - case GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB: - case GL_PROGRAM_PARAMETERS_ARB: - case GL_MAX_PROGRAM_PARAMETERS_ARB: - case GL_PROGRAM_NATIVE_PARAMETERS_ARB: - case GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB: - case GL_PROGRAM_ATTRIBS_ARB: - case GL_MAX_PROGRAM_ATTRIBS_ARB: - case GL_PROGRAM_NATIVE_ATTRIBS_ARB: - case GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB: - case GL_PROGRAM_ADDRESS_REGISTERS_ARB: - case GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB: - case GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: - case GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: - case GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB: - case GL_MAX_PROGRAM_ENV_PARAMETERS_ARB: - case GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB: - case GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV: - case GL_MAX_PROGRAM_CALL_DEPTH_NV: - case GL_MAX_PROGRAM_IF_DEPTH_NV: - case GL_MAX_PROGRAM_LOOP_DEPTH_NV: - case GL_MAX_PROGRAM_LOOP_COUNT_NV: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetVertexAttribdvARB_size(GLenum e) -{ - switch (e) { - case GL_VERTEX_PROGRAM_ARB: - case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: - case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: - case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: - case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: - case GL_CURRENT_VERTEX_ATTRIB_ARB: - case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetQueryObjectivARB_size(GLenum e) -{ - switch (e) { - case GL_QUERY_RESULT_ARB: - case GL_QUERY_RESULT_AVAILABLE_ARB: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetQueryivARB_size(GLenum e) -{ - switch (e) { - case GL_QUERY_COUNTER_BITS_ARB: - case GL_CURRENT_QUERY_ARB: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glPointParameterfvEXT_size(GLenum e) -{ - switch (e) { - case GL_POINT_SIZE_MIN: -/* case GL_POINT_SIZE_MIN_ARB:*/ -/* case GL_POINT_SIZE_MIN_SGIS:*/ - case GL_POINT_SIZE_MAX: -/* case GL_POINT_SIZE_MAX_ARB:*/ -/* case GL_POINT_SIZE_MAX_SGIS:*/ - case GL_POINT_FADE_THRESHOLD_SIZE: -/* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/ -/* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/ - case GL_POINT_SPRITE_R_MODE_NV: - case GL_POINT_SPRITE_COORD_ORIGIN: - return 1; - case GL_POINT_DISTANCE_ATTENUATION: -/* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/ -/* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/ - return 3; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetProgramivNV_size(GLenum e) -{ - switch (e) { - case GL_PROGRAM_LENGTH_NV: - case GL_PROGRAM_TARGET_NV: - case GL_PROGRAM_RESIDENT_NV: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetVertexAttribdvNV_size(GLenum e) -{ - switch (e) { - case GL_ATTRIB_ARRAY_SIZE_NV: - case GL_ATTRIB_ARRAY_STRIDE_NV: - case GL_ATTRIB_ARRAY_TYPE_NV: - case GL_CURRENT_ATTRIB_NV: - return 1; - default: - return 0; - } -} - -INTERNAL PURE FASTCALL GLint -__glGetFramebufferAttachmentParameterivEXT_size(GLenum e) -{ - switch (e) { - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT: - return 1; - default: - return 0; - } -} - -ALIAS(Fogiv, Fogfv) - ALIAS(Lightiv, Lightfv) - ALIAS(LightModeliv, LightModelfv) - ALIAS(Materialiv, Materialfv) - ALIAS(TexParameteriv, TexParameterfv) - ALIAS(TexEnviv, TexEnvfv) - ALIAS(TexGenfv, TexGendv) - ALIAS(TexGeniv, TexGendv) - ALIAS(Map1f, Map1d) - ALIAS(Map2f, Map2d) - ALIAS(GetDoublev, GetBooleanv) - ALIAS(GetFloatv, GetBooleanv) - ALIAS(GetIntegerv, GetBooleanv) - ALIAS(GetLightfv, Lightfv) - ALIAS(GetLightiv, Lightfv) - ALIAS(GetMaterialfv, Materialfv) - ALIAS(GetMaterialiv, Materialfv) - ALIAS(GetTexEnvfv, TexEnvfv) - ALIAS(GetTexEnviv, TexEnvfv) - ALIAS(GetTexGendv, TexGendv) - ALIAS(GetTexGenfv, TexGendv) - ALIAS(GetTexGeniv, TexGendv) - ALIAS(GetTexParameteriv, GetTexParameterfv) - ALIAS(GetTexLevelParameteriv, GetTexLevelParameterfv) - ALIAS(ColorTableParameteriv, ColorTableParameterfv) - ALIAS(GetColorTableParameteriv, GetColorTableParameterfv) - ALIAS(ConvolutionParameteriv, ConvolutionParameterfv) - ALIAS(GetConvolutionParameteriv, GetConvolutionParameterfv) - ALIAS(GetHistogramParameteriv, GetHistogramParameterfv) - ALIAS(GetMinmaxParameteriv, GetMinmaxParameterfv) - ALIAS(GetVertexAttribfvARB, GetVertexAttribdvARB) - ALIAS(GetVertexAttribivARB, GetVertexAttribdvARB) - ALIAS(GetQueryObjectuivARB, GetQueryObjectivARB) - ALIAS(GetVertexAttribfvNV, GetVertexAttribdvNV) - ALIAS(GetVertexAttribivNV, GetVertexAttribdvNV) - ALIAS(PointParameterivNV, PointParameterfvEXT) -# undef PURE -# undef FASTCALL -# undef INTERNAL +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2004
+ * 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, sub license,
+ * 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 (including the next
+ * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS 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.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
+
+#include <GL/gl.h>
+#include "indirect_size_get.h"
+#include "glxserver.h"
+#include "indirect_util.h"
+#include "indirect_size.h"
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PURE __attribute__((pure))
+# else
+# define PURE
+# endif
+
+# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define FASTCALL __attribute__((fastcall))
+# else
+# define FASTCALL
+# endif
+
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# define INTERNAL __attribute__((visibility("internal")))
+# else
+# define INTERNAL
+# endif
+
+
+#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
+# undef HAVE_ALIAS
+#endif
+#ifdef HAVE_ALIAS
+# define ALIAS2(from,to) \
+ INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \
+ __attribute__ ((alias( # to )));
+# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )
+#else
+# define ALIAS(from,to) \
+ INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \
+ { return __gl ## to ## _size( e ); }
+#endif
+
+
+INTERNAL PURE FASTCALL GLint
+__glCallLists_size(GLenum e)
+{
+ switch (e) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ return 1;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_2_BYTES:
+ return 2;
+ case GL_3_BYTES:
+ return 3;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_4_BYTES:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glFogfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_FOG_INDEX:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_MODE:
+ case GL_FOG_OFFSET_VALUE_SGIX:
+ case GL_FOG_DISTANCE_MODE_NV:
+ return 1;
+ case GL_FOG_COLOR:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glLightfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_SPOT_EXPONENT:
+ case GL_SPOT_CUTOFF:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ return 1;
+ case GL_SPOT_DIRECTION:
+ return 3;
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_POSITION:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glLightModelfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+/* case GL_LIGHT_MODEL_COLOR_CONTROL_EXT:*/
+ return 1;
+ case GL_LIGHT_MODEL_AMBIENT:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glMaterialfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_SHININESS:
+ return 1;
+ case GL_COLOR_INDEXES:
+ return 3;
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_EMISSION:
+ case GL_AMBIENT_AND_DIFFUSE:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glTexParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+/* case GL_SHADOW_AMBIENT_SGIX:*/
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_TEXTURE_CLIPMAP_FRAME_SGIX:
+ case GL_TEXTURE_LOD_BIAS_S_SGIX:
+ case GL_TEXTURE_LOD_BIAS_T_SGIX:
+ case GL_TEXTURE_LOD_BIAS_R_SGIX:
+ case GL_GENERATE_MIPMAP:
+/* case GL_GENERATE_MIPMAP_SGIS:*/
+ case GL_TEXTURE_COMPARE_SGIX:
+ case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_S_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_T_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_R_SGIX:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
+/* case GL_TEXTURE_LOD_BIAS_EXT:*/
+ case GL_DEPTH_TEXTURE_MODE:
+/* case GL_DEPTH_TEXTURE_MODE_ARB:*/
+ case GL_TEXTURE_COMPARE_MODE:
+/* case GL_TEXTURE_COMPARE_MODE_ARB:*/
+ case GL_TEXTURE_COMPARE_FUNC:
+/* case GL_TEXTURE_COMPARE_FUNC_ARB:*/
+ case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV:
+ return 1;
+ case GL_TEXTURE_CLIPMAP_CENTER_SGIX:
+ case GL_TEXTURE_CLIPMAP_OFFSET_SGIX:
+ return 2;
+ case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX:
+ return 3;
+ case GL_TEXTURE_BORDER_COLOR:
+ case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
+ case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glTexEnvfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_ALPHA_SCALE:
+ case GL_TEXTURE_ENV_MODE:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_COMBINE_RGB:
+ case GL_COMBINE_ALPHA:
+ case GL_RGB_SCALE:
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
+ case GL_SOURCE3_RGB_NV:
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
+ case GL_SOURCE3_ALPHA_NV:
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ case GL_OPERAND3_RGB_NV:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ case GL_OPERAND3_ALPHA_NV:
+ case GL_COORD_REPLACE_ARB:
+/* case GL_COORD_REPLACE_NV:*/
+ return 1;
+ case GL_TEXTURE_ENV_COLOR:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glTexGendv_size(GLenum e)
+{
+ switch (e) {
+ case GL_TEXTURE_GEN_MODE:
+ return 1;
+ case GL_OBJECT_PLANE:
+ case GL_EYE_PLANE:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glMap1d_size(GLenum e)
+{
+ switch (e) {
+ case GL_MAP1_INDEX:
+ case GL_MAP1_TEXTURE_COORD_1:
+ return 1;
+ case GL_MAP1_TEXTURE_COORD_2:
+ return 2;
+ case GL_MAP1_NORMAL:
+ case GL_MAP1_TEXTURE_COORD_3:
+ case GL_MAP1_VERTEX_3:
+ return 3;
+ case GL_MAP1_COLOR_4:
+ case GL_MAP1_TEXTURE_COORD_4:
+ case GL_MAP1_VERTEX_4:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glMap2d_size(GLenum e)
+{
+ switch (e) {
+ case GL_MAP2_INDEX:
+ case GL_MAP2_TEXTURE_COORD_1:
+ return 1;
+ case GL_MAP2_TEXTURE_COORD_2:
+ return 2;
+ case GL_MAP2_NORMAL:
+ case GL_MAP2_TEXTURE_COORD_3:
+ case GL_MAP2_VERTEX_3:
+ return 3;
+ case GL_MAP2_COLOR_4:
+ case GL_MAP2_TEXTURE_COORD_4:
+ case GL_MAP2_VERTEX_4:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetBooleanv_size(GLenum e)
+{
+ switch (e) {
+ case GL_CURRENT_INDEX:
+ case GL_CURRENT_RASTER_INDEX:
+ case GL_CURRENT_RASTER_POSITION_VALID:
+ case GL_CURRENT_RASTER_DISTANCE:
+ case GL_POINT_SMOOTH:
+ case GL_POINT_SIZE:
+ case GL_SMOOTH_POINT_SIZE_GRANULARITY:
+ case GL_LINE_SMOOTH:
+ case GL_LINE_WIDTH:
+ case GL_LINE_WIDTH_GRANULARITY:
+ case GL_LINE_STIPPLE:
+ case GL_LINE_STIPPLE_PATTERN:
+ case GL_LINE_STIPPLE_REPEAT:
+ case GL_LIST_MODE:
+ case GL_MAX_LIST_NESTING:
+ case GL_LIST_BASE:
+ case GL_LIST_INDEX:
+ case GL_POLYGON_SMOOTH:
+ case GL_POLYGON_STIPPLE:
+ case GL_EDGE_FLAG:
+ case GL_CULL_FACE:
+ case GL_CULL_FACE_MODE:
+ case GL_FRONT_FACE:
+ case GL_LIGHTING:
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_SHADE_MODEL:
+ case GL_COLOR_MATERIAL_FACE:
+ case GL_COLOR_MATERIAL_PARAMETER:
+ case GL_COLOR_MATERIAL:
+ case GL_FOG:
+ case GL_FOG_INDEX:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_MODE:
+ case GL_DEPTH_TEST:
+ case GL_DEPTH_WRITEMASK:
+ case GL_DEPTH_CLEAR_VALUE:
+ case GL_DEPTH_FUNC:
+ case GL_STENCIL_TEST:
+ case GL_STENCIL_CLEAR_VALUE:
+ case GL_STENCIL_FUNC:
+ case GL_STENCIL_VALUE_MASK:
+ case GL_STENCIL_FAIL:
+ case GL_STENCIL_PASS_DEPTH_FAIL:
+ case GL_STENCIL_PASS_DEPTH_PASS:
+ case GL_STENCIL_REF:
+ case GL_STENCIL_WRITEMASK:
+ case GL_MATRIX_MODE:
+ case GL_NORMALIZE:
+ case GL_MODELVIEW_STACK_DEPTH:
+ case GL_PROJECTION_STACK_DEPTH:
+ case GL_TEXTURE_STACK_DEPTH:
+ case GL_ATTRIB_STACK_DEPTH:
+ case GL_CLIENT_ATTRIB_STACK_DEPTH:
+ case GL_ALPHA_TEST:
+ case GL_ALPHA_TEST_FUNC:
+ case GL_ALPHA_TEST_REF:
+ case GL_DITHER:
+ case GL_BLEND_DST:
+ case GL_BLEND_SRC:
+ case GL_BLEND:
+ case GL_LOGIC_OP_MODE:
+ case GL_LOGIC_OP:
+ case GL_AUX_BUFFERS:
+ case GL_DRAW_BUFFER:
+ case GL_READ_BUFFER:
+ case GL_SCISSOR_TEST:
+ case GL_INDEX_CLEAR_VALUE:
+ case GL_INDEX_WRITEMASK:
+ case GL_INDEX_MODE:
+ case GL_RGBA_MODE:
+ case GL_DOUBLEBUFFER:
+ case GL_STEREO:
+ case GL_RENDER_MODE:
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ case GL_POINT_SMOOTH_HINT:
+ case GL_LINE_SMOOTH_HINT:
+ case GL_POLYGON_SMOOTH_HINT:
+ case GL_FOG_HINT:
+ case GL_TEXTURE_GEN_S:
+ case GL_TEXTURE_GEN_T:
+ case GL_TEXTURE_GEN_R:
+ case GL_TEXTURE_GEN_Q:
+ case GL_PIXEL_MAP_I_TO_I:
+ case GL_PIXEL_MAP_I_TO_I_SIZE:
+ case GL_PIXEL_MAP_S_TO_S_SIZE:
+ case GL_PIXEL_MAP_I_TO_R_SIZE:
+ case GL_PIXEL_MAP_I_TO_G_SIZE:
+ case GL_PIXEL_MAP_I_TO_B_SIZE:
+ case GL_PIXEL_MAP_I_TO_A_SIZE:
+ case GL_PIXEL_MAP_R_TO_R_SIZE:
+ case GL_PIXEL_MAP_G_TO_G_SIZE:
+ case GL_PIXEL_MAP_B_TO_B_SIZE:
+ case GL_PIXEL_MAP_A_TO_A_SIZE:
+ case GL_UNPACK_SWAP_BYTES:
+ case GL_UNPACK_LSB_FIRST:
+ case GL_UNPACK_ROW_LENGTH:
+ case GL_UNPACK_SKIP_ROWS:
+ case GL_UNPACK_SKIP_PIXELS:
+ case GL_UNPACK_ALIGNMENT:
+ case GL_PACK_SWAP_BYTES:
+ case GL_PACK_LSB_FIRST:
+ case GL_PACK_ROW_LENGTH:
+ case GL_PACK_SKIP_ROWS:
+ case GL_PACK_SKIP_PIXELS:
+ case GL_PACK_ALIGNMENT:
+ case GL_MAP_COLOR:
+ case GL_MAP_STENCIL:
+ case GL_INDEX_SHIFT:
+ case GL_INDEX_OFFSET:
+ case GL_RED_SCALE:
+ case GL_RED_BIAS:
+ case GL_ZOOM_X:
+ case GL_ZOOM_Y:
+ case GL_GREEN_SCALE:
+ case GL_GREEN_BIAS:
+ case GL_BLUE_SCALE:
+ case GL_BLUE_BIAS:
+ case GL_ALPHA_SCALE:
+ case GL_ALPHA_BIAS:
+ case GL_DEPTH_SCALE:
+ case GL_DEPTH_BIAS:
+ case GL_MAX_EVAL_ORDER:
+ case GL_MAX_LIGHTS:
+ case GL_MAX_CLIP_PLANES:
+ case GL_MAX_TEXTURE_SIZE:
+ case GL_MAX_PIXEL_MAP_TABLE:
+ case GL_MAX_ATTRIB_STACK_DEPTH:
+ case GL_MAX_MODELVIEW_STACK_DEPTH:
+ case GL_MAX_NAME_STACK_DEPTH:
+ case GL_MAX_PROJECTION_STACK_DEPTH:
+ case GL_MAX_TEXTURE_STACK_DEPTH:
+ case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
+ case GL_SUBPIXEL_BITS:
+ case GL_INDEX_BITS:
+ case GL_RED_BITS:
+ case GL_GREEN_BITS:
+ case GL_BLUE_BITS:
+ case GL_ALPHA_BITS:
+ case GL_DEPTH_BITS:
+ case GL_STENCIL_BITS:
+ case GL_ACCUM_RED_BITS:
+ case GL_ACCUM_GREEN_BITS:
+ case GL_ACCUM_BLUE_BITS:
+ case GL_ACCUM_ALPHA_BITS:
+ case GL_NAME_STACK_DEPTH:
+ case GL_AUTO_NORMAL:
+ case GL_MAP1_COLOR_4:
+ case GL_MAP1_INDEX:
+ case GL_MAP1_NORMAL:
+ case GL_MAP1_TEXTURE_COORD_1:
+ case GL_MAP1_TEXTURE_COORD_2:
+ case GL_MAP1_TEXTURE_COORD_3:
+ case GL_MAP1_TEXTURE_COORD_4:
+ case GL_MAP1_VERTEX_3:
+ case GL_MAP1_VERTEX_4:
+ case GL_MAP2_COLOR_4:
+ case GL_MAP2_INDEX:
+ case GL_MAP2_NORMAL:
+ case GL_MAP2_TEXTURE_COORD_1:
+ case GL_MAP2_TEXTURE_COORD_2:
+ case GL_MAP2_TEXTURE_COORD_3:
+ case GL_MAP2_TEXTURE_COORD_4:
+ case GL_MAP2_VERTEX_3:
+ case GL_MAP2_VERTEX_4:
+ case GL_MAP1_GRID_SEGMENTS:
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_POLYGON_OFFSET_UNITS:
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ case GL_BLEND_EQUATION:
+/* case GL_BLEND_EQUATION_EXT:*/
+ case GL_CONVOLUTION_1D:
+ case GL_CONVOLUTION_2D:
+ case GL_SEPARABLE_2D:
+ case GL_MAX_CONVOLUTION_WIDTH:
+/* case GL_MAX_CONVOLUTION_WIDTH_EXT:*/
+ case GL_MAX_CONVOLUTION_HEIGHT:
+/* case GL_MAX_CONVOLUTION_HEIGHT_EXT:*/
+ case GL_POST_CONVOLUTION_RED_SCALE:
+/* case GL_POST_CONVOLUTION_RED_SCALE_EXT:*/
+ case GL_POST_CONVOLUTION_GREEN_SCALE:
+/* case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:*/
+ case GL_POST_CONVOLUTION_BLUE_SCALE:
+/* case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:*/
+ case GL_POST_CONVOLUTION_ALPHA_SCALE:
+/* case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:*/
+ case GL_POST_CONVOLUTION_RED_BIAS:
+/* case GL_POST_CONVOLUTION_RED_BIAS_EXT:*/
+ case GL_POST_CONVOLUTION_GREEN_BIAS:
+/* case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:*/
+ case GL_POST_CONVOLUTION_BLUE_BIAS:
+/* case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:*/
+ case GL_POST_CONVOLUTION_ALPHA_BIAS:
+/* case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:*/
+ case GL_HISTOGRAM:
+ case GL_MINMAX:
+ case GL_POLYGON_OFFSET_FACTOR:
+ case GL_RESCALE_NORMAL:
+/* case GL_RESCALE_NORMAL_EXT:*/
+ case GL_TEXTURE_BINDING_1D:
+ case GL_TEXTURE_BINDING_2D:
+ case GL_TEXTURE_BINDING_3D:
+ case GL_PACK_SKIP_IMAGES:
+ case GL_PACK_IMAGE_HEIGHT:
+ case GL_UNPACK_SKIP_IMAGES:
+ case GL_UNPACK_IMAGE_HEIGHT:
+ case GL_TEXTURE_3D:
+ case GL_MAX_3D_TEXTURE_SIZE:
+ case GL_VERTEX_ARRAY:
+ case GL_NORMAL_ARRAY:
+ case GL_COLOR_ARRAY:
+ case GL_INDEX_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_VERTEX_ARRAY_SIZE:
+ case GL_VERTEX_ARRAY_TYPE:
+ case GL_VERTEX_ARRAY_STRIDE:
+ case GL_NORMAL_ARRAY_TYPE:
+ case GL_NORMAL_ARRAY_STRIDE:
+ case GL_COLOR_ARRAY_SIZE:
+ case GL_COLOR_ARRAY_TYPE:
+ case GL_COLOR_ARRAY_STRIDE:
+ case GL_INDEX_ARRAY_TYPE:
+ case GL_INDEX_ARRAY_STRIDE:
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ case GL_TEXTURE_COORD_ARRAY_TYPE:
+ case GL_TEXTURE_COORD_ARRAY_STRIDE:
+ case GL_EDGE_FLAG_ARRAY_STRIDE:
+ case GL_MULTISAMPLE:
+/* case GL_MULTISAMPLE_ARB:*/
+ case GL_SAMPLE_ALPHA_TO_COVERAGE:
+/* case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:*/
+ case GL_SAMPLE_ALPHA_TO_ONE:
+/* case GL_SAMPLE_ALPHA_TO_ONE_ARB:*/
+ case GL_SAMPLE_COVERAGE:
+/* case GL_SAMPLE_COVERAGE_ARB:*/
+ case GL_SAMPLE_BUFFERS:
+/* case GL_SAMPLE_BUFFERS_ARB:*/
+ case GL_SAMPLES:
+/* case GL_SAMPLES_ARB:*/
+ case GL_SAMPLE_COVERAGE_VALUE:
+/* case GL_SAMPLE_COVERAGE_VALUE_ARB:*/
+ case GL_SAMPLE_COVERAGE_INVERT:
+/* case GL_SAMPLE_COVERAGE_INVERT_ARB:*/
+ case GL_COLOR_MATRIX_STACK_DEPTH:
+ case GL_MAX_COLOR_MATRIX_STACK_DEPTH:
+ case GL_POST_COLOR_MATRIX_RED_SCALE:
+ case GL_POST_COLOR_MATRIX_GREEN_SCALE:
+ case GL_POST_COLOR_MATRIX_BLUE_SCALE:
+ case GL_POST_COLOR_MATRIX_ALPHA_SCALE:
+ case GL_POST_COLOR_MATRIX_RED_BIAS:
+ case GL_POST_COLOR_MATRIX_GREEN_BIAS:
+ case GL_POST_COLOR_MATRIX_BLUE_BIAS:
+ case GL_POST_COLOR_MATRIX_ALPHA_BIAS:
+ case GL_BLEND_DST_RGB:
+ case GL_BLEND_SRC_RGB:
+ case GL_BLEND_DST_ALPHA:
+ case GL_BLEND_SRC_ALPHA:
+ case GL_COLOR_TABLE:
+ case GL_POST_CONVOLUTION_COLOR_TABLE:
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE:
+ case GL_MAX_ELEMENTS_VERTICES:
+ case GL_MAX_ELEMENTS_INDICES:
+ case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
+ case GL_POINT_SIZE_MIN:
+ case GL_POINT_SIZE_MAX:
+ case GL_POINT_FADE_THRESHOLD_SIZE:
+ case GL_OCCLUSION_TEST_HP:
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ case GL_CURRENT_FOG_COORD:
+ case GL_FOG_COORDINATE_ARRAY_TYPE:
+ case GL_FOG_COORDINATE_ARRAY_STRIDE:
+ case GL_FOG_COORD_ARRAY:
+ case GL_COLOR_SUM_ARB:
+ case GL_SECONDARY_COLOR_ARRAY_SIZE:
+ case GL_SECONDARY_COLOR_ARRAY_TYPE:
+ case GL_SECONDARY_COLOR_ARRAY_STRIDE:
+ case GL_SECONDARY_COLOR_ARRAY:
+ case GL_ACTIVE_TEXTURE:
+/* case GL_ACTIVE_TEXTURE_ARB:*/
+ case GL_CLIENT_ACTIVE_TEXTURE:
+/* case GL_CLIENT_ACTIVE_TEXTURE_ARB:*/
+ case GL_MAX_TEXTURE_UNITS:
+/* case GL_MAX_TEXTURE_UNITS_ARB:*/
+ case GL_MAX_RENDERBUFFER_SIZE_EXT:
+ case GL_TEXTURE_COMPRESSION_HINT:
+/* case GL_TEXTURE_COMPRESSION_HINT_ARB:*/
+ case GL_TEXTURE_RECTANGLE_ARB:
+/* case GL_TEXTURE_RECTANGLE_NV:*/
+ case GL_TEXTURE_BINDING_RECTANGLE_ARB:
+/* case GL_TEXTURE_BINDING_RECTANGLE_NV:*/
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB:
+/* case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:*/
+ case GL_MAX_TEXTURE_LOD_BIAS:
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_MAX_SHININESS_NV:
+ case GL_MAX_SPOT_EXPONENT_NV:
+ case GL_TEXTURE_CUBE_MAP:
+/* case GL_TEXTURE_CUBE_MAP_ARB:*/
+ case GL_TEXTURE_BINDING_CUBE_MAP:
+/* case GL_TEXTURE_BINDING_CUBE_MAP_ARB:*/
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
+/* case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:*/
+ case GL_MULTISAMPLE_FILTER_HINT_NV:
+ case GL_FOG_DISTANCE_MODE_NV:
+ case GL_VERTEX_PROGRAM_ARB:
+ case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB:
+ case GL_MAX_PROGRAM_MATRICES_ARB:
+ case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
+ case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
+ case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
+ case GL_PROGRAM_ERROR_POSITION_ARB:
+ case GL_DEPTH_CLAMP_NV:
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
+/* case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:*/
+ case GL_MAX_VERTEX_UNITS_ARB:
+ case GL_ACTIVE_VERTEX_UNITS_ARB:
+ case GL_WEIGHT_SUM_UNITY_ARB:
+ case GL_VERTEX_BLEND_ARB:
+ case GL_CURRENT_WEIGHT_ARB:
+ case GL_WEIGHT_ARRAY_TYPE_ARB:
+ case GL_WEIGHT_ARRAY_STRIDE_ARB:
+ case GL_WEIGHT_ARRAY_SIZE_ARB:
+ case GL_WEIGHT_ARRAY_ARB:
+ case GL_PACK_INVERT_MESA:
+ case GL_STENCIL_BACK_FUNC_ATI:
+ case GL_STENCIL_BACK_FAIL_ATI:
+ case GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI:
+ case GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI:
+ case GL_FRAGMENT_PROGRAM_ARB:
+ case GL_MAX_DRAW_BUFFERS_ARB:
+/* case GL_MAX_DRAW_BUFFERS_ATI:*/
+ case GL_DRAW_BUFFER0_ARB:
+/* case GL_DRAW_BUFFER0_ATI:*/
+ case GL_DRAW_BUFFER1_ARB:
+/* case GL_DRAW_BUFFER1_ATI:*/
+ case GL_DRAW_BUFFER2_ARB:
+/* case GL_DRAW_BUFFER2_ATI:*/
+ case GL_DRAW_BUFFER3_ARB:
+/* case GL_DRAW_BUFFER3_ATI:*/
+ case GL_DRAW_BUFFER4_ARB:
+/* case GL_DRAW_BUFFER4_ATI:*/
+ case GL_DRAW_BUFFER5_ARB:
+/* case GL_DRAW_BUFFER5_ATI:*/
+ case GL_DRAW_BUFFER6_ARB:
+/* case GL_DRAW_BUFFER6_ATI:*/
+ case GL_DRAW_BUFFER7_ARB:
+/* case GL_DRAW_BUFFER7_ATI:*/
+ case GL_DRAW_BUFFER8_ARB:
+/* case GL_DRAW_BUFFER8_ATI:*/
+ case GL_DRAW_BUFFER9_ARB:
+/* case GL_DRAW_BUFFER9_ATI:*/
+ case GL_DRAW_BUFFER10_ARB:
+/* case GL_DRAW_BUFFER10_ATI:*/
+ case GL_DRAW_BUFFER11_ARB:
+/* case GL_DRAW_BUFFER11_ATI:*/
+ case GL_DRAW_BUFFER12_ARB:
+/* case GL_DRAW_BUFFER12_ATI:*/
+ case GL_DRAW_BUFFER13_ARB:
+/* case GL_DRAW_BUFFER13_ATI:*/
+ case GL_DRAW_BUFFER14_ARB:
+/* case GL_DRAW_BUFFER14_ATI:*/
+ case GL_DRAW_BUFFER15_ARB:
+/* case GL_DRAW_BUFFER15_ATI:*/
+ case GL_BLEND_EQUATION_ALPHA_EXT:
+ case GL_MATRIX_PALETTE_ARB:
+ case GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB:
+ case GL_MAX_PALETTE_MATRICES_ARB:
+ case GL_CURRENT_PALETTE_MATRIX_ARB:
+ case GL_MATRIX_INDEX_ARRAY_ARB:
+ case GL_CURRENT_MATRIX_INDEX_ARB:
+ case GL_MATRIX_INDEX_ARRAY_SIZE_ARB:
+ case GL_MATRIX_INDEX_ARRAY_TYPE_ARB:
+ case GL_MATRIX_INDEX_ARRAY_STRIDE_ARB:
+ case GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT:
+ case GL_POINT_SPRITE_ARB:
+/* case GL_POINT_SPRITE_NV:*/
+ case GL_POINT_SPRITE_R_MODE_NV:
+ case GL_MAX_VERTEX_ATTRIBS_ARB:
+ case GL_MAX_TEXTURE_COORDS_ARB:
+ case GL_MAX_TEXTURE_IMAGE_UNITS_ARB:
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+ case GL_ARRAY_BUFFER_BINDING_ARB:
+ case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
+ case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
+ case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
+ case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
+ case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
+ case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
+ case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB:
+ case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT:
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
+ case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
+ case GL_DRAW_FRAMEBUFFER_BINDING_EXT:
+ case GL_RENDERBUFFER_BINDING_EXT:
+ case GL_READ_FRAMEBUFFER_BINDING_EXT:
+ case GL_MAX_COLOR_ATTACHMENTS_EXT:
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ return 1;
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ case GL_LINE_WIDTH_RANGE:
+ case GL_POLYGON_MODE:
+ case GL_DEPTH_RANGE:
+ case GL_MAX_VIEWPORT_DIMS:
+ case GL_MAP1_GRID_DOMAIN:
+ case GL_MAP2_GRID_SEGMENTS:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_DEPTH_BOUNDS_EXT:
+ return 2;
+ case GL_CURRENT_NORMAL:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ return 3;
+ case GL_CURRENT_COLOR:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_CURRENT_RASTER_COLOR:
+ case GL_CURRENT_RASTER_TEXTURE_COORDS:
+ case GL_CURRENT_RASTER_POSITION:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_FOG_COLOR:
+ case GL_ACCUM_CLEAR_VALUE:
+ case GL_VIEWPORT:
+ case GL_SCISSOR_BOX:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_MAP2_GRID_DOMAIN:
+ case GL_BLEND_COLOR:
+/* case GL_BLEND_COLOR_EXT:*/
+ case GL_CURRENT_SECONDARY_COLOR:
+ return 4;
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ case GL_MODELVIEW0_ARB:
+ case GL_COLOR_MATRIX:
+ case GL_MODELVIEW1_ARB:
+ case GL_CURRENT_MATRIX_ARB:
+ case GL_MODELVIEW2_ARB:
+ case GL_MODELVIEW3_ARB:
+ case GL_MODELVIEW4_ARB:
+ case GL_MODELVIEW5_ARB:
+ case GL_MODELVIEW6_ARB:
+ case GL_MODELVIEW7_ARB:
+ case GL_MODELVIEW8_ARB:
+ case GL_MODELVIEW9_ARB:
+ case GL_MODELVIEW10_ARB:
+ case GL_MODELVIEW11_ARB:
+ case GL_MODELVIEW12_ARB:
+ case GL_MODELVIEW13_ARB:
+ case GL_MODELVIEW14_ARB:
+ case GL_MODELVIEW15_ARB:
+ case GL_MODELVIEW16_ARB:
+ case GL_MODELVIEW17_ARB:
+ case GL_MODELVIEW18_ARB:
+ case GL_MODELVIEW19_ARB:
+ case GL_MODELVIEW20_ARB:
+ case GL_MODELVIEW21_ARB:
+ case GL_MODELVIEW22_ARB:
+ case GL_MODELVIEW23_ARB:
+ case GL_MODELVIEW24_ARB:
+ case GL_MODELVIEW25_ARB:
+ case GL_MODELVIEW26_ARB:
+ case GL_MODELVIEW27_ARB:
+ case GL_MODELVIEW28_ARB:
+ case GL_MODELVIEW29_ARB:
+ case GL_MODELVIEW30_ARB:
+ case GL_MODELVIEW31_ARB:
+ case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
+ return 16;
+ case GL_FOG_COORDINATE_SOURCE:
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ return __glGetBooleanv_variable_size(e);
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetTexParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_RESIDENT:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+/* case GL_SHADOW_AMBIENT_SGIX:*/
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_TEXTURE_CLIPMAP_FRAME_SGIX:
+ case GL_TEXTURE_LOD_BIAS_S_SGIX:
+ case GL_TEXTURE_LOD_BIAS_T_SGIX:
+ case GL_TEXTURE_LOD_BIAS_R_SGIX:
+ case GL_GENERATE_MIPMAP:
+/* case GL_GENERATE_MIPMAP_SGIS:*/
+ case GL_TEXTURE_COMPARE_SGIX:
+ case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_S_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_T_SGIX:
+ case GL_TEXTURE_MAX_CLAMP_R_SGIX:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
+/* case GL_TEXTURE_LOD_BIAS_EXT:*/
+ case GL_DEPTH_TEXTURE_MODE:
+/* case GL_DEPTH_TEXTURE_MODE_ARB:*/
+ case GL_TEXTURE_COMPARE_MODE:
+/* case GL_TEXTURE_COMPARE_MODE_ARB:*/
+ case GL_TEXTURE_COMPARE_FUNC:
+/* case GL_TEXTURE_COMPARE_FUNC_ARB:*/
+ case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV:
+ return 1;
+ case GL_TEXTURE_CLIPMAP_CENTER_SGIX:
+ case GL_TEXTURE_CLIPMAP_OFFSET_SGIX:
+ return 2;
+ case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX:
+ return 3;
+ case GL_TEXTURE_BORDER_COLOR:
+ case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
+ case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetTexLevelParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_TEXTURE_WIDTH:
+ case GL_TEXTURE_HEIGHT:
+ case GL_TEXTURE_COMPONENTS:
+ case GL_TEXTURE_BORDER:
+ case GL_TEXTURE_RED_SIZE:
+/* case GL_TEXTURE_RED_SIZE_EXT:*/
+ case GL_TEXTURE_GREEN_SIZE:
+/* case GL_TEXTURE_GREEN_SIZE_EXT:*/
+ case GL_TEXTURE_BLUE_SIZE:
+/* case GL_TEXTURE_BLUE_SIZE_EXT:*/
+ case GL_TEXTURE_ALPHA_SIZE:
+/* case GL_TEXTURE_ALPHA_SIZE_EXT:*/
+ case GL_TEXTURE_LUMINANCE_SIZE:
+/* case GL_TEXTURE_LUMINANCE_SIZE_EXT:*/
+ case GL_TEXTURE_INTENSITY_SIZE:
+/* case GL_TEXTURE_INTENSITY_SIZE_EXT:*/
+ case GL_TEXTURE_DEPTH:
+#ifndef _MSC_VER
+ case GL_TEXTURE_INDEX_SIZE_EXT:
+#endif
+ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
+/* case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:*/
+ case GL_TEXTURE_COMPRESSED:
+/* case GL_TEXTURE_COMPRESSED_ARB:*/
+ case GL_TEXTURE_DEPTH_SIZE:
+/* case GL_TEXTURE_DEPTH_SIZE_ARB:*/
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glColorTableParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_COLOR_TABLE_SCALE:
+ case GL_COLOR_TABLE_BIAS:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetColorTableParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_COLOR_TABLE_FORMAT:
+/* case GL_COLOR_TABLE_FORMAT_EXT:*/
+ case GL_COLOR_TABLE_WIDTH:
+/* case GL_COLOR_TABLE_WIDTH_EXT:*/
+ case GL_COLOR_TABLE_RED_SIZE:
+/* case GL_COLOR_TABLE_RED_SIZE_EXT:*/
+ case GL_COLOR_TABLE_GREEN_SIZE:
+/* case GL_COLOR_TABLE_GREEN_SIZE_EXT:*/
+ case GL_COLOR_TABLE_BLUE_SIZE:
+/* case GL_COLOR_TABLE_BLUE_SIZE_EXT:*/
+ case GL_COLOR_TABLE_ALPHA_SIZE:
+/* case GL_COLOR_TABLE_ALPHA_SIZE_EXT:*/
+ case GL_COLOR_TABLE_LUMINANCE_SIZE:
+/* case GL_COLOR_TABLE_LUMINANCE_SIZE_EXT:*/
+ case GL_COLOR_TABLE_INTENSITY_SIZE:
+/* case GL_COLOR_TABLE_INTENSITY_SIZE_EXT:*/
+ return 1;
+ case GL_COLOR_TABLE_SCALE:
+ case GL_COLOR_TABLE_BIAS:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glConvolutionParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_CONVOLUTION_BORDER_MODE:
+/* case GL_CONVOLUTION_BORDER_MODE_EXT:*/
+ return 1;
+ case GL_CONVOLUTION_FILTER_SCALE:
+/* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/
+ case GL_CONVOLUTION_FILTER_BIAS:
+/* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/
+ case GL_CONVOLUTION_BORDER_COLOR:
+/* case GL_CONVOLUTION_BORDER_COLOR_HP:*/
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetConvolutionParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_CONVOLUTION_BORDER_MODE:
+/* case GL_CONVOLUTION_BORDER_MODE_EXT:*/
+ case GL_CONVOLUTION_FORMAT:
+/* case GL_CONVOLUTION_FORMAT_EXT:*/
+ case GL_CONVOLUTION_WIDTH:
+/* case GL_CONVOLUTION_WIDTH_EXT:*/
+ case GL_CONVOLUTION_HEIGHT:
+/* case GL_CONVOLUTION_HEIGHT_EXT:*/
+ case GL_MAX_CONVOLUTION_WIDTH:
+/* case GL_MAX_CONVOLUTION_WIDTH_EXT:*/
+ case GL_MAX_CONVOLUTION_HEIGHT:
+/* case GL_MAX_CONVOLUTION_HEIGHT_EXT:*/
+ return 1;
+ case GL_CONVOLUTION_FILTER_SCALE:
+/* case GL_CONVOLUTION_FILTER_SCALE_EXT:*/
+ case GL_CONVOLUTION_FILTER_BIAS:
+/* case GL_CONVOLUTION_FILTER_BIAS_EXT:*/
+ case GL_CONVOLUTION_BORDER_COLOR:
+/* case GL_CONVOLUTION_BORDER_COLOR_HP:*/
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetHistogramParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_HISTOGRAM_WIDTH:
+ case GL_HISTOGRAM_FORMAT:
+ case GL_HISTOGRAM_RED_SIZE:
+ case GL_HISTOGRAM_GREEN_SIZE:
+ case GL_HISTOGRAM_BLUE_SIZE:
+ case GL_HISTOGRAM_ALPHA_SIZE:
+ case GL_HISTOGRAM_LUMINANCE_SIZE:
+ case GL_HISTOGRAM_SINK:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetMinmaxParameterfv_size(GLenum e)
+{
+ switch (e) {
+ case GL_MINMAX_FORMAT:
+ case GL_MINMAX_SINK:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetProgramivARB_size(GLenum e)
+{
+ switch (e) {
+ case GL_PROGRAM_LENGTH_ARB:
+ case GL_PROGRAM_BINDING_ARB:
+ case GL_PROGRAM_ALU_INSTRUCTIONS_ARB:
+ case GL_PROGRAM_TEX_INSTRUCTIONS_ARB:
+ case GL_PROGRAM_TEX_INDIRECTIONS_ARB:
+ case GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB:
+ case GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB:
+ case GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB:
+ case GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB:
+ case GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB:
+ case GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB:
+ case GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB:
+ case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB:
+ case GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB:
+ case GL_PROGRAM_FORMAT_ARB:
+ case GL_PROGRAM_INSTRUCTIONS_ARB:
+ case GL_MAX_PROGRAM_INSTRUCTIONS_ARB:
+ case GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB:
+ case GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB:
+ case GL_PROGRAM_TEMPORARIES_ARB:
+ case GL_MAX_PROGRAM_TEMPORARIES_ARB:
+ case GL_PROGRAM_NATIVE_TEMPORARIES_ARB:
+ case GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB:
+ case GL_PROGRAM_PARAMETERS_ARB:
+ case GL_MAX_PROGRAM_PARAMETERS_ARB:
+ case GL_PROGRAM_NATIVE_PARAMETERS_ARB:
+ case GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB:
+ case GL_PROGRAM_ATTRIBS_ARB:
+ case GL_MAX_PROGRAM_ATTRIBS_ARB:
+ case GL_PROGRAM_NATIVE_ATTRIBS_ARB:
+ case GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB:
+ case GL_PROGRAM_ADDRESS_REGISTERS_ARB:
+ case GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB:
+ case GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB:
+ case GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB:
+ case GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB:
+ case GL_MAX_PROGRAM_ENV_PARAMETERS_ARB:
+ case GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB:
+ case GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV:
+ case GL_MAX_PROGRAM_CALL_DEPTH_NV:
+ case GL_MAX_PROGRAM_IF_DEPTH_NV:
+ case GL_MAX_PROGRAM_LOOP_DEPTH_NV:
+ case GL_MAX_PROGRAM_LOOP_COUNT_NV:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetVertexAttribdvARB_size(GLenum e)
+{
+ switch (e) {
+ case GL_VERTEX_PROGRAM_ARB:
+ case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
+ case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB:
+ case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB:
+ case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB:
+ case GL_CURRENT_VERTEX_ATTRIB_ARB:
+ case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetQueryObjectivARB_size(GLenum e)
+{
+ switch (e) {
+ case GL_QUERY_RESULT_ARB:
+ case GL_QUERY_RESULT_AVAILABLE_ARB:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetQueryivARB_size(GLenum e)
+{
+ switch (e) {
+ case GL_QUERY_COUNTER_BITS_ARB:
+ case GL_CURRENT_QUERY_ARB:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glPointParameterfvEXT_size(GLenum e)
+{
+ switch (e) {
+ case GL_POINT_SIZE_MIN:
+/* case GL_POINT_SIZE_MIN_ARB:*/
+/* case GL_POINT_SIZE_MIN_SGIS:*/
+ case GL_POINT_SIZE_MAX:
+/* case GL_POINT_SIZE_MAX_ARB:*/
+/* case GL_POINT_SIZE_MAX_SGIS:*/
+ case GL_POINT_FADE_THRESHOLD_SIZE:
+/* case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/
+/* case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/
+ case GL_POINT_SPRITE_R_MODE_NV:
+ case GL_POINT_SPRITE_COORD_ORIGIN:
+ return 1;
+ case GL_POINT_DISTANCE_ATTENUATION:
+/* case GL_POINT_DISTANCE_ATTENUATION_ARB:*/
+/* case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/
+ return 3;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetProgramivNV_size(GLenum e)
+{
+ switch (e) {
+ case GL_PROGRAM_LENGTH_NV:
+ case GL_PROGRAM_TARGET_NV:
+ case GL_PROGRAM_RESIDENT_NV:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetVertexAttribdvNV_size(GLenum e)
+{
+ switch (e) {
+ case GL_ATTRIB_ARRAY_SIZE_NV:
+ case GL_ATTRIB_ARRAY_STRIDE_NV:
+ case GL_ATTRIB_ARRAY_TYPE_NV:
+ case GL_CURRENT_ATTRIB_NV:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+INTERNAL PURE FASTCALL GLint
+__glGetFramebufferAttachmentParameterivEXT_size(GLenum e)
+{
+ switch (e) {
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+ALIAS(Fogiv, Fogfv)
+ ALIAS(Lightiv, Lightfv)
+ ALIAS(LightModeliv, LightModelfv)
+ ALIAS(Materialiv, Materialfv)
+ ALIAS(TexParameteriv, TexParameterfv)
+ ALIAS(TexEnviv, TexEnvfv)
+ ALIAS(TexGenfv, TexGendv)
+ ALIAS(TexGeniv, TexGendv)
+ ALIAS(Map1f, Map1d)
+ ALIAS(Map2f, Map2d)
+ ALIAS(GetDoublev, GetBooleanv)
+ ALIAS(GetFloatv, GetBooleanv)
+ ALIAS(GetIntegerv, GetBooleanv)
+ ALIAS(GetLightfv, Lightfv)
+ ALIAS(GetLightiv, Lightfv)
+ ALIAS(GetMaterialfv, Materialfv)
+ ALIAS(GetMaterialiv, Materialfv)
+ ALIAS(GetTexEnvfv, TexEnvfv)
+ ALIAS(GetTexEnviv, TexEnvfv)
+ ALIAS(GetTexGendv, TexGendv)
+ ALIAS(GetTexGenfv, TexGendv)
+ ALIAS(GetTexGeniv, TexGendv)
+ ALIAS(GetTexParameteriv, GetTexParameterfv)
+ ALIAS(GetTexLevelParameteriv, GetTexLevelParameterfv)
+ ALIAS(ColorTableParameteriv, ColorTableParameterfv)
+ ALIAS(GetColorTableParameteriv, GetColorTableParameterfv)
+ ALIAS(ConvolutionParameteriv, ConvolutionParameterfv)
+ ALIAS(GetConvolutionParameteriv, GetConvolutionParameterfv)
+ ALIAS(GetHistogramParameteriv, GetHistogramParameterfv)
+ ALIAS(GetMinmaxParameteriv, GetMinmaxParameterfv)
+ ALIAS(GetVertexAttribfvARB, GetVertexAttribdvARB)
+ ALIAS(GetVertexAttribivARB, GetVertexAttribdvARB)
+ ALIAS(GetQueryObjectuivARB, GetQueryObjectivARB)
+ ALIAS(GetVertexAttribfvNV, GetVertexAttribdvNV)
+ ALIAS(GetVertexAttribivNV, GetVertexAttribdvNV)
+ ALIAS(PointParameterivNV, PointParameterfvEXT)
+# undef PURE
+# undef FASTCALL
+# undef INTERNAL
diff --git a/xorg-server/glx/indirect_size_get.h b/xorg-server/glx/indirect_size_get.h index 4fcb55b4e..7f24a64fa 100644 --- a/xorg-server/glx/indirect_size_get.h +++ b/xorg-server/glx/indirect_size_get.h @@ -1,102 +1,102 @@ -/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2004 - * 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, sub license, - * 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS 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. - */ - -#if !defined( _INDIRECT_SIZE_GET_H_ ) -# define _INDIRECT_SIZE_GET_H_ - -/** - * \file - * Prototypes for functions used to determine the number of data elements in - * various GLX protocol messages. - * - * \author Ian Romanick <idr@us.ibm.com> - */ - -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif - -# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define FASTCALL __attribute__((fastcall)) -# else -# define FASTCALL -# endif - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) -# define INTERNAL __attribute__((visibility("internal"))) -# else -# define INTERNAL -# endif - -extern INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetDoublev_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetFloatv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetIntegerv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetLightfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetLightiv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetMaterialfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetMaterialiv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexEnvfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexEnviv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexGendv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexGenfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexGeniv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint -__glGetConvolutionParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint -__glGetConvolutionParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvARB_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvARB_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivARB_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectivARB_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectuivARB_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetQueryivARB_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetProgramivNV_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvNV_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvNV_size(GLenum); -extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivNV_size(GLenum); -extern INTERNAL PURE FASTCALL GLint -__glGetFramebufferAttachmentParameterivEXT_size(GLenum); - -# undef PURE -# undef FASTCALL -# undef INTERNAL - -#endif /* !defined( _INDIRECT_SIZE_GET_H_ ) */ +/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2004
+ * 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, sub license,
+ * 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 (including the next
+ * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS 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.
+ */
+
+#if !defined( _INDIRECT_SIZE_GET_H_ )
+# define _INDIRECT_SIZE_GET_H_
+
+/**
+ * \file
+ * Prototypes for functions used to determine the number of data elements in
+ * various GLX protocol messages.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PURE __attribute__((pure))
+# else
+# define PURE
+# endif
+
+# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define FASTCALL __attribute__((fastcall))
+# else
+# define FASTCALL
+# endif
+
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# define INTERNAL __attribute__((visibility("internal")))
+# else
+# define INTERNAL
+# endif
+
+extern INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetDoublev_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetFloatv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetIntegerv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetLightfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetLightiv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetMaterialfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetMaterialiv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexEnvfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexEnviv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexGendv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexGenfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexGeniv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint
+__glGetConvolutionParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint
+__glGetConvolutionParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvARB_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvARB_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivARB_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectivARB_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectuivARB_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetQueryivARB_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetProgramivNV_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvNV_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvNV_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivNV_size(GLenum);
+extern INTERNAL PURE FASTCALL GLint
+__glGetFramebufferAttachmentParameterivEXT_size(GLenum);
+
+# undef PURE
+# undef FASTCALL
+# undef INTERNAL
+
+#endif /* !defined( _INDIRECT_SIZE_GET_H_ ) */
diff --git a/xorg-server/hw/dmx/doc/Makefile.am b/xorg-server/hw/dmx/doc/Makefile.am index 0fb6e8949..b8a047baa 100644 --- a/xorg-server/hw/dmx/doc/Makefile.am +++ b/xorg-server/hw/dmx/doc/Makefile.am @@ -1,290 +1,290 @@ -# Copyright 2005 Red Hat, Inc. -# -# 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 name of Red Hat -# not be used in advertising or publicity pertaining to distribution -# of the software without specific, written prior permission. Red -# Hat makes no representations about the suitability of this software -# for any purpose. It is provided "as is" without express or implied -# warranty. -# -# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN -# NO EVENT SHALL RED HAT 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. - -SGML_FILES = dmx.sgml scaled.sgml - -if BUILD_LINUXDOC -TXT_FILES = $(SGML_FILES:%.sgml=%.txt) -PS_FILES = $(SGML_FILES:%.sgml=%.ps) -if BUILD_PDFDOC -PDF_FILES = $(SGML_FILES:%.sgml=%.pdf) -endif -HTML_FILES = $(SGML_FILES:%.sgml=%.html) - -SUFFIXES = .sgml .txt .html .ps .pdf - -.sgml.txt: - @rm -f $@ - $(MAKE_TEXT) $< - -.sgml.ps: - @rm -f $@ - $(MAKE_PS) $< - -.ps.pdf: - @rm -f $@ - $(MAKE_PDF) $< - -.sgml.html: - @rm -f $@ - $(MAKE_HTML) $< - -noinst_DATA = $(TXT_FILES) $(PS_FILES) $(PDF_FILES) $(HTML_FILES) -CLEANFILES = $(TXT_FILES) $(PS_FILES) $(PDF_FILES) $(HTML_FILES) -endif - -if HAVE_DOXYGEN - -DOXYGEN_SRC=doxygen.head doxygen.foot doxygen.css doxygen.conf - -all-local: html/annotated.html - -dist-local: html/annotated.html - -html/annotated.html: $(DOXYGEN_SRC) - $(DOXYGEN) $(srcdir)/doxygen.conf - -clean-local: - rm -rf html/ -endif - -EXTRA_DIST = \ - $(SGML_FILES) \ - DMXSpec.txt \ - DMXSpec-v1.txt \ - dmx.txt \ - doxygen.conf \ - doxygen.css \ - doxygen.foot \ - doxygen.head \ - scaled.txt \ - html/annotated.html \ - html/ChkNotMaskEv_8c.html \ - html/ChkNotMaskEv_8h.html \ - html/ChkNotMaskEv_8h_source.html \ - html/classes.html \ - html/dmx_8h.html \ - html/dmx_8h_source.html \ - html/dmxarg_8c.html \ - html/dmxarg_8h.html \ - html/dmxarg_8h_source.html \ - html/dmxbackend_8c.html \ - html/dmxbackend_8h.html \ - html/dmxbackend_8h_source.html \ - html/dmxcb_8c.html \ - html/dmxcb_8h.html \ - html/dmxcb_8h_source.html \ - html/dmxclient_8h.html \ - html/dmxclient_8h_source.html \ - html/dmxcmap_8c.html \ - html/dmxcmap_8h.html \ - html/dmxcmap_8h_source.html \ - html/dmxcommon_8c.html \ - html/dmxcommon_8h.html \ - html/dmxcommon_8h_source.html \ - html/dmxcompat_8c.html \ - html/dmxcompat_8h.html \ - html/dmxcompat_8h_source.html \ - html/dmxconfig_8c.html \ - html/dmxconfig_8h.html \ - html/dmxconfig_8h_source.html \ - html/dmxconsole_8c.html \ - html/dmxconsole_8h.html \ - html/dmxconsole_8h_source.html \ - html/dmxcursor_8c.html \ - html/dmxcursor_8h.html \ - html/dmxcursor_8h_source.html \ - html/dmxdetach_8c.html \ - html/dmxdpms_8c.html \ - html/dmxdpms_8h.html \ - html/dmxdpms_8h_source.html \ - html/dmxdummy_8c.html \ - html/dmxdummy_8h.html \ - html/dmxdummy_8h_source.html \ - html/dmxevents_8c.html \ - html/dmxevents_8h.html \ - html/dmxevents_8h_source.html \ - html/dmxextension_8c.html \ - html/dmxextension_8h.html \ - html/dmxextension_8h_source.html \ - html/dmxfont_8c.html \ - html/dmxfont_8h.html \ - html/dmxfont_8h_source.html \ - html/dmxgc_8c.html \ - html/dmxgc_8h.html \ - html/dmxgc_8h_source.html \ - html/dmxgcops_8c.html \ - html/dmxgcops_8h.html \ - html/dmxgcops_8h_source.html \ - html/dmx__glxvisuals_8h_source.html \ - html/dmxinit_8c.html \ - html/dmxinit_8h.html \ - html/dmxinit_8h_source.html \ - html/dmxinput_8c.html \ - html/dmxinput_8h.html \ - html/dmxinput_8h_source.html \ - html/dmxinputinit_8c.html \ - html/dmxinputinit_8h.html \ - html/dmxinputinit_8h_source.html \ - html/dmxlog_8c.html \ - html/dmxlog_8h.html \ - html/dmxlog_8h_source.html \ - html/dmxmap_8c.html \ - html/dmxmap_8h.html \ - html/dmxmap_8h_source.html \ - html/dmxmotion_8c.html \ - html/dmxmotion_8h.html \ - html/dmxmotion_8h_source.html \ - html/dmxparse_8c.html \ - html/dmxparse_8h.html \ - html/dmxparse_8h_source.html \ - html/dmxpict_8c.html \ - html/dmxpict_8h.html \ - html/dmxpict_8h_source.html \ - html/dmxpixmap_8c.html \ - html/dmxpixmap_8h.html \ - html/dmxpixmap_8h_source.html \ - html/dmxprint_8c.html \ - html/dmxprint_8h.html \ - html/dmxprint_8h_source.html \ - html/dmxprop_8c.html \ - html/dmxprop_8h.html \ - html/dmxprop_8h_source.html \ - html/dmxscrinit_8c.html \ - html/dmxscrinit_8h.html \ - html/dmxscrinit_8h_source.html \ - html/dmxshadow_8c.html \ - html/dmxshadow_8h.html \ - html/dmxshadow_8h_source.html \ - html/dmxsigio_8c.html \ - html/dmxsigio_8h.html \ - html/dmxsigio_8h_source.html \ - html/dmxstat_8c.html \ - html/dmxstat_8h.html \ - html/dmxstat_8h_source.html \ - html/dmxsync_8c.html \ - html/dmxsync_8h.html \ - html/dmxsync_8h_source.html \ - html/dmxvisual_8c.html \ - html/dmxvisual_8h.html \ - html/dmxvisual_8h_source.html \ - html/dmxwindow_8c.html \ - html/dmxwindow_8h.html \ - html/dmxwindow_8h_source.html \ - html/dmxxinput_8c.html \ - html/doxygen.css \ - html/doxygen.png \ - html/files.html \ - html/ftv2blank.png \ - html/ftv2doc.png \ - html/ftv2folderclosed.png \ - html/ftv2folderopen.png \ - html/ftv2lastnode.png \ - html/ftv2link.png \ - html/ftv2mlastnode.png \ - html/ftv2mnode.png \ - html/ftv2node.png \ - html/ftv2plastnode.png \ - html/ftv2pnode.png \ - html/ftv2vertline.png \ - html/functions.html \ - html/functions_vars.html \ - html/globals_defs.html \ - html/globals_enum.html \ - html/globals_eval.html \ - html/globals_func.html \ - html/globals.html \ - html/globals_type.html \ - html/globals_vars.html \ - html/index.html \ - html/lnx-keyboard_8c.html \ - html/lnx-keyboard_8h.html \ - html/lnx-keyboard_8h_source.html \ - html/lnx-ms_8c.html \ - html/lnx-ms_8h.html \ - html/lnx-ms_8h_source.html \ - html/lnx-ps2_8c.html \ - html/lnx-ps2_8h.html \ - html/lnx-ps2_8h_source.html \ - html/main.html \ - html/struct__dmxArg.html \ - html/struct__dmxColormapPriv.html \ - html/structDMXConfigCmdStruct.html \ - html/struct__DMXConfigComment.html \ - html/struct__DMXConfigDisplay.html \ - html/struct__DMXConfigEntry.html \ - html/struct__DMXConfigFullDim.html \ - html/structDMXConfigListStruct.html \ - html/struct__DMXConfigNumber.html \ - html/struct__DMXConfigOption.html \ - html/struct__DMXConfigPair.html \ - html/struct__DMXConfigParam.html \ - html/struct__DMXConfigPartDim.html \ - html/struct__DMXConfigString.html \ - html/struct__DMXConfigSub.html \ - html/struct__DMXConfigToken.html \ - html/struct__DMXConfigVirtual.html \ - html/struct__DMXConfigWall.html \ - html/struct__dmxCursorPriv.html \ - html/structDMXDesktopAttributesRec.html \ - html/struct__DMXEventMap.html \ - html/struct__dmxFontPriv.html \ - html/struct__dmxGCPriv.html \ - html/structdmxGlxVisualPrivate.html \ - html/struct__dmxGlyphPriv.html \ - html/structDMXInputAttributesRec.html \ - html/struct__DMXInputInfo.html \ - html/struct__DMXLocalInitInfo.html \ - html/struct__DMXLocalInputInfo.html \ - html/struct__dmxPictPriv.html \ - html/struct__dmxPixPriv.html \ - html/structDMXScreenAttributesRec.html \ - html/struct__DMXScreenInfo.html \ - html/struct__DMXStatAvg.html \ - html/struct__DMXStatInfo.html \ - html/structDMXWindowAttributesRec.html \ - html/struct__dmxWinPriv.html \ - html/struct__myPrivate.html \ - html/tree.html \ - html/usb-common_8c.html \ - html/usb-common_8h.html \ - html/usb-common_8h_source.html \ - html/usb-keyboard_8c.html \ - html/usb-keyboard_8h.html \ - html/usb-keyboard_8h_source.html \ - html/usb-mouse_8c.html \ - html/usb-mouse_8h.html \ - html/usb-mouse_8h_source.html \ - html/usb-other_8c.html \ - html/usb-other_8h.html \ - html/usb-other_8h_source.html \ - html/usb-private_8h.html \ - html/usb-private_8h_source.html - -$(builddir)/doxygen.head: - $(LN_S) $(srcdir)/doxygen.head $@ - -$(builddir)/doxygen.foot: - $(LN_S) $(srcdir)/doxygen.foot $@ - -$(builddir)doxygen.css: - $(LN_S) $(srcdir)/doxygen.css $@ - +# Copyright 2005 Red Hat, Inc.
+#
+# 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 name of Red Hat
+# not be used in advertising or publicity pertaining to distribution
+# of the software without specific, written prior permission. Red
+# Hat makes no representations about the suitability of this software
+# for any purpose. It is provided "as is" without express or implied
+# warranty.
+#
+# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+# NO EVENT SHALL RED HAT 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.
+
+SGML_FILES = dmx.sgml scaled.sgml
+
+if BUILD_LINUXDOC
+TXT_FILES = $(SGML_FILES:%.sgml=%.txt)
+PS_FILES = $(SGML_FILES:%.sgml=%.ps)
+if BUILD_PDFDOC
+PDF_FILES = $(SGML_FILES:%.sgml=%.pdf)
+endif
+HTML_FILES = $(SGML_FILES:%.sgml=%.html)
+
+SUFFIXES = .sgml .txt .html .ps .pdf
+
+.sgml.txt:
+ @rm -f $@
+ $(MAKE_TEXT) $<
+
+.sgml.ps:
+ @rm -f $@
+ $(MAKE_PS) $<
+
+.ps.pdf:
+ @rm -f $@
+ $(MAKE_PDF) $<
+
+.sgml.html:
+ @rm -f $@
+ $(MAKE_HTML) $<
+
+noinst_DATA = $(TXT_FILES) $(PS_FILES) $(PDF_FILES) $(HTML_FILES)
+CLEANFILES = $(TXT_FILES) $(PS_FILES) $(PDF_FILES) $(HTML_FILES)
+endif
+
+if HAVE_DOXYGEN
+
+DOXYGEN_SRC=doxygen.head doxygen.foot doxygen.css doxygen.conf
+
+all-local: html/annotated.html
+
+dist-local: html/annotated.html
+
+html/annotated.html: $(DOXYGEN_SRC)
+ $(DOXYGEN) $(srcdir)/doxygen.conf
+
+maintainer-clean-local:
+ rm -rf html/
+endif
+
+EXTRA_DIST = \
+ $(SGML_FILES) \
+ DMXSpec.txt \
+ DMXSpec-v1.txt \
+ dmx.txt \
+ doxygen.conf \
+ doxygen.css \
+ doxygen.foot \
+ doxygen.head \
+ scaled.txt \
+ html/annotated.html \
+ html/ChkNotMaskEv_8c.html \
+ html/ChkNotMaskEv_8h.html \
+ html/ChkNotMaskEv_8h_source.html \
+ html/classes.html \
+ html/dmx_8h.html \
+ html/dmx_8h_source.html \
+ html/dmxarg_8c.html \
+ html/dmxarg_8h.html \
+ html/dmxarg_8h_source.html \
+ html/dmxbackend_8c.html \
+ html/dmxbackend_8h.html \
+ html/dmxbackend_8h_source.html \
+ html/dmxcb_8c.html \
+ html/dmxcb_8h.html \
+ html/dmxcb_8h_source.html \
+ html/dmxclient_8h.html \
+ html/dmxclient_8h_source.html \
+ html/dmxcmap_8c.html \
+ html/dmxcmap_8h.html \
+ html/dmxcmap_8h_source.html \
+ html/dmxcommon_8c.html \
+ html/dmxcommon_8h.html \
+ html/dmxcommon_8h_source.html \
+ html/dmxcompat_8c.html \
+ html/dmxcompat_8h.html \
+ html/dmxcompat_8h_source.html \
+ html/dmxconfig_8c.html \
+ html/dmxconfig_8h.html \
+ html/dmxconfig_8h_source.html \
+ html/dmxconsole_8c.html \
+ html/dmxconsole_8h.html \
+ html/dmxconsole_8h_source.html \
+ html/dmxcursor_8c.html \
+ html/dmxcursor_8h.html \
+ html/dmxcursor_8h_source.html \
+ html/dmxdetach_8c.html \
+ html/dmxdpms_8c.html \
+ html/dmxdpms_8h.html \
+ html/dmxdpms_8h_source.html \
+ html/dmxdummy_8c.html \
+ html/dmxdummy_8h.html \
+ html/dmxdummy_8h_source.html \
+ html/dmxevents_8c.html \
+ html/dmxevents_8h.html \
+ html/dmxevents_8h_source.html \
+ html/dmxextension_8c.html \
+ html/dmxextension_8h.html \
+ html/dmxextension_8h_source.html \
+ html/dmxfont_8c.html \
+ html/dmxfont_8h.html \
+ html/dmxfont_8h_source.html \
+ html/dmxgc_8c.html \
+ html/dmxgc_8h.html \
+ html/dmxgc_8h_source.html \
+ html/dmxgcops_8c.html \
+ html/dmxgcops_8h.html \
+ html/dmxgcops_8h_source.html \
+ html/dmx__glxvisuals_8h_source.html \
+ html/dmxinit_8c.html \
+ html/dmxinit_8h.html \
+ html/dmxinit_8h_source.html \
+ html/dmxinput_8c.html \
+ html/dmxinput_8h.html \
+ html/dmxinput_8h_source.html \
+ html/dmxinputinit_8c.html \
+ html/dmxinputinit_8h.html \
+ html/dmxinputinit_8h_source.html \
+ html/dmxlog_8c.html \
+ html/dmxlog_8h.html \
+ html/dmxlog_8h_source.html \
+ html/dmxmap_8c.html \
+ html/dmxmap_8h.html \
+ html/dmxmap_8h_source.html \
+ html/dmxmotion_8c.html \
+ html/dmxmotion_8h.html \
+ html/dmxmotion_8h_source.html \
+ html/dmxparse_8c.html \
+ html/dmxparse_8h.html \
+ html/dmxparse_8h_source.html \
+ html/dmxpict_8c.html \
+ html/dmxpict_8h.html \
+ html/dmxpict_8h_source.html \
+ html/dmxpixmap_8c.html \
+ html/dmxpixmap_8h.html \
+ html/dmxpixmap_8h_source.html \
+ html/dmxprint_8c.html \
+ html/dmxprint_8h.html \
+ html/dmxprint_8h_source.html \
+ html/dmxprop_8c.html \
+ html/dmxprop_8h.html \
+ html/dmxprop_8h_source.html \
+ html/dmxscrinit_8c.html \
+ html/dmxscrinit_8h.html \
+ html/dmxscrinit_8h_source.html \
+ html/dmxshadow_8c.html \
+ html/dmxshadow_8h.html \
+ html/dmxshadow_8h_source.html \
+ html/dmxsigio_8c.html \
+ html/dmxsigio_8h.html \
+ html/dmxsigio_8h_source.html \
+ html/dmxstat_8c.html \
+ html/dmxstat_8h.html \
+ html/dmxstat_8h_source.html \
+ html/dmxsync_8c.html \
+ html/dmxsync_8h.html \
+ html/dmxsync_8h_source.html \
+ html/dmxvisual_8c.html \
+ html/dmxvisual_8h.html \
+ html/dmxvisual_8h_source.html \
+ html/dmxwindow_8c.html \
+ html/dmxwindow_8h.html \
+ html/dmxwindow_8h_source.html \
+ html/dmxxinput_8c.html \
+ html/doxygen.css \
+ html/doxygen.png \
+ html/files.html \
+ html/ftv2blank.png \
+ html/ftv2doc.png \
+ html/ftv2folderclosed.png \
+ html/ftv2folderopen.png \
+ html/ftv2lastnode.png \
+ html/ftv2link.png \
+ html/ftv2mlastnode.png \
+ html/ftv2mnode.png \
+ html/ftv2node.png \
+ html/ftv2plastnode.png \
+ html/ftv2pnode.png \
+ html/ftv2vertline.png \
+ html/functions.html \
+ html/functions_vars.html \
+ html/globals_defs.html \
+ html/globals_enum.html \
+ html/globals_eval.html \
+ html/globals_func.html \
+ html/globals.html \
+ html/globals_type.html \
+ html/globals_vars.html \
+ html/index.html \
+ html/lnx-keyboard_8c.html \
+ html/lnx-keyboard_8h.html \
+ html/lnx-keyboard_8h_source.html \
+ html/lnx-ms_8c.html \
+ html/lnx-ms_8h.html \
+ html/lnx-ms_8h_source.html \
+ html/lnx-ps2_8c.html \
+ html/lnx-ps2_8h.html \
+ html/lnx-ps2_8h_source.html \
+ html/main.html \
+ html/struct__dmxArg.html \
+ html/struct__dmxColormapPriv.html \
+ html/structDMXConfigCmdStruct.html \
+ html/struct__DMXConfigComment.html \
+ html/struct__DMXConfigDisplay.html \
+ html/struct__DMXConfigEntry.html \
+ html/struct__DMXConfigFullDim.html \
+ html/structDMXConfigListStruct.html \
+ html/struct__DMXConfigNumber.html \
+ html/struct__DMXConfigOption.html \
+ html/struct__DMXConfigPair.html \
+ html/struct__DMXConfigParam.html \
+ html/struct__DMXConfigPartDim.html \
+ html/struct__DMXConfigString.html \
+ html/struct__DMXConfigSub.html \
+ html/struct__DMXConfigToken.html \
+ html/struct__DMXConfigVirtual.html \
+ html/struct__DMXConfigWall.html \
+ html/struct__dmxCursorPriv.html \
+ html/structDMXDesktopAttributesRec.html \
+ html/struct__DMXEventMap.html \
+ html/struct__dmxFontPriv.html \
+ html/struct__dmxGCPriv.html \
+ html/structdmxGlxVisualPrivate.html \
+ html/struct__dmxGlyphPriv.html \
+ html/structDMXInputAttributesRec.html \
+ html/struct__DMXInputInfo.html \
+ html/struct__DMXLocalInitInfo.html \
+ html/struct__DMXLocalInputInfo.html \
+ html/struct__dmxPictPriv.html \
+ html/struct__dmxPixPriv.html \
+ html/structDMXScreenAttributesRec.html \
+ html/struct__DMXScreenInfo.html \
+ html/struct__DMXStatAvg.html \
+ html/struct__DMXStatInfo.html \
+ html/structDMXWindowAttributesRec.html \
+ html/struct__dmxWinPriv.html \
+ html/struct__myPrivate.html \
+ html/tree.html \
+ html/usb-common_8c.html \
+ html/usb-common_8h.html \
+ html/usb-common_8h_source.html \
+ html/usb-keyboard_8c.html \
+ html/usb-keyboard_8h.html \
+ html/usb-keyboard_8h_source.html \
+ html/usb-mouse_8c.html \
+ html/usb-mouse_8h.html \
+ html/usb-mouse_8h_source.html \
+ html/usb-other_8c.html \
+ html/usb-other_8h.html \
+ html/usb-other_8h_source.html \
+ html/usb-private_8h.html \
+ html/usb-private_8h_source.html
+
+$(builddir)/doxygen.head:
+ $(LN_S) $(srcdir)/doxygen.head $@
+
+$(builddir)/doxygen.foot:
+ $(LN_S) $(srcdir)/doxygen.foot $@
+
+$(builddir)doxygen.css:
+ $(LN_S) $(srcdir)/doxygen.css $@
+
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c index 8cd765a1c..ee4835233 100644 --- a/xorg-server/hw/xfree86/common/xf86Events.c +++ b/xorg-server/hw/xfree86/common/xf86Events.c @@ -1,747 +1,740 @@ -/* - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. - * - * 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 name of Thomas Roell not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Thomas Roell makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THOMAS ROELL 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. - * - */ -/* - * Copyright (c) 1994-2003 by The XFree86 Project, 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 - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s) - * and author(s) 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 copyright holder(s) and author(s). - */ - -/* [JCH-96/01/21] Extended std reverse map to four buttons. */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> -#include <X11/Xpoll.h> -#include <X11/Xproto.h> -#include "misc.h" -#include "compiler.h" -#include "xf86.h" -#include "xf86Priv.h" -#define XF86_OS_PRIVS -#include "xf86_OSlib.h" -#include <X11/keysym.h> - -#ifdef XFreeXDGA -#include "dgaproc.h" -#endif - -#include <X11/extensions/XI.h> -#include <X11/extensions/XIproto.h> -#include "inputstr.h" -#include "xf86Xinput.h" - -#include "mi.h" -#include "mipointer.h" - -#include "xkbsrv.h" -#include "xkbstr.h" - -#ifdef DPMSExtension -#include <X11/extensions/dpmsconst.h> -#include "dpmsproc.h" -#endif - -/* - * This is a toggling variable: - * FALSE = No VT switching keys have been pressed last time around - * TRUE = Possible VT switch Pending - * (DWH - 12/2/93) - * - * This has been generalised to work with Linux and *BSD+syscons (DHD) - */ - -Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for - *BSD and for avoiding VT - switches when using the DRI - automatic full screen mode.*/ - -extern fd_set EnabledDevices; - -#ifdef XF86PM -extern void (*xf86OSPMClose)(void); -#endif - -static void xf86VTSwitch(void); - -/* - * Allow arbitrary drivers or other XFree86 code to register with our main - * Wakeup handler. - */ -typedef struct x_IHRec { - int fd; - InputHandlerProc ihproc; - pointer data; - Bool enabled; - struct x_IHRec * next; -} IHRec, *IHPtr; - -static IHPtr InputHandlers = NULL; - - -Bool -LegalModifier(unsigned int key, DeviceIntPtr pDev) -{ - return TRUE; -} - -/* - * TimeSinceLastInputEvent -- - * Function used for screensaver purposes by the os module. Returns the - * time in milliseconds since there last was any input. - */ -int -TimeSinceLastInputEvent(void) -{ - if (xf86Info.lastEventTime == 0) { - xf86Info.lastEventTime = GetTimeInMillis(); - } - return GetTimeInMillis() - xf86Info.lastEventTime; -} - -/* - * SetTimeSinceLastInputEvent -- - * Set the lastEventTime to now. - */ -void -SetTimeSinceLastInputEvent(void) -{ - xf86Info.lastEventTime = GetTimeInMillis(); -} - -/* - * ProcessInputEvents -- - * Retrieve all waiting input events and pass them to DIX in their - * correct chronological order. Only reads from the system pointer - * and keyboard. - */ -void -ProcessInputEvents (void) -{ - int x, y; - - mieqProcessInputEvents(); - - /* FIXME: This is a problem if we have multiple pointers */ - miPointerGetPosition(inputInfo.pointer, &x, &y); - xf86SetViewport(xf86Info.currentScreen, x, y); -} - -/* - * Handle keyboard events that cause some kind of "action" - * (i.e., server termination, video mode changes, VT switches, etc.) - */ -void -xf86ProcessActionEvent(ActionEvent action, void *arg) -{ - DebugF("ProcessActionEvent(%d,%x)\n", (int) action, arg); - switch (action) { - case ACTION_TERMINATE: - if (!xf86Info.dontZap) { -#ifdef XFreeXDGA - DGAShutdown(); -#endif - GiveUp(0); - } - break; - case ACTION_NEXT_MODE: - if (!xf86Info.dontZoom) - xf86ZoomViewport(xf86Info.currentScreen, 1); - break; - case ACTION_PREV_MODE: - if (!xf86Info.dontZoom) - xf86ZoomViewport(xf86Info.currentScreen, -1); - break; -#if defined(VT_ACTIVATE) - case ACTION_SWITCHSCREEN: - if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { - int vtno = *((int *) arg); -#if defined(__SCO__) || defined(__UNIXWARE__) - vtno--; -#endif -#if defined(sun) - if (vtno == xf86Info.vtno) - break; - - xf86Info.vtRequestsPending = TRUE; - xf86Info.vtPendingNum = vtno; -#else - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) - ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); -#endif - } - break; - case ACTION_SWITCHSCREEN_NEXT: - if (VTSwitchEnabled && !xf86Info.dontVTSwitch) { -#if defined(__SCO__) || defined(__UNIXWARE__) - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) -#else - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno + 1) < 0) -#endif -#if defined (__SCO__) || (defined(sun) && defined (__i386__) && defined (SVR4)) || defined(__UNIXWARE__) - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 0) < 0) -#else - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) < 0) -#endif - ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); - } - break; - case ACTION_SWITCHSCREEN_PREV: - if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) { - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno - 1) < 0) - ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); - } - break; -#endif - default: - break; - } -} - -/* - * xf86Wakeup -- - * Os wakeup handler. - */ - -/* ARGSUSED */ -void -xf86Wakeup(pointer blockData, int err, pointer pReadmask) -{ - fd_set* LastSelectMask = (fd_set*)pReadmask; - fd_set devicesWithInput; - InputInfoPtr pInfo; - - if (err >= 0) { - - XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices); - if (XFD_ANYSET(&devicesWithInput)) { - pInfo = xf86InputDevs; - while (pInfo) { - if (pInfo->read_input && pInfo->fd >= 0 && - (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) { - int sigstate = xf86BlockSIGIO(); - - /* - * Remove the descriptior from the set because more than one - * device may share the same file descriptor. - */ - FD_CLR(pInfo->fd, &devicesWithInput); - - pInfo->read_input(pInfo); - xf86UnblockSIGIO(sigstate); - } - pInfo = pInfo->next; - } - } - } - - if (err >= 0) { /* we don't want the handlers called if select() */ - IHPtr ih; /* returned with an error condition, do we? */ - - for (ih = InputHandlers; ih; ih = ih->next) { - if (ih->enabled && ih->fd >= 0 && ih->ihproc && - (FD_ISSET(ih->fd, ((fd_set *)pReadmask)) != 0)) { - ih->ihproc(ih->fd, ih->data); - } - } - } - - if (xf86VTSwitchPending()) xf86VTSwitch(); -} - - -/* - * xf86SigioReadInput -- - * signal handler for the SIGIO signal. - */ -static void -xf86SigioReadInput(int fd, void *closure) -{ - int errno_save = errno; - InputInfoPtr pInfo = closure; - - pInfo->read_input(pInfo); - - errno = errno_save; -} - -/* - * xf86AddEnabledDevice -- - * - */ -void -xf86AddEnabledDevice(InputInfoPtr pInfo) -{ - if (!xf86InstallSIGIOHandler (pInfo->fd, xf86SigioReadInput, pInfo)) { - AddEnabledDevice(pInfo->fd); - } -} - -/* - * xf86RemoveEnabledDevice -- - * - */ -void -xf86RemoveEnabledDevice(InputInfoPtr pInfo) -{ - if (!xf86RemoveSIGIOHandler (pInfo->fd)) { - RemoveEnabledDevice(pInfo->fd); - } -} - -static int *xf86SignalIntercept = NULL; - -void -xf86InterceptSignals(int *signo) -{ - if ((xf86SignalIntercept = signo)) - *signo = -1; -} - -static void (*xf86SigIllHandler)(void) = NULL; - -void -xf86InterceptSigIll(void (*sigillhandler)(void)) -{ - xf86SigIllHandler = sigillhandler; -} - -/* - * xf86SigWrapper -- - * Catch unexpected signals and exit or continue cleanly. - */ -int -xf86SigWrapper(int signo) -{ - if ((signo == SIGILL) && xf86SigIllHandler) { - (*xf86SigIllHandler)(); - return 0; /* continue */ - } - - if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) { - *xf86SignalIntercept = signo; - return 0; /* continue */ - } - - xf86Info.caughtSignal = TRUE; - return 1; /* abort */ -} - -/* - * xf86PrintBacktrace -- - * Print a stack backtrace for debugging purposes. - */ -void -xf86PrintBacktrace(void) -{ - xorg_backtrace(); -} - -#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7))) - -static void -xf86ReleaseKeys(DeviceIntPtr pDev) -{ - KeyClassPtr keyc; - int i, j, nevents, sigstate; - - if (!pDev || !pDev->key) - return; - - keyc = pDev->key; - - /* - * Hmm... here is the biggest hack of every time ! - * It may be possible that a switch-vt procedure has finished BEFORE - * you released all keys neccessary to do this. That peculiar behavior - * can fool the X-server pretty much, cause it assumes that some keys - * were not released. TWM may stuck alsmost completly.... - * OK, what we are doing here is after returning from the vt-switch - * exeplicitely unrelease all keyboard keys before the input-devices - * are reenabled. - */ - - for (i = keyc->xkbInfo->desc->min_key_code; - i < keyc->xkbInfo->desc->max_key_code; - i++) { - if (KeyPressed(i)) { - sigstate = xf86BlockSIGIO (); - nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i); - for (j = 0; j < nevents; j++) - mieqEnqueue(pDev, (InternalEvent*)(xf86Events + j)->event); - xf86UnblockSIGIO(sigstate); - } - } -} - -/* - * xf86VTSwitch -- - * Handle requests for switching the vt. - */ -static void -xf86VTSwitch(void) -{ - int i, prevSIGIO; - InputInfoPtr pInfo; - IHPtr ih; - - DebugF("xf86VTSwitch()\n"); - -#ifdef XFreeXDGA - if(!DGAVTSwitch()) - return; -#endif - - /* - * Since all screens are currently all in the same state it is sufficient - * check the first. This might change in future. - */ - if (xf86Screens[0]->vtSema) { - - DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n", - BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE)); -#ifdef DPMSExtension - if (DPMSPowerLevel != DPMSModeOn) - DPMSSet(serverClient, DPMSModeOn); -#endif - for (i = 0; i < xf86NumScreens; i++) { - if (!(dispatchException & DE_TERMINATE)) - if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); - } - - /* - * Keep the order: Disable Device > LeaveVT - * EnterVT > EnableDevice - */ - for (ih = InputHandlers; ih; ih = ih->next) - xf86DisableInputHandler(ih); - for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) { - if (pInfo->dev) { - xf86ReleaseKeys(pInfo->dev); - ProcessInputEvents(); - DisableDevice(pInfo->dev, TRUE); - } - } - xf86EnterServerState(SETUP); - for (i = 0; i < xf86NumScreens; i++) - xf86Screens[i]->LeaveVT(i, 0); - - xf86AccessLeave(); /* We need this here, otherwise */ - - if (!xf86VTSwitchAway()) { - /* - * switch failed - */ - - DebugF("xf86VTSwitch: Leave failed\n"); - prevSIGIO = xf86BlockSIGIO(); - xf86AccessEnter(); - xf86EnterServerState(SETUP); - for (i = 0; i < xf86NumScreens; i++) { - if (!xf86Screens[i]->EnterVT(i, 0)) - FatalError("EnterVT failed for screen %d\n", i); - } - xf86EnterServerState(OPERATING); - if (!(dispatchException & DE_TERMINATE)) { - for (i = 0; i < xf86NumScreens; i++) { - if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); - } - } - dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); - - pInfo = xf86InputDevs; - while (pInfo) { - if (pInfo->dev) - EnableDevice(pInfo->dev, TRUE); - pInfo = pInfo->next; - } - for (ih = InputHandlers; ih; ih = ih->next) - xf86EnableInputHandler(ih); - - xf86UnblockSIGIO(prevSIGIO); - - } else { -#ifdef XF86PM - if (xf86OSPMClose) - xf86OSPMClose(); - xf86OSPMClose = NULL; -#endif - - for (i = 0; i < xf86NumScreens; i++) { - /* - * zero all access functions to - * trap calls when switched away. - */ - xf86Screens[i]->vtSema = FALSE; - } - if (xorgHWAccess) - xf86DisableIO(); - } - } else { - - DebugF("xf86VTSwitch: Entering\n"); - if (!xf86VTSwitchTo()) return; - - prevSIGIO = xf86BlockSIGIO(); -#ifdef XF86PM - xf86OSPMClose = xf86OSPMOpen(); -#endif - - if (xorgHWAccess) - xf86EnableIO(); - xf86AccessEnter(); - xf86EnterServerState(SETUP); - for (i = 0; i < xf86NumScreens; i++) { - xf86Screens[i]->vtSema = TRUE; - if (!xf86Screens[i]->EnterVT(i, 0)) - FatalError("EnterVT failed for screen %d\n", i); - } - xf86EnterServerState(OPERATING); - for (i = 0; i < xf86NumScreens; i++) { - if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess)(i, TRUE); - } - - /* Turn screen saver off when switching back */ - dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); - - pInfo = xf86InputDevs; - while (pInfo) { - if (pInfo->dev) - EnableDevice(pInfo->dev, TRUE); - pInfo = pInfo->next; - } - - for (ih = InputHandlers; ih; ih = ih->next) - xf86EnableInputHandler(ih); - - xf86UnblockSIGIO(prevSIGIO); - } -} - - -/* Input handler registration */ - -static pointer -addInputHandler(int fd, InputHandlerProc proc, pointer data) -{ - IHPtr ih; - - if (fd < 0 || !proc) - return NULL; - - ih = xcalloc(sizeof(*ih), 1); - if (!ih) - return NULL; - - ih->fd = fd; - ih->ihproc = proc; - ih->data = data; - ih->enabled = TRUE; - - ih->next = InputHandlers; - InputHandlers = ih; - - return ih; -} - -pointer -xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data) -{ - IHPtr ih = addInputHandler(fd, proc, data); - - if (ih) - AddEnabledDevice(fd); - return ih; -} - -pointer -xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) -{ - IHPtr ih = addInputHandler(fd, proc, data); - - if (ih) - AddGeneralSocket(fd); - return ih; -} - -static void -removeInputHandler(IHPtr ih) -{ - IHPtr p; - - if (ih == InputHandlers) - InputHandlers = ih->next; - else { - p = InputHandlers; - while (p && p->next != ih) - p = p->next; - if (ih) - p->next = ih->next; - } - xfree(ih); -} - -int -xf86RemoveInputHandler(pointer handler) -{ - IHPtr ih; - int fd; - - if (!handler) - return -1; - - ih = handler; - fd = ih->fd; - - if (ih->fd >= 0) - RemoveEnabledDevice(ih->fd); - removeInputHandler(ih); - - return fd; -} - -int -xf86RemoveGeneralHandler(pointer handler) -{ - IHPtr ih; - int fd; - - if (!handler) - return -1; - - ih = handler; - fd = ih->fd; - - if (ih->fd >= 0) - RemoveGeneralSocket(ih->fd); - removeInputHandler(ih); - - return fd; -} - -void -xf86DisableInputHandler(pointer handler) -{ - IHPtr ih; - - if (!handler) - return; - - ih = handler; - ih->enabled = FALSE; - if (ih->fd >= 0) - RemoveEnabledDevice(ih->fd); -} - -void -xf86DisableGeneralHandler(pointer handler) -{ - IHPtr ih; - - if (!handler) - return; - - ih = handler; - ih->enabled = FALSE; - if (ih->fd >= 0) - RemoveGeneralSocket(ih->fd); -} - -void -xf86EnableInputHandler(pointer handler) -{ - IHPtr ih; - - if (!handler) - return; - - ih = handler; - ih->enabled = TRUE; - if (ih->fd >= 0) - AddEnabledDevice(ih->fd); -} - -void -xf86EnableGeneralHandler(pointer handler) -{ - IHPtr ih; - - if (!handler) - return; - - ih = handler; - ih->enabled = TRUE; - if (ih->fd >= 0) - AddGeneralSocket(ih->fd); -} - -/* - * As used currently by the DRI, the return value is ignored. - */ -Bool -xf86EnableVTSwitch(Bool new) -{ - static Bool def = TRUE; - Bool old; - - old = VTSwitchEnabled; - if (!new) { - /* Disable VT switching */ - def = VTSwitchEnabled; - VTSwitchEnabled = FALSE; - } else { - /* Restore VT switching to default */ - VTSwitchEnabled = def; - } - return old; -} - -void -DDXRingBell(int volume, int pitch, int duration) { - xf86OSRingBell(volume, pitch, duration); -} +/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * 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 name of Thomas Roell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Thomas Roell makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THOMAS ROELL 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.
+ *
+ */
+/*
+ * Copyright (c) 1994-2003 by The XFree86 Project, 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
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
+ * and author(s) 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 copyright holder(s) and author(s).
+ */
+
+/* [JCH-96/01/21] Extended std reverse map to four buttons. */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xpoll.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSlib.h"
+#include <X11/keysym.h>
+
+#ifdef XFreeXDGA
+#include "dgaproc.h"
+#endif
+
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "inputstr.h"
+#include "xf86Xinput.h"
+
+#include "mi.h"
+#include "mipointer.h"
+
+#include "xkbsrv.h"
+#include "xkbstr.h"
+
+#ifdef DPMSExtension
+#include <X11/extensions/dpmsconst.h>
+#include "dpmsproc.h"
+#endif
+
+/*
+ * This is a toggling variable:
+ * FALSE = No VT switching keys have been pressed last time around
+ * TRUE = Possible VT switch Pending
+ * (DWH - 12/2/93)
+ *
+ * This has been generalised to work with Linux and *BSD+syscons (DHD)
+ */
+
+Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
+ *BSD and for avoiding VT
+ switches when using the DRI
+ automatic full screen mode.*/
+
+extern fd_set EnabledDevices;
+
+#ifdef XF86PM
+extern void (*xf86OSPMClose)(void);
+#endif
+
+static void xf86VTSwitch(void);
+
+/*
+ * Allow arbitrary drivers or other XFree86 code to register with our main
+ * Wakeup handler.
+ */
+typedef struct x_IHRec {
+ int fd;
+ InputHandlerProc ihproc;
+ pointer data;
+ Bool enabled;
+ struct x_IHRec * next;
+} IHRec, *IHPtr;
+
+static IHPtr InputHandlers = NULL;
+
+
+Bool
+LegalModifier(unsigned int key, DeviceIntPtr pDev)
+{
+ return TRUE;
+}
+
+/*
+ * TimeSinceLastInputEvent --
+ * Function used for screensaver purposes by the os module. Returns the
+ * time in milliseconds since there last was any input.
+ */
+int
+TimeSinceLastInputEvent(void)
+{
+ if (xf86Info.lastEventTime == 0) {
+ xf86Info.lastEventTime = GetTimeInMillis();
+ }
+ return GetTimeInMillis() - xf86Info.lastEventTime;
+}
+
+/*
+ * SetTimeSinceLastInputEvent --
+ * Set the lastEventTime to now.
+ */
+void
+SetTimeSinceLastInputEvent(void)
+{
+ xf86Info.lastEventTime = GetTimeInMillis();
+}
+
+/*
+ * ProcessInputEvents --
+ * Retrieve all waiting input events and pass them to DIX in their
+ * correct chronological order. Only reads from the system pointer
+ * and keyboard.
+ */
+void
+ProcessInputEvents (void)
+{
+ int x, y;
+
+ mieqProcessInputEvents();
+
+ /* FIXME: This is a problem if we have multiple pointers */
+ miPointerGetPosition(inputInfo.pointer, &x, &y);
+ xf86SetViewport(xf86Info.currentScreen, x, y);
+}
+
+/*
+ * Handle keyboard events that cause some kind of "action"
+ * (i.e., server termination, video mode changes, VT switches, etc.)
+ */
+void
+xf86ProcessActionEvent(ActionEvent action, void *arg)
+{
+ DebugF("ProcessActionEvent(%d,%x)\n", (int) action, arg);
+ switch (action) {
+ case ACTION_TERMINATE:
+ if (!xf86Info.dontZap) {
+#ifdef XFreeXDGA
+ DGAShutdown();
+#endif
+ GiveUp(0);
+ }
+ break;
+ case ACTION_NEXT_MODE:
+ if (!xf86Info.dontZoom)
+ xf86ZoomViewport(xf86Info.currentScreen, 1);
+ break;
+ case ACTION_PREV_MODE:
+ if (!xf86Info.dontZoom)
+ xf86ZoomViewport(xf86Info.currentScreen, -1);
+ break;
+ case ACTION_SWITCHSCREEN:
+ if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) {
+ int vtno = *((int *) arg);
+
+ if (vtno != xf86Info.vtno) {
+ if (!xf86VTActivate(vtno)) {
+ ErrorF("Failed to switch from vt%02d to vt%02d: %s\n",
+ xf86Info.vtno, vtno, strerror(errno));
+ }
+ }
+ }
+ break;
+ case ACTION_SWITCHSCREEN_NEXT:
+ if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
+ if (!xf86VTActivate(xf86Info.vtno + 1)) {
+ /* If first try failed, assume this is the last VT and
+ * try wrapping around to the first vt.
+ */
+ if (!xf86VTActivate(1)) {
+ ErrorF("Failed to switch from vt%02d to next vt: %s\n",
+ xf86Info.vtno, strerror(errno));
+ }
+ }
+ }
+ break;
+ case ACTION_SWITCHSCREEN_PREV:
+ if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) {
+ if (!xf86VTActivate(xf86Info.vtno - 1)) {
+ /* Don't know what the maximum VT is, so can't wrap around */
+ ErrorF("Failed to switch from vt%02d to previous vt: %s\n",
+ xf86Info.vtno, strerror(errno));
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+/*
+ * xf86Wakeup --
+ * Os wakeup handler.
+ */
+
+/* ARGSUSED */
+void
+xf86Wakeup(pointer blockData, int err, pointer pReadmask)
+{
+ fd_set* LastSelectMask = (fd_set*)pReadmask;
+ fd_set devicesWithInput;
+ InputInfoPtr pInfo;
+
+ if (err >= 0) {
+
+ XFD_ANDSET(&devicesWithInput, LastSelectMask, &EnabledDevices);
+ if (XFD_ANYSET(&devicesWithInput)) {
+ pInfo = xf86InputDevs;
+ while (pInfo) {
+ if (pInfo->read_input && pInfo->fd >= 0 &&
+ (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
+ int sigstate = xf86BlockSIGIO();
+
+ /*
+ * Remove the descriptior from the set because more than one
+ * device may share the same file descriptor.
+ */
+ FD_CLR(pInfo->fd, &devicesWithInput);
+
+ pInfo->read_input(pInfo);
+ xf86UnblockSIGIO(sigstate);
+ }
+ pInfo = pInfo->next;
+ }
+ }
+ }
+
+ if (err >= 0) { /* we don't want the handlers called if select() */
+ IHPtr ih; /* returned with an error condition, do we? */
+
+ for (ih = InputHandlers; ih; ih = ih->next) {
+ if (ih->enabled && ih->fd >= 0 && ih->ihproc &&
+ (FD_ISSET(ih->fd, ((fd_set *)pReadmask)) != 0)) {
+ ih->ihproc(ih->fd, ih->data);
+ }
+ }
+ }
+
+ if (xf86VTSwitchPending()) xf86VTSwitch();
+}
+
+
+/*
+ * xf86SigioReadInput --
+ * signal handler for the SIGIO signal.
+ */
+static void
+xf86SigioReadInput(int fd, void *closure)
+{
+ int errno_save = errno;
+ InputInfoPtr pInfo = closure;
+
+ pInfo->read_input(pInfo);
+
+ errno = errno_save;
+}
+
+/*
+ * xf86AddEnabledDevice --
+ *
+ */
+void
+xf86AddEnabledDevice(InputInfoPtr pInfo)
+{
+ if (!xf86InstallSIGIOHandler (pInfo->fd, xf86SigioReadInput, pInfo)) {
+ AddEnabledDevice(pInfo->fd);
+ }
+}
+
+/*
+ * xf86RemoveEnabledDevice --
+ *
+ */
+void
+xf86RemoveEnabledDevice(InputInfoPtr pInfo)
+{
+ if (!xf86RemoveSIGIOHandler (pInfo->fd)) {
+ RemoveEnabledDevice(pInfo->fd);
+ }
+}
+
+static int *xf86SignalIntercept = NULL;
+
+void
+xf86InterceptSignals(int *signo)
+{
+ if ((xf86SignalIntercept = signo))
+ *signo = -1;
+}
+
+static void (*xf86SigIllHandler)(void) = NULL;
+
+void
+xf86InterceptSigIll(void (*sigillhandler)(void))
+{
+ xf86SigIllHandler = sigillhandler;
+}
+
+/*
+ * xf86SigWrapper --
+ * Catch unexpected signals and exit or continue cleanly.
+ */
+int
+xf86SigWrapper(int signo)
+{
+ if ((signo == SIGILL) && xf86SigIllHandler) {
+ (*xf86SigIllHandler)();
+ return 0; /* continue */
+ }
+
+ if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) {
+ *xf86SignalIntercept = signo;
+ return 0; /* continue */
+ }
+
+ xf86Info.caughtSignal = TRUE;
+ return 1; /* abort */
+}
+
+/*
+ * xf86PrintBacktrace --
+ * Print a stack backtrace for debugging purposes.
+ */
+void
+xf86PrintBacktrace(void)
+{
+ xorg_backtrace();
+}
+
+#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7)))
+
+static void
+xf86ReleaseKeys(DeviceIntPtr pDev)
+{
+ KeyClassPtr keyc;
+ int i, j, nevents, sigstate;
+
+ if (!pDev || !pDev->key)
+ return;
+
+ keyc = pDev->key;
+
+ /*
+ * Hmm... here is the biggest hack of every time !
+ * It may be possible that a switch-vt procedure has finished BEFORE
+ * you released all keys neccessary to do this. That peculiar behavior
+ * can fool the X-server pretty much, cause it assumes that some keys
+ * were not released. TWM may stuck alsmost completly....
+ * OK, what we are doing here is after returning from the vt-switch
+ * exeplicitely unrelease all keyboard keys before the input-devices
+ * are reenabled.
+ */
+
+ for (i = keyc->xkbInfo->desc->min_key_code;
+ i < keyc->xkbInfo->desc->max_key_code;
+ i++) {
+ if (KeyPressed(i)) {
+ sigstate = xf86BlockSIGIO ();
+ nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i);
+ for (j = 0; j < nevents; j++)
+ mieqEnqueue(pDev, (InternalEvent*)(xf86Events + j)->event);
+ xf86UnblockSIGIO(sigstate);
+ }
+ }
+}
+
+/*
+ * xf86VTSwitch --
+ * Handle requests for switching the vt.
+ */
+static void
+xf86VTSwitch(void)
+{
+ int i, prevSIGIO;
+ InputInfoPtr pInfo;
+ IHPtr ih;
+
+ DebugF("xf86VTSwitch()\n");
+
+#ifdef XFreeXDGA
+ if(!DGAVTSwitch())
+ return;
+#endif
+
+ /*
+ * Since all screens are currently all in the same state it is sufficient
+ * check the first. This might change in future.
+ */
+ if (xf86Screens[0]->vtSema) {
+
+ DebugF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
+ BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));
+#ifdef DPMSExtension
+ if (DPMSPowerLevel != DPMSModeOn)
+ DPMSSet(serverClient, DPMSModeOn);
+#endif
+ for (i = 0; i < xf86NumScreens; i++) {
+ if (!(dispatchException & DE_TERMINATE))
+ if (xf86Screens[i]->EnableDisableFBAccess)
+ (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE);
+ }
+
+ /*
+ * Keep the order: Disable Device > LeaveVT
+ * EnterVT > EnableDevice
+ */
+ for (ih = InputHandlers; ih; ih = ih->next)
+ xf86DisableInputHandler(ih);
+ for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) {
+ if (pInfo->dev) {
+ xf86ReleaseKeys(pInfo->dev);
+ ProcessInputEvents();
+ DisableDevice(pInfo->dev, TRUE);
+ }
+ }
+ xf86EnterServerState(SETUP);
+ for (i = 0; i < xf86NumScreens; i++)
+ xf86Screens[i]->LeaveVT(i, 0);
+
+ xf86AccessLeave(); /* We need this here, otherwise */
+
+ if (!xf86VTSwitchAway()) {
+ /*
+ * switch failed
+ */
+
+ DebugF("xf86VTSwitch: Leave failed\n");
+ prevSIGIO = xf86BlockSIGIO();
+ xf86AccessEnter();
+ xf86EnterServerState(SETUP);
+ for (i = 0; i < xf86NumScreens; i++) {
+ if (!xf86Screens[i]->EnterVT(i, 0))
+ FatalError("EnterVT failed for screen %d\n", i);
+ }
+ xf86EnterServerState(OPERATING);
+ if (!(dispatchException & DE_TERMINATE)) {
+ for (i = 0; i < xf86NumScreens; i++) {
+ if (xf86Screens[i]->EnableDisableFBAccess)
+ (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
+ }
+ }
+ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
+
+ pInfo = xf86InputDevs;
+ while (pInfo) {
+ if (pInfo->dev)
+ EnableDevice(pInfo->dev, TRUE);
+ pInfo = pInfo->next;
+ }
+ for (ih = InputHandlers; ih; ih = ih->next)
+ xf86EnableInputHandler(ih);
+
+ xf86UnblockSIGIO(prevSIGIO);
+
+ } else {
+#ifdef XF86PM
+ if (xf86OSPMClose)
+ xf86OSPMClose();
+ xf86OSPMClose = NULL;
+#endif
+
+ for (i = 0; i < xf86NumScreens; i++) {
+ /*
+ * zero all access functions to
+ * trap calls when switched away.
+ */
+ xf86Screens[i]->vtSema = FALSE;
+ }
+ if (xorgHWAccess)
+ xf86DisableIO();
+ }
+ } else {
+
+ DebugF("xf86VTSwitch: Entering\n");
+ if (!xf86VTSwitchTo()) return;
+
+ prevSIGIO = xf86BlockSIGIO();
+#ifdef XF86PM
+ xf86OSPMClose = xf86OSPMOpen();
+#endif
+
+ if (xorgHWAccess)
+ xf86EnableIO();
+ xf86AccessEnter();
+ xf86EnterServerState(SETUP);
+ for (i = 0; i < xf86NumScreens; i++) {
+ xf86Screens[i]->vtSema = TRUE;
+ if (!xf86Screens[i]->EnterVT(i, 0))
+ FatalError("EnterVT failed for screen %d\n", i);
+ }
+ xf86EnterServerState(OPERATING);
+ for (i = 0; i < xf86NumScreens; i++) {
+ if (xf86Screens[i]->EnableDisableFBAccess)
+ (*xf86Screens[i]->EnableDisableFBAccess)(i, TRUE);
+ }
+
+ /* Turn screen saver off when switching back */
+ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
+
+ pInfo = xf86InputDevs;
+ while (pInfo) {
+ if (pInfo->dev)
+ EnableDevice(pInfo->dev, TRUE);
+ pInfo = pInfo->next;
+ }
+
+ for (ih = InputHandlers; ih; ih = ih->next)
+ xf86EnableInputHandler(ih);
+
+ xf86UnblockSIGIO(prevSIGIO);
+ }
+}
+
+
+/* Input handler registration */
+
+static pointer
+addInputHandler(int fd, InputHandlerProc proc, pointer data)
+{
+ IHPtr ih;
+
+ if (fd < 0 || !proc)
+ return NULL;
+
+ ih = xcalloc(sizeof(*ih), 1);
+ if (!ih)
+ return NULL;
+
+ ih->fd = fd;
+ ih->ihproc = proc;
+ ih->data = data;
+ ih->enabled = TRUE;
+
+ ih->next = InputHandlers;
+ InputHandlers = ih;
+
+ return ih;
+}
+
+pointer
+xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data)
+{
+ IHPtr ih = addInputHandler(fd, proc, data);
+
+ if (ih)
+ AddEnabledDevice(fd);
+ return ih;
+}
+
+pointer
+xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data)
+{
+ IHPtr ih = addInputHandler(fd, proc, data);
+
+ if (ih)
+ AddGeneralSocket(fd);
+ return ih;
+}
+
+static void
+removeInputHandler(IHPtr ih)
+{
+ IHPtr p;
+
+ if (ih == InputHandlers)
+ InputHandlers = ih->next;
+ else {
+ p = InputHandlers;
+ while (p && p->next != ih)
+ p = p->next;
+ if (ih)
+ p->next = ih->next;
+ }
+ xfree(ih);
+}
+
+int
+xf86RemoveInputHandler(pointer handler)
+{
+ IHPtr ih;
+ int fd;
+
+ if (!handler)
+ return -1;
+
+ ih = handler;
+ fd = ih->fd;
+
+ if (ih->fd >= 0)
+ RemoveEnabledDevice(ih->fd);
+ removeInputHandler(ih);
+
+ return fd;
+}
+
+int
+xf86RemoveGeneralHandler(pointer handler)
+{
+ IHPtr ih;
+ int fd;
+
+ if (!handler)
+ return -1;
+
+ ih = handler;
+ fd = ih->fd;
+
+ if (ih->fd >= 0)
+ RemoveGeneralSocket(ih->fd);
+ removeInputHandler(ih);
+
+ return fd;
+}
+
+void
+xf86DisableInputHandler(pointer handler)
+{
+ IHPtr ih;
+
+ if (!handler)
+ return;
+
+ ih = handler;
+ ih->enabled = FALSE;
+ if (ih->fd >= 0)
+ RemoveEnabledDevice(ih->fd);
+}
+
+void
+xf86DisableGeneralHandler(pointer handler)
+{
+ IHPtr ih;
+
+ if (!handler)
+ return;
+
+ ih = handler;
+ ih->enabled = FALSE;
+ if (ih->fd >= 0)
+ RemoveGeneralSocket(ih->fd);
+}
+
+void
+xf86EnableInputHandler(pointer handler)
+{
+ IHPtr ih;
+
+ if (!handler)
+ return;
+
+ ih = handler;
+ ih->enabled = TRUE;
+ if (ih->fd >= 0)
+ AddEnabledDevice(ih->fd);
+}
+
+void
+xf86EnableGeneralHandler(pointer handler)
+{
+ IHPtr ih;
+
+ if (!handler)
+ return;
+
+ ih = handler;
+ ih->enabled = TRUE;
+ if (ih->fd >= 0)
+ AddGeneralSocket(ih->fd);
+}
+
+/*
+ * As used currently by the DRI, the return value is ignored.
+ */
+Bool
+xf86EnableVTSwitch(Bool new)
+{
+ static Bool def = TRUE;
+ Bool old;
+
+ old = VTSwitchEnabled;
+ if (!new) {
+ /* Disable VT switching */
+ def = VTSwitchEnabled;
+ VTSwitchEnabled = FALSE;
+ } else {
+ /* Restore VT switching to default */
+ VTSwitchEnabled = def;
+ }
+ return old;
+}
+
+void
+DDXRingBell(int volume, int pitch, int duration) {
+ xf86OSRingBell(volume, pitch, duration);
+}
diff --git a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c index b24099811..a3eccdfff 100644 --- a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c +++ b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c @@ -1,1178 +1,1113 @@ -/* - * This code was stolen from RAC and adapted to control the legacy vga - * interface. - * - * - * Copyright (c) 2007 Paulo R. Zanoni, Tiago Vignatti - * - * 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 AUTHORS OR COPYRIGHT - * HOLDERS 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. - * - */ - -#include "xorg-config.h" - -#include "xf86VGAarbiter.h" - -#ifdef HAVE_PCI_DEVICE_VGAARB_INIT -#include "xf86VGAarbiterPriv.h" -#include "xf86Bus.h" -#include "xf86Priv.h" -#include "pciaccess.h" - -#ifdef DEBUG -#error "no, really, you dont want to do this" -#define DPRINT_S(x,y) ErrorF(x ": %i\n",y); -#define DPRINT(x) ErrorF(x "\n"); -#else -#define DPRINT_S(x,y) -#define DPRINT(x) -#endif - -static GCFuncs VGAarbiterGCFuncs = { - VGAarbiterValidateGC, VGAarbiterChangeGC, VGAarbiterCopyGC, - VGAarbiterDestroyGC, VGAarbiterChangeClip, VGAarbiterDestroyClip, - VGAarbiterCopyClip -}; - -static GCOps VGAarbiterGCOps = { - VGAarbiterFillSpans, VGAarbiterSetSpans, VGAarbiterPutImage, - VGAarbiterCopyArea, VGAarbiterCopyPlane, VGAarbiterPolyPoint, - VGAarbiterPolylines, VGAarbiterPolySegment, VGAarbiterPolyRectangle, - VGAarbiterPolyArc, VGAarbiterFillPolygon, VGAarbiterPolyFillRect, - VGAarbiterPolyFillArc, VGAarbiterPolyText8, VGAarbiterPolyText16, - VGAarbiterImageText8, VGAarbiterImageText16, VGAarbiterImageGlyphBlt, - VGAarbiterPolyGlyphBlt, VGAarbiterPushPixels, - {NULL} /* devPrivate */ -}; - -static miPointerSpriteFuncRec VGAarbiterSpriteFuncs = { - VGAarbiterSpriteRealizeCursor, VGAarbiterSpriteUnrealizeCursor, - VGAarbiterSpriteSetCursor, VGAarbiterSpriteMoveCursor, - VGAarbiterDeviceCursorInitialize, VGAarbiterDeviceCursorCleanup -}; - -static int VGAarbiterKeyIndex; -static DevPrivateKey VGAarbiterScreenKey = &VGAarbiterKeyIndex; -static int VGAarbiterGCIndex; -static DevPrivateKey VGAarbiterGCKey = &VGAarbiterGCIndex; - -static int vga_no_arb = 0; -void -xf86VGAarbiterInit(void) -{ - if (pci_device_vgaarb_init() != 0) { - vga_no_arb = 1; - xf86Msg(X_WARNING, "VGA arbiter: cannot open kernel arbiter, no multi-card support\n"); - } -} - -void -xf86VGAarbiterFini(void) -{ - if (vga_no_arb) - return; - pci_device_vgaarb_fini(); -} - -void -xf86VGAarbiterLock(ScrnInfoPtr pScrn) -{ - if (vga_no_arb) - return; - pci_device_vgaarb_set_target(pScrn->vgaDev); - pci_device_vgaarb_lock(); -} - -void -xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) -{ - if (vga_no_arb) - return; - pci_device_vgaarb_unlock(); -} - -Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) -{ - int vga_count; - int rsrc_decodes; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - - if (vga_no_arb) - return TRUE; - - pci_device_vgaarb_get_info(pScrn->vgaDev, &vga_count, &rsrc_decodes); - if (vga_count > 1) { - if (rsrc_decodes) { - return FALSE; - } - } - return TRUE; -} - -void -xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) -{ - struct pci_device *dev; - EntityPtr pEnt; - - if (vga_no_arb) - return; - - pEnt = xf86Entities[pScrn->entityList[0]]; - if (pEnt->bus.type != BUS_PCI) - return; - - dev = pEnt->bus.id.pci; - pScrn->vgaDev = dev; -} - -void -xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn) -{ - if (vga_no_arb) - return; - pci_device_vgaarb_decodes(VGA_ARB_RSRC_LEGACY_MEM | VGA_ARB_RSRC_LEGACY_IO); -} - -Bool -xf86VGAarbiterWrapFunctions(void) -{ - ScrnInfoPtr pScrn; - VGAarbiterScreenPtr pScreenPriv; - miPointerScreenPtr PointPriv; -#ifdef RENDER - PictureScreenPtr ps; -#endif - ScreenPtr pScreen; - int vga_count, i; - - if (vga_no_arb) - return FALSE; - - /* - * we need to wrap the arbiter if we have more than - * one VGA card - hotplug cries. - */ - pci_device_vgaarb_get_info(NULL, &vga_count, NULL); - if (vga_count < 2 || !xf86Screens) - return FALSE; - - xf86Msg(X_INFO,"Found %d VGA devices: arbiter wrapping enabled\n", - vga_count); - - for (i = 0; i < xf86NumScreens; i++) { - pScreen = xf86Screens[i]->pScreen; -#ifdef RENDER - ps = GetPictureScreenIfSet(pScreen); -#endif - pScrn = xf86Screens[pScreen->myNum]; - PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); - - DPRINT_S("VGAarbiterWrapFunctions",pScreen->myNum); - - if (!dixRequestPrivate(VGAarbiterGCKey, sizeof(VGAarbiterGCRec))) - return FALSE; - - if (!(pScreenPriv = xalloc(sizeof(VGAarbiterScreenRec)))) - return FALSE; - - dixSetPrivate(&pScreen->devPrivates, VGAarbiterScreenKey, pScreenPriv); - - WRAP_SCREEN(CloseScreen, VGAarbiterCloseScreen); - WRAP_SCREEN(SaveScreen, VGAarbiterSaveScreen); - WRAP_SCREEN(WakeupHandler, VGAarbiterWakeupHandler); - WRAP_SCREEN(BlockHandler, VGAarbiterBlockHandler); - WRAP_SCREEN(CreateGC, VGAarbiterCreateGC); - WRAP_SCREEN(GetImage, VGAarbiterGetImage); - WRAP_SCREEN(GetSpans, VGAarbiterGetSpans); - WRAP_SCREEN(SourceValidate, VGAarbiterSourceValidate); - WRAP_SCREEN(CopyWindow, VGAarbiterCopyWindow); - WRAP_SCREEN(ClearToBackground, VGAarbiterClearToBackground); - WRAP_SCREEN(CreatePixmap, VGAarbiterCreatePixmap); - WRAP_SCREEN(StoreColors, VGAarbiterStoreColors); - WRAP_SCREEN(DisplayCursor, VGAarbiterDisplayCursor); - WRAP_SCREEN(RealizeCursor, VGAarbiterRealizeCursor); - WRAP_SCREEN(UnrealizeCursor, VGAarbiterUnrealizeCursor); - WRAP_SCREEN(RecolorCursor, VGAarbiterRecolorCursor); - WRAP_SCREEN(SetCursorPosition, VGAarbiterSetCursorPosition); -#ifdef RENDER - WRAP_PICT(Composite,VGAarbiterComposite); - WRAP_PICT(Glyphs,VGAarbiterGlyphs); - WRAP_PICT(CompositeRects,VGAarbiterCompositeRects); -#endif - WRAP_SCREEN_INFO(AdjustFrame, VGAarbiterAdjustFrame); - WRAP_SCREEN_INFO(SwitchMode, VGAarbiterSwitchMode); - WRAP_SCREEN_INFO(EnterVT, VGAarbiterEnterVT); - WRAP_SCREEN_INFO(LeaveVT, VGAarbiterLeaveVT); - WRAP_SCREEN_INFO(FreeScreen, VGAarbiterFreeScreen); - WRAP_SPRITE; - } - - return TRUE; -} - -/* Screen funcs */ -static Bool -VGAarbiterCloseScreen (int i, ScreenPtr pScreen) -{ - Bool val; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, VGAarbiterScreenKey); - miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, miPointerScreenKey); -#ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); -#endif - - DPRINT_S("VGAarbiterCloseScreen",pScreen->myNum); - UNWRAP_SCREEN(CreateGC); - UNWRAP_SCREEN(CloseScreen); - UNWRAP_SCREEN(GetImage); - UNWRAP_SCREEN(GetSpans); - UNWRAP_SCREEN(SourceValidate); - UNWRAP_SCREEN(CopyWindow); - UNWRAP_SCREEN(ClearToBackground); - UNWRAP_SCREEN(SaveScreen); - UNWRAP_SCREEN(StoreColors); - UNWRAP_SCREEN(DisplayCursor); - UNWRAP_SCREEN(RealizeCursor); - UNWRAP_SCREEN(UnrealizeCursor); - UNWRAP_SCREEN(RecolorCursor); - UNWRAP_SCREEN(SetCursorPosition); -#ifdef RENDER - UNWRAP_PICT(Composite); - UNWRAP_PICT(Glyphs); - UNWRAP_PICT(CompositeRects); -#endif - UNWRAP_SCREEN_INFO(AdjustFrame); - UNWRAP_SCREEN_INFO(SwitchMode); - UNWRAP_SCREEN_INFO(EnterVT); - UNWRAP_SCREEN_INFO(LeaveVT); - UNWRAP_SCREEN_INFO(FreeScreen); - UNWRAP_SPRITE; - - xfree ((pointer) pScreenPriv); - xf86VGAarbiterLock(xf86Screens[i]); - val = (*pScreen->CloseScreen) (i, pScreen); - xf86VGAarbiterUnlock(xf86Screens[i]); - return val; -} - -static void -VGAarbiterBlockHandler(int i, - pointer blockData, pointer pTimeout, pointer pReadmask) -{ - ScreenPtr pScreen = screenInfo.screens[i]; - SCREEN_PROLOG(BlockHandler); - VGAGet(); - pScreen->BlockHandler(i, blockData, pTimeout, pReadmask); - VGAPut(); - SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler); -} - -static void -VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, pointer pReadmask) -{ - ScreenPtr pScreen = screenInfo.screens[i]; - SCREEN_PROLOG(WakeupHandler); - VGAGet(); - pScreen->WakeupHandler(i, blockData, result, pReadmask); - VGAPut(); - SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler); -} - -static void -VGAarbiterGetImage ( - DrawablePtr pDrawable, - int sx, int sy, int w, int h, - unsigned int format, - unsigned long planemask, - char *pdstLine - ) -{ - ScreenPtr pScreen = pDrawable->pScreen; - DPRINT_S("VGAarbiterGetImage",pScreen->myNum); - SCREEN_PROLOG(GetImage); -// if (xf86Screens[pScreen->myNum]->vtSema) { - VGAGet(); -// } - (*pScreen->GetImage) (pDrawable, sx, sy, w, h, - format, planemask, pdstLine); - VGAPut(); - SCREEN_EPILOG (GetImage, VGAarbiterGetImage); -} - -static void -VGAarbiterGetSpans ( - DrawablePtr pDrawable, - int wMax, - DDXPointPtr ppt, - int *pwidth, - int nspans, - char *pdstStart - ) -{ - ScreenPtr pScreen = pDrawable->pScreen; - - DPRINT_S("VGAarbiterGetSpans",pScreen->myNum); - SCREEN_PROLOG (GetSpans); - VGAGet(); - (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); - VGAPut(); - SCREEN_EPILOG (GetSpans, VGAarbiterGetSpans); -} - -static void -VGAarbiterSourceValidate ( - DrawablePtr pDrawable, - int x, int y, int width, int height ) -{ - ScreenPtr pScreen = pDrawable->pScreen; - DPRINT_S("VGAarbiterSourceValidate",pScreen->myNum); - SCREEN_PROLOG (SourceValidate); - VGAGet(); - if (pScreen->SourceValidate) - (*pScreen->SourceValidate) (pDrawable, x, y, width, height); - VGAPut(); - SCREEN_EPILOG (SourceValidate, VGAarbiterSourceValidate); -} - -static void -VGAarbiterCopyWindow( - WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc ) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("VGAarbiterCopyWindow",pScreen->myNum); - SCREEN_PROLOG (CopyWindow); - VGAGet(); - (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); - VGAPut(); - SCREEN_EPILOG (CopyWindow, VGAarbiterCopyWindow); -} - -static void -VGAarbiterClearToBackground ( - WindowPtr pWin, - int x, int y, - int w, int h, - Bool generateExposures ) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("VGAarbiterClearToBackground",pScreen->myNum); - SCREEN_PROLOG ( ClearToBackground); - VGAGet(); - (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures); - VGAPut(); - SCREEN_EPILOG (ClearToBackground, VGAarbiterClearToBackground); -} - -static PixmapPtr -VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) -{ - PixmapPtr pPix; - - DPRINT_S("VGAarbiterCreatePixmap",pScreen->myNum); - SCREEN_PROLOG ( CreatePixmap); - VGAGet(); - pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); - VGAPut(); - SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap); - - return pPix; -} - -static Bool -VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank) -{ - Bool val; - - DPRINT_S("VGAarbiterSaveScreen",pScreen->myNum); - SCREEN_PROLOG (SaveScreen); - VGAGet(); - val = (*pScreen->SaveScreen) (pScreen, unblank); - VGAPut(); - SCREEN_EPILOG (SaveScreen, VGAarbiterSaveScreen); - - return val; -} - -static void -VGAarbiterStoreColors ( - ColormapPtr pmap, - int ndef, - xColorItem *pdefs) -{ - ScreenPtr pScreen = pmap->pScreen; - - DPRINT_S("VGAarbiterStoreColors",pScreen->myNum); - SCREEN_PROLOG (StoreColors); - VGAGet(); - (*pScreen->StoreColors) (pmap,ndef,pdefs); - VGAPut(); - SCREEN_EPILOG ( StoreColors, VGAarbiterStoreColors); -} - -static void -VGAarbiterRecolorCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCurs, - Bool displayed - ) -{ - DPRINT_S("VGAarbiterRecolorCursor",pScreen->myNum); - SCREEN_PROLOG (RecolorCursor); - VGAGet(); - (*pScreen->RecolorCursor) (pDev, pScreen, pCurs, displayed); - VGAPut(); - SCREEN_EPILOG ( RecolorCursor, VGAarbiterRecolorCursor); -} - -static Bool -VGAarbiterRealizeCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCursor - ) -{ - Bool val; - - DPRINT_S("VGAarbiterRealizeCursor",pScreen->myNum); - SCREEN_PROLOG (RealizeCursor); - VGAGet(); - val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor); - VGAPut(); - SCREEN_EPILOG ( RealizeCursor, VGAarbiterRealizeCursor); - return val; -} - -static Bool -VGAarbiterUnrealizeCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCursor - ) -{ - Bool val; - - DPRINT_S("VGAarbiterUnrealizeCursor",pScreen->myNum); - SCREEN_PROLOG (UnrealizeCursor); - VGAGet(); - val = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor); - VGAPut(); - SCREEN_EPILOG ( UnrealizeCursor, VGAarbiterUnrealizeCursor); - return val; -} - -static Bool -VGAarbiterDisplayCursor ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - CursorPtr pCursor - ) -{ - Bool val; - - DPRINT_S("VGAarbiterDisplayCursor",pScreen->myNum); - SCREEN_PROLOG (DisplayCursor); - VGAGet(); - val = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); - VGAPut(); - SCREEN_EPILOG ( DisplayCursor, VGAarbiterDisplayCursor); - return val; -} - -static Bool -VGAarbiterSetCursorPosition ( - DeviceIntPtr pDev, - ScreenPtr pScreen, - int x, int y, - Bool generateEvent) -{ - Bool val; - - DPRINT_S("VGAarbiterSetCursorPosition",pScreen->myNum); - SCREEN_PROLOG (SetCursorPosition); - VGAGet(); - val = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); - VGAPut(); - SCREEN_EPILOG ( SetCursorPosition, VGAarbiterSetCursorPosition); - return val; -} - -static void -VGAarbiterAdjustFrame(int index, int x, int y, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, VGAarbiterScreenKey); - - DPRINT_S("VGAarbiterAdjustFrame",index); - VGAGet(); - (*pScreenPriv->AdjustFrame)(index, x, y, flags); - VGAPut(); -} - -static Bool -VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags) -{ - Bool val; - ScreenPtr pScreen = screenInfo.screens[index]; - VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, VGAarbiterScreenKey); - - DPRINT_S("VGAarbiterSwitchMode",index); - VGAGet(); - val = (*pScreenPriv->SwitchMode)(index, mode, flags); - VGAPut(); - return val; -} - -static Bool -VGAarbiterEnterVT(int index, int flags) -{ - Bool val; - ScreenPtr pScreen = screenInfo.screens[index]; - VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, VGAarbiterScreenKey); - - DPRINT_S("VGAarbiterEnterVT",index); - VGAGet(); - val = (*pScreenPriv->EnterVT)(index, flags); - VGAPut(); - return val; -} - -static void -VGAarbiterLeaveVT(int index, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, VGAarbiterScreenKey); - - DPRINT_S("VGAarbiterLeaveVT",index); - - VGAGet(); - (*pScreenPriv->LeaveVT)(index, flags); - VGAPut(); -} - -static void -VGAarbiterFreeScreen(int index, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, VGAarbiterScreenKey); - - DPRINT_S("VGAarbiterFreeScreen",index); - - VGAGet(); - (*pScreenPriv->FreeScreen)(index, flags); - VGAPut(); -} - -static Bool -VGAarbiterCreateGC(GCPtr pGC) -{ - ScreenPtr pScreen = pGC->pScreen; - VGAarbiterGCPtr pGCPriv = (VGAarbiterGCPtr)dixLookupPrivate(&pGC->devPrivates, VGAarbiterGCKey); - Bool ret; - - DPRINT_S("VGAarbiterCreateGC",pScreen->myNum); - SCREEN_PROLOG(CreateGC); - VGAGet(); - ret = (*pScreen->CreateGC)(pGC); - VGAPut(); - GC_WRAP(pGC); - SCREEN_EPILOG(CreateGC,VGAarbiterCreateGC); - - return ret; -} - -/* GC funcs */ -static void -VGAarbiterValidateGC( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDraw ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterValidateGC"); - (*pGC->funcs->ValidateGC)(pGC, changes, pDraw); - GC_WRAP(pGC); -} - - -static void -VGAarbiterDestroyGC(GCPtr pGC) -{ - GC_UNWRAP (pGC); - DPRINT("VGAarbiterDestroyGC"); - (*pGC->funcs->DestroyGC)(pGC); - GC_WRAP (pGC); -} - -static void -VGAarbiterChangeGC ( - GCPtr pGC, - unsigned long mask) -{ - GC_UNWRAP (pGC); - DPRINT("VGAarbiterChangeGC"); - (*pGC->funcs->ChangeGC) (pGC, mask); - GC_WRAP (pGC); -} - -static void -VGAarbiterCopyGC ( - GCPtr pGCSrc, - unsigned long mask, - GCPtr pGCDst) -{ - GC_UNWRAP (pGCDst); - DPRINT("VGAarbiterCopyGC"); - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - GC_WRAP (pGCDst); -} - -static void -VGAarbiterChangeClip ( - GCPtr pGC, - int type, - pointer pvalue, - int nrects ) -{ - GC_UNWRAP (pGC); - DPRINT("VGAarbiterChangeClip"); - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - GC_WRAP (pGC); -} - -static void -VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - GC_UNWRAP (pgcDst); - DPRINT("VGAarbiterCopyClip"); - (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc); - GC_WRAP (pgcDst); -} - -static void -VGAarbiterDestroyClip(GCPtr pGC) -{ - GC_UNWRAP (pGC); - DPRINT("VGAarbiterDestroyClip"); - (* pGC->funcs->DestroyClip)(pGC); - GC_WRAP (pGC); -} - -/* GC Ops */ -static void -VGAarbiterFillSpans( - DrawablePtr pDraw, - GC *pGC, - int nInit, - DDXPointPtr pptInit, - int *pwidthInit, - int fSorted ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterFillSpans"); - VGAGet_GC(); - (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterSetSpans( - DrawablePtr pDraw, - GCPtr pGC, - char *pcharsrc, - register DDXPointPtr ppt, - int *pwidth, - int nspans, - int fSorted ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterSetSpans"); - VGAGet_GC(); - (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPutImage( - DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, - int leftPad, - int format, - char *pImage ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPutImage"); - VGAGet_GC(); - (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h, - leftPad, format, pImage); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static RegionPtr -VGAarbiterCopyArea( - DrawablePtr pSrc, - DrawablePtr pDst, - GC *pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty ) -{ - RegionPtr ret; - - GC_UNWRAP(pGC); - DPRINT("VGAarbiterCopyArea"); - VGAGet_GC(); - ret = (*pGC->ops->CopyArea)(pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); - VGAPut_GC(); - GC_WRAP(pGC); - return ret; -} - -static RegionPtr -VGAarbiterCopyPlane( - DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, - unsigned long bitPlane ) -{ - RegionPtr ret; - - GC_UNWRAP(pGC); - DPRINT("VGAarbiterCopyPlane"); - VGAGet_GC(); - ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy, - width, height, dstx, dsty, bitPlane); - VGAPut_GC(); - GC_WRAP(pGC); - return ret; -} - -static void -VGAarbiterPolyPoint( - DrawablePtr pDraw, - GCPtr pGC, - int mode, - int npt, - xPoint *pptInit ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyPoint"); - VGAGet_GC(); - (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit); - VGAPut_GC(); - GC_WRAP(pGC); -} - - -static void -VGAarbiterPolylines( - DrawablePtr pDraw, - GCPtr pGC, - int mode, - int npt, - DDXPointPtr pptInit ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolylines"); - VGAGet_GC(); - (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPolySegment( - DrawablePtr pDraw, - GCPtr pGC, - int nseg, - xSegment *pSeg ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolySegment"); - VGAGet_GC(); - (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPolyRectangle( - DrawablePtr pDraw, - GCPtr pGC, - int nRectsInit, - xRectangle *pRectsInit ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyRectangle"); - VGAGet_GC(); - (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPolyArc( - DrawablePtr pDraw, - GCPtr pGC, - int narcs, - xArc *parcs ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyArc"); - VGAGet_GC(); - (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterFillPolygon( - DrawablePtr pDraw, - GCPtr pGC, - int shape, - int mode, - int count, - DDXPointPtr ptsIn ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterFillPolygon"); - VGAGet_GC(); - (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPolyFillRect( - DrawablePtr pDraw, - GCPtr pGC, - int nrectFill, - xRectangle *prectInit) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyFillRect"); - VGAGet_GC(); - (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPolyFillArc( - DrawablePtr pDraw, - GCPtr pGC, - int narcs, - xArc *parcs ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyFillArc"); - VGAGet_GC(); - (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static int -VGAarbiterPolyText8( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - char *chars ) -{ - int ret; - - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyText8"); - VGAGet_GC(); - ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars); - VGAPut_GC(); - GC_WRAP(pGC); - return ret; -} - -static int -VGAarbiterPolyText16( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars ) -{ - int ret; - - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyText16"); - VGAGet_GC(); - ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars); - VGAPut_GC(); - GC_WRAP(pGC); - return ret; -} - -static void -VGAarbiterImageText8( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - char *chars ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterImageText8"); - VGAGet_GC(); - (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterImageText16( - DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, - int count, - unsigned short *chars ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterImageText16"); - VGAGet_GC(); - (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars); - VGAPut_GC(); - GC_WRAP(pGC); -} - - -static void -VGAarbiterImageGlyphBlt( - DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterImageGlyphBlt"); - VGAGet_GC(); - (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, - nglyph, ppci, pglyphBase); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPolyGlyphBlt( - DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr *ppci, - pointer pglyphBase ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPolyGlyphBlt"); - VGAGet_GC(); - (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, - nglyph, ppci, pglyphBase); - VGAPut_GC(); - GC_WRAP(pGC); -} - -static void -VGAarbiterPushPixels( - GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, - int dx, int dy, int xOrg, int yOrg ) -{ - GC_UNWRAP(pGC); - DPRINT("VGAarbiterPushPixels"); - VGAGet_GC(); - (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); - VGAPut_GC(); - GC_WRAP(pGC); -} - - -/* miSpriteFuncs */ -static Bool -VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) -{ - Bool val; - SPRITE_PROLOG; - DPRINT_S("VGAarbiterSpriteRealizeCursor",pScreen->myNum); - VGAGet(); - val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur); - VGAPut(); - SPRITE_EPILOG; - return val; -} - -static Bool -VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) -{ - Bool val; - SPRITE_PROLOG; - DPRINT_S("VGAarbiterSpriteUnrealizeCursor",pScreen->myNum); - VGAGet(); - val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur); - VGAPut(); - SPRITE_EPILOG; - return val; -} - -static void -VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y) -{ - SPRITE_PROLOG; - DPRINT_S("VGAarbiterSpriteSetCursor",pScreen->myNum); - VGAGet(); - PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y); - VGAPut(); - SPRITE_EPILOG; -} - -static void -VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) -{ - SPRITE_PROLOG; - DPRINT_S("VGAarbiterSpriteMoveCursor",pScreen->myNum); - VGAGet(); - PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y); - VGAPut(); - SPRITE_EPILOG; -} - -static Bool -VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) -{ - Bool val; - SPRITE_PROLOG; - DPRINT_S("VGAarbiterDeviceCursorInitialize",pScreen->myNum); - VGAGet(); - val = PointPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen); - VGAPut(); - SPRITE_EPILOG; - return val; -} - -static void -VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) -{ - SPRITE_PROLOG; - DPRINT_S("VGAarbiterDeviceCursorCleanup",pScreen->myNum); - VGAGet(); - PointPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen); - VGAPut(); - SPRITE_EPILOG; -} - -#ifdef RENDER -static void -VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, - PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, - INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, - CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - PICTURE_PROLOGUE(Composite); - - VGAGet(); - (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, - yDst, width, height); - VGAPut(); - PICTURE_EPILOGUE(Composite, VGAarbiterComposite); -} - -static void -VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, - GlyphListPtr list, GlyphPtr *glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - PICTURE_PROLOGUE(Glyphs); - - VGAGet(); - (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - VGAPut(); - PICTURE_EPILOGUE (Glyphs, VGAarbiterGlyphs); -} - -static void -VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, - xRectangle *rects) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - PICTURE_PROLOGUE(CompositeRects); - - VGAGet(); - (*ps->CompositeRects)(op, pDst, color, nRect, rects); - VGAPut(); - PICTURE_EPILOGUE (CompositeRects, VGAarbiterCompositeRects); -} -#endif -#else -/* dummy functions */ -void xf86VGAarbiterInit(void) {} -void xf86VGAarbiterFini(void) {} - -void xf86VGAarbiterLock(ScrnInfoPtr pScrn) {} -void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) {} -Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { return TRUE; } -void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) {} -void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn) {} -Bool xf86VGAarbiterWrapFunctions(void) { return FALSE; } - -#endif +/*
+ * This code was stolen from RAC and adapted to control the legacy vga
+ * interface.
+ *
+ *
+ * Copyright (c) 2007 Paulo R. Zanoni, Tiago Vignatti
+ *
+ * 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 AUTHORS OR COPYRIGHT
+ * HOLDERS 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.
+ *
+ */
+
+#include "xorg-config.h"
+
+#include "xf86VGAarbiter.h"
+
+#ifdef HAVE_PCI_DEVICE_VGAARB_INIT
+#include "xf86VGAarbiterPriv.h"
+#include "xf86Bus.h"
+#include "xf86Priv.h"
+#include "pciaccess.h"
+
+
+static GCFuncs VGAarbiterGCFuncs = {
+ VGAarbiterValidateGC, VGAarbiterChangeGC, VGAarbiterCopyGC,
+ VGAarbiterDestroyGC, VGAarbiterChangeClip, VGAarbiterDestroyClip,
+ VGAarbiterCopyClip
+};
+
+static GCOps VGAarbiterGCOps = {
+ VGAarbiterFillSpans, VGAarbiterSetSpans, VGAarbiterPutImage,
+ VGAarbiterCopyArea, VGAarbiterCopyPlane, VGAarbiterPolyPoint,
+ VGAarbiterPolylines, VGAarbiterPolySegment, VGAarbiterPolyRectangle,
+ VGAarbiterPolyArc, VGAarbiterFillPolygon, VGAarbiterPolyFillRect,
+ VGAarbiterPolyFillArc, VGAarbiterPolyText8, VGAarbiterPolyText16,
+ VGAarbiterImageText8, VGAarbiterImageText16, VGAarbiterImageGlyphBlt,
+ VGAarbiterPolyGlyphBlt, VGAarbiterPushPixels,
+ {NULL} /* devPrivate */
+};
+
+static miPointerSpriteFuncRec VGAarbiterSpriteFuncs = {
+ VGAarbiterSpriteRealizeCursor, VGAarbiterSpriteUnrealizeCursor,
+ VGAarbiterSpriteSetCursor, VGAarbiterSpriteMoveCursor,
+ VGAarbiterDeviceCursorInitialize, VGAarbiterDeviceCursorCleanup
+};
+
+static int VGAarbiterKeyIndex;
+static DevPrivateKey VGAarbiterScreenKey = &VGAarbiterKeyIndex;
+static int VGAarbiterGCIndex;
+static DevPrivateKey VGAarbiterGCKey = &VGAarbiterGCIndex;
+
+static int vga_no_arb = 0;
+void
+xf86VGAarbiterInit(void)
+{
+ if (pci_device_vgaarb_init() != 0) {
+ vga_no_arb = 1;
+ xf86Msg(X_WARNING, "VGA arbiter: cannot open kernel arbiter, no multi-card support\n");
+ }
+}
+
+void
+xf86VGAarbiterFini(void)
+{
+ if (vga_no_arb)
+ return;
+ pci_device_vgaarb_fini();
+}
+
+void
+xf86VGAarbiterLock(ScrnInfoPtr pScrn)
+{
+ if (vga_no_arb)
+ return;
+ pci_device_vgaarb_set_target(pScrn->vgaDev);
+ pci_device_vgaarb_lock();
+}
+
+void
+xf86VGAarbiterUnlock(ScrnInfoPtr pScrn)
+{
+ if (vga_no_arb)
+ return;
+ pci_device_vgaarb_unlock();
+}
+
+Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen)
+{
+ int vga_count;
+ int rsrc_decodes;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (vga_no_arb)
+ return TRUE;
+
+ pci_device_vgaarb_get_info(pScrn->vgaDev, &vga_count, &rsrc_decodes);
+ if (vga_count > 1) {
+ if (rsrc_decodes) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+void
+xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn)
+{
+ struct pci_device *dev;
+ EntityPtr pEnt;
+
+ if (vga_no_arb)
+ return;
+
+ pEnt = xf86Entities[pScrn->entityList[0]];
+ if (pEnt->bus.type != BUS_PCI)
+ return;
+
+ dev = pEnt->bus.id.pci;
+ pScrn->vgaDev = dev;
+}
+
+void
+xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn)
+{
+ if (vga_no_arb)
+ return;
+ pci_device_vgaarb_decodes(VGA_ARB_RSRC_LEGACY_MEM | VGA_ARB_RSRC_LEGACY_IO);
+}
+
+Bool
+xf86VGAarbiterWrapFunctions(void)
+{
+ ScrnInfoPtr pScrn;
+ VGAarbiterScreenPtr pScreenPriv;
+ miPointerScreenPtr PointPriv;
+#ifdef RENDER
+ PictureScreenPtr ps;
+#endif
+ ScreenPtr pScreen;
+ int vga_count, i;
+
+ if (vga_no_arb)
+ return FALSE;
+
+ /*
+ * we need to wrap the arbiter if we have more than
+ * one VGA card - hotplug cries.
+ */
+ pci_device_vgaarb_get_info(NULL, &vga_count, NULL);
+ if (vga_count < 2 || !xf86Screens)
+ return FALSE;
+
+ xf86Msg(X_INFO,"Found %d VGA devices: arbiter wrapping enabled\n",
+ vga_count);
+
+ for (i = 0; i < xf86NumScreens; i++) {
+ pScreen = xf86Screens[i]->pScreen;
+#ifdef RENDER
+ ps = GetPictureScreenIfSet(pScreen);
+#endif
+ pScrn = xf86Screens[pScreen->myNum];
+ PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
+
+ if (!dixRequestPrivate(VGAarbiterGCKey, sizeof(VGAarbiterGCRec)))
+ return FALSE;
+
+ if (!(pScreenPriv = xalloc(sizeof(VGAarbiterScreenRec))))
+ return FALSE;
+
+ dixSetPrivate(&pScreen->devPrivates, VGAarbiterScreenKey, pScreenPriv);
+
+ WRAP_SCREEN(CloseScreen, VGAarbiterCloseScreen);
+ WRAP_SCREEN(SaveScreen, VGAarbiterSaveScreen);
+ WRAP_SCREEN(WakeupHandler, VGAarbiterWakeupHandler);
+ WRAP_SCREEN(BlockHandler, VGAarbiterBlockHandler);
+ WRAP_SCREEN(CreateGC, VGAarbiterCreateGC);
+ WRAP_SCREEN(GetImage, VGAarbiterGetImage);
+ WRAP_SCREEN(GetSpans, VGAarbiterGetSpans);
+ WRAP_SCREEN(SourceValidate, VGAarbiterSourceValidate);
+ WRAP_SCREEN(CopyWindow, VGAarbiterCopyWindow);
+ WRAP_SCREEN(ClearToBackground, VGAarbiterClearToBackground);
+ WRAP_SCREEN(CreatePixmap, VGAarbiterCreatePixmap);
+ WRAP_SCREEN(StoreColors, VGAarbiterStoreColors);
+ WRAP_SCREEN(DisplayCursor, VGAarbiterDisplayCursor);
+ WRAP_SCREEN(RealizeCursor, VGAarbiterRealizeCursor);
+ WRAP_SCREEN(UnrealizeCursor, VGAarbiterUnrealizeCursor);
+ WRAP_SCREEN(RecolorCursor, VGAarbiterRecolorCursor);
+ WRAP_SCREEN(SetCursorPosition, VGAarbiterSetCursorPosition);
+#ifdef RENDER
+ WRAP_PICT(Composite,VGAarbiterComposite);
+ WRAP_PICT(Glyphs,VGAarbiterGlyphs);
+ WRAP_PICT(CompositeRects,VGAarbiterCompositeRects);
+#endif
+ WRAP_SCREEN_INFO(AdjustFrame, VGAarbiterAdjustFrame);
+ WRAP_SCREEN_INFO(SwitchMode, VGAarbiterSwitchMode);
+ WRAP_SCREEN_INFO(EnterVT, VGAarbiterEnterVT);
+ WRAP_SCREEN_INFO(LeaveVT, VGAarbiterLeaveVT);
+ WRAP_SCREEN_INFO(FreeScreen, VGAarbiterFreeScreen);
+ WRAP_SPRITE;
+ }
+
+ return TRUE;
+}
+
+/* Screen funcs */
+static Bool
+VGAarbiterCloseScreen (int i, ScreenPtr pScreen)
+{
+ Bool val;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, VGAarbiterScreenKey);
+ miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, miPointerScreenKey);
+#ifdef RENDER
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+#endif
+
+ UNWRAP_SCREEN(CreateGC);
+ UNWRAP_SCREEN(CloseScreen);
+ UNWRAP_SCREEN(GetImage);
+ UNWRAP_SCREEN(GetSpans);
+ UNWRAP_SCREEN(SourceValidate);
+ UNWRAP_SCREEN(CopyWindow);
+ UNWRAP_SCREEN(ClearToBackground);
+ UNWRAP_SCREEN(SaveScreen);
+ UNWRAP_SCREEN(StoreColors);
+ UNWRAP_SCREEN(DisplayCursor);
+ UNWRAP_SCREEN(RealizeCursor);
+ UNWRAP_SCREEN(UnrealizeCursor);
+ UNWRAP_SCREEN(RecolorCursor);
+ UNWRAP_SCREEN(SetCursorPosition);
+#ifdef RENDER
+ UNWRAP_PICT(Composite);
+ UNWRAP_PICT(Glyphs);
+ UNWRAP_PICT(CompositeRects);
+#endif
+ UNWRAP_SCREEN_INFO(AdjustFrame);
+ UNWRAP_SCREEN_INFO(SwitchMode);
+ UNWRAP_SCREEN_INFO(EnterVT);
+ UNWRAP_SCREEN_INFO(LeaveVT);
+ UNWRAP_SCREEN_INFO(FreeScreen);
+ UNWRAP_SPRITE;
+
+ xfree ((pointer) pScreenPriv);
+ xf86VGAarbiterLock(xf86Screens[i]);
+ val = (*pScreen->CloseScreen) (i, pScreen);
+ xf86VGAarbiterUnlock(xf86Screens[i]);
+ return val;
+}
+
+static void
+VGAarbiterBlockHandler(int i,
+ pointer blockData, pointer pTimeout, pointer pReadmask)
+{
+ ScreenPtr pScreen = screenInfo.screens[i];
+ SCREEN_PROLOG(BlockHandler);
+ VGAGet();
+ pScreen->BlockHandler(i, blockData, pTimeout, pReadmask);
+ VGAPut();
+ SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler);
+}
+
+static void
+VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, pointer pReadmask)
+{
+ ScreenPtr pScreen = screenInfo.screens[i];
+ SCREEN_PROLOG(WakeupHandler);
+ VGAGet();
+ pScreen->WakeupHandler(i, blockData, result, pReadmask);
+ VGAPut();
+ SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler);
+}
+
+static void
+VGAarbiterGetImage (
+ DrawablePtr pDrawable,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planemask,
+ char *pdstLine
+ )
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+ SCREEN_PROLOG(GetImage);
+// if (xf86Screens[pScreen->myNum]->vtSema) {
+ VGAGet();
+// }
+ (*pScreen->GetImage) (pDrawable, sx, sy, w, h,
+ format, planemask, pdstLine);
+ VGAPut();
+ SCREEN_EPILOG (GetImage, VGAarbiterGetImage);
+}
+
+static void
+VGAarbiterGetSpans (
+ DrawablePtr pDrawable,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pdstStart
+ )
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+
+ SCREEN_PROLOG (GetSpans);
+ VGAGet();
+ (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+ VGAPut();
+ SCREEN_EPILOG (GetSpans, VGAarbiterGetSpans);
+}
+
+static void
+VGAarbiterSourceValidate (
+ DrawablePtr pDrawable,
+ int x, int y, int width, int height )
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+ SCREEN_PROLOG (SourceValidate);
+ VGAGet();
+ if (pScreen->SourceValidate)
+ (*pScreen->SourceValidate) (pDrawable, x, y, width, height);
+ VGAPut();
+ SCREEN_EPILOG (SourceValidate, VGAarbiterSourceValidate);
+}
+
+static void
+VGAarbiterCopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc )
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ SCREEN_PROLOG (CopyWindow);
+ VGAGet();
+ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
+ VGAPut();
+ SCREEN_EPILOG (CopyWindow, VGAarbiterCopyWindow);
+}
+
+static void
+VGAarbiterClearToBackground (
+ WindowPtr pWin,
+ int x, int y,
+ int w, int h,
+ Bool generateExposures )
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ SCREEN_PROLOG ( ClearToBackground);
+ VGAGet();
+ (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
+ VGAPut();
+ SCREEN_EPILOG (ClearToBackground, VGAarbiterClearToBackground);
+}
+
+static PixmapPtr
+VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
+{
+ PixmapPtr pPix;
+
+ SCREEN_PROLOG ( CreatePixmap);
+ VGAGet();
+ pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
+ VGAPut();
+ SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
+
+ return pPix;
+}
+
+static Bool
+VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank)
+{
+ Bool val;
+
+ SCREEN_PROLOG (SaveScreen);
+ VGAGet();
+ val = (*pScreen->SaveScreen) (pScreen, unblank);
+ VGAPut();
+ SCREEN_EPILOG (SaveScreen, VGAarbiterSaveScreen);
+
+ return val;
+}
+
+static void
+VGAarbiterStoreColors (
+ ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+
+ SCREEN_PROLOG (StoreColors);
+ VGAGet();
+ (*pScreen->StoreColors) (pmap,ndef,pdefs);
+ VGAPut();
+ SCREEN_EPILOG ( StoreColors, VGAarbiterStoreColors);
+}
+
+static void
+VGAarbiterRecolorCursor (
+ DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ CursorPtr pCurs,
+ Bool displayed
+ )
+{
+ SCREEN_PROLOG (RecolorCursor);
+ VGAGet();
+ (*pScreen->RecolorCursor) (pDev, pScreen, pCurs, displayed);
+ VGAPut();
+ SCREEN_EPILOG ( RecolorCursor, VGAarbiterRecolorCursor);
+}
+
+static Bool
+VGAarbiterRealizeCursor (
+ DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ CursorPtr pCursor
+ )
+{
+ Bool val;
+
+ SCREEN_PROLOG (RealizeCursor);
+ VGAGet();
+ val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor);
+ VGAPut();
+ SCREEN_EPILOG ( RealizeCursor, VGAarbiterRealizeCursor);
+ return val;
+}
+
+static Bool
+VGAarbiterUnrealizeCursor (
+ DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ CursorPtr pCursor
+ )
+{
+ Bool val;
+
+ SCREEN_PROLOG (UnrealizeCursor);
+ VGAGet();
+ val = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
+ VGAPut();
+ SCREEN_EPILOG ( UnrealizeCursor, VGAarbiterUnrealizeCursor);
+ return val;
+}
+
+static Bool
+VGAarbiterDisplayCursor (
+ DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ CursorPtr pCursor
+ )
+{
+ Bool val;
+
+ SCREEN_PROLOG (DisplayCursor);
+ VGAGet();
+ val = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
+ VGAPut();
+ SCREEN_EPILOG ( DisplayCursor, VGAarbiterDisplayCursor);
+ return val;
+}
+
+static Bool
+VGAarbiterSetCursorPosition (
+ DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ int x, int y,
+ Bool generateEvent)
+{
+ Bool val;
+
+ SCREEN_PROLOG (SetCursorPosition);
+ VGAGet();
+ val = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
+ VGAPut();
+ SCREEN_EPILOG ( SetCursorPosition, VGAarbiterSetCursorPosition);
+ return val;
+}
+
+static void
+VGAarbiterAdjustFrame(int index, int x, int y, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, VGAarbiterScreenKey);
+
+ VGAGet();
+ (*pScreenPriv->AdjustFrame)(index, x, y, flags);
+ VGAPut();
+}
+
+static Bool
+VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags)
+{
+ Bool val;
+ ScreenPtr pScreen = screenInfo.screens[index];
+ VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, VGAarbiterScreenKey);
+
+ VGAGet();
+ val = (*pScreenPriv->SwitchMode)(index, mode, flags);
+ VGAPut();
+ return val;
+}
+
+static Bool
+VGAarbiterEnterVT(int index, int flags)
+{
+ Bool val;
+ ScreenPtr pScreen = screenInfo.screens[index];
+ VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, VGAarbiterScreenKey);
+
+ VGAGet();
+ val = (*pScreenPriv->EnterVT)(index, flags);
+ VGAPut();
+ return val;
+}
+
+static void
+VGAarbiterLeaveVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, VGAarbiterScreenKey);
+
+ VGAGet();
+ (*pScreenPriv->LeaveVT)(index, flags);
+ VGAPut();
+}
+
+static void
+VGAarbiterFreeScreen(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, VGAarbiterScreenKey);
+
+ VGAGet();
+ (*pScreenPriv->FreeScreen)(index, flags);
+ VGAPut();
+}
+
+static Bool
+VGAarbiterCreateGC(GCPtr pGC)
+{
+ ScreenPtr pScreen = pGC->pScreen;
+ VGAarbiterGCPtr pGCPriv = (VGAarbiterGCPtr)dixLookupPrivate(&pGC->devPrivates, VGAarbiterGCKey);
+ Bool ret;
+
+ SCREEN_PROLOG(CreateGC);
+ VGAGet();
+ ret = (*pScreen->CreateGC)(pGC);
+ VGAPut();
+ GC_WRAP(pGC);
+ SCREEN_EPILOG(CreateGC,VGAarbiterCreateGC);
+
+ return ret;
+}
+
+/* GC funcs */
+static void
+VGAarbiterValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ GC_UNWRAP(pGC);
+ (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
+ GC_WRAP(pGC);
+}
+
+
+static void
+VGAarbiterDestroyGC(GCPtr pGC)
+{
+ GC_UNWRAP (pGC);
+ (*pGC->funcs->DestroyGC)(pGC);
+ GC_WRAP (pGC);
+}
+
+static void
+VGAarbiterChangeGC (
+ GCPtr pGC,
+ unsigned long mask)
+{
+ GC_UNWRAP (pGC);
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ GC_WRAP (pGC);
+}
+
+static void
+VGAarbiterCopyGC (
+ GCPtr pGCSrc,
+ unsigned long mask,
+ GCPtr pGCDst)
+{
+ GC_UNWRAP (pGCDst);
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ GC_WRAP (pGCDst);
+}
+
+static void
+VGAarbiterChangeClip (
+ GCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects )
+{
+ GC_UNWRAP (pGC);
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ GC_WRAP (pGC);
+}
+
+static void
+VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+ GC_UNWRAP (pgcDst);
+ (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+ GC_WRAP (pgcDst);
+}
+
+static void
+VGAarbiterDestroyClip(GCPtr pGC)
+{
+ GC_UNWRAP (pGC);
+ (* pGC->funcs->DestroyClip)(pGC);
+ GC_WRAP (pGC);
+}
+
+/* GC Ops */
+static void
+VGAarbiterFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterSetSpans(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static RegionPtr
+VGAarbiterCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty )
+{
+ RegionPtr ret;
+
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static RegionPtr
+VGAarbiterCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane )
+{
+ RegionPtr ret;
+
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
+ width, height, dstx, dsty, bitPlane);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static void
+VGAarbiterPolyPoint(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+
+static void
+VGAarbiterPolylines(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPolySegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPolyRectangle(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPolyArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterFillPolygon(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit)
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPolyFillArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static int
+VGAarbiterPolyText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars )
+{
+ int ret;
+
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static int
+VGAarbiterPolyText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars )
+{
+ int ret;
+
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static void
+VGAarbiterImageText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterImageText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+
+static void
+VGAarbiterImageGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
+ nglyph, ppci, pglyphBase);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPolyGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
+ nglyph, ppci, pglyphBase);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+static void
+VGAarbiterPushPixels(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg )
+{
+ GC_UNWRAP(pGC);
+ VGAGet_GC();
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ VGAPut_GC();
+ GC_WRAP(pGC);
+}
+
+
+/* miSpriteFuncs */
+static Bool
+VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur)
+{
+ Bool val;
+ SPRITE_PROLOG;
+ VGAGet();
+ val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur);
+ VGAPut();
+ SPRITE_EPILOG;
+ return val;
+}
+
+static Bool
+VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur)
+{
+ Bool val;
+ SPRITE_PROLOG;
+ VGAGet();
+ val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur);
+ VGAPut();
+ SPRITE_EPILOG;
+ return val;
+}
+
+static void
+VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y)
+{
+ SPRITE_PROLOG;
+ VGAGet();
+ PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y);
+ VGAPut();
+ SPRITE_EPILOG;
+}
+
+static void
+VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
+{
+ SPRITE_PROLOG;
+ VGAGet();
+ PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y);
+ VGAPut();
+ SPRITE_EPILOG;
+}
+
+static Bool
+VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+ Bool val;
+ SPRITE_PROLOG;
+ VGAGet();
+ val = PointPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
+ VGAPut();
+ SPRITE_EPILOG;
+ return val;
+}
+
+static void
+VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+ SPRITE_PROLOG;
+ VGAGet();
+ PointPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen);
+ VGAPut();
+ SPRITE_EPILOG;
+}
+
+#ifdef RENDER
+static void
+VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+ PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask,
+ INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width,
+ CARD16 height)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+ PICTURE_PROLOGUE(Composite);
+
+ VGAGet();
+ (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst,
+ yDst, width, height);
+ VGAPut();
+ PICTURE_EPILOGUE(Composite, VGAarbiterComposite);
+}
+
+static void
+VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
+ GlyphListPtr list, GlyphPtr *glyphs)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+ PICTURE_PROLOGUE(Glyphs);
+
+ VGAGet();
+ (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
+ VGAPut();
+ PICTURE_EPILOGUE (Glyphs, VGAarbiterGlyphs);
+}
+
+static void
+VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect,
+ xRectangle *rects)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+ PICTURE_PROLOGUE(CompositeRects);
+
+ VGAGet();
+ (*ps->CompositeRects)(op, pDst, color, nRect, rects);
+ VGAPut();
+ PICTURE_EPILOGUE (CompositeRects, VGAarbiterCompositeRects);
+}
+#endif
+#else
+/* dummy functions */
+void xf86VGAarbiterInit(void) {}
+void xf86VGAarbiterFini(void) {}
+
+void xf86VGAarbiterLock(ScrnInfoPtr pScrn) {}
+void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) {}
+Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { return TRUE; }
+void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) {}
+void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn) {}
+Bool xf86VGAarbiterWrapFunctions(void) { return FALSE; }
+
+#endif
diff --git a/xorg-server/hw/xfree86/common/xf86cmap.c b/xorg-server/hw/xfree86/common/xf86cmap.c index 08f557ccd..4cab8b3eb 100644 --- a/xorg-server/hw/xfree86/common/xf86cmap.c +++ b/xorg-server/hw/xfree86/common/xf86cmap.c @@ -1,1165 +1,1170 @@ -/* - * Copyright (c) 1998-2001 by The XFree86 Project, 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 - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s) - * and author(s) 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 copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4) -#include <math.h> -#else -#define _XOPEN_SOURCE /* to get prototype for pow on some systems */ -#include <math.h> -#undef _XOPEN_SOURCE -#endif - -#include <X11/X.h> -#include "misc.h" -#include <X11/Xproto.h> -#include "colormapst.h" -#include "scrnintstr.h" - -#include "resource.h" - -#include "xf86.h" -#include "xf86_OSproc.h" -#include "xf86str.h" -#include "micmap.h" -#include "xf86Crtc.h" - -#ifdef XFreeXDGA -#include <X11/extensions/xf86dgaproto.h> -#include "dgaproc.h" -#endif - -#include "xf86cmap.h" - -#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \ - ((CMapScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, CMapScreenKey))->field) -#define SCREEN_EPILOGUE(pScreen, field, wrapper)\ - ((pScreen)->field = wrapper) - -#define LOAD_PALETTE(pmap, index) \ - ((pmap == miInstalledMaps[index]) && \ - ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || \ - xf86Screens[index]->vtSema || pScreenPriv->isDGAmode)) - - -typedef struct _CMapLink { - ColormapPtr cmap; - struct _CMapLink *next; -} CMapLink, *CMapLinkPtr; - -typedef struct { - ScrnInfoPtr pScrn; - CloseScreenProcPtr CloseScreen; - CreateColormapProcPtr CreateColormap; - DestroyColormapProcPtr DestroyColormap; - InstallColormapProcPtr InstallColormap; - StoreColorsProcPtr StoreColors; - Bool (*EnterVT)(int, int); - Bool (*SwitchMode)(int, DisplayModePtr, int); - int (*SetDGAMode)(int, int, DGADevicePtr); - xf86ChangeGammaProc *ChangeGamma; - int maxColors; - int sigRGBbits; - int gammaElements; - LOCO *gamma; - int *PreAllocIndices; - CMapLinkPtr maps; - unsigned int flags; - Bool isDGAmode; -} CMapScreenRec, *CMapScreenPtr; - -typedef struct { - int numColors; - LOCO *colors; - Bool recalculate; - int overscan; -} CMapColormapRec, *CMapColormapPtr; - -static int CMapScreenKeyIndex; -static DevPrivateKey CMapScreenKey; -static int CMapColormapKeyIndex; -static DevPrivateKey CMapColormapKey = &CMapColormapKeyIndex; - -static void CMapInstallColormap(ColormapPtr); -static void CMapStoreColors(ColormapPtr, int, xColorItem *); -static Bool CMapCloseScreen (int, ScreenPtr); -static Bool CMapCreateColormap (ColormapPtr); -static void CMapDestroyColormap (ColormapPtr); - -static Bool CMapEnterVT(int, int); -static Bool CMapSwitchMode(int, DisplayModePtr, int); -#ifdef XFreeXDGA -static int CMapSetDGAMode(int, int, DGADevicePtr); -#endif -static int CMapChangeGamma(int, Gamma); - -static void ComputeGamma(CMapScreenPtr); -static Bool CMapAllocateColormapPrivate(ColormapPtr); -static void CMapRefreshColors(ColormapPtr, int, int*); -static void CMapSetOverscan(ColormapPtr, int, int *); -static void CMapReinstallMap(ColormapPtr); -static void CMapUnwrapScreen(ScreenPtr pScreen); - - - -Bool xf86HandleColormaps( - ScreenPtr pScreen, - int maxColors, - int sigRGBbits, - xf86LoadPaletteProc *loadPalette, - xf86SetOverscanProc *setOverscan, - unsigned int flags -){ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - ColormapPtr pDefMap = NULL; - CMapScreenPtr pScreenPriv; - LOCO *gamma; - int *indices; - int elements; - - /* If we support a better colormap system, then pretend we succeeded. */ - if (xf86_crtc_supports_gamma(pScrn)) - return TRUE; - - if(!maxColors || !sigRGBbits || !loadPalette) - return FALSE; - - CMapScreenKey = &CMapScreenKeyIndex; - - elements = 1 << sigRGBbits; - - if(!(gamma = xalloc(elements * sizeof(LOCO)))) - return FALSE; - - if(!(indices = xalloc(maxColors * sizeof(int)))) { - xfree(gamma); - return FALSE; - } - - if(!(pScreenPriv = xalloc(sizeof(CMapScreenRec)))) { - xfree(gamma); - xfree(indices); - return FALSE; - } - - dixSetPrivate(&pScreen->devPrivates, CMapScreenKey, pScreenPriv); - - pScreenPriv->CloseScreen = pScreen->CloseScreen; - pScreenPriv->CreateColormap = pScreen->CreateColormap; - pScreenPriv->DestroyColormap = pScreen->DestroyColormap; - pScreenPriv->InstallColormap = pScreen->InstallColormap; - pScreenPriv->StoreColors = pScreen->StoreColors; - pScreen->CloseScreen = CMapCloseScreen; - pScreen->CreateColormap = CMapCreateColormap; - pScreen->DestroyColormap = CMapDestroyColormap; - pScreen->InstallColormap = CMapInstallColormap; - pScreen->StoreColors = CMapStoreColors; - - pScreenPriv->pScrn = pScrn; - pScrn->LoadPalette = loadPalette; - pScrn->SetOverscan = setOverscan; - pScreenPriv->maxColors = maxColors; - pScreenPriv->sigRGBbits = sigRGBbits; - pScreenPriv->gammaElements = elements; - pScreenPriv->gamma = gamma; - pScreenPriv->PreAllocIndices = indices; - pScreenPriv->maps = NULL; - pScreenPriv->flags = flags; - pScreenPriv->isDGAmode = FALSE; - - pScreenPriv->EnterVT = pScrn->EnterVT; - pScreenPriv->SwitchMode = pScrn->SwitchMode; - pScreenPriv->SetDGAMode = pScrn->SetDGAMode; - pScreenPriv->ChangeGamma = pScrn->ChangeGamma; - - if (!(flags & CMAP_LOAD_EVEN_IF_OFFSCREEN)) { - pScrn->EnterVT = CMapEnterVT; - if ((flags & CMAP_RELOAD_ON_MODE_SWITCH) && pScrn->SwitchMode) - pScrn->SwitchMode = CMapSwitchMode; - } -#ifdef XFreeXDGA - pScrn->SetDGAMode = CMapSetDGAMode; -#endif - pScrn->ChangeGamma = CMapChangeGamma; - - ComputeGamma(pScreenPriv); - - /* get the default map */ - dixLookupResourceByType((pointer *)&pDefMap, pScreen->defColormap, - RT_COLORMAP, serverClient, DixInstallAccess); - - if(!CMapAllocateColormapPrivate(pDefMap)) { - CMapUnwrapScreen(pScreen); - return FALSE; - } - - /* Force the initial map to be loaded */ - miInstalledMaps[pScreen->myNum] = NULL; - CMapInstallColormap(pDefMap); - return TRUE; -} - - -/**** Screen functions ****/ - - -static Bool -CMapCloseScreen (int i, ScreenPtr pScreen) -{ - CMapUnwrapScreen(pScreen); - - return (*pScreen->CloseScreen) (i, pScreen); -} - -static Bool -CMapColormapUseMax(VisualPtr pVisual, CMapScreenPtr pScreenPriv) -{ - if (pVisual->nplanes > 16) - return TRUE; - return ((1 << pVisual->nplanes) > pScreenPriv->maxColors); -} - -static Bool -CMapAllocateColormapPrivate(ColormapPtr pmap) -{ - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pmap->pScreen->devPrivates, CMapScreenKey); - CMapColormapPtr pColPriv; - CMapLinkPtr pLink; - int numColors; - LOCO *colors; - - if (CMapColormapUseMax(pmap->pVisual, pScreenPriv)) - numColors = pmap->pVisual->ColormapEntries; - else - numColors = 1 << pmap->pVisual->nplanes; - - if(!(colors = xalloc(numColors * sizeof(LOCO)))) - return FALSE; - - if(!(pColPriv = xalloc(sizeof(CMapColormapRec)))) { - xfree(colors); - return FALSE; - } - - dixSetPrivate(&pmap->devPrivates, CMapColormapKey, pColPriv); - - pColPriv->numColors = numColors; - pColPriv->colors = colors; - pColPriv->recalculate = TRUE; - pColPriv->overscan = -1; - - /* add map to list */ - pLink = xalloc(sizeof(CMapLink)); - if(pLink) { - pLink->cmap = pmap; - pLink->next = pScreenPriv->maps; - pScreenPriv->maps = pLink; - } - - return TRUE; -} - -static Bool -CMapCreateColormap (ColormapPtr pmap) -{ - ScreenPtr pScreen = pmap->pScreen; - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - Bool ret = FALSE; - - pScreen->CreateColormap = pScreenPriv->CreateColormap; - if((*pScreen->CreateColormap)(pmap)) { - if(CMapAllocateColormapPrivate(pmap)) - ret = TRUE; - } - pScreen->CreateColormap = CMapCreateColormap; - - return ret; -} - -static void -CMapDestroyColormap (ColormapPtr cmap) -{ - ScreenPtr pScreen = cmap->pScreen; - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate( - &cmap->devPrivates, CMapColormapKey); - CMapLinkPtr prevLink = NULL, pLink = pScreenPriv->maps; - - if(pColPriv) { - if(pColPriv->colors) xfree(pColPriv->colors); - xfree(pColPriv); - } - - /* remove map from list */ - while(pLink) { - if(pLink->cmap == cmap) { - if(prevLink) - prevLink->next = pLink->next; - else - pScreenPriv->maps = pLink->next; - xfree(pLink); - break; - } - prevLink = pLink; - pLink = pLink->next; - } - - if(pScreenPriv->DestroyColormap) { - pScreen->DestroyColormap = pScreenPriv->DestroyColormap; - (*pScreen->DestroyColormap)(cmap); - pScreen->DestroyColormap = CMapDestroyColormap; - } -} - - - -static void -CMapStoreColors( - ColormapPtr pmap, - int ndef, - xColorItem *pdefs -){ - ScreenPtr pScreen = pmap->pScreen; - VisualPtr pVisual = pmap->pVisual; - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - int *indices = pScreenPriv->PreAllocIndices; - int num = ndef; - - /* At the moment this isn't necessary since there's nobody below us */ - pScreen->StoreColors = pScreenPriv->StoreColors; - (*pScreen->StoreColors)(pmap, ndef, pdefs); - pScreen->StoreColors = CMapStoreColors; - - /* should never get here for these */ - if( (pVisual->class == TrueColor) || - (pVisual->class == StaticColor) || - (pVisual->class == StaticGray)) - return; - - if(pVisual->class == DirectColor) { - CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate( - &pmap->devPrivates, CMapColormapKey); - int i; - - if (CMapColormapUseMax(pVisual, pScreenPriv)) { - int index; - - num = 0; - while(ndef--) { - if(pdefs[ndef].flags & DoRed) { - index = (pdefs[ndef].pixel & pVisual->redMask) >> - pVisual->offsetRed; - i = num; - while(i--) - if(indices[i] == index) break; - if(i == -1) - indices[num++] = index; - } - if(pdefs[ndef].flags & DoGreen) { - index = (pdefs[ndef].pixel & pVisual->greenMask) >> - pVisual->offsetGreen; - i = num; - while(i--) - if(indices[i] == index) break; - if(i == -1) - indices[num++] = index; - } - if(pdefs[ndef].flags & DoBlue) { - index = (pdefs[ndef].pixel & pVisual->blueMask) >> - pVisual->offsetBlue; - i = num; - while(i--) - if(indices[i] == index) break; - if(i == -1) - indices[num++] = index; - } - } - - } else { - /* not really as overkill as it seems */ - num = pColPriv->numColors; - for(i = 0; i < pColPriv->numColors; i++) - indices[i] = i; - } - } else { - while(ndef--) - indices[ndef] = pdefs[ndef].pixel; - } - - CMapRefreshColors(pmap, num, indices); -} - - -static void -CMapInstallColormap(ColormapPtr pmap) -{ - ScreenPtr pScreen = pmap->pScreen; - int index = pScreen->myNum; - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - - if (pmap == miInstalledMaps[index]) - return; - - pScreen->InstallColormap = pScreenPriv->InstallColormap; - (*pScreen->InstallColormap)(pmap); - pScreen->InstallColormap = CMapInstallColormap; - - /* Important. We let the lower layers, namely DGA, - overwrite the choice of Colormap to install */ - if (miInstalledMaps[index]) - pmap = miInstalledMaps[index]; - - if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && - (pmap->pVisual->class == TrueColor) && - CMapColormapUseMax(pmap->pVisual, pScreenPriv)) - return; - - if(LOAD_PALETTE(pmap, index)) - CMapReinstallMap(pmap); -} - - -/**** ScrnInfoRec functions ****/ - -static Bool -CMapEnterVT(int index, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - - if((*pScreenPriv->EnterVT)(index, flags)) { - if(miInstalledMaps[index]) - CMapReinstallMap(miInstalledMaps[index]); - return TRUE; - } - return FALSE; -} - - -static Bool -CMapSwitchMode(int index, DisplayModePtr mode, int flags) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - - if((*pScreenPriv->SwitchMode)(index, mode, flags)) { - if(miInstalledMaps[index]) - CMapReinstallMap(miInstalledMaps[index]); - return TRUE; - } - return FALSE; -} - -#ifdef XFreeXDGA -static int -CMapSetDGAMode(int index, int num, DGADevicePtr dev) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - int ret; - - ret = (*pScreenPriv->SetDGAMode)(index, num, dev); - - pScreenPriv->isDGAmode = DGAActive(index); - - if(!pScreenPriv->isDGAmode && miInstalledMaps[index] - && xf86Screens[pScreen->myNum]->vtSema) - CMapReinstallMap(miInstalledMaps[index]); - - return ret; -} -#endif - - -/**** Utilities ****/ - -static void -CMapReinstallMap(ColormapPtr pmap) -{ - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pmap->pScreen->devPrivates, CMapScreenKey); - CMapColormapPtr cmapPriv = (CMapColormapPtr)dixLookupPrivate( - &pmap->devPrivates, CMapColormapKey); - ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; - int i = cmapPriv->numColors; - int *indices = pScreenPriv->PreAllocIndices; - - while(i--) - indices[i] = i; - - if(cmapPriv->recalculate) - CMapRefreshColors(pmap, cmapPriv->numColors, indices); - else { - (*pScrn->LoadPalette)(pScrn, cmapPriv->numColors, - indices, cmapPriv->colors, pmap->pVisual); - if (pScrn->SetOverscan) { -#ifdef DEBUGOVERSCAN - ErrorF("SetOverscan() called from CMapReinstallMap\n"); -#endif - pScrn->SetOverscan(pScrn, cmapPriv->overscan); - } - } - - cmapPriv->recalculate = FALSE; -} - - -static void -CMapRefreshColors(ColormapPtr pmap, int defs, int* indices) -{ - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pmap->pScreen->devPrivates, CMapScreenKey); - CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate( - &pmap->devPrivates, CMapColormapKey); - VisualPtr pVisual = pmap->pVisual; - ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; - int numColors, i; - LOCO *gamma, *colors; - EntryPtr entry; - int reds, greens, blues, maxValue, index, shift; - - numColors = pColPriv->numColors; - shift = 16 - pScreenPriv->sigRGBbits; - maxValue = (1 << pScreenPriv->sigRGBbits) - 1; - gamma = pScreenPriv->gamma; - colors = pColPriv->colors; - - reds = pVisual->redMask >> pVisual->offsetRed; - greens = pVisual->greenMask >> pVisual->offsetGreen; - blues = pVisual->blueMask >> pVisual->offsetBlue; - - switch(pVisual->class) { - case StaticGray: - for(i = 0; i < numColors; i++) { - index = (i+1) * maxValue / numColors; - colors[i].red = gamma[index].red; - colors[i].green = gamma[index].green; - colors[i].blue = gamma[index].blue; - } - break; - case TrueColor: - if (CMapColormapUseMax(pVisual, pScreenPriv)) { - for(i = 0; i <= reds; i++) - colors[i].red = gamma[i * maxValue / reds].red; - for(i = 0; i <= greens; i++) - colors[i].green = gamma[i * maxValue / greens].green; - for(i = 0; i <= blues; i++) - colors[i].blue = gamma[i * maxValue / blues].blue; - break; - } - for(i = 0; i < numColors; i++) { - colors[i].red = gamma[((i >> pVisual->offsetRed) & reds) * - maxValue / reds].red; - colors[i].green = gamma[((i >> pVisual->offsetGreen) & greens) * - maxValue / greens].green; - colors[i].blue = gamma[((i >> pVisual->offsetBlue) & blues) * - maxValue / blues].blue; - } - break; - case StaticColor: - case PseudoColor: - case GrayScale: - for(i = 0; i < defs; i++) { - index = indices[i]; - entry = (EntryPtr)&pmap->red[index]; - - if(entry->fShared) { - colors[index].red = - gamma[entry->co.shco.red->color >> shift].red; - colors[index].green = - gamma[entry->co.shco.green->color >> shift].green; - colors[index].blue = - gamma[entry->co.shco.blue->color >> shift].blue; - } else { - colors[index].red = - gamma[entry->co.local.red >> shift].red; - colors[index].green = - gamma[entry->co.local.green >> shift].green; - colors[index].blue = - gamma[entry->co.local.blue >> shift].blue; - } - } - break; - case DirectColor: - if (CMapColormapUseMax(pVisual, pScreenPriv)) { - for(i = 0; i < defs; i++) { - index = indices[i]; - if(index <= reds) - colors[index].red = - gamma[pmap->red[index].co.local.red >> shift].red; - if(index <= greens) - colors[index].green = - gamma[pmap->green[index].co.local.green >> shift].green; - if(index <= blues) - colors[index].blue = - gamma[pmap->blue[index].co.local.blue >> shift].blue; - - } - break; - } - for(i = 0; i < defs; i++) { - index = indices[i]; - - colors[index].red = gamma[pmap->red[ - (index >> pVisual->offsetRed) & reds - ].co.local.red >> shift].red; - colors[index].green = gamma[pmap->green[ - (index >> pVisual->offsetGreen) & greens - ].co.local.green >> shift].green; - colors[index].blue = gamma[pmap->blue[ - (index >> pVisual->offsetBlue) & blues - ].co.local.blue >> shift].blue; - } - break; - } - - - if(LOAD_PALETTE(pmap, pmap->pScreen->myNum)) - (*pScrn->LoadPalette)(pScreenPriv->pScrn, defs, indices, - colors, pmap->pVisual); - - if (pScrn->SetOverscan) - CMapSetOverscan(pmap, defs, indices); - -} - -static Bool -CMapCompareColors(LOCO *color1, LOCO *color2) -{ - /* return TRUE if the color1 is "closer" to black than color2 */ -#ifdef DEBUGOVERSCAN - ErrorF("#%02x%02x%02x vs #%02x%02x%02x (%d vs %d)\n", - color1->red, color1->green, color1->blue, - color2->red, color2->green, color2->blue, - color1->red + color1->green + color1->blue, - color2->red + color2->green + color2->blue); -#endif - return (color1->red + color1->green + color1->blue < - color2->red + color2->green + color2->blue); -} - -static void -CMapSetOverscan(ColormapPtr pmap, int defs, int *indices) -{ - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pmap->pScreen->devPrivates, CMapScreenKey); - CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate( - &pmap->devPrivates, CMapColormapKey); - ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; - VisualPtr pVisual = pmap->pVisual; - int i; - LOCO *colors; - int index; - Bool newOverscan = FALSE; - int overscan, tmpOverscan; - - colors = pColPriv->colors; - overscan = pColPriv->overscan; - - /* - * Search for a new overscan index in the following cases: - * - * - The index hasn't yet been initialised. In this case search - * for an index that is black or a close match to black. - * - * - The colour of the old index is changed. In this case search - * all indices for a black or close match to black. - * - * - The colour of the old index wasn't black. In this case only - * search the indices that were changed for a better match to black. - */ - - switch (pVisual->class) { - case StaticGray: - case TrueColor: - /* Should only come here once. Initialise the overscan index to 0 */ - overscan = 0; - newOverscan = TRUE; - break; - case StaticColor: - /* - * Only come here once, but search for the overscan in the same way - * as for the other cases. - */ - case DirectColor: - case PseudoColor: - case GrayScale: - if (overscan < 0 || overscan > pScreenPriv->maxColors - 1) { - /* Uninitialised */ - newOverscan = TRUE; - } else { - /* Check if the overscan was changed */ - for (i = 0; i < defs; i++) { - index = indices[i]; - if (index == overscan) { - newOverscan = TRUE; - break; - } - } - } - if (newOverscan) { - /* The overscan is either uninitialised or it has been changed */ - - if (overscan < 0 || overscan > pScreenPriv->maxColors - 1) - tmpOverscan = pScreenPriv->maxColors - 1; - else - tmpOverscan = overscan; - - /* search all entries for a close match to black */ - for (i = pScreenPriv->maxColors - 1; i >= 0; i--) { - if (colors[i].red == 0 && colors[i].green == 0 && - colors[i].blue == 0) { - overscan = i; -#ifdef DEBUGOVERSCAN - ErrorF("Black found at index 0x%02x\n", i); -#endif - break; - } else { -#ifdef DEBUGOVERSCAN - ErrorF("0x%02x: ", i); -#endif - if (CMapCompareColors(&colors[i], &colors[tmpOverscan])) { - tmpOverscan = i; -#ifdef DEBUGOVERSCAN - ErrorF("possible \"Black\" at index 0x%02x\n", i); -#endif - } - } - } - if (i < 0) - overscan = tmpOverscan; - } else { - /* Check of the old overscan wasn't black */ - if (colors[overscan].red != 0 || colors[overscan].green != 0 || - colors[overscan].blue != 0) { - int oldOverscan = tmpOverscan = overscan; - /* See of there is now a better match */ - for (i = 0; i < defs; i++) { - index = indices[i]; - if (colors[index].red == 0 && colors[index].green == 0 && - colors[index].blue == 0) { - overscan = index; -#ifdef DEBUGOVERSCAN - ErrorF("Black found at index 0x%02x\n", index); -#endif - break; - } else { -#ifdef DEBUGOVERSCAN - ErrorF("0x%02x: ", index); -#endif - if (CMapCompareColors(&colors[index], - &colors[tmpOverscan])) { - tmpOverscan = index; -#ifdef DEBUGOVERSCAN - ErrorF("possible \"Black\" at index 0x%02x\n", - index); -#endif - } - } - } - if (i == defs) - overscan = tmpOverscan; - if (overscan != oldOverscan) - newOverscan = TRUE; - } - } - break; - } - if (newOverscan) { - pColPriv->overscan = overscan; - if (LOAD_PALETTE(pmap, pmap->pScreen->myNum)) { -#ifdef DEBUGOVERSCAN - ErrorF("SetOverscan() called from CmapSetOverscan\n"); -#endif - pScrn->SetOverscan(pScreenPriv->pScrn, overscan); - } - } -} - -static void -CMapUnwrapScreen(ScreenPtr pScreen) -{ - CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( - &pScreen->devPrivates, CMapScreenKey); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - - pScreen->CloseScreen = pScreenPriv->CloseScreen; - pScreen->CreateColormap = pScreenPriv->CreateColormap; - pScreen->DestroyColormap = pScreenPriv->DestroyColormap; - pScreen->InstallColormap = pScreenPriv->InstallColormap; - pScreen->StoreColors = pScreenPriv->StoreColors; - - pScrn->EnterVT = pScreenPriv->EnterVT; - pScrn->SwitchMode = pScreenPriv->SwitchMode; - pScrn->SetDGAMode = pScreenPriv->SetDGAMode; - pScrn->ChangeGamma = pScreenPriv->ChangeGamma; - - xfree(pScreenPriv->gamma); - xfree(pScreenPriv->PreAllocIndices); - xfree(pScreenPriv); -} - - -static void -ComputeGamma(CMapScreenPtr priv) -{ - int elements = priv->gammaElements - 1; - double RedGamma, GreenGamma, BlueGamma; - int i; - -#ifndef DONT_CHECK_GAMMA - /* This check is to catch drivers that are not initialising pScrn->gamma */ - if (priv->pScrn->gamma.red < GAMMA_MIN || - priv->pScrn->gamma.red > GAMMA_MAX || - priv->pScrn->gamma.green < GAMMA_MIN || - priv->pScrn->gamma.green > GAMMA_MAX || - priv->pScrn->gamma.blue < GAMMA_MIN || - priv->pScrn->gamma.blue > GAMMA_MAX) { - - xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0, - "The %s driver didn't call xf86SetGamma() to initialise\n" - "\tthe gamma values.\n", priv->pScrn->driverName); - xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0, - "PLEASE FIX THE `%s' DRIVER!\n", priv->pScrn->driverName); - priv->pScrn->gamma.red = 1.0; - priv->pScrn->gamma.green = 1.0; - priv->pScrn->gamma.blue = 1.0; - } -#endif - - RedGamma = 1.0 / (double)priv->pScrn->gamma.red; - GreenGamma = 1.0 / (double)priv->pScrn->gamma.green; - BlueGamma = 1.0 / (double)priv->pScrn->gamma.blue; - - for(i = 0; i <= elements; i++) { - if(RedGamma == 1.0) - priv->gamma[i].red = i; - else - priv->gamma[i].red = (CARD16)(pow((double)i/(double)elements, - RedGamma) * (double)elements + 0.5); - - if(GreenGamma == 1.0) - priv->gamma[i].green = i; - else - priv->gamma[i].green = (CARD16)(pow((double)i/(double)elements, - GreenGamma) * (double)elements + 0.5); - - if(BlueGamma == 1.0) - priv->gamma[i].blue = i; - else - priv->gamma[i].blue = (CARD16)(pow((double)i/(double)elements, - BlueGamma) * (double)elements + 0.5); - } -} - - -int -CMapChangeGamma( - int index, - Gamma gamma -){ - int ret = Success; - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = pScrn->pScreen; - CMapColormapPtr pColPriv; - CMapScreenPtr pScreenPriv; - CMapLinkPtr pLink; - - /* Is this sufficient checking ? */ - if(CMapScreenKey == NULL) - return BadImplementation; - - pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - CMapScreenKey); - if(!pScreenPriv) - return BadImplementation; - - if (gamma.red < GAMMA_MIN || gamma.red > GAMMA_MAX || - gamma.green < GAMMA_MIN || gamma.green > GAMMA_MAX || - gamma.blue < GAMMA_MIN || gamma.blue > GAMMA_MAX) - return BadValue; - - pScrn->gamma.red = gamma.red; - pScrn->gamma.green = gamma.green; - pScrn->gamma.blue = gamma.blue; - - ComputeGamma(pScreenPriv); - - /* mark all colormaps on this screen */ - pLink = pScreenPriv->maps; - while(pLink) { - pColPriv = (CMapColormapPtr)dixLookupPrivate(&pLink->cmap->devPrivates, - CMapColormapKey); - pColPriv->recalculate = TRUE; - pLink = pLink->next; - } - - if(miInstalledMaps[pScreen->myNum] && - ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || - pScrn->vtSema || pScreenPriv->isDGAmode)) { - ColormapPtr pMap = miInstalledMaps[pScreen->myNum]; - - if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && - (pMap->pVisual->class == TrueColor) && - CMapColormapUseMax(pMap->pVisual, pScreenPriv)) { - - /* if the current map doesn't have a palette look - for another map to change the gamma on. */ - - pLink = pScreenPriv->maps; - while(pLink) { - if(pLink->cmap->pVisual->class == PseudoColor) - break; - pLink = pLink->next; - } - - if(pLink) { - /* need to trick CMapRefreshColors() into thinking - this is the currently installed map */ - miInstalledMaps[pScreen->myNum] = pLink->cmap; - CMapReinstallMap(pLink->cmap); - miInstalledMaps[pScreen->myNum] = pMap; - } - } else - CMapReinstallMap(pMap); - } - - pScrn->ChangeGamma = pScreenPriv->ChangeGamma; - if (pScrn->ChangeGamma) - ret = pScrn->ChangeGamma(index, gamma); - pScrn->ChangeGamma = CMapChangeGamma; - - return ret; -} - - -static void -ComputeGammaRamp ( - CMapScreenPtr priv, - unsigned short *red, - unsigned short *green, - unsigned short *blue -){ - int elements = priv->gammaElements; - LOCO *entry = priv->gamma; - int shift = 16 - priv->sigRGBbits; - - while(elements--) { - entry->red = *(red++) >> shift; - entry->green = *(green++) >> shift; - entry->blue = *(blue++) >> shift; - entry++; - } -} - -int -xf86ChangeGammaRamp( - ScreenPtr pScreen, - int size, - unsigned short *red, - unsigned short *green, - unsigned short *blue -){ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - CMapColormapPtr pColPriv; - CMapScreenPtr pScreenPriv; - CMapLinkPtr pLink; - - if (xf86_crtc_supports_gamma(pScrn)) { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc; - - if (crtc->gammaSize != size) - return BadValue; - - RRCrtcGammaSet(crtc, red, green, blue); - - return Success; - } - - if(CMapScreenKey == NULL) - return BadImplementation; - - pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - CMapScreenKey); - if(!pScreenPriv) - return BadImplementation; - - if(pScreenPriv->gammaElements != size) - return BadValue; - - ComputeGammaRamp(pScreenPriv, red, green, blue); - - /* mark all colormaps on this screen */ - pLink = pScreenPriv->maps; - while(pLink) { - pColPriv = (CMapColormapPtr)dixLookupPrivate(&pLink->cmap->devPrivates, - CMapColormapKey); - pColPriv->recalculate = TRUE; - pLink = pLink->next; - } - - if(miInstalledMaps[pScreen->myNum] && - ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || - pScrn->vtSema || pScreenPriv->isDGAmode)) { - ColormapPtr pMap = miInstalledMaps[pScreen->myNum]; - - if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && - (pMap->pVisual->class == TrueColor) && - CMapColormapUseMax(pMap->pVisual, pScreenPriv)) { - - /* if the current map doesn't have a palette look - for another map to change the gamma on. */ - - pLink = pScreenPriv->maps; - while(pLink) { - if(pLink->cmap->pVisual->class == PseudoColor) - break; - pLink = pLink->next; - } - - if(pLink) { - /* need to trick CMapRefreshColors() into thinking - this is the currently installed map */ - miInstalledMaps[pScreen->myNum] = pLink->cmap; - CMapReinstallMap(pLink->cmap); - miInstalledMaps[pScreen->myNum] = pMap; - } - } else - CMapReinstallMap(pMap); - } - - return Success; -} - -int -xf86GetGammaRampSize(ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - CMapScreenPtr pScreenPriv; - - if (xf86_crtc_supports_gamma(pScrn)) { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc; - - return crtc->gammaSize; - } - - if(CMapScreenKey == NULL) return 0; - - pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - CMapScreenKey); - if(!pScreenPriv) return 0; - - return pScreenPriv->gammaElements; -} - -int -xf86GetGammaRamp( - ScreenPtr pScreen, - int size, - unsigned short *red, - unsigned short *green, - unsigned short *blue -){ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - CMapScreenPtr pScreenPriv; - LOCO *entry; - int shift, sigbits; - - if (xf86_crtc_supports_gamma(pScrn)) { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc; - - if (crtc->gammaSize < size) - return BadValue; - - if (!RRCrtcGammaGet(crtc)) - return BadImplementation; - - memcpy(red, crtc->gammaRed, size * sizeof(*red)); - memcpy(green, crtc->gammaGreen, size * sizeof(*green)); - memcpy(blue, crtc->gammaBlue, size * sizeof(*blue)); - - return Success; - } - - if(CMapScreenKey == NULL) - return BadImplementation; - - pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - CMapScreenKey); - if(!pScreenPriv) - return BadImplementation; - - if(size > pScreenPriv->gammaElements) - return BadValue; - - entry = pScreenPriv->gamma; - sigbits = pScreenPriv->sigRGBbits; - - while(size--) { - *red = entry->red << (16 - sigbits); - *green = entry->green << (16 - sigbits); - *blue = entry->blue << (16 - sigbits); - shift = sigbits; - while(shift < 16) { - *red |= *red >> shift; - *green |= *green >> shift; - *blue |= *blue >> shift; - shift += sigbits; - } - red++; green++; blue++; - entry++; - } - - return Success; -} - -int -xf86ChangeGamma( - ScreenPtr pScreen, - Gamma gamma -){ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - - if(pScrn->ChangeGamma) - return (*pScrn->ChangeGamma)(pScreen->myNum, gamma); - - return BadImplementation; -} +/*
+ * Copyright (c) 1998-2001 by The XFree86 Project, 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
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
+ * and author(s) 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 copyright holder(s) and author(s).
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4)
+#include <math.h>
+#else
+#define _XOPEN_SOURCE /* to get prototype for pow on some systems */
+#include <math.h>
+#undef _XOPEN_SOURCE
+#endif
+
+#include <X11/X.h>
+#include "misc.h"
+#include <X11/Xproto.h>
+#include "colormapst.h"
+#include "scrnintstr.h"
+
+#include "resource.h"
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86str.h"
+#include "micmap.h"
+#include "xf86Crtc.h"
+
+#ifdef XFreeXDGA
+#include <X11/extensions/xf86dgaproto.h>
+#include "dgaproc.h"
+#endif
+
+#include "xf86cmap.h"
+
+#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \
+ ((CMapScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, CMapScreenKey))->field)
+#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
+ ((pScreen)->field = wrapper)
+
+#define LOAD_PALETTE(pmap, index) \
+ ((pmap == miInstalledMaps[index]) && \
+ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || \
+ xf86Screens[index]->vtSema || pScreenPriv->isDGAmode))
+
+
+typedef struct _CMapLink {
+ ColormapPtr cmap;
+ struct _CMapLink *next;
+} CMapLink, *CMapLinkPtr;
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ CloseScreenProcPtr CloseScreen;
+ CreateColormapProcPtr CreateColormap;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ StoreColorsProcPtr StoreColors;
+ Bool (*EnterVT)(int, int);
+ Bool (*SwitchMode)(int, DisplayModePtr, int);
+ int (*SetDGAMode)(int, int, DGADevicePtr);
+ xf86ChangeGammaProc *ChangeGamma;
+ int maxColors;
+ int sigRGBbits;
+ int gammaElements;
+ LOCO *gamma;
+ int *PreAllocIndices;
+ CMapLinkPtr maps;
+ unsigned int flags;
+ Bool isDGAmode;
+} CMapScreenRec, *CMapScreenPtr;
+
+typedef struct {
+ int numColors;
+ LOCO *colors;
+ Bool recalculate;
+ int overscan;
+} CMapColormapRec, *CMapColormapPtr;
+
+static int CMapScreenKeyIndex;
+static DevPrivateKey CMapScreenKey;
+static int CMapColormapKeyIndex;
+static DevPrivateKey CMapColormapKey = &CMapColormapKeyIndex;
+
+static void CMapInstallColormap(ColormapPtr);
+static void CMapStoreColors(ColormapPtr, int, xColorItem *);
+static Bool CMapCloseScreen (int, ScreenPtr);
+static Bool CMapCreateColormap (ColormapPtr);
+static void CMapDestroyColormap (ColormapPtr);
+
+static Bool CMapEnterVT(int, int);
+static Bool CMapSwitchMode(int, DisplayModePtr, int);
+#ifdef XFreeXDGA
+static int CMapSetDGAMode(int, int, DGADevicePtr);
+#endif
+static int CMapChangeGamma(int, Gamma);
+
+static void ComputeGamma(CMapScreenPtr);
+static Bool CMapAllocateColormapPrivate(ColormapPtr);
+static void CMapRefreshColors(ColormapPtr, int, int*);
+static void CMapSetOverscan(ColormapPtr, int, int *);
+static void CMapReinstallMap(ColormapPtr);
+static void CMapUnwrapScreen(ScreenPtr pScreen);
+
+
+
+Bool xf86HandleColormaps(
+ ScreenPtr pScreen,
+ int maxColors,
+ int sigRGBbits,
+ xf86LoadPaletteProc *loadPalette,
+ xf86SetOverscanProc *setOverscan,
+ unsigned int flags
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ColormapPtr pDefMap = NULL;
+ CMapScreenPtr pScreenPriv;
+ LOCO *gamma;
+ int *indices;
+ int elements;
+
+ /* If we support a better colormap system, then pretend we succeeded. */
+ if (xf86_crtc_supports_gamma(pScrn))
+ return TRUE;
+
+ if(!maxColors || !sigRGBbits || !loadPalette)
+ return FALSE;
+
+ CMapScreenKey = &CMapScreenKeyIndex;
+
+ elements = 1 << sigRGBbits;
+
+ if(!(gamma = xalloc(elements * sizeof(LOCO))))
+ return FALSE;
+
+ if(!(indices = xalloc(maxColors * sizeof(int)))) {
+ xfree(gamma);
+ return FALSE;
+ }
+
+ if(!(pScreenPriv = xalloc(sizeof(CMapScreenRec)))) {
+ xfree(gamma);
+ xfree(indices);
+ return FALSE;
+ }
+
+ dixSetPrivate(&pScreen->devPrivates, CMapScreenKey, pScreenPriv);
+
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreenPriv->CreateColormap = pScreen->CreateColormap;
+ pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
+ pScreenPriv->InstallColormap = pScreen->InstallColormap;
+ pScreenPriv->StoreColors = pScreen->StoreColors;
+ pScreen->CloseScreen = CMapCloseScreen;
+ pScreen->CreateColormap = CMapCreateColormap;
+ pScreen->DestroyColormap = CMapDestroyColormap;
+ pScreen->InstallColormap = CMapInstallColormap;
+ pScreen->StoreColors = CMapStoreColors;
+
+ pScreenPriv->pScrn = pScrn;
+ pScrn->LoadPalette = loadPalette;
+ pScrn->SetOverscan = setOverscan;
+ pScreenPriv->maxColors = maxColors;
+ pScreenPriv->sigRGBbits = sigRGBbits;
+ pScreenPriv->gammaElements = elements;
+ pScreenPriv->gamma = gamma;
+ pScreenPriv->PreAllocIndices = indices;
+ pScreenPriv->maps = NULL;
+ pScreenPriv->flags = flags;
+ pScreenPriv->isDGAmode = FALSE;
+
+ pScreenPriv->EnterVT = pScrn->EnterVT;
+ pScreenPriv->SwitchMode = pScrn->SwitchMode;
+ pScreenPriv->SetDGAMode = pScrn->SetDGAMode;
+ pScreenPriv->ChangeGamma = pScrn->ChangeGamma;
+
+ if (!(flags & CMAP_LOAD_EVEN_IF_OFFSCREEN)) {
+ pScrn->EnterVT = CMapEnterVT;
+ if ((flags & CMAP_RELOAD_ON_MODE_SWITCH) && pScrn->SwitchMode)
+ pScrn->SwitchMode = CMapSwitchMode;
+ }
+#ifdef XFreeXDGA
+ pScrn->SetDGAMode = CMapSetDGAMode;
+#endif
+ pScrn->ChangeGamma = CMapChangeGamma;
+
+ ComputeGamma(pScreenPriv);
+
+ /* get the default map */
+ dixLookupResourceByType((pointer *)&pDefMap, pScreen->defColormap,
+ RT_COLORMAP, serverClient, DixInstallAccess);
+
+ if(!CMapAllocateColormapPrivate(pDefMap)) {
+ CMapUnwrapScreen(pScreen);
+ return FALSE;
+ }
+
+ /* Force the initial map to be loaded */
+ miInstalledMaps[pScreen->myNum] = NULL;
+ CMapInstallColormap(pDefMap);
+ return TRUE;
+}
+
+
+/**** Screen functions ****/
+
+
+static Bool
+CMapCloseScreen (int i, ScreenPtr pScreen)
+{
+ CMapUnwrapScreen(pScreen);
+
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+static Bool
+CMapColormapUseMax(VisualPtr pVisual, CMapScreenPtr pScreenPriv)
+{
+ if (pVisual->nplanes > 16)
+ return TRUE;
+ return ((1 << pVisual->nplanes) > pScreenPriv->maxColors);
+}
+
+static Bool
+CMapAllocateColormapPrivate(ColormapPtr pmap)
+{
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pmap->pScreen->devPrivates, CMapScreenKey);
+ CMapColormapPtr pColPriv;
+ CMapLinkPtr pLink;
+ int numColors;
+ LOCO *colors;
+
+ if (CMapColormapUseMax(pmap->pVisual, pScreenPriv))
+ numColors = pmap->pVisual->ColormapEntries;
+ else
+ numColors = 1 << pmap->pVisual->nplanes;
+
+ if(!(colors = xalloc(numColors * sizeof(LOCO))))
+ return FALSE;
+
+ if(!(pColPriv = xalloc(sizeof(CMapColormapRec)))) {
+ xfree(colors);
+ return FALSE;
+ }
+
+ dixSetPrivate(&pmap->devPrivates, CMapColormapKey, pColPriv);
+
+ pColPriv->numColors = numColors;
+ pColPriv->colors = colors;
+ pColPriv->recalculate = TRUE;
+ pColPriv->overscan = -1;
+
+ /* add map to list */
+ pLink = xalloc(sizeof(CMapLink));
+ if(pLink) {
+ pLink->cmap = pmap;
+ pLink->next = pScreenPriv->maps;
+ pScreenPriv->maps = pLink;
+ }
+
+ return TRUE;
+}
+
+static Bool
+CMapCreateColormap (ColormapPtr pmap)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+ Bool ret = FALSE;
+
+ pScreen->CreateColormap = pScreenPriv->CreateColormap;
+ if((*pScreen->CreateColormap)(pmap)) {
+ if(CMapAllocateColormapPrivate(pmap))
+ ret = TRUE;
+ }
+ pScreen->CreateColormap = CMapCreateColormap;
+
+ return ret;
+}
+
+static void
+CMapDestroyColormap (ColormapPtr cmap)
+{
+ ScreenPtr pScreen = cmap->pScreen;
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+ CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate(
+ &cmap->devPrivates, CMapColormapKey);
+ CMapLinkPtr prevLink = NULL, pLink = pScreenPriv->maps;
+
+ if(pColPriv) {
+ if(pColPriv->colors) xfree(pColPriv->colors);
+ xfree(pColPriv);
+ }
+
+ /* remove map from list */
+ while(pLink) {
+ if(pLink->cmap == cmap) {
+ if(prevLink)
+ prevLink->next = pLink->next;
+ else
+ pScreenPriv->maps = pLink->next;
+ xfree(pLink);
+ break;
+ }
+ prevLink = pLink;
+ pLink = pLink->next;
+ }
+
+ if(pScreenPriv->DestroyColormap) {
+ pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
+ (*pScreen->DestroyColormap)(cmap);
+ pScreen->DestroyColormap = CMapDestroyColormap;
+ }
+}
+
+
+
+static void
+CMapStoreColors(
+ ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs
+){
+ ScreenPtr pScreen = pmap->pScreen;
+ VisualPtr pVisual = pmap->pVisual;
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+ int *indices = pScreenPriv->PreAllocIndices;
+ int num = ndef;
+
+ /* At the moment this isn't necessary since there's nobody below us */
+ pScreen->StoreColors = pScreenPriv->StoreColors;
+ (*pScreen->StoreColors)(pmap, ndef, pdefs);
+ pScreen->StoreColors = CMapStoreColors;
+
+ /* should never get here for these */
+ if( (pVisual->class == TrueColor) ||
+ (pVisual->class == StaticColor) ||
+ (pVisual->class == StaticGray))
+ return;
+
+ if(pVisual->class == DirectColor) {
+ CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate(
+ &pmap->devPrivates, CMapColormapKey);
+ int i;
+
+ if (CMapColormapUseMax(pVisual, pScreenPriv)) {
+ int index;
+
+ num = 0;
+ while(ndef--) {
+ if(pdefs[ndef].flags & DoRed) {
+ index = (pdefs[ndef].pixel & pVisual->redMask) >>
+ pVisual->offsetRed;
+ i = num;
+ while(i--)
+ if(indices[i] == index) break;
+ if(i == -1)
+ indices[num++] = index;
+ }
+ if(pdefs[ndef].flags & DoGreen) {
+ index = (pdefs[ndef].pixel & pVisual->greenMask) >>
+ pVisual->offsetGreen;
+ i = num;
+ while(i--)
+ if(indices[i] == index) break;
+ if(i == -1)
+ indices[num++] = index;
+ }
+ if(pdefs[ndef].flags & DoBlue) {
+ index = (pdefs[ndef].pixel & pVisual->blueMask) >>
+ pVisual->offsetBlue;
+ i = num;
+ while(i--)
+ if(indices[i] == index) break;
+ if(i == -1)
+ indices[num++] = index;
+ }
+ }
+
+ } else {
+ /* not really as overkill as it seems */
+ num = pColPriv->numColors;
+ for(i = 0; i < pColPriv->numColors; i++)
+ indices[i] = i;
+ }
+ } else {
+ while(ndef--)
+ indices[ndef] = pdefs[ndef].pixel;
+ }
+
+ CMapRefreshColors(pmap, num, indices);
+}
+
+
+static void
+CMapInstallColormap(ColormapPtr pmap)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ int index = pScreen->myNum;
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+
+ if (pmap == miInstalledMaps[index])
+ return;
+
+ pScreen->InstallColormap = pScreenPriv->InstallColormap;
+ (*pScreen->InstallColormap)(pmap);
+ pScreen->InstallColormap = CMapInstallColormap;
+
+ /* Important. We let the lower layers, namely DGA,
+ overwrite the choice of Colormap to install */
+ if (miInstalledMaps[index])
+ pmap = miInstalledMaps[index];
+
+ if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
+ (pmap->pVisual->class == TrueColor) &&
+ CMapColormapUseMax(pmap->pVisual, pScreenPriv))
+ return;
+
+ if(LOAD_PALETTE(pmap, index))
+ CMapReinstallMap(pmap);
+}
+
+
+/**** ScrnInfoRec functions ****/
+
+static Bool
+CMapEnterVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+
+ if((*pScreenPriv->EnterVT)(index, flags)) {
+ if(miInstalledMaps[index])
+ CMapReinstallMap(miInstalledMaps[index]);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+static Bool
+CMapSwitchMode(int index, DisplayModePtr mode, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+
+ if((*pScreenPriv->SwitchMode)(index, mode, flags)) {
+ if(miInstalledMaps[index])
+ CMapReinstallMap(miInstalledMaps[index]);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#ifdef XFreeXDGA
+static int
+CMapSetDGAMode(int index, int num, DGADevicePtr dev)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+ int ret;
+
+ ret = (*pScreenPriv->SetDGAMode)(index, num, dev);
+
+ pScreenPriv->isDGAmode = DGAActive(index);
+
+ if(!pScreenPriv->isDGAmode && miInstalledMaps[index]
+ && xf86Screens[pScreen->myNum]->vtSema)
+ CMapReinstallMap(miInstalledMaps[index]);
+
+ return ret;
+}
+#endif
+
+
+/**** Utilities ****/
+
+static void
+CMapReinstallMap(ColormapPtr pmap)
+{
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pmap->pScreen->devPrivates, CMapScreenKey);
+ CMapColormapPtr cmapPriv = (CMapColormapPtr)dixLookupPrivate(
+ &pmap->devPrivates, CMapColormapKey);
+ ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
+ int i = cmapPriv->numColors;
+ int *indices = pScreenPriv->PreAllocIndices;
+
+ while(i--)
+ indices[i] = i;
+
+ if(cmapPriv->recalculate)
+ CMapRefreshColors(pmap, cmapPriv->numColors, indices);
+ else {
+ (*pScrn->LoadPalette)(pScrn, cmapPriv->numColors,
+ indices, cmapPriv->colors, pmap->pVisual);
+ if (pScrn->SetOverscan) {
+#ifdef DEBUGOVERSCAN
+ ErrorF("SetOverscan() called from CMapReinstallMap\n");
+#endif
+ pScrn->SetOverscan(pScrn, cmapPriv->overscan);
+ }
+ }
+
+ cmapPriv->recalculate = FALSE;
+}
+
+
+static void
+CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
+{
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pmap->pScreen->devPrivates, CMapScreenKey);
+ CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate(
+ &pmap->devPrivates, CMapColormapKey);
+ VisualPtr pVisual = pmap->pVisual;
+ ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
+ int numColors, i;
+ LOCO *gamma, *colors;
+ EntryPtr entry;
+ int reds, greens, blues, maxValue, index, shift;
+
+ numColors = pColPriv->numColors;
+ shift = 16 - pScreenPriv->sigRGBbits;
+ maxValue = (1 << pScreenPriv->sigRGBbits) - 1;
+ gamma = pScreenPriv->gamma;
+ colors = pColPriv->colors;
+
+ reds = pVisual->redMask >> pVisual->offsetRed;
+ greens = pVisual->greenMask >> pVisual->offsetGreen;
+ blues = pVisual->blueMask >> pVisual->offsetBlue;
+
+ switch(pVisual->class) {
+ case StaticGray:
+ for(i = 0; i < numColors; i++) {
+ index = (i+1) * maxValue / numColors;
+ colors[i].red = gamma[index].red;
+ colors[i].green = gamma[index].green;
+ colors[i].blue = gamma[index].blue;
+ }
+ break;
+ case TrueColor:
+ if (CMapColormapUseMax(pVisual, pScreenPriv)) {
+ for(i = 0; i <= reds; i++)
+ colors[i].red = gamma[i * maxValue / reds].red;
+ for(i = 0; i <= greens; i++)
+ colors[i].green = gamma[i * maxValue / greens].green;
+ for(i = 0; i <= blues; i++)
+ colors[i].blue = gamma[i * maxValue / blues].blue;
+ break;
+ }
+ for(i = 0; i < numColors; i++) {
+ colors[i].red = gamma[((i >> pVisual->offsetRed) & reds) *
+ maxValue / reds].red;
+ colors[i].green = gamma[((i >> pVisual->offsetGreen) & greens) *
+ maxValue / greens].green;
+ colors[i].blue = gamma[((i >> pVisual->offsetBlue) & blues) *
+ maxValue / blues].blue;
+ }
+ break;
+ case StaticColor:
+ case PseudoColor:
+ case GrayScale:
+ for(i = 0; i < defs; i++) {
+ index = indices[i];
+ entry = (EntryPtr)&pmap->red[index];
+
+ if(entry->fShared) {
+ colors[index].red =
+ gamma[entry->co.shco.red->color >> shift].red;
+ colors[index].green =
+ gamma[entry->co.shco.green->color >> shift].green;
+ colors[index].blue =
+ gamma[entry->co.shco.blue->color >> shift].blue;
+ } else {
+ colors[index].red =
+ gamma[entry->co.local.red >> shift].red;
+ colors[index].green =
+ gamma[entry->co.local.green >> shift].green;
+ colors[index].blue =
+ gamma[entry->co.local.blue >> shift].blue;
+ }
+ }
+ break;
+ case DirectColor:
+ if (CMapColormapUseMax(pVisual, pScreenPriv)) {
+ for(i = 0; i < defs; i++) {
+ index = indices[i];
+ if(index <= reds)
+ colors[index].red =
+ gamma[pmap->red[index].co.local.red >> shift].red;
+ if(index <= greens)
+ colors[index].green =
+ gamma[pmap->green[index].co.local.green >> shift].green;
+ if(index <= blues)
+ colors[index].blue =
+ gamma[pmap->blue[index].co.local.blue >> shift].blue;
+
+ }
+ break;
+ }
+ for(i = 0; i < defs; i++) {
+ index = indices[i];
+
+ colors[index].red = gamma[pmap->red[
+ (index >> pVisual->offsetRed) & reds
+ ].co.local.red >> shift].red;
+ colors[index].green = gamma[pmap->green[
+ (index >> pVisual->offsetGreen) & greens
+ ].co.local.green >> shift].green;
+ colors[index].blue = gamma[pmap->blue[
+ (index >> pVisual->offsetBlue) & blues
+ ].co.local.blue >> shift].blue;
+ }
+ break;
+ }
+
+
+ if(LOAD_PALETTE(pmap, pmap->pScreen->myNum))
+ (*pScrn->LoadPalette)(pScreenPriv->pScrn, defs, indices,
+ colors, pmap->pVisual);
+
+ if (pScrn->SetOverscan)
+ CMapSetOverscan(pmap, defs, indices);
+
+}
+
+static Bool
+CMapCompareColors(LOCO *color1, LOCO *color2)
+{
+ /* return TRUE if the color1 is "closer" to black than color2 */
+#ifdef DEBUGOVERSCAN
+ ErrorF("#%02x%02x%02x vs #%02x%02x%02x (%d vs %d)\n",
+ color1->red, color1->green, color1->blue,
+ color2->red, color2->green, color2->blue,
+ color1->red + color1->green + color1->blue,
+ color2->red + color2->green + color2->blue);
+#endif
+ return (color1->red + color1->green + color1->blue <
+ color2->red + color2->green + color2->blue);
+}
+
+static void
+CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
+{
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pmap->pScreen->devPrivates, CMapScreenKey);
+ CMapColormapPtr pColPriv = (CMapColormapPtr)dixLookupPrivate(
+ &pmap->devPrivates, CMapColormapKey);
+ ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
+ VisualPtr pVisual = pmap->pVisual;
+ int i;
+ LOCO *colors;
+ int index;
+ Bool newOverscan = FALSE;
+ int overscan, tmpOverscan;
+
+ colors = pColPriv->colors;
+ overscan = pColPriv->overscan;
+
+ /*
+ * Search for a new overscan index in the following cases:
+ *
+ * - The index hasn't yet been initialised. In this case search
+ * for an index that is black or a close match to black.
+ *
+ * - The colour of the old index is changed. In this case search
+ * all indices for a black or close match to black.
+ *
+ * - The colour of the old index wasn't black. In this case only
+ * search the indices that were changed for a better match to black.
+ */
+
+ switch (pVisual->class) {
+ case StaticGray:
+ case TrueColor:
+ /* Should only come here once. Initialise the overscan index to 0 */
+ overscan = 0;
+ newOverscan = TRUE;
+ break;
+ case StaticColor:
+ /*
+ * Only come here once, but search for the overscan in the same way
+ * as for the other cases.
+ */
+ case DirectColor:
+ case PseudoColor:
+ case GrayScale:
+ if (overscan < 0 || overscan > pScreenPriv->maxColors - 1) {
+ /* Uninitialised */
+ newOverscan = TRUE;
+ } else {
+ /* Check if the overscan was changed */
+ for (i = 0; i < defs; i++) {
+ index = indices[i];
+ if (index == overscan) {
+ newOverscan = TRUE;
+ break;
+ }
+ }
+ }
+ if (newOverscan) {
+ /* The overscan is either uninitialised or it has been changed */
+
+ if (overscan < 0 || overscan > pScreenPriv->maxColors - 1)
+ tmpOverscan = pScreenPriv->maxColors - 1;
+ else
+ tmpOverscan = overscan;
+
+ /* search all entries for a close match to black */
+ for (i = pScreenPriv->maxColors - 1; i >= 0; i--) {
+ if (colors[i].red == 0 && colors[i].green == 0 &&
+ colors[i].blue == 0) {
+ overscan = i;
+#ifdef DEBUGOVERSCAN
+ ErrorF("Black found at index 0x%02x\n", i);
+#endif
+ break;
+ } else {
+#ifdef DEBUGOVERSCAN
+ ErrorF("0x%02x: ", i);
+#endif
+ if (CMapCompareColors(&colors[i], &colors[tmpOverscan])) {
+ tmpOverscan = i;
+#ifdef DEBUGOVERSCAN
+ ErrorF("possible \"Black\" at index 0x%02x\n", i);
+#endif
+ }
+ }
+ }
+ if (i < 0)
+ overscan = tmpOverscan;
+ } else {
+ /* Check of the old overscan wasn't black */
+ if (colors[overscan].red != 0 || colors[overscan].green != 0 ||
+ colors[overscan].blue != 0) {
+ int oldOverscan = tmpOverscan = overscan;
+ /* See of there is now a better match */
+ for (i = 0; i < defs; i++) {
+ index = indices[i];
+ if (colors[index].red == 0 && colors[index].green == 0 &&
+ colors[index].blue == 0) {
+ overscan = index;
+#ifdef DEBUGOVERSCAN
+ ErrorF("Black found at index 0x%02x\n", index);
+#endif
+ break;
+ } else {
+#ifdef DEBUGOVERSCAN
+ ErrorF("0x%02x: ", index);
+#endif
+ if (CMapCompareColors(&colors[index],
+ &colors[tmpOverscan])) {
+ tmpOverscan = index;
+#ifdef DEBUGOVERSCAN
+ ErrorF("possible \"Black\" at index 0x%02x\n",
+ index);
+#endif
+ }
+ }
+ }
+ if (i == defs)
+ overscan = tmpOverscan;
+ if (overscan != oldOverscan)
+ newOverscan = TRUE;
+ }
+ }
+ break;
+ }
+ if (newOverscan) {
+ pColPriv->overscan = overscan;
+ if (LOAD_PALETTE(pmap, pmap->pScreen->myNum)) {
+#ifdef DEBUGOVERSCAN
+ ErrorF("SetOverscan() called from CmapSetOverscan\n");
+#endif
+ pScrn->SetOverscan(pScreenPriv->pScrn, overscan);
+ }
+ }
+}
+
+static void
+CMapUnwrapScreen(ScreenPtr pScreen)
+{
+ CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, CMapScreenKey);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ pScreen->CreateColormap = pScreenPriv->CreateColormap;
+ pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
+ pScreen->InstallColormap = pScreenPriv->InstallColormap;
+ pScreen->StoreColors = pScreenPriv->StoreColors;
+
+ pScrn->EnterVT = pScreenPriv->EnterVT;
+ pScrn->SwitchMode = pScreenPriv->SwitchMode;
+ pScrn->SetDGAMode = pScreenPriv->SetDGAMode;
+ pScrn->ChangeGamma = pScreenPriv->ChangeGamma;
+
+ xfree(pScreenPriv->gamma);
+ xfree(pScreenPriv->PreAllocIndices);
+ xfree(pScreenPriv);
+}
+
+
+static void
+ComputeGamma(CMapScreenPtr priv)
+{
+ int elements = priv->gammaElements - 1;
+ double RedGamma, GreenGamma, BlueGamma;
+ int i;
+
+#ifndef DONT_CHECK_GAMMA
+ /* This check is to catch drivers that are not initialising pScrn->gamma */
+ if (priv->pScrn->gamma.red < GAMMA_MIN ||
+ priv->pScrn->gamma.red > GAMMA_MAX ||
+ priv->pScrn->gamma.green < GAMMA_MIN ||
+ priv->pScrn->gamma.green > GAMMA_MAX ||
+ priv->pScrn->gamma.blue < GAMMA_MIN ||
+ priv->pScrn->gamma.blue > GAMMA_MAX) {
+
+ xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
+ "The %s driver didn't call xf86SetGamma() to initialise\n"
+ "\tthe gamma values.\n", priv->pScrn->driverName);
+ xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
+ "PLEASE FIX THE `%s' DRIVER!\n", priv->pScrn->driverName);
+ priv->pScrn->gamma.red = 1.0;
+ priv->pScrn->gamma.green = 1.0;
+ priv->pScrn->gamma.blue = 1.0;
+ }
+#endif
+
+ RedGamma = 1.0 / (double)priv->pScrn->gamma.red;
+ GreenGamma = 1.0 / (double)priv->pScrn->gamma.green;
+ BlueGamma = 1.0 / (double)priv->pScrn->gamma.blue;
+
+ for(i = 0; i <= elements; i++) {
+ if(RedGamma == 1.0)
+ priv->gamma[i].red = i;
+ else
+ priv->gamma[i].red = (CARD16)(pow((double)i/(double)elements,
+ RedGamma) * (double)elements + 0.5);
+
+ if(GreenGamma == 1.0)
+ priv->gamma[i].green = i;
+ else
+ priv->gamma[i].green = (CARD16)(pow((double)i/(double)elements,
+ GreenGamma) * (double)elements + 0.5);
+
+ if(BlueGamma == 1.0)
+ priv->gamma[i].blue = i;
+ else
+ priv->gamma[i].blue = (CARD16)(pow((double)i/(double)elements,
+ BlueGamma) * (double)elements + 0.5);
+ }
+}
+
+
+int
+CMapChangeGamma(
+ int index,
+ Gamma gamma
+){
+ int ret = Success;
+ ScrnInfoPtr pScrn = xf86Screens[index];
+ ScreenPtr pScreen = pScrn->pScreen;
+ CMapColormapPtr pColPriv;
+ CMapScreenPtr pScreenPriv;
+ CMapLinkPtr pLink;
+
+ /* Is this sufficient checking ? */
+ if(CMapScreenKey == NULL)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
+ CMapScreenKey);
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if (gamma.red < GAMMA_MIN || gamma.red > GAMMA_MAX ||
+ gamma.green < GAMMA_MIN || gamma.green > GAMMA_MAX ||
+ gamma.blue < GAMMA_MIN || gamma.blue > GAMMA_MAX)
+ return BadValue;
+
+ pScrn->gamma.red = gamma.red;
+ pScrn->gamma.green = gamma.green;
+ pScrn->gamma.blue = gamma.blue;
+
+ ComputeGamma(pScreenPriv);
+
+ /* mark all colormaps on this screen */
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ pColPriv = (CMapColormapPtr)dixLookupPrivate(&pLink->cmap->devPrivates,
+ CMapColormapKey);
+ pColPriv->recalculate = TRUE;
+ pLink = pLink->next;
+ }
+
+ if(miInstalledMaps[pScreen->myNum] &&
+ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) ||
+ pScrn->vtSema || pScreenPriv->isDGAmode)) {
+ ColormapPtr pMap = miInstalledMaps[pScreen->myNum];
+
+ if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
+ (pMap->pVisual->class == TrueColor) &&
+ CMapColormapUseMax(pMap->pVisual, pScreenPriv)) {
+
+ /* if the current map doesn't have a palette look
+ for another map to change the gamma on. */
+
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ if(pLink->cmap->pVisual->class == PseudoColor)
+ break;
+ pLink = pLink->next;
+ }
+
+ if(pLink) {
+ /* need to trick CMapRefreshColors() into thinking
+ this is the currently installed map */
+ miInstalledMaps[pScreen->myNum] = pLink->cmap;
+ CMapReinstallMap(pLink->cmap);
+ miInstalledMaps[pScreen->myNum] = pMap;
+ }
+ } else
+ CMapReinstallMap(pMap);
+ }
+
+ pScrn->ChangeGamma = pScreenPriv->ChangeGamma;
+ if (pScrn->ChangeGamma)
+ ret = pScrn->ChangeGamma(index, gamma);
+ pScrn->ChangeGamma = CMapChangeGamma;
+
+ return ret;
+}
+
+
+static void
+ComputeGammaRamp (
+ CMapScreenPtr priv,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ int elements = priv->gammaElements;
+ LOCO *entry = priv->gamma;
+ int shift = 16 - priv->sigRGBbits;
+
+ while(elements--) {
+ entry->red = *(red++) >> shift;
+ entry->green = *(green++) >> shift;
+ entry->blue = *(blue++) >> shift;
+ entry++;
+ }
+}
+
+int
+xf86ChangeGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ CMapColormapPtr pColPriv;
+ CMapScreenPtr pScreenPriv;
+ CMapLinkPtr pLink;
+
+ if (xf86_crtc_supports_gamma(pScrn)) {
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
+
+ if (crtc) {
+ if (crtc->gammaSize != size)
+ return BadValue;
+
+ RRCrtcGammaSet(crtc, red, green, blue);
+
+ return Success;
+ }
+ }
+
+ if(CMapScreenKey == NULL)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
+ CMapScreenKey);
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if(pScreenPriv->gammaElements != size)
+ return BadValue;
+
+ ComputeGammaRamp(pScreenPriv, red, green, blue);
+
+ /* mark all colormaps on this screen */
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ pColPriv = (CMapColormapPtr)dixLookupPrivate(&pLink->cmap->devPrivates,
+ CMapColormapKey);
+ pColPriv->recalculate = TRUE;
+ pLink = pLink->next;
+ }
+
+ if(miInstalledMaps[pScreen->myNum] &&
+ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) ||
+ pScrn->vtSema || pScreenPriv->isDGAmode)) {
+ ColormapPtr pMap = miInstalledMaps[pScreen->myNum];
+
+ if (!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
+ (pMap->pVisual->class == TrueColor) &&
+ CMapColormapUseMax(pMap->pVisual, pScreenPriv)) {
+
+ /* if the current map doesn't have a palette look
+ for another map to change the gamma on. */
+
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ if(pLink->cmap->pVisual->class == PseudoColor)
+ break;
+ pLink = pLink->next;
+ }
+
+ if(pLink) {
+ /* need to trick CMapRefreshColors() into thinking
+ this is the currently installed map */
+ miInstalledMaps[pScreen->myNum] = pLink->cmap;
+ CMapReinstallMap(pLink->cmap);
+ miInstalledMaps[pScreen->myNum] = pMap;
+ }
+ } else
+ CMapReinstallMap(pMap);
+ }
+
+ return Success;
+}
+
+int
+xf86GetGammaRampSize(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ CMapScreenPtr pScreenPriv;
+
+ if (xf86_crtc_supports_gamma(pScrn)) {
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
+
+ if (crtc)
+ return crtc->gammaSize;
+ }
+
+ if(CMapScreenKey == NULL) return 0;
+
+ pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
+ CMapScreenKey);
+ if(!pScreenPriv) return 0;
+
+ return pScreenPriv->gammaElements;
+}
+
+int
+xf86GetGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ CMapScreenPtr pScreenPriv;
+ LOCO *entry;
+ int shift, sigbits;
+
+ if (xf86_crtc_supports_gamma(pScrn)) {
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
+
+ if (crtc) {
+ if (crtc->gammaSize < size)
+ return BadValue;
+
+ if (!RRCrtcGammaGet(crtc))
+ return BadImplementation;
+
+ memcpy(red, crtc->gammaRed, size * sizeof(*red));
+ memcpy(green, crtc->gammaGreen, size * sizeof(*green));
+ memcpy(blue, crtc->gammaBlue, size * sizeof(*blue));
+
+ return Success;
+ }
+ }
+
+ if(CMapScreenKey == NULL)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
+ CMapScreenKey);
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if(size > pScreenPriv->gammaElements)
+ return BadValue;
+
+ entry = pScreenPriv->gamma;
+ sigbits = pScreenPriv->sigRGBbits;
+
+ while(size--) {
+ *red = entry->red << (16 - sigbits);
+ *green = entry->green << (16 - sigbits);
+ *blue = entry->blue << (16 - sigbits);
+ shift = sigbits;
+ while(shift < 16) {
+ *red |= *red >> shift;
+ *green |= *green >> shift;
+ *blue |= *blue >> shift;
+ shift += sigbits;
+ }
+ red++; green++; blue++;
+ entry++;
+ }
+
+ return Success;
+}
+
+int
+xf86ChangeGamma(
+ ScreenPtr pScreen,
+ Gamma gamma
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if(pScrn->ChangeGamma)
+ return (*pScrn->ChangeGamma)(pScreen->myNum, gamma);
+
+ return BadImplementation;
+}
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index 3db826e91..787544c20 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -1,892 +1,934 @@ -/* - * Copyright © 2007, 2008 Red Hat, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Soft- - * ware"), 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 Soft- - * ware 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 MERCHANTABIL- - * ITY, 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 CONSE- - * QUENTIAL 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 PERFOR- - * MANCE 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. - * - * Authors: - * Kristian Høgsberg (krh@redhat.com) - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <errno.h> -#include <xf86drm.h> -#include "xf86Module.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "dixstruct.h" -#include "dri2.h" -#include "xf86VGAarbiter.h" - -#include "xf86.h" - -static int dri2ScreenPrivateKeyIndex; -static DevPrivateKey dri2ScreenPrivateKey = &dri2ScreenPrivateKeyIndex; -static int dri2WindowPrivateKeyIndex; -static DevPrivateKey dri2WindowPrivateKey = &dri2WindowPrivateKeyIndex; -static int dri2PixmapPrivateKeyIndex; -static DevPrivateKey dri2PixmapPrivateKey = &dri2PixmapPrivateKeyIndex; - -typedef struct _DRI2Drawable { - unsigned int refCount; - int width; - int height; - DRI2BufferPtr *buffers; - int bufferCount; - unsigned int swapsPending; - ClientPtr blockedClient; - int swap_interval; - CARD64 swap_count; - CARD64 target_sbc; /* -1 means no SBC wait outstanding */ - CARD64 last_swap_target; /* most recently queued swap target */ - int swap_limit; /* for N-buffering */ -} DRI2DrawableRec, *DRI2DrawablePtr; - -typedef struct _DRI2Screen *DRI2ScreenPtr; - -typedef struct _DRI2Screen { - const char *driverName; - const char *deviceName; - int fd; - unsigned int lastSequence; - - DRI2CreateBufferProcPtr CreateBuffer; - DRI2DestroyBufferProcPtr DestroyBuffer; - DRI2CopyRegionProcPtr CopyRegion; - DRI2ScheduleSwapProcPtr ScheduleSwap; - DRI2GetMSCProcPtr GetMSC; - DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; - - HandleExposuresProcPtr HandleExposures; -} DRI2ScreenRec; - -static DRI2ScreenPtr -DRI2GetScreen(ScreenPtr pScreen) -{ - return dixLookupPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey); -} - -static DRI2DrawablePtr -DRI2GetDrawable(DrawablePtr pDraw) -{ - WindowPtr pWin; - PixmapPtr pPixmap; - - if (!pDraw) - return NULL; - - if (pDraw->type == DRAWABLE_WINDOW) - { - pWin = (WindowPtr) pDraw; - return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey); - } - else - { - pPixmap = (PixmapPtr) pDraw; - return dixLookupPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey); - } -} - -int -DRI2CreateDrawable(DrawablePtr pDraw) -{ - WindowPtr pWin; - PixmapPtr pPixmap; - DRI2DrawablePtr pPriv; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv != NULL) - { - pPriv->refCount++; - return Success; - } - - pPriv = xalloc(sizeof *pPriv); - if (pPriv == NULL) - return BadAlloc; - - pPriv->refCount = 1; - pPriv->width = pDraw->width; - pPriv->height = pDraw->height; - pPriv->buffers = NULL; - pPriv->bufferCount = 0; - pPriv->swapsPending = 0; - pPriv->blockedClient = NULL; - pPriv->swap_count = 0; - pPriv->target_sbc = -1; - pPriv->swap_interval = 1; - pPriv->last_swap_target = -1; - pPriv->swap_limit = 1; /* default to double buffering */ - - if (pDraw->type == DRAWABLE_WINDOW) - { - pWin = (WindowPtr) pDraw; - dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); - } - else - { - pPixmap = (PixmapPtr) pDraw; - dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv); - } - - return Success; -} - -static int -find_attachment(DRI2DrawablePtr pPriv, unsigned attachment) -{ - int i; - - if (pPriv->buffers == NULL) { - return -1; - } - - for (i = 0; i < pPriv->bufferCount; i++) { - if ((pPriv->buffers[i] != NULL) - && (pPriv->buffers[i]->attachment == attachment)) { - return i; - } - } - - return -1; -} - -static DRI2BufferPtr -allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds, - DRI2DrawablePtr pPriv, - unsigned int attachment, unsigned int format, - int dimensions_match) -{ - DRI2BufferPtr buffer; - int old_buf; - - old_buf = find_attachment(pPriv, attachment); - - if ((old_buf < 0) - || !dimensions_match - || (pPriv->buffers[old_buf]->format != format)) { - buffer = (*ds->CreateBuffer)(pDraw, attachment, format); - } else { - buffer = pPriv->buffers[old_buf]; - pPriv->buffers[old_buf] = NULL; - } - - return buffer; -} - -static DRI2BufferPtr * -do_get_buffers(DrawablePtr pDraw, int *width, int *height, - unsigned int *attachments, int count, int *out_count, - int has_format) -{ - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); - DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); - DRI2BufferPtr *buffers; - int need_real_front = 0; - int need_fake_front = 0; - int have_fake_front = 0; - int front_format = 0; - int dimensions_match; - int i; - - if (!pPriv) { - *width = pDraw->width; - *height = pDraw->height; - *out_count = 0; - return NULL; - } - - dimensions_match = (pDraw->width == pPriv->width) - && (pDraw->height == pPriv->height); - - buffers = xalloc((count + 1) * sizeof(buffers[0])); - - for (i = 0; i < count; i++) { - const unsigned attachment = *(attachments++); - const unsigned format = (has_format) ? *(attachments++) : 0; - - buffers[i] = allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment, - format, dimensions_match); - - /* If the drawable is a window and the front-buffer is requested, - * silently add the fake front-buffer to the list of requested - * attachments. The counting logic in the loop accounts for the case - * where the client requests both the fake and real front-buffer. - */ - if (attachment == DRI2BufferBackLeft) { - need_real_front++; - front_format = format; - } - - if (attachment == DRI2BufferFrontLeft) { - need_real_front--; - front_format = format; - - if (pDraw->type == DRAWABLE_WINDOW) { - need_fake_front++; - } - } - - if (pDraw->type == DRAWABLE_WINDOW) { - if (attachment == DRI2BufferFakeFrontLeft) { - need_fake_front--; - have_fake_front = 1; - } - } - } - - if (need_real_front > 0) { - buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv, - DRI2BufferFrontLeft, - front_format, dimensions_match); - } - - if (need_fake_front > 0) { - buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv, - DRI2BufferFakeFrontLeft, - front_format, dimensions_match); - have_fake_front = 1; - } - - *out_count = i; - - - if (pPriv->buffers != NULL) { - for (i = 0; i < pPriv->bufferCount; i++) { - if (pPriv->buffers[i] != NULL) { - (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]); - } - } - - xfree(pPriv->buffers); - } - - pPriv->buffers = buffers; - pPriv->bufferCount = *out_count; - pPriv->width = pDraw->width; - pPriv->height = pDraw->height; - *width = pPriv->width; - *height = pPriv->height; - - - /* If the client is getting a fake front-buffer, pre-fill it with the - * contents of the real front-buffer. This ensures correct operation of - * applications that call glXWaitX before calling glDrawBuffer. - */ - if (have_fake_front) { - BoxRec box; - RegionRec region; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pPriv->width; - box.y2 = pPriv->height; - REGION_INIT(pDraw->pScreen, ®ion, &box, 0); - - DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft, - DRI2BufferFrontLeft); - } - - return pPriv->buffers; -} - -DRI2BufferPtr * -DRI2GetBuffers(DrawablePtr pDraw, int *width, int *height, - unsigned int *attachments, int count, int *out_count) -{ - return do_get_buffers(pDraw, width, height, attachments, count, - out_count, FALSE); -} - -DRI2BufferPtr * -DRI2GetBuffersWithFormat(DrawablePtr pDraw, int *width, int *height, - unsigned int *attachments, int count, int *out_count) -{ - return do_get_buffers(pDraw, width, height, attachments, count, - out_count, TRUE); -} - -/* - * In the direct rendered case, we throttle the clients that have more - * than their share of outstanding swaps (and thus busy buffers) when a - * new GetBuffers request is received. In the AIGLX case, we allow the - * client to get the new buffers, but throttle when the next GLX request - * comes in (see __glXDRIcontextWait()). - */ -Bool -DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw) -{ - DRI2DrawablePtr pPriv; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - return FALSE; - - /* Throttle to swap limit */ - if ((pPriv->swapsPending >= pPriv->swap_limit) && - !pPriv->blockedClient) { - ResetCurrentRequest(client); - client->sequence--; - IgnoreClient(client); - pPriv->blockedClient = client; - return TRUE; - } - - return FALSE; -} - -void -DRI2BlockClient(ClientPtr client, DrawablePtr pDraw) -{ - DRI2DrawablePtr pPriv; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - return; - - if (pPriv->blockedClient == NULL) { - IgnoreClient(client); - pPriv->blockedClient = client; - } -} - -int -DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, - unsigned int dest, unsigned int src) -{ - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); - DRI2DrawablePtr pPriv; - DRI2BufferPtr pDestBuffer, pSrcBuffer; - int i; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - return BadDrawable; - - pDestBuffer = NULL; - pSrcBuffer = NULL; - for (i = 0; i < pPriv->bufferCount; i++) - { - if (pPriv->buffers[i]->attachment == dest) - pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i]; - if (pPriv->buffers[i]->attachment == src) - pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; - } - if (pSrcBuffer == NULL || pDestBuffer == NULL) - return BadValue; - - (*ds->CopyRegion)(pDraw, pRegion, pDestBuffer, pSrcBuffer); - - return Success; -} - -/* Can this drawable be page flipped? */ -Bool -DRI2CanFlip(DrawablePtr pDraw) -{ - ScreenPtr pScreen = pDraw->pScreen; - WindowPtr pWin, pRoot; - PixmapPtr pWinPixmap, pRootPixmap; - - if (pDraw->type == DRAWABLE_PIXMAP) - return TRUE; - - pRoot = WindowTable[pScreen->myNum]; - pRootPixmap = pScreen->GetWindowPixmap(pRoot); - - pWin = (WindowPtr) pDraw; - pWinPixmap = pScreen->GetWindowPixmap(pWin); - if (pRootPixmap != pWinPixmap) - return FALSE; - if (!REGION_EQUAL(pScreen, &pWin->clipList, &pRoot->winSize)) - return FALSE; - - return TRUE; -} - -/* Can we do a pixmap exchange instead of a blit? */ -Bool -DRI2CanExchange(DrawablePtr pDraw) -{ - return FALSE; -} - -void -DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame, - unsigned int tv_sec, unsigned int tv_usec) -{ - DRI2DrawablePtr pPriv; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - return; - - ProcDRI2WaitMSCReply(client, ((CARD64)tv_sec * 1000000) + tv_usec, - frame, pPriv->swap_count); - - if (pPriv->blockedClient) - AttendClient(pPriv->blockedClient); - - pPriv->blockedClient = NULL; -} - -static void -DRI2WakeClient(ClientPtr client, DrawablePtr pDraw, int frame, - unsigned int tv_sec, unsigned int tv_usec) -{ - ScreenPtr pScreen = pDraw->pScreen; - DRI2DrawablePtr pPriv; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: bad drawable\n", __func__); - return; - } - - /* - * Swap completed. Either wake up an SBC waiter or a client that was - * blocked due to GLX activity during a swap. - */ - if (pPriv->target_sbc != -1 && - pPriv->target_sbc >= pPriv->swap_count) { - ProcDRI2WaitMSCReply(client, ((CARD64)tv_sec * 1000000) + tv_usec, - frame, pPriv->swap_count); - pPriv->target_sbc = -1; - - AttendClient(pPriv->blockedClient); - pPriv->blockedClient = NULL; - } else if (pPriv->target_sbc == -1) { - if (pPriv->blockedClient) - AttendClient(pPriv->blockedClient); - pPriv->blockedClient = NULL; - } -} - -void -DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame, - unsigned int tv_sec, unsigned int tv_usec, int type, - DRI2SwapEventPtr swap_complete, void *swap_data) -{ - ScreenPtr pScreen = pDraw->pScreen; - DRI2DrawablePtr pPriv; - CARD64 ust = 0; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: bad drawable\n", __func__); - return; - } - - if (pPriv->refCount == 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: bad drawable refcount\n", __func__); - xfree(pPriv); - return; - } - - ust = ((CARD64)tv_sec * 1000000) + tv_usec; - if (swap_complete) - swap_complete(client, swap_data, type, ust, frame, pPriv->swap_count); - - pPriv->swapsPending--; - pPriv->swap_count++; - - DRI2WakeClient(client, pDraw, frame, tv_sec, tv_usec); -} - -Bool -DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable) -{ - DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable); - - /* If we're currently waiting for a swap on this drawable, reset - * the request and suspend the client. We only support one - * blocked client per drawable. */ - if ((pPriv->swapsPending) && - pPriv->blockedClient == NULL) { - ResetCurrentRequest(client); - client->sequence--; - DRI2BlockClient(client, pDrawable); - return TRUE; - } - - return FALSE; -} - -int -DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, - CARD64 divisor, CARD64 remainder, CARD64 *swap_target, - DRI2SwapEventPtr func, void *data) -{ - ScreenPtr pScreen = pDraw->pScreen; - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); - DRI2DrawablePtr pPriv; - DRI2BufferPtr pDestBuffer = NULL, pSrcBuffer = NULL; - CARD64 ust; - int ret, i; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: bad drawable\n", __func__); - return BadDrawable; - } - - for (i = 0; i < pPriv->bufferCount; i++) { - if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft) - pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i]; - if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft) - pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; - } - if (pSrcBuffer == NULL || pDestBuffer == NULL) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: drawable has no back or front?\n", __func__); - return BadDrawable; - } - - /* Old DDX, just blit */ - if (!ds->ScheduleSwap) { - BoxRec box; - RegionRec region; - - box.x1 = 0; - box.y1 = 0; - box.x2 = pDraw->width; - box.y2 = pDraw->height; - REGION_INIT(pScreen, ®ion, &box, 0); - - pPriv->swapsPending++; - - (*ds->CopyRegion)(pDraw, ®ion, pDestBuffer, pSrcBuffer); - DRI2SwapComplete(client, pDraw, target_msc, 0, 0, DRI2_BLIT_COMPLETE, - func, data); - return Success; - } - - /* - * In the simple glXSwapBuffers case, all params will be 0, and we just - * need to schedule a swap for the last swap target + the swap interval. - * If the last swap target hasn't been set yet, call into the driver - * to get the current count. - */ - if (target_msc == 0 && divisor == 0 && remainder == 0 && - pPriv->last_swap_target < 0) { - ret = (*ds->GetMSC)(pDraw, &ust, &target_msc); - if (!ret) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: driver failed to return current MSC\n", - __func__); - return BadDrawable; - } - } - - /* First swap needs to initialize last_swap_target */ - if (pPriv->last_swap_target < 0) - pPriv->last_swap_target = target_msc; - - /* - * Swap target for this swap is last swap target + swap interval since - * we have to account for the current swap count, interval, and the - * number of pending swaps. - */ - *swap_target = pPriv->last_swap_target + pPriv->swap_interval; - - ret = (*ds->ScheduleSwap)(client, pDraw, pDestBuffer, pSrcBuffer, - swap_target, divisor, remainder, func, data); - if (!ret) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: driver failed to schedule swap\n", __func__); - return BadDrawable; - } - - pPriv->swapsPending++; - pPriv->last_swap_target = *swap_target; - - return Success; -} - -void -DRI2SwapInterval(DrawablePtr pDrawable, int interval) -{ - DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable); - - /* fixme: check against arbitrary max? */ - - pPriv->swap_interval = interval; -} - -int -DRI2GetMSC(DrawablePtr pDraw, CARD64 *ust, CARD64 *msc, CARD64 *sbc) -{ - ScreenPtr pScreen = pDraw->pScreen; - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); - DRI2DrawablePtr pPriv; - Bool ret; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: bad drawable\n", __func__); - return BadDrawable; - } - - if (!ds->GetMSC) { - *ust = 0; - *msc = 0; - *sbc = pPriv->swap_count; - return Success; - } - - /* - * Spec needs to be updated to include unmapped or redirected - * drawables - */ - - ret = (*ds->GetMSC)(pDraw, ust, msc); - if (!ret) - return BadDrawable; - - *sbc = pPriv->swap_count; - - return Success; -} - -int -DRI2WaitMSC(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, - CARD64 divisor, CARD64 remainder) -{ - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); - DRI2DrawablePtr pPriv; - Bool ret; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - return BadDrawable; - - /* Old DDX just completes immediately */ - if (!ds->ScheduleWaitMSC) { - DRI2WaitMSCComplete(client, pDraw, target_msc, 0, 0); - - return Success; - } - - ret = (*ds->ScheduleWaitMSC)(client, pDraw, target_msc, divisor, remainder); - if (!ret) - return BadDrawable; - - return Success; -} - -int -DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc, - CARD64 *ust, CARD64 *msc, CARD64 *sbc) -{ - DRI2DrawablePtr pPriv; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - return BadDrawable; - - if (pPriv->swap_count >= target_sbc) - return Success; - - pPriv->target_sbc = target_sbc; - DRI2BlockClient(client, pDraw); - - return Success; -} - -void -DRI2DestroyDrawable(DrawablePtr pDraw) -{ - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); - DRI2DrawablePtr pPriv; - WindowPtr pWin; - PixmapPtr pPixmap; - - pPriv = DRI2GetDrawable(pDraw); - if (pPriv == NULL) - return; - - pPriv->refCount--; - if (pPriv->refCount > 0) - return; - - if (pPriv->buffers != NULL) { - int i; - - for (i = 0; i < pPriv->bufferCount; i++) - (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]); - - xfree(pPriv->buffers); - } - - /* If the window is destroyed while we have a swap pending, don't - * actually free the priv yet. We'll need it in the DRI2SwapComplete() - * callback and we'll free it there once we're done. */ - if (!pPriv->swapsPending) - xfree(pPriv); - - if (pDraw->type == DRAWABLE_WINDOW) - { - pWin = (WindowPtr) pDraw; - dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, NULL); - } - else - { - pPixmap = (PixmapPtr) pDraw; - dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL); - } -} - -Bool -DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, - const char **driverName, const char **deviceName) -{ - DRI2ScreenPtr ds = DRI2GetScreen(pScreen); - - if (ds == NULL) - return FALSE; - - if (driverType != DRI2DriverDRI) - return BadValue; - - *fd = ds->fd; - *driverName = ds->driverName; - *deviceName = ds->deviceName; - - return TRUE; -} - -Bool -DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic) -{ - DRI2ScreenPtr ds = DRI2GetScreen(pScreen); - - if (ds == NULL || drmAuthMagic(ds->fd, magic)) - return FALSE; - - return TRUE; -} - -Bool -DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) -{ - DRI2ScreenPtr ds; - - if (info->version < 3) - return FALSE; - - if (!xf86VGAarbiterAllowDRI(pScreen)) { - xf86DrvMsg(pScreen->myNum, X_WARNING, - "[DRI2] Direct rendering is not supported when VGA arb is necessary for the device\n"); - return FALSE; - } - - ds = xcalloc(1, sizeof *ds); - if (!ds) - return FALSE; - - ds->fd = info->fd; - ds->driverName = info->driverName; - ds->deviceName = info->deviceName; - - ds->CreateBuffer = info->CreateBuffer; - ds->DestroyBuffer = info->DestroyBuffer; - ds->CopyRegion = info->CopyRegion; - - if (info->version >= 4) { - ds->ScheduleSwap = info->ScheduleSwap; - ds->ScheduleWaitMSC = info->ScheduleWaitMSC; - ds->GetMSC = info->GetMSC; - } - - dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, ds); - - xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] Setup complete\n"); - - return TRUE; -} - -void -DRI2CloseScreen(ScreenPtr pScreen) -{ - DRI2ScreenPtr ds = DRI2GetScreen(pScreen); - - xfree(ds); - dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL); -} - -extern ExtensionModule dri2ExtensionModule; - -static pointer -DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - static Bool setupDone = FALSE; - - if (!setupDone) - { - setupDone = TRUE; - LoadExtension(&dri2ExtensionModule, FALSE); - } - else - { - if (errmaj) - *errmaj = LDR_ONCEONLY; - } - - return (pointer) 1; -} - -static XF86ModuleVersionInfo DRI2VersRec = -{ - "dri2", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 1, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_NONE, - { 0, 0, 0, 0 } -}; - -_X_EXPORT XF86ModuleData dri2ModuleData = { &DRI2VersRec, DRI2Setup, NULL }; - -void -DRI2Version(int *major, int *minor) -{ - if (major != NULL) - *major = DRI2VersRec.majorversion; - - if (minor != NULL) - *minor = DRI2VersRec.minorversion; -} +/*
+ * Copyright © 2007, 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), 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 Soft-
+ * ware 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 MERCHANTABIL-
+ * ITY, 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 CONSE-
+ * QUENTIAL 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 PERFOR-
+ * MANCE 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.
+ *
+ * Authors:
+ * Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <errno.h>
+#include <xf86drm.h>
+#include "xf86Module.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "dixstruct.h"
+#include "dri2.h"
+#include "xf86VGAarbiter.h"
+
+#include "xf86.h"
+
+static int dri2ScreenPrivateKeyIndex;
+static DevPrivateKey dri2ScreenPrivateKey = &dri2ScreenPrivateKeyIndex;
+static int dri2WindowPrivateKeyIndex;
+static DevPrivateKey dri2WindowPrivateKey = &dri2WindowPrivateKeyIndex;
+static int dri2PixmapPrivateKeyIndex;
+static DevPrivateKey dri2PixmapPrivateKey = &dri2PixmapPrivateKeyIndex;
+
+typedef struct _DRI2Drawable {
+ unsigned int refCount;
+ int width;
+ int height;
+ DRI2BufferPtr *buffers;
+ int bufferCount;
+ unsigned int swapsPending;
+ ClientPtr blockedClient;
+ int swap_interval;
+ CARD64 swap_count;
+ CARD64 target_sbc; /* -1 means no SBC wait outstanding */
+ CARD64 last_swap_target; /* most recently queued swap target */
+ int swap_limit; /* for N-buffering */
+} DRI2DrawableRec, *DRI2DrawablePtr;
+
+typedef struct _DRI2Screen *DRI2ScreenPtr;
+
+typedef struct _DRI2Screen {
+ unsigned int numDrivers;
+ const char **driverNames;
+ const char *deviceName;
+ int fd;
+ unsigned int lastSequence;
+
+ DRI2CreateBufferProcPtr CreateBuffer;
+ DRI2DestroyBufferProcPtr DestroyBuffer;
+ DRI2CopyRegionProcPtr CopyRegion;
+ DRI2ScheduleSwapProcPtr ScheduleSwap;
+ DRI2GetMSCProcPtr GetMSC;
+ DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
+
+ HandleExposuresProcPtr HandleExposures;
+} DRI2ScreenRec;
+
+static DRI2ScreenPtr
+DRI2GetScreen(ScreenPtr pScreen)
+{
+ return dixLookupPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey);
+}
+
+static DRI2DrawablePtr
+DRI2GetDrawable(DrawablePtr pDraw)
+{
+ WindowPtr pWin;
+ PixmapPtr pPixmap;
+
+ if (!pDraw)
+ return NULL;
+
+ if (pDraw->type == DRAWABLE_WINDOW)
+ {
+ pWin = (WindowPtr) pDraw;
+ return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey);
+ }
+ else
+ {
+ pPixmap = (PixmapPtr) pDraw;
+ return dixLookupPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey);
+ }
+}
+
+int
+DRI2CreateDrawable(DrawablePtr pDraw)
+{
+ WindowPtr pWin;
+ PixmapPtr pPixmap;
+ DRI2DrawablePtr pPriv;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv != NULL)
+ {
+ pPriv->refCount++;
+ return Success;
+ }
+
+ pPriv = xalloc(sizeof *pPriv);
+ if (pPriv == NULL)
+ return BadAlloc;
+
+ pPriv->refCount = 1;
+ pPriv->width = pDraw->width;
+ pPriv->height = pDraw->height;
+ pPriv->buffers = NULL;
+ pPriv->bufferCount = 0;
+ pPriv->swapsPending = 0;
+ pPriv->blockedClient = NULL;
+ pPriv->swap_count = 0;
+ pPriv->target_sbc = -1;
+ pPriv->swap_interval = 1;
+ pPriv->last_swap_target = -1;
+ pPriv->swap_limit = 1; /* default to double buffering */
+
+ if (pDraw->type == DRAWABLE_WINDOW)
+ {
+ pWin = (WindowPtr) pDraw;
+ dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv);
+ }
+ else
+ {
+ pPixmap = (PixmapPtr) pDraw;
+ dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv);
+ }
+
+ return Success;
+}
+
+static void
+DRI2FreeDrawable(DrawablePtr pDraw)
+{
+ DRI2DrawablePtr pPriv;
+ WindowPtr pWin;
+ PixmapPtr pPixmap;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return;
+
+ xfree(pPriv);
+
+ if (pDraw->type == DRAWABLE_WINDOW)
+ {
+ pWin = (WindowPtr) pDraw;
+ dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, NULL);
+ }
+ else
+ {
+ pPixmap = (PixmapPtr) pDraw;
+ dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL);
+ }
+}
+
+static int
+find_attachment(DRI2DrawablePtr pPriv, unsigned attachment)
+{
+ int i;
+
+ if (pPriv->buffers == NULL) {
+ return -1;
+ }
+
+ for (i = 0; i < pPriv->bufferCount; i++) {
+ if ((pPriv->buffers[i] != NULL)
+ && (pPriv->buffers[i]->attachment == attachment)) {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+static DRI2BufferPtr
+allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
+ DRI2DrawablePtr pPriv,
+ unsigned int attachment, unsigned int format,
+ int dimensions_match)
+{
+ DRI2BufferPtr buffer;
+ int old_buf;
+
+ old_buf = find_attachment(pPriv, attachment);
+
+ if ((old_buf < 0)
+ || !dimensions_match
+ || (pPriv->buffers[old_buf]->format != format)) {
+ buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+ } else {
+ buffer = pPriv->buffers[old_buf];
+ pPriv->buffers[old_buf] = NULL;
+ }
+
+ return buffer;
+}
+
+static DRI2BufferPtr *
+do_get_buffers(DrawablePtr pDraw, int *width, int *height,
+ unsigned int *attachments, int count, int *out_count,
+ int has_format)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
+ DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
+ DRI2BufferPtr *buffers;
+ int need_real_front = 0;
+ int need_fake_front = 0;
+ int have_fake_front = 0;
+ int front_format = 0;
+ int dimensions_match;
+ int i;
+
+ if (!pPriv) {
+ *width = pDraw->width;
+ *height = pDraw->height;
+ *out_count = 0;
+ return NULL;
+ }
+
+ dimensions_match = (pDraw->width == pPriv->width)
+ && (pDraw->height == pPriv->height);
+
+ buffers = xalloc((count + 1) * sizeof(buffers[0]));
+
+ for (i = 0; i < count; i++) {
+ const unsigned attachment = *(attachments++);
+ const unsigned format = (has_format) ? *(attachments++) : 0;
+
+ buffers[i] = allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment,
+ format, dimensions_match);
+
+ /* If the drawable is a window and the front-buffer is requested,
+ * silently add the fake front-buffer to the list of requested
+ * attachments. The counting logic in the loop accounts for the case
+ * where the client requests both the fake and real front-buffer.
+ */
+ if (attachment == DRI2BufferBackLeft) {
+ need_real_front++;
+ front_format = format;
+ }
+
+ if (attachment == DRI2BufferFrontLeft) {
+ need_real_front--;
+ front_format = format;
+
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ need_fake_front++;
+ }
+ }
+
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ if (attachment == DRI2BufferFakeFrontLeft) {
+ need_fake_front--;
+ have_fake_front = 1;
+ }
+ }
+ }
+
+ if (need_real_front > 0) {
+ buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv,
+ DRI2BufferFrontLeft,
+ front_format, dimensions_match);
+ }
+
+ if (need_fake_front > 0) {
+ buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv,
+ DRI2BufferFakeFrontLeft,
+ front_format, dimensions_match);
+ have_fake_front = 1;
+ }
+
+ *out_count = i;
+
+
+ if (pPriv->buffers != NULL) {
+ for (i = 0; i < pPriv->bufferCount; i++) {
+ if (pPriv->buffers[i] != NULL) {
+ (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]);
+ }
+ }
+
+ xfree(pPriv->buffers);
+ }
+
+ pPriv->buffers = buffers;
+ pPriv->bufferCount = *out_count;
+ pPriv->width = pDraw->width;
+ pPriv->height = pDraw->height;
+ *width = pPriv->width;
+ *height = pPriv->height;
+
+
+ /* If the client is getting a fake front-buffer, pre-fill it with the
+ * contents of the real front-buffer. This ensures correct operation of
+ * applications that call glXWaitX before calling glDrawBuffer.
+ */
+ if (have_fake_front) {
+ BoxRec box;
+ RegionRec region;
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pPriv->width;
+ box.y2 = pPriv->height;
+ REGION_INIT(pDraw->pScreen, ®ion, &box, 0);
+
+ DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft,
+ DRI2BufferFrontLeft);
+ }
+
+ return pPriv->buffers;
+}
+
+DRI2BufferPtr *
+DRI2GetBuffers(DrawablePtr pDraw, int *width, int *height,
+ unsigned int *attachments, int count, int *out_count)
+{
+ return do_get_buffers(pDraw, width, height, attachments, count,
+ out_count, FALSE);
+}
+
+DRI2BufferPtr *
+DRI2GetBuffersWithFormat(DrawablePtr pDraw, int *width, int *height,
+ unsigned int *attachments, int count, int *out_count)
+{
+ return do_get_buffers(pDraw, width, height, attachments, count,
+ out_count, TRUE);
+}
+
+/*
+ * In the direct rendered case, we throttle the clients that have more
+ * than their share of outstanding swaps (and thus busy buffers) when a
+ * new GetBuffers request is received. In the AIGLX case, we allow the
+ * client to get the new buffers, but throttle when the next GLX request
+ * comes in (see __glXDRIcontextWait()).
+ */
+Bool
+DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw)
+{
+ DRI2DrawablePtr pPriv;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return FALSE;
+
+ /* Throttle to swap limit */
+ if ((pPriv->swapsPending >= pPriv->swap_limit) &&
+ !pPriv->blockedClient) {
+ ResetCurrentRequest(client);
+ client->sequence--;
+ IgnoreClient(client);
+ pPriv->blockedClient = client;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void
+DRI2BlockClient(ClientPtr client, DrawablePtr pDraw)
+{
+ DRI2DrawablePtr pPriv;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return;
+
+ if (pPriv->blockedClient == NULL) {
+ IgnoreClient(client);
+ pPriv->blockedClient = client;
+ }
+}
+
+int
+DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
+ unsigned int dest, unsigned int src)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
+ DRI2DrawablePtr pPriv;
+ DRI2BufferPtr pDestBuffer, pSrcBuffer;
+ int i;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return BadDrawable;
+
+ pDestBuffer = NULL;
+ pSrcBuffer = NULL;
+ for (i = 0; i < pPriv->bufferCount; i++)
+ {
+ if (pPriv->buffers[i]->attachment == dest)
+ pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i];
+ if (pPriv->buffers[i]->attachment == src)
+ pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i];
+ }
+ if (pSrcBuffer == NULL || pDestBuffer == NULL)
+ return BadValue;
+
+ (*ds->CopyRegion)(pDraw, pRegion, pDestBuffer, pSrcBuffer);
+
+ return Success;
+}
+
+/* Can this drawable be page flipped? */
+Bool
+DRI2CanFlip(DrawablePtr pDraw)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ WindowPtr pWin, pRoot;
+ PixmapPtr pWinPixmap, pRootPixmap;
+
+ if (pDraw->type == DRAWABLE_PIXMAP)
+ return TRUE;
+
+ pRoot = WindowTable[pScreen->myNum];
+ pRootPixmap = pScreen->GetWindowPixmap(pRoot);
+
+ pWin = (WindowPtr) pDraw;
+ pWinPixmap = pScreen->GetWindowPixmap(pWin);
+ if (pRootPixmap != pWinPixmap)
+ return FALSE;
+ if (!REGION_EQUAL(pScreen, &pWin->clipList, &pRoot->winSize))
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Can we do a pixmap exchange instead of a blit? */
+Bool
+DRI2CanExchange(DrawablePtr pDraw)
+{
+ return FALSE;
+}
+
+void
+DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame,
+ unsigned int tv_sec, unsigned int tv_usec)
+{
+ DRI2DrawablePtr pPriv;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return;
+
+ ProcDRI2WaitMSCReply(client, ((CARD64)tv_sec * 1000000) + tv_usec,
+ frame, pPriv->swap_count);
+
+ if (pPriv->blockedClient)
+ AttendClient(pPriv->blockedClient);
+
+ pPriv->blockedClient = NULL;
+}
+
+static void
+DRI2WakeClient(ClientPtr client, DrawablePtr pDraw, int frame,
+ unsigned int tv_sec, unsigned int tv_usec)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ DRI2DrawablePtr pPriv;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: bad drawable\n", __func__);
+ return;
+ }
+
+ /*
+ * Swap completed. Either wake up an SBC waiter or a client that was
+ * blocked due to GLX activity during a swap.
+ */
+ if (pPriv->target_sbc != -1 &&
+ pPriv->target_sbc >= pPriv->swap_count) {
+ ProcDRI2WaitMSCReply(client, ((CARD64)tv_sec * 1000000) + tv_usec,
+ frame, pPriv->swap_count);
+ pPriv->target_sbc = -1;
+
+ AttendClient(pPriv->blockedClient);
+ pPriv->blockedClient = NULL;
+ } else if (pPriv->target_sbc == -1) {
+ if (pPriv->blockedClient)
+ AttendClient(pPriv->blockedClient);
+ pPriv->blockedClient = NULL;
+ }
+}
+
+void
+DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame,
+ unsigned int tv_sec, unsigned int tv_usec, int type,
+ DRI2SwapEventPtr swap_complete, void *swap_data)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ DRI2DrawablePtr pPriv;
+ CARD64 ust = 0;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: bad drawable\n", __func__);
+ return;
+ }
+
+ if (pPriv->refCount == 0) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: bad drawable refcount\n", __func__);
+ DRI2FreeDrawable(pDraw);
+ return;
+ }
+
+ ust = ((CARD64)tv_sec * 1000000) + tv_usec;
+ if (swap_complete)
+ swap_complete(client, swap_data, type, ust, frame, pPriv->swap_count);
+
+ pPriv->swapsPending--;
+ pPriv->swap_count++;
+
+ DRI2WakeClient(client, pDraw, frame, tv_sec, tv_usec);
+}
+
+Bool
+DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
+{
+ DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable);
+
+ /* If we're currently waiting for a swap on this drawable, reset
+ * the request and suspend the client. We only support one
+ * blocked client per drawable. */
+ if ((pPriv->swapsPending) &&
+ pPriv->blockedClient == NULL) {
+ ResetCurrentRequest(client);
+ client->sequence--;
+ DRI2BlockClient(client, pDrawable);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+int
+DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
+ CARD64 divisor, CARD64 remainder, CARD64 *swap_target,
+ DRI2SwapEventPtr func, void *data)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
+ DRI2DrawablePtr pPriv;
+ DRI2BufferPtr pDestBuffer = NULL, pSrcBuffer = NULL;
+ CARD64 ust;
+ int ret, i;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: bad drawable\n", __func__);
+ return BadDrawable;
+ }
+
+ for (i = 0; i < pPriv->bufferCount; i++) {
+ if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft)
+ pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i];
+ if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft)
+ pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i];
+ }
+ if (pSrcBuffer == NULL || pDestBuffer == NULL) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: drawable has no back or front?\n", __func__);
+ return BadDrawable;
+ }
+
+ /* Old DDX, just blit */
+ if (!ds->ScheduleSwap) {
+ BoxRec box;
+ RegionRec region;
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pDraw->width;
+ box.y2 = pDraw->height;
+ REGION_INIT(pScreen, ®ion, &box, 0);
+
+ pPriv->swapsPending++;
+
+ (*ds->CopyRegion)(pDraw, ®ion, pDestBuffer, pSrcBuffer);
+ DRI2SwapComplete(client, pDraw, target_msc, 0, 0, DRI2_BLIT_COMPLETE,
+ func, data);
+ return Success;
+ }
+
+ /*
+ * In the simple glXSwapBuffers case, all params will be 0, and we just
+ * need to schedule a swap for the last swap target + the swap interval.
+ * If the last swap target hasn't been set yet, call into the driver
+ * to get the current count.
+ */
+ if (target_msc == 0 && divisor == 0 && remainder == 0 &&
+ pPriv->last_swap_target < 0) {
+ ret = (*ds->GetMSC)(pDraw, &ust, &target_msc);
+ if (!ret) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: driver failed to return current MSC\n",
+ __func__);
+ return BadDrawable;
+ }
+ }
+
+ /* First swap needs to initialize last_swap_target */
+ if (pPriv->last_swap_target < 0)
+ pPriv->last_swap_target = target_msc;
+
+ /*
+ * Swap target for this swap is last swap target + swap interval since
+ * we have to account for the current swap count, interval, and the
+ * number of pending swaps.
+ */
+ *swap_target = pPriv->last_swap_target + pPriv->swap_interval;
+
+ ret = (*ds->ScheduleSwap)(client, pDraw, pDestBuffer, pSrcBuffer,
+ swap_target, divisor, remainder, func, data);
+ if (!ret) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: driver failed to schedule swap\n", __func__);
+ return BadDrawable;
+ }
+
+ pPriv->swapsPending++;
+ pPriv->last_swap_target = *swap_target;
+
+ return Success;
+}
+
+void
+DRI2SwapInterval(DrawablePtr pDrawable, int interval)
+{
+ DRI2DrawablePtr pPriv = DRI2GetDrawable(pDrawable);
+
+ /* fixme: check against arbitrary max? */
+
+ pPriv->swap_interval = interval;
+}
+
+int
+DRI2GetMSC(DrawablePtr pDraw, CARD64 *ust, CARD64 *msc, CARD64 *sbc)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
+ DRI2DrawablePtr pPriv;
+ Bool ret;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI2] %s: bad drawable\n", __func__);
+ return BadDrawable;
+ }
+
+ if (!ds->GetMSC) {
+ *ust = 0;
+ *msc = 0;
+ *sbc = pPriv->swap_count;
+ return Success;
+ }
+
+ /*
+ * Spec needs to be updated to include unmapped or redirected
+ * drawables
+ */
+
+ ret = (*ds->GetMSC)(pDraw, ust, msc);
+ if (!ret)
+ return BadDrawable;
+
+ *sbc = pPriv->swap_count;
+
+ return Success;
+}
+
+int
+DRI2WaitMSC(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
+ CARD64 divisor, CARD64 remainder)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
+ DRI2DrawablePtr pPriv;
+ Bool ret;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return BadDrawable;
+
+ /* Old DDX just completes immediately */
+ if (!ds->ScheduleWaitMSC) {
+ DRI2WaitMSCComplete(client, pDraw, target_msc, 0, 0);
+
+ return Success;
+ }
+
+ ret = (*ds->ScheduleWaitMSC)(client, pDraw, target_msc, divisor, remainder);
+ if (!ret)
+ return BadDrawable;
+
+ return Success;
+}
+
+int
+DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc,
+ CARD64 *ust, CARD64 *msc, CARD64 *sbc)
+{
+ DRI2DrawablePtr pPriv;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return BadDrawable;
+
+ if (pPriv->swap_count >= target_sbc)
+ return Success;
+
+ pPriv->target_sbc = target_sbc;
+ DRI2BlockClient(client, pDraw);
+
+ return Success;
+}
+
+void
+DRI2DestroyDrawable(DrawablePtr pDraw)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen);
+ DRI2DrawablePtr pPriv;
+
+ pPriv = DRI2GetDrawable(pDraw);
+ if (pPriv == NULL)
+ return;
+
+ pPriv->refCount--;
+ if (pPriv->refCount > 0)
+ return;
+
+ if (pPriv->buffers != NULL) {
+ int i;
+
+ for (i = 0; i < pPriv->bufferCount; i++)
+ (*ds->DestroyBuffer)(pDraw, pPriv->buffers[i]);
+
+ xfree(pPriv->buffers);
+ }
+
+ /* If the window is destroyed while we have a swap pending, don't
+ * actually free the priv yet. We'll need it in the DRI2SwapComplete()
+ * callback and we'll free it there once we're done. */
+ if (!pPriv->swapsPending)
+ DRI2FreeDrawable(pDraw);
+}
+
+Bool
+DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
+ const char **driverName, const char **deviceName)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+
+ if (ds == NULL || driverType >= ds->numDrivers ||
+ !ds->driverNames[driverType])
+ return FALSE;
+
+ *fd = ds->fd;
+ *driverName = ds->driverNames[driverType];
+ *deviceName = ds->deviceName;
+
+ return TRUE;
+}
+
+Bool
+DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+
+ if (ds == NULL || drmAuthMagic(ds->fd, magic))
+ return FALSE;
+
+ return TRUE;
+}
+
+Bool
+DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
+{
+ DRI2ScreenPtr ds;
+ const char* driverTypeNames[] = {
+ "DRI", /* DRI2DriverDRI */
+ "VDPAU", /* DRI2DriverVDPAU */
+ };
+ unsigned int i;
+
+ if (info->version < 3)
+ return FALSE;
+
+ if (!xf86VGAarbiterAllowDRI(pScreen)) {
+ xf86DrvMsg(pScreen->myNum, X_WARNING,
+ "[DRI2] Direct rendering is not supported when VGA arb is necessary for the device\n");
+ return FALSE;
+ }
+
+ ds = xcalloc(1, sizeof *ds);
+ if (!ds)
+ return FALSE;
+
+ ds->fd = info->fd;
+ ds->deviceName = info->deviceName;
+
+ ds->CreateBuffer = info->CreateBuffer;
+ ds->DestroyBuffer = info->DestroyBuffer;
+ ds->CopyRegion = info->CopyRegion;
+
+ if (info->version >= 4) {
+ ds->ScheduleSwap = info->ScheduleSwap;
+ ds->ScheduleWaitMSC = info->ScheduleWaitMSC;
+ ds->GetMSC = info->GetMSC;
+ }
+
+ if (info->version == 3 || info->numDrivers == 0) {
+ /* Driver too old: use the old-style driverName field */
+ ds->numDrivers = 1;
+ ds->driverNames = xalloc(sizeof(*ds->driverNames));
+ if (!ds->driverNames) {
+ xfree(ds);
+ return FALSE;
+ }
+ ds->driverNames[0] = info->driverName;
+ } else {
+ ds->numDrivers = info->numDrivers;
+ ds->driverNames = xalloc(info->numDrivers * sizeof(*ds->driverNames));
+ if (!ds->driverNames) {
+ xfree(ds);
+ return FALSE;
+ }
+ memcpy(ds->driverNames, info->driverNames,
+ info->numDrivers * sizeof(*ds->driverNames));
+ }
+
+ dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, ds);
+
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] Setup complete\n");
+ for (i = 0; i < sizeof(driverTypeNames) / sizeof(driverTypeNames[0]); i++) {
+ if (i < ds->numDrivers && ds->driverNames[i]) {
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] %s driver: %s\n",
+ driverTypeNames[i], ds->driverNames[i]);
+ }
+ }
+
+ return TRUE;
+}
+
+void
+DRI2CloseScreen(ScreenPtr pScreen)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+
+ xfree(ds->driverNames);
+ xfree(ds);
+ dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL);
+}
+
+extern ExtensionModule dri2ExtensionModule;
+
+static pointer
+DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+
+ if (!setupDone)
+ {
+ setupDone = TRUE;
+ LoadExtension(&dri2ExtensionModule, FALSE);
+ }
+ else
+ {
+ if (errmaj)
+ *errmaj = LDR_ONCEONLY;
+ }
+
+ return (pointer) 1;
+}
+
+static XF86ModuleVersionInfo DRI2VersRec =
+{
+ "dri2",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 2, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ { 0, 0, 0, 0 }
+};
+
+_X_EXPORT XF86ModuleData dri2ModuleData = { &DRI2VersRec, DRI2Setup, NULL };
+
+void
+DRI2Version(int *major, int *minor)
+{
+ if (major != NULL)
+ *major = DRI2VersRec.majorversion;
+
+ if (minor != NULL)
+ *minor = DRI2VersRec.minorversion;
+}
diff --git a/xorg-server/hw/xfree86/dri2/dri2.h b/xorg-server/hw/xfree86/dri2/dri2.h index dd59297df..cb818f898 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.h +++ b/xorg-server/hw/xfree86/dri2/dri2.h @@ -1,259 +1,268 @@ -/* - * Copyright © 2007 Red Hat, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Soft- - * ware"), 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 Soft- - * ware 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 MERCHANTABIL- - * ITY, 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 CONSE- - * QUENTIAL 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 PERFOR- - * MANCE 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. - * - * Authors: - * Kristian Høgsberg (krh@redhat.com) - */ - -#ifndef _DRI2_H_ -#define _DRI2_H_ - -#include <X11/extensions/dri2tokens.h> - -/* Version 2 structure (with format at the end) */ -typedef struct { - unsigned int attachment; - unsigned int name; - unsigned int pitch; - unsigned int cpp; - unsigned int flags; - unsigned int format; - void *driverPrivate; -} DRI2BufferRec, *DRI2BufferPtr; - -typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr; -typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type, - CARD64 ust, CARD64 msc, CARD64 sbc); - - -typedef DRI2BufferPtr (*DRI2CreateBuffersProcPtr)(DrawablePtr pDraw, - unsigned int *attachments, - int count); -typedef void (*DRI2DestroyBuffersProcPtr)(DrawablePtr pDraw, - DRI2BufferPtr buffers, - int count); -typedef void (*DRI2CopyRegionProcPtr)(DrawablePtr pDraw, - RegionPtr pRegion, - DRI2BufferPtr pDestBuffer, - DRI2BufferPtr pSrcBuffer); -typedef void (*DRI2WaitProcPtr)(WindowPtr pWin, - unsigned int sequence); -/** - * Schedule a buffer swap - * - * This callback is used to support glXSwapBuffers and the OML_sync_control - * extension (see it for a description of the params). - * - * Drivers should queue an event for the frame count that satisfies the - * parameters passed in. If the event is in the future (i.e. the conditions - * aren't currently satisfied), the server may block the client at the next - * GLX request using DRI2WaitSwap. When the event arrives, drivers should call - * \c DRI2SwapComplete, which will handle waking the client and returning - * the appropriate data. - * - * The DDX is responsible for doing a flip, exchange, or blit of the swap - * when the corresponding event arrives. The \c DRI2CanFlip and - * \c DRI2CanExchange functions can be used as helpers for this purpose. - * - * \param client client pointer (used for block/unblock) - * \param pDraw drawable whose count we want - * \param pDestBuffer current front buffer - * \param pSrcBuffer current back buffer - * \param target_msc frame count to wait for - * \param divisor divisor for condition equation - * \param remainder remainder for division equation - * \param func function to call when the swap completes - * \param data data for the callback \p func. - */ -typedef int (*DRI2ScheduleSwapProcPtr)(ClientPtr client, - DrawablePtr pDraw, - DRI2BufferPtr pDestBuffer, - DRI2BufferPtr pSrcBuffer, - CARD64 *target_msc, - CARD64 divisor, - CARD64 remainder, - DRI2SwapEventPtr func, - void *data); -typedef DRI2BufferPtr (*DRI2CreateBufferProcPtr)(DrawablePtr pDraw, - unsigned int attachment, - unsigned int format); -typedef void (*DRI2DestroyBufferProcPtr)(DrawablePtr pDraw, - DRI2BufferPtr buffer); -/** - * Get current media stamp counter values - * - * This callback is used to support the SGI_video_sync and OML_sync_control - * extensions. - * - * Drivers should return the current frame counter and the timestamp from - * when the returned frame count was last incremented. - * - * The count should correspond to the screen where the drawable is currently - * visible. If the drawable isn't visible (e.g. redirected), the server - * should return BadDrawable to the client, pending GLX spec updates to - * define this behavior. - * - * \param pDraw drawable whose count we want - * \param ust timestamp from when the count was last incremented. - * \param mst current frame count - */ -typedef int (*DRI2GetMSCProcPtr)(DrawablePtr pDraw, CARD64 *ust, - CARD64 *msc); -/** - * Schedule a frame count related wait - * - * This callback is used to support the SGI_video_sync and OML_sync_control - * extensions. See those specifications for details on how to handle - * the divisor and remainder parameters. - * - * Drivers should queue an event for the frame count that satisfies the - * parameters passed in. If the event is in the future (i.e. the conditions - * aren't currently satisfied), the driver should block the client using - * \c DRI2BlockClient. When the event arrives, drivers should call - * \c DRI2WaitMSCComplete, which will handle waking the client and returning - * the appropriate data. - * - * \param client client pointer (used for block/unblock) - * \param pDraw drawable whose count we want - * \param target_msc frame count to wait for - * \param divisor divisor for condition equation - * \param remainder remainder for division equation - */ -typedef int (*DRI2ScheduleWaitMSCProcPtr)(ClientPtr client, - DrawablePtr pDraw, - CARD64 target_msc, - CARD64 divisor, - CARD64 remainder); -/** - * Version of the DRI2InfoRec structure defined in this header - */ -#define DRI2INFOREC_VERSION 4 - -typedef struct { - unsigned int version; /**< Version of this struct */ - int fd; - const char *driverName; - const char *deviceName; - - DRI2CreateBufferProcPtr CreateBuffer; - DRI2DestroyBufferProcPtr DestroyBuffer; - DRI2CopyRegionProcPtr CopyRegion; - DRI2WaitProcPtr Wait; - DRI2ScheduleSwapProcPtr ScheduleSwap; - DRI2GetMSCProcPtr GetMSC; - DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; -} DRI2InfoRec, *DRI2InfoPtr; - -extern _X_EXPORT int DRI2EventBase; - -extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen, - DRI2InfoPtr info); - -extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen); - -extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen, - unsigned int driverType, - int *fd, - const char **driverName, - const char **deviceName); - -extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic); - -extern _X_EXPORT int DRI2CreateDrawable(DrawablePtr pDraw); - -extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw); - -extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw, - int *width, - int *height, - unsigned int *attachments, - int count, - int *out_count); - -extern _X_EXPORT int DRI2CopyRegion(DrawablePtr pDraw, - RegionPtr pRegion, - unsigned int dest, - unsigned int src); - -/** - * Determine the major and minor version of the DRI2 extension. - * - * Provides a mechanism to other modules (e.g., 2D drivers) to determine the - * version of the DRI2 extension. While it is possible to peek directly at - * the \c XF86ModuleData from a layered module, such a module will fail to - * load (due to an unresolved symbol) if the DRI2 extension is not loaded. - * - * \param major Location to store the major verion of the DRI2 extension - * \param minor Location to store the minor verion of the DRI2 extension - * - * \note - * This interface was added some time after the initial release of the DRI2 - * module. Layered modules that wish to use this interface must first test - * its existance by calling \c xf86LoaderCheckSymbol. - */ -extern _X_EXPORT void DRI2Version(int *major, int *minor); - -extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffersWithFormat(DrawablePtr pDraw, - int *width, int *height, unsigned int *attachments, int count, - int *out_count); - -extern _X_EXPORT void DRI2SwapInterval(DrawablePtr pDrawable, int interval); -extern _X_EXPORT int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDrawable, - CARD64 target_msc, CARD64 divisor, - CARD64 remainder, CARD64 *swap_target, - DRI2SwapEventPtr func, void *data); -extern _X_EXPORT Bool DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable); - -extern _X_EXPORT int DRI2GetMSC(DrawablePtr pDrawable, CARD64 *ust, - CARD64 *msc, CARD64 *sbc); -extern _X_EXPORT int DRI2WaitMSC(ClientPtr client, DrawablePtr pDrawable, - CARD64 target_msc, CARD64 divisor, - CARD64 remainder); -extern _X_EXPORT int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust, - CARD64 msc, CARD64 sbc); -extern _X_EXPORT int DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, - CARD64 target_sbc, CARD64 *ust, CARD64 *msc, - CARD64 *sbc); -extern _X_EXPORT Bool DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw); - -extern _X_EXPORT Bool DRI2CanFlip(DrawablePtr pDraw); - -extern _X_EXPORT Bool DRI2CanExchange(DrawablePtr pDraw); - -extern _X_EXPORT void DRI2BlockClient(ClientPtr client, DrawablePtr pDraw); - -extern _X_EXPORT void DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, - int frame, unsigned int tv_sec, - unsigned int tv_usec, int type, - DRI2SwapEventPtr swap_complete, - void *swap_data); -extern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, - int frame, unsigned int tv_sec, - unsigned int tv_usec); - -#endif +/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), 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 Soft-
+ * ware 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 MERCHANTABIL-
+ * ITY, 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 CONSE-
+ * QUENTIAL 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 PERFOR-
+ * MANCE 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.
+ *
+ * Authors:
+ * Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_H_
+#define _DRI2_H_
+
+#include <X11/extensions/dri2tokens.h>
+
+/* Version 2 structure (with format at the end) */
+typedef struct {
+ unsigned int attachment;
+ unsigned int name;
+ unsigned int pitch;
+ unsigned int cpp;
+ unsigned int flags;
+ unsigned int format;
+ void *driverPrivate;
+} DRI2BufferRec, *DRI2BufferPtr;
+
+typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
+typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type,
+ CARD64 ust, CARD64 msc, CARD64 sbc);
+
+
+typedef DRI2BufferPtr (*DRI2CreateBuffersProcPtr)(DrawablePtr pDraw,
+ unsigned int *attachments,
+ int count);
+typedef void (*DRI2DestroyBuffersProcPtr)(DrawablePtr pDraw,
+ DRI2BufferPtr buffers,
+ int count);
+typedef void (*DRI2CopyRegionProcPtr)(DrawablePtr pDraw,
+ RegionPtr pRegion,
+ DRI2BufferPtr pDestBuffer,
+ DRI2BufferPtr pSrcBuffer);
+typedef void (*DRI2WaitProcPtr)(WindowPtr pWin,
+ unsigned int sequence);
+/**
+ * Schedule a buffer swap
+ *
+ * This callback is used to support glXSwapBuffers and the OML_sync_control
+ * extension (see it for a description of the params).
+ *
+ * Drivers should queue an event for the frame count that satisfies the
+ * parameters passed in. If the event is in the future (i.e. the conditions
+ * aren't currently satisfied), the server may block the client at the next
+ * GLX request using DRI2WaitSwap. When the event arrives, drivers should call
+ * \c DRI2SwapComplete, which will handle waking the client and returning
+ * the appropriate data.
+ *
+ * The DDX is responsible for doing a flip, exchange, or blit of the swap
+ * when the corresponding event arrives. The \c DRI2CanFlip and
+ * \c DRI2CanExchange functions can be used as helpers for this purpose.
+ *
+ * \param client client pointer (used for block/unblock)
+ * \param pDraw drawable whose count we want
+ * \param pDestBuffer current front buffer
+ * \param pSrcBuffer current back buffer
+ * \param target_msc frame count to wait for
+ * \param divisor divisor for condition equation
+ * \param remainder remainder for division equation
+ * \param func function to call when the swap completes
+ * \param data data for the callback \p func.
+ */
+typedef int (*DRI2ScheduleSwapProcPtr)(ClientPtr client,
+ DrawablePtr pDraw,
+ DRI2BufferPtr pDestBuffer,
+ DRI2BufferPtr pSrcBuffer,
+ CARD64 *target_msc,
+ CARD64 divisor,
+ CARD64 remainder,
+ DRI2SwapEventPtr func,
+ void *data);
+typedef DRI2BufferPtr (*DRI2CreateBufferProcPtr)(DrawablePtr pDraw,
+ unsigned int attachment,
+ unsigned int format);
+typedef void (*DRI2DestroyBufferProcPtr)(DrawablePtr pDraw,
+ DRI2BufferPtr buffer);
+/**
+ * Get current media stamp counter values
+ *
+ * This callback is used to support the SGI_video_sync and OML_sync_control
+ * extensions.
+ *
+ * Drivers should return the current frame counter and the timestamp from
+ * when the returned frame count was last incremented.
+ *
+ * The count should correspond to the screen where the drawable is currently
+ * visible. If the drawable isn't visible (e.g. redirected), the server
+ * should return BadDrawable to the client, pending GLX spec updates to
+ * define this behavior.
+ *
+ * \param pDraw drawable whose count we want
+ * \param ust timestamp from when the count was last incremented.
+ * \param mst current frame count
+ */
+typedef int (*DRI2GetMSCProcPtr)(DrawablePtr pDraw, CARD64 *ust,
+ CARD64 *msc);
+/**
+ * Schedule a frame count related wait
+ *
+ * This callback is used to support the SGI_video_sync and OML_sync_control
+ * extensions. See those specifications for details on how to handle
+ * the divisor and remainder parameters.
+ *
+ * Drivers should queue an event for the frame count that satisfies the
+ * parameters passed in. If the event is in the future (i.e. the conditions
+ * aren't currently satisfied), the driver should block the client using
+ * \c DRI2BlockClient. When the event arrives, drivers should call
+ * \c DRI2WaitMSCComplete, which will handle waking the client and returning
+ * the appropriate data.
+ *
+ * \param client client pointer (used for block/unblock)
+ * \param pDraw drawable whose count we want
+ * \param target_msc frame count to wait for
+ * \param divisor divisor for condition equation
+ * \param remainder remainder for division equation
+ */
+typedef int (*DRI2ScheduleWaitMSCProcPtr)(ClientPtr client,
+ DrawablePtr pDraw,
+ CARD64 target_msc,
+ CARD64 divisor,
+ CARD64 remainder);
+/**
+ * Version of the DRI2InfoRec structure defined in this header
+ */
+#define DRI2INFOREC_VERSION 4
+
+typedef struct {
+ unsigned int version; /**< Version of this struct */
+ int fd;
+ const char *driverName;
+ const char *deviceName;
+
+ DRI2CreateBufferProcPtr CreateBuffer;
+ DRI2DestroyBufferProcPtr DestroyBuffer;
+ DRI2CopyRegionProcPtr CopyRegion;
+ DRI2WaitProcPtr Wait;
+
+ /* added in version 4 */
+
+ DRI2ScheduleSwapProcPtr ScheduleSwap;
+ DRI2GetMSCProcPtr GetMSC;
+ DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
+
+ /* number of drivers in the driverNames array */
+ unsigned int numDrivers;
+ /* array of driver names, indexed by DRI2Driver* driver types */
+ /* a name of NULL means that driver is not supported */
+ const char * const *driverNames;
+} DRI2InfoRec, *DRI2InfoPtr;
+
+extern _X_EXPORT int DRI2EventBase;
+
+extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen,
+ DRI2InfoPtr info);
+
+extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen);
+
+extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen,
+ unsigned int driverType,
+ int *fd,
+ const char **driverName,
+ const char **deviceName);
+
+extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic);
+
+extern _X_EXPORT int DRI2CreateDrawable(DrawablePtr pDraw);
+
+extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw);
+
+extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
+ int *width,
+ int *height,
+ unsigned int *attachments,
+ int count,
+ int *out_count);
+
+extern _X_EXPORT int DRI2CopyRegion(DrawablePtr pDraw,
+ RegionPtr pRegion,
+ unsigned int dest,
+ unsigned int src);
+
+/**
+ * Determine the major and minor version of the DRI2 extension.
+ *
+ * Provides a mechanism to other modules (e.g., 2D drivers) to determine the
+ * version of the DRI2 extension. While it is possible to peek directly at
+ * the \c XF86ModuleData from a layered module, such a module will fail to
+ * load (due to an unresolved symbol) if the DRI2 extension is not loaded.
+ *
+ * \param major Location to store the major verion of the DRI2 extension
+ * \param minor Location to store the minor verion of the DRI2 extension
+ *
+ * \note
+ * This interface was added some time after the initial release of the DRI2
+ * module. Layered modules that wish to use this interface must first test
+ * its existance by calling \c xf86LoaderCheckSymbol.
+ */
+extern _X_EXPORT void DRI2Version(int *major, int *minor);
+
+extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffersWithFormat(DrawablePtr pDraw,
+ int *width, int *height, unsigned int *attachments, int count,
+ int *out_count);
+
+extern _X_EXPORT void DRI2SwapInterval(DrawablePtr pDrawable, int interval);
+extern _X_EXPORT int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDrawable,
+ CARD64 target_msc, CARD64 divisor,
+ CARD64 remainder, CARD64 *swap_target,
+ DRI2SwapEventPtr func, void *data);
+extern _X_EXPORT Bool DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable);
+
+extern _X_EXPORT int DRI2GetMSC(DrawablePtr pDrawable, CARD64 *ust,
+ CARD64 *msc, CARD64 *sbc);
+extern _X_EXPORT int DRI2WaitMSC(ClientPtr client, DrawablePtr pDrawable,
+ CARD64 target_msc, CARD64 divisor,
+ CARD64 remainder);
+extern _X_EXPORT int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust,
+ CARD64 msc, CARD64 sbc);
+extern _X_EXPORT int DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw,
+ CARD64 target_sbc, CARD64 *ust, CARD64 *msc,
+ CARD64 *sbc);
+extern _X_EXPORT Bool DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw);
+
+extern _X_EXPORT Bool DRI2CanFlip(DrawablePtr pDraw);
+
+extern _X_EXPORT Bool DRI2CanExchange(DrawablePtr pDraw);
+
+extern _X_EXPORT void DRI2BlockClient(ClientPtr client, DrawablePtr pDraw);
+
+extern _X_EXPORT void DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw,
+ int frame, unsigned int tv_sec,
+ unsigned int tv_usec, int type,
+ DRI2SwapEventPtr swap_complete,
+ void *swap_data);
+extern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw,
+ int frame, unsigned int tv_sec,
+ unsigned int tv_usec);
+
+#endif
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index d015c6a77..cfe808e3e 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -1,3198 +1,3198 @@ -/* - * Copyright © 2006 Keith Packard - * Copyright © 2008 Red Hat, Inc. - * - * 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 name 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> -#else -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#endif - -#include <stddef.h> -#include <string.h> -#include <stdio.h> - -#include "xf86.h" -#include "xf86DDC.h" -#include "xf86Crtc.h" -#include "xf86Modes.h" -#include "xf86Priv.h" -#include "xf86RandR12.h" -#include "X11/extensions/render.h" -#include "X11/extensions/dpmsconst.h" -#include "X11/Xatom.h" -#ifdef RENDER -#include "picturestr.h" -#endif - -#include "xf86xv.h" - -/* - * Initialize xf86CrtcConfig structure - */ - -int xf86CrtcConfigPrivateIndex = -1; - -void -xf86CrtcConfigInit (ScrnInfoPtr scrn, - const xf86CrtcConfigFuncsRec *funcs) -{ - xf86CrtcConfigPtr config; - - if (xf86CrtcConfigPrivateIndex == -1) - xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); - config = xnfcalloc (1, sizeof (xf86CrtcConfigRec)); - - config->funcs = funcs; - - scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config; -} - -void -xf86CrtcSetSizeRange (ScrnInfoPtr scrn, - int minWidth, int minHeight, - int maxWidth, int maxHeight) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - config->minWidth = minWidth; - config->minHeight = minHeight; - config->maxWidth = maxWidth; - config->maxHeight = maxHeight; -} - -/* - * Crtc functions - */ -xf86CrtcPtr -xf86CrtcCreate (ScrnInfoPtr scrn, - const xf86CrtcFuncsRec *funcs) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CrtcPtr crtc, *crtcs; - - crtc = xcalloc (sizeof (xf86CrtcRec), 1); - if (!crtc) - return NULL; - crtc->version = XF86_CRTC_VERSION; - crtc->scrn = scrn; - crtc->funcs = funcs; -#ifdef RANDR_12_INTERFACE - crtc->randr_crtc = NULL; -#endif - crtc->rotation = RR_Rotate_0; - crtc->desiredRotation = RR_Rotate_0; - pixman_transform_init_identity (&crtc->crtc_to_framebuffer); - pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer); - pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc); - crtc->filter = NULL; - crtc->params = NULL; - crtc->nparams = 0; - crtc->filter_width = 0; - crtc->filter_height = 0; - crtc->transform_in_use = FALSE; - crtc->transformPresent = FALSE; - crtc->desiredTransformPresent = FALSE; - memset (&crtc->bounds, '\0', sizeof (crtc->bounds)); - - /* Preallocate gamma at a sensible size. */ - crtc->gamma_size = 256; - crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16)); - if (!crtc->gamma_red) { - xfree (crtc); - return NULL; - } - crtc->gamma_green = crtc->gamma_red + crtc->gamma_size; - crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size; - - if (xf86_config->crtc) - crtcs = xrealloc (xf86_config->crtc, - (xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); - else - crtcs = xalloc ((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); - if (!crtcs) - { - xfree (crtc); - return NULL; - } - xf86_config->crtc = crtcs; - xf86_config->crtc[xf86_config->num_crtc++] = crtc; - return crtc; -} - -void -xf86CrtcDestroy (xf86CrtcPtr crtc) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); - int c; - - (*crtc->funcs->destroy) (crtc); - for (c = 0; c < xf86_config->num_crtc; c++) - if (xf86_config->crtc[c] == crtc) - { - memmove (&xf86_config->crtc[c], - &xf86_config->crtc[c+1], - ((xf86_config->num_crtc - (c + 1)) * sizeof(void*))); - xf86_config->num_crtc--; - break; - } - if (crtc->params) - xfree (crtc->params); - free(crtc->gamma_red); - xfree (crtc); -} - - -/** - * Return whether any outputs are connected to the specified pipe - */ - -Bool -xf86CrtcInUse (xf86CrtcPtr crtc) -{ - ScrnInfoPtr pScrn = crtc->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int o; - - for (o = 0; o < xf86_config->num_output; o++) - if (xf86_config->output[o]->crtc == crtc) - return TRUE; - return FALSE; -} - -void -xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) -{ -#ifdef RENDER - int subpixel_order = SubPixelUnknown; - Bool has_none = FALSE; - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int c, o; - - for (c = 0; c < xf86_config->num_crtc; c++) - { - xf86CrtcPtr crtc = xf86_config->crtc[c]; - - for (o = 0; o < xf86_config->num_output; o++) - { - xf86OutputPtr output = xf86_config->output[o]; - - if (output->crtc == crtc) - { - switch (output->subpixel_order) { - case SubPixelNone: - has_none = TRUE; - break; - case SubPixelUnknown: - break; - default: - subpixel_order = output->subpixel_order; - break; - } - } - if (subpixel_order != SubPixelUnknown) - break; - } - if (subpixel_order != SubPixelUnknown) - { - static const int circle[4] = { - SubPixelHorizontalRGB, - SubPixelVerticalRGB, - SubPixelHorizontalBGR, - SubPixelVerticalBGR, - }; - int rotate; - int c; - for (rotate = 0; rotate < 4; rotate++) - if (crtc->rotation & (1 << rotate)) - break; - for (c = 0; c < 4; c++) - if (circle[c] == subpixel_order) - break; - c = (c + rotate) & 0x3; - if ((crtc->rotation & RR_Reflect_X) && !(c & 1)) - c ^= 2; - if ((crtc->rotation & RR_Reflect_Y) && (c & 1)) - c ^= 2; - subpixel_order = circle[c]; - break; - } - } - if (subpixel_order == SubPixelUnknown && has_none) - subpixel_order = SubPixelNone; - PictureSetSubpixelOrder (pScreen, subpixel_order); -#endif -} - -/** - * Sets the given video mode on the given crtc - */ -Bool -xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, - RRTransformPtr transform, int x, int y) -{ - ScrnInfoPtr scrn = crtc->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int i; - Bool ret = FALSE; - Bool didLock = FALSE; - DisplayModePtr adjusted_mode; - DisplayModeRec saved_mode; - int saved_x, saved_y; - Rotation saved_rotation; - RRTransformRec saved_transform; - Bool saved_transform_present; - - crtc->enabled = xf86CrtcInUse (crtc); - - /* We only hit this if someone explicitly sends a "disabled" modeset. */ - if (!crtc->enabled) - { - /* Check everything for stuff that should be off. */ - xf86DisableUnusedFunctions(scrn); - return TRUE; - } - - adjusted_mode = xf86DuplicateMode(mode); - - - saved_mode = crtc->mode; - saved_x = crtc->x; - saved_y = crtc->y; - saved_rotation = crtc->rotation; - if (crtc->transformPresent) { - RRTransformInit (&saved_transform); - RRTransformCopy (&saved_transform, &crtc->transform); - } - saved_transform_present = crtc->transformPresent; - - /* Update crtc values up front so the driver can rely on them for mode - * setting. - */ - crtc->mode = *mode; - crtc->x = x; - crtc->y = y; - crtc->rotation = rotation; - if (transform) { - RRTransformCopy (&crtc->transform, transform); - crtc->transformPresent = TRUE; - } else - crtc->transformPresent = FALSE; - - if (crtc->funcs->set_mode_major) { - ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y); - goto done; - } - - didLock = crtc->funcs->lock (crtc); - /* Pass our mode to the outputs and the CRTC to give them a chance to - * adjust it according to limitations or output properties, and also - * a chance to reject the mode entirely. - */ - for (i = 0; i < xf86_config->num_output; i++) { - xf86OutputPtr output = xf86_config->output[i]; - - if (output->crtc != crtc) - continue; - - if (!output->funcs->mode_fixup(output, mode, adjusted_mode)) { - goto done; - } - } - - if (!crtc->funcs->mode_fixup(crtc, mode, adjusted_mode)) { - goto done; - } - - if (!xf86CrtcRotate (crtc)) - goto done; - - /* Prepare the outputs and CRTCs before setting the mode. */ - for (i = 0; i < xf86_config->num_output; i++) { - xf86OutputPtr output = xf86_config->output[i]; - - if (output->crtc != crtc) - continue; - - /* Disable the output as the first thing we do. */ - output->funcs->prepare(output); - } - - crtc->funcs->prepare(crtc); - - /* Set up the DPLL and any output state that needs to adjust or depend - * on the DPLL. - */ - crtc->funcs->mode_set(crtc, mode, adjusted_mode, crtc->x, crtc->y); - for (i = 0; i < xf86_config->num_output; i++) - { - xf86OutputPtr output = xf86_config->output[i]; - if (output->crtc == crtc) - output->funcs->mode_set(output, mode, adjusted_mode); - } - - /* Only upload when needed, to avoid unneeded delays. */ - if (!crtc->active) - crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, - crtc->gamma_blue, crtc->gamma_size); - - /* Now, enable the clocks, plane, pipe, and outputs that we set up. */ - crtc->funcs->commit(crtc); - for (i = 0; i < xf86_config->num_output; i++) - { - xf86OutputPtr output = xf86_config->output[i]; - if (output->crtc == crtc) - output->funcs->commit(output); - } - - ret = TRUE; - -done: - if (ret) { - crtc->active = TRUE; - if (scrn->pScreen) - xf86CrtcSetScreenSubpixelOrder (scrn->pScreen); - } else { - crtc->x = saved_x; - crtc->y = saved_y; - crtc->rotation = saved_rotation; - crtc->mode = saved_mode; - if (saved_transform_present) - RRTransformCopy (&crtc->transform, &saved_transform); - crtc->transformPresent = saved_transform_present; - } - - if (adjusted_mode->name) - xfree(adjusted_mode->name); - xfree(adjusted_mode); - - if (didLock) - crtc->funcs->unlock (crtc); - - return ret; -} - -/** - * Sets the given video mode on the given crtc, but without providing - * a transform - */ -Bool -xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, - int x, int y) -{ - return xf86CrtcSetModeTransform (crtc, mode, rotation, NULL, x, y); -} - -/** - * Pans the screen, does not change the mode - */ -void -xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y) -{ - crtc->x = x; - crtc->y = y; - if (crtc->funcs->set_origin) { - if (!xf86CrtcRotate (crtc)) - return; - crtc->funcs->set_origin (crtc, x, y); - } - else - xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y); -} - -/* - * Output functions - */ - -extern XF86ConfigPtr xf86configptr; - -typedef enum { - OPTION_PREFERRED_MODE, - OPTION_POSITION, - OPTION_BELOW, - OPTION_RIGHT_OF, - OPTION_ABOVE, - OPTION_LEFT_OF, - OPTION_ENABLE, - OPTION_DISABLE, - OPTION_MIN_CLOCK, - OPTION_MAX_CLOCK, - OPTION_IGNORE, - OPTION_ROTATE, - OPTION_PANNING, - OPTION_PRIMARY, -} OutputOpts; - -static OptionInfoRec xf86OutputOptions[] = { - {OPTION_PREFERRED_MODE, "PreferredMode", OPTV_STRING, {0}, FALSE }, - {OPTION_POSITION, "Position", OPTV_STRING, {0}, FALSE }, - {OPTION_BELOW, "Below", OPTV_STRING, {0}, FALSE }, - {OPTION_RIGHT_OF, "RightOf", OPTV_STRING, {0}, FALSE }, - {OPTION_ABOVE, "Above", OPTV_STRING, {0}, FALSE }, - {OPTION_LEFT_OF, "LeftOf", OPTV_STRING, {0}, FALSE }, - {OPTION_ENABLE, "Enable", OPTV_BOOLEAN, {0}, FALSE }, - {OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE }, - {OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE }, - {OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE }, - {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE }, - {OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE }, - {OPTION_PANNING, "Panning", OPTV_STRING, {0}, FALSE }, - {OPTION_PRIMARY, "Primary", OPTV_BOOLEAN, {0}, FALSE }, - {-1, NULL, OPTV_NONE, {0}, FALSE }, -}; - -enum { - OPTION_MODEDEBUG, -}; - -static OptionInfoRec xf86DeviceOptions[] = { - {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE }, - {-1, NULL, OPTV_NONE, {0}, FALSE }, -}; - -static void -xf86OutputSetMonitor (xf86OutputPtr output) -{ - char *option_name; - static const char monitor_prefix[] = "monitor-"; - char *monitor; - - if (!output->name) - return; - - if (output->options) - xfree (output->options); - - output->options = xnfalloc (sizeof (xf86OutputOptions)); - memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions)); - - option_name = xnfalloc (strlen (monitor_prefix) + - strlen (output->name) + 1); - strcpy (option_name, monitor_prefix); - strcat (option_name, output->name); - monitor = xf86findOptionValue (output->scrn->options, option_name); - if (!monitor) - monitor = output->name; - else - xf86MarkOptionUsedByName (output->scrn->options, option_name); - xfree (option_name); - output->conf_monitor = xf86findMonitor (monitor, - xf86configptr->conf_monitor_lst); - /* - * Find the monitor section of the screen and use that - */ - if (!output->conf_monitor && output->use_screen_monitor) - output->conf_monitor = xf86findMonitor (output->scrn->monitor->id, - xf86configptr->conf_monitor_lst); - if (output->conf_monitor) - { - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s using monitor section %s\n", - output->name, output->conf_monitor->mon_identifier); - xf86ProcessOptions (output->scrn->scrnIndex, - output->conf_monitor->mon_option_lst, - output->options); - } - else - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s has no monitor section\n", - output->name); -} - -static Bool -xf86OutputEnabled (xf86OutputPtr output, Bool strict) -{ - Bool enable, disable; - - /* check to see if this output was enabled in the config file */ - if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable) - { - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s enabled by config file\n", output->name); - return TRUE; - } - /* or if this output was disabled in the config file */ - if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable) - { - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s disabled by config file\n", output->name); - return FALSE; - } - - /* If not, try to only light up the ones we know are connected */ - if (strict) { - enable = output->status == XF86OutputStatusConnected; - } - /* But if that fails, try to light up even outputs we're unsure of */ - else { - enable = output->status != XF86OutputStatusDisconnected; - } - - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s %sconnected\n", output->name, enable ? "" : "dis"); - return enable; -} - -static Bool -xf86OutputIgnored (xf86OutputPtr output) -{ - return xf86ReturnOptValBool (output->options, OPTION_IGNORE, FALSE); -} - -static char *direction[4] = { - "normal", - "left", - "inverted", - "right" -}; - -static Rotation -xf86OutputInitialRotation (xf86OutputPtr output) -{ - char *rotate_name = xf86GetOptValString (output->options, - OPTION_ROTATE); - int i; - - if (!rotate_name) - return RR_Rotate_0; - - for (i = 0; i < 4; i++) - if (xf86nameCompare (direction[i], rotate_name) == 0) - return (1 << i); - return RR_Rotate_0; -} - -xf86OutputPtr -xf86OutputCreate (ScrnInfoPtr scrn, - const xf86OutputFuncsRec *funcs, - const char *name) -{ - xf86OutputPtr output, *outputs; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int len; - Bool primary; - - if (name) - len = strlen (name) + 1; - else - len = 0; - - output = xcalloc (sizeof (xf86OutputRec) + len, 1); - if (!output) - return NULL; - output->scrn = scrn; - output->funcs = funcs; - if (name) - { - output->name = (char *) (output + 1); - strcpy (output->name, name); - } - output->subpixel_order = SubPixelUnknown; - /* - * Use the old per-screen monitor section for the first output - */ - output->use_screen_monitor = (xf86_config->num_output == 0); -#ifdef RANDR_12_INTERFACE - output->randr_output = NULL; -#endif - if (name) - { - xf86OutputSetMonitor (output); - if (xf86OutputIgnored (output)) - { - xfree (output); - return FALSE; - } - } - - - if (xf86_config->output) - outputs = xrealloc (xf86_config->output, - (xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); - else - outputs = xalloc ((xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); - if (!outputs) - { - xfree (output); - return NULL; - } - - xf86_config->output = outputs; - - if (xf86GetOptValBool (output->options, OPTION_PRIMARY, &primary) && primary) - { - memmove(xf86_config->output + 1, xf86_config->output, - xf86_config->num_output * sizeof (xf86OutputPtr)); - xf86_config->output[0] = output; - } - else - { - xf86_config->output[xf86_config->num_output] = output; - } - - xf86_config->num_output++; - - return output; -} - -Bool -xf86OutputRename (xf86OutputPtr output, const char *name) -{ - int len = strlen(name) + 1; - char *newname = xalloc (len); - - if (!newname) - return FALSE; /* so sorry... */ - - strcpy (newname, name); - if (output->name && output->name != (char *) (output + 1)) - xfree (output->name); - output->name = newname; - xf86OutputSetMonitor (output); - if (xf86OutputIgnored (output)) - return FALSE; - return TRUE; -} - -void -xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor) -{ - if (use_screen_monitor != output->use_screen_monitor) - { - output->use_screen_monitor = use_screen_monitor; - xf86OutputSetMonitor (output); - } -} - -void -xf86OutputDestroy (xf86OutputPtr output) -{ - ScrnInfoPtr scrn = output->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - (*output->funcs->destroy) (output); - while (output->probed_modes) - xf86DeleteMode (&output->probed_modes, output->probed_modes); - for (o = 0; o < xf86_config->num_output; o++) - if (xf86_config->output[o] == output) - { - memmove (&xf86_config->output[o], - &xf86_config->output[o+1], - ((xf86_config->num_output - (o + 1)) * sizeof(void*))); - xf86_config->num_output--; - break; - } - if (output->name && output->name != (char *) (output + 1)) - xfree (output->name); - xfree (output); -} - -/* - * Called during CreateScreenResources to hook up RandR - */ -static Bool -xf86CrtcCreateScreenResources (ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - screen->CreateScreenResources = config->CreateScreenResources; - - if (!(*screen->CreateScreenResources)(screen)) - return FALSE; - - if (!xf86RandR12CreateScreenResources (screen)) - return FALSE; - - return TRUE; -} - -/* - * Clean up config on server reset - */ -static Bool -xf86CrtcCloseScreen (int index, ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o, c; - - screen->CloseScreen = config->CloseScreen; - - xf86RotateCloseScreen (screen); - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - output->randr_output = NULL; - } - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - - crtc->randr_crtc = NULL; - } - return screen->CloseScreen (index, screen); -} - -/* - * Called at ScreenInit time to set up - */ -#ifdef RANDR_13_INTERFACE -int -#else -Bool -#endif -xf86CrtcScreenInit (ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c; - - /* Rotation */ - xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n"); - xf86DisableRandR(); /* Disable old RandR extension support */ - xf86RandR12Init (screen); - - /* support all rotations if every crtc has the shadow alloc funcs */ - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create) - break; - } - if (c == config->num_crtc) - { - xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 | - RR_Rotate_180 | RR_Rotate_270 | - RR_Reflect_X | RR_Reflect_Y); - xf86RandR12SetTransformSupport (screen, TRUE); - } - else - { - xf86RandR12SetRotations (screen, RR_Rotate_0); - xf86RandR12SetTransformSupport (screen, FALSE); - } - - /* Wrap CreateScreenResources so we can initialize the RandR code */ - config->CreateScreenResources = screen->CreateScreenResources; - screen->CreateScreenResources = xf86CrtcCreateScreenResources; - - config->CloseScreen = screen->CloseScreen; - screen->CloseScreen = xf86CrtcCloseScreen; - -#ifdef XFreeXDGA - _xf86_di_dga_init_internal(screen); -#endif -#ifdef RANDR_13_INTERFACE - return RANDR_INTERFACE_VERSION; -#else - return TRUE; -#endif -} - -static DisplayModePtr -xf86DefaultMode (xf86OutputPtr output, int width, int height) -{ - DisplayModePtr target_mode = NULL; - DisplayModePtr mode; - int target_diff = 0; - int target_preferred = 0; - int mm_height; - - mm_height = output->mm_height; - if (!mm_height) - mm_height = (768 * 25.4) / DEFAULT_DPI; - /* - * Pick a mode closest to DEFAULT_DPI - */ - for (mode = output->probed_modes; mode; mode = mode->next) - { - int dpi; - int preferred = (((mode->type & M_T_PREFERRED) != 0) + - ((mode->type & M_T_USERPREF) != 0)); - int diff; - - if (xf86ModeWidth (mode, output->initial_rotation) > width || - xf86ModeHeight (mode, output->initial_rotation) > height) - continue; - - /* yes, use VDisplay here, not xf86ModeHeight */ - dpi = (mode->VDisplay * 254) / (mm_height * 10); - diff = dpi - DEFAULT_DPI; - diff = diff < 0 ? -diff : diff; - if (target_mode == NULL || (preferred > target_preferred) || - (preferred == target_preferred && diff < target_diff)) - { - target_mode = mode; - target_diff = diff; - target_preferred = preferred; - } - } - return target_mode; -} - -static DisplayModePtr -xf86ClosestMode (xf86OutputPtr output, - DisplayModePtr match, Rotation match_rotation, - int width, int height) -{ - DisplayModePtr target_mode = NULL; - DisplayModePtr mode; - int target_diff = 0; - - /* - * Pick a mode closest to the specified mode - */ - for (mode = output->probed_modes; mode; mode = mode->next) - { - int dx, dy; - int diff; - - if (xf86ModeWidth (mode, output->initial_rotation) > width || - xf86ModeHeight (mode, output->initial_rotation) > height) - continue; - - /* exact matches are preferred */ - if (output->initial_rotation == match_rotation && - xf86ModesEqual (mode, match)) - return mode; - - dx = xf86ModeWidth (match, match_rotation) - xf86ModeWidth (mode, output->initial_rotation); - dy = xf86ModeHeight (match, match_rotation) - xf86ModeHeight (mode, output->initial_rotation); - diff = dx * dx + dy * dy; - if (target_mode == NULL || diff < target_diff) - { - target_mode = mode; - target_diff = diff; - } - } - return target_mode; -} - -static DisplayModePtr -xf86OutputHasPreferredMode (xf86OutputPtr output, int width, int height) -{ - DisplayModePtr mode; - - for (mode = output->probed_modes; mode; mode = mode->next) - { - if (xf86ModeWidth (mode, output->initial_rotation) > width || - xf86ModeHeight (mode, output->initial_rotation) > height) - continue; - - if (mode->type & M_T_PREFERRED) - return mode; - } - return NULL; -} - -static DisplayModePtr -xf86OutputHasUserPreferredMode (xf86OutputPtr output) -{ - DisplayModePtr mode, first = output->probed_modes; - - for (mode = first; mode && mode->next != first; mode = mode->next) - if (mode->type & M_T_USERPREF) - return mode; - - return NULL; -} - -static int -xf86PickCrtcs (ScrnInfoPtr scrn, - xf86CrtcPtr *best_crtcs, - DisplayModePtr *modes, - int n, - int width, - int height) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c, o; - xf86OutputPtr output; - xf86CrtcPtr crtc; - xf86CrtcPtr *crtcs; - xf86CrtcPtr best_crtc; - int best_score; - int score; - int my_score; - - if (n == config->num_output) - return 0; - output = config->output[n]; - - /* - * Compute score with this output disabled - */ - best_crtcs[n] = NULL; - best_crtc = NULL; - best_score = xf86PickCrtcs (scrn, best_crtcs, modes, n+1, width, height); - if (modes[n] == NULL) - return best_score; - - crtcs = xalloc (config->num_output * sizeof (xf86CrtcPtr)); - if (!crtcs) - return best_score; - - my_score = 1; - /* Score outputs that are known to be connected higher */ - if (output->status == XF86OutputStatusConnected) - my_score++; - /* Score outputs with preferred modes higher */ - if (xf86OutputHasPreferredMode (output, width, height)) - my_score++; - /* - * Select a crtc for this output and - * then attempt to configure the remaining - * outputs - */ - for (c = 0; c < config->num_crtc; c++) - { - if ((output->possible_crtcs & (1 << c)) == 0) - continue; - - crtc = config->crtc[c]; - /* - * Check to see if some other output is - * using this crtc - */ - for (o = 0; o < n; o++) - if (best_crtcs[o] == crtc) - break; - if (o < n) - { - /* - * If the two outputs desire the same mode, - * see if they can be cloned - */ - if (xf86ModesEqual (modes[o], modes[n]) && - config->output[o]->initial_rotation == config->output[n]->initial_rotation && - config->output[o]->initial_x == config->output[n]->initial_x && - config->output[o]->initial_y == config->output[n]->initial_y) - { - if ((output->possible_clones & (1 << o)) == 0) - continue; /* nope, try next CRTC */ - } - else - continue; /* different modes, can't clone */ - } - crtcs[n] = crtc; - memcpy (crtcs, best_crtcs, n * sizeof (xf86CrtcPtr)); - score = my_score + xf86PickCrtcs (scrn, crtcs, modes, n+1, width, height); - if (score > best_score) - { - best_crtc = crtc; - best_score = score; - memcpy (best_crtcs, crtcs, config->num_output * sizeof (xf86CrtcPtr)); - } - } - xfree (crtcs); - return best_score; -} - - -/* - * Compute the virtual size necessary to place all of the available - * crtcs in the specified configuration. - * - * canGrow indicates that the driver can make the screen larger than its initial - * configuration. If FALSE, this function will enlarge the screen to include - * the largest available mode. - */ - -static void -xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp, - Bool canGrow) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int width = 0, height = 0; - int o; - int c; - int s; - - for (c = 0; c < config->num_crtc; c++) - { - int crtc_width = 0, crtc_height = 0; - xf86CrtcPtr crtc = config->crtc[c]; - - if (crtc->enabled) - { - crtc_width = crtc->x + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation); - crtc_height = crtc->y + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation); - } - if (!canGrow) { - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - for (s = 0; s < config->num_crtc; s++) - if (output->possible_crtcs & (1 << s)) - { - DisplayModePtr mode; - for (mode = output->probed_modes; mode; mode = mode->next) - { - if (mode->HDisplay > crtc_width) - crtc_width = mode->HDisplay; - if (mode->VDisplay > crtc_width) - crtc_width = mode->VDisplay; - if (mode->VDisplay > crtc_height) - crtc_height = mode->VDisplay; - if (mode->HDisplay > crtc_height) - crtc_height = mode->HDisplay; - } - } - } - } - if (crtc_width > width) - width = crtc_width; - if (crtc_height > height) - height = crtc_height; - } - if (config->maxWidth && width > config->maxWidth) width = config->maxWidth; - if (config->maxHeight && height > config->maxHeight) height = config->maxHeight; - if (config->minWidth && width < config->minWidth) width = config->minWidth; - if (config->minHeight && height < config->minHeight) height = config->minHeight; - *widthp = width; - *heightp = height; -} - -#define POSITION_UNSET -100000 - -/* - * check if the user configured any outputs at all - * with either a position or a relative setting or a mode. - */ -static Bool -xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - Bool user_conf = FALSE; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - char *position; - char *relative_name; - OutputOpts relation; - int r; - static const OutputOpts relations[] = { - OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF - }; - - position = xf86GetOptValString (output->options, - OPTION_POSITION); - if (position) - user_conf = TRUE; - - relation = 0; - relative_name = NULL; - for (r = 0; r < 4; r++) - { - relation = relations[r]; - relative_name = xf86GetOptValString (output->options, - relation); - if (relative_name) - break; - } - if (relative_name) - user_conf = TRUE; - - modes[o] = xf86OutputHasUserPreferredMode(output); - if (modes[o]) - user_conf = TRUE; - } - - return user_conf; -} - -static Bool -xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - int min_x, min_y; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - output->initial_x = output->initial_y = POSITION_UNSET; - } - - /* - * Loop until all outputs are set - */ - for (;;) - { - Bool any_set = FALSE; - Bool keep_going = FALSE; - - for (o = 0; o < config->num_output; o++) - { - static const OutputOpts relations[] = { - OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF - }; - xf86OutputPtr output = config->output[o]; - xf86OutputPtr relative; - char *relative_name; - char *position; - OutputOpts relation; - int r; - - if (output->initial_x != POSITION_UNSET) - continue; - position = xf86GetOptValString (output->options, - OPTION_POSITION); - /* - * Absolute position wins - */ - if (position) - { - int x, y; - if (sscanf (position, "%d %d", &x, &y) == 2) - { - output->initial_x = x; - output->initial_y = y; - } - else - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Output %s position not of form \"x y\"\n", - output->name); - output->initial_x = output->initial_y = 0; - } - any_set = TRUE; - continue; - } - /* - * Next comes relative positions - */ - relation = 0; - relative_name = NULL; - for (r = 0; r < 4; r++) - { - relation = relations[r]; - relative_name = xf86GetOptValString (output->options, - relation); - if (relative_name) - break; - } - if (relative_name) - { - int or; - relative = NULL; - for (or = 0; or < config->num_output; or++) - { - xf86OutputPtr out_rel = config->output[or]; - XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor; - - if (rel_mon) - { - if (xf86nameCompare (rel_mon->mon_identifier, - relative_name) == 0) - { - relative = config->output[or]; - break; - } - } - if (strcmp (out_rel->name, relative_name) == 0) - { - relative = config->output[or]; - break; - } - } - if (!relative) - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Cannot position output %s relative to unknown output %s\n", - output->name, relative_name); - output->initial_x = 0; - output->initial_y = 0; - any_set = TRUE; - continue; - } - if (!modes[or]) - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Cannot position output %s relative to output %s without modes\n", - output->name, relative_name); - output->initial_x = 0; - output->initial_y = 0; - any_set = TRUE; - continue; - } - if (relative->initial_x == POSITION_UNSET) - { - keep_going = TRUE; - continue; - } - output->initial_x = relative->initial_x; - output->initial_y = relative->initial_y; - switch (relation) { - case OPTION_BELOW: - output->initial_y += xf86ModeHeight (modes[or], relative->initial_rotation); - break; - case OPTION_RIGHT_OF: - output->initial_x += xf86ModeWidth (modes[or], relative->initial_rotation); - break; - case OPTION_ABOVE: - if (modes[o]) - output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation); - break; - case OPTION_LEFT_OF: - if (modes[o]) - output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation); - break; - default: - break; - } - any_set = TRUE; - continue; - } - - /* Nothing set, just stick them at 0,0 */ - output->initial_x = 0; - output->initial_y = 0; - any_set = TRUE; - } - if (!keep_going) - break; - if (!any_set) - { - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - if (output->initial_x == POSITION_UNSET) - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Output position loop. Moving %s to 0,0\n", - output->name); - output->initial_x = output->initial_y = 0; - break; - } - } - } - } - - /* - * normalize positions - */ - min_x = 1000000; - min_y = 1000000; - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - if (output->initial_x < min_x) - min_x = output->initial_x; - if (output->initial_y < min_y) - min_y = output->initial_y; - } - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - output->initial_x -= min_x; - output->initial_y -= min_y; - } - return TRUE; -} - -static void -xf86InitialPanning (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - char *panning = xf86GetOptValString (output->options, OPTION_PANNING); - int width, height, left, top; - int track_width, track_height, track_left, track_top; - int brdr[4]; - - memset (&output->initialTotalArea, 0, sizeof(BoxRec)); - memset (&output->initialTrackingArea, 0, sizeof(BoxRec)); - memset (output->initialBorder, 0, 4*sizeof(INT16)); - - if (! panning) - continue; - - switch (sscanf (panning, "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d", - &width, &height, &left, &top, - &track_width, &track_height, &track_left, &track_top, - &brdr[0], &brdr[1], &brdr[2], &brdr[3])) { - case 12: - output->initialBorder[0] = brdr[0]; - output->initialBorder[1] = brdr[1]; - output->initialBorder[2] = brdr[2]; - output->initialBorder[3] = brdr[3]; - /* fall through */ - case 8: - output->initialTrackingArea.x1 = track_left; - output->initialTrackingArea.y1 = track_top; - output->initialTrackingArea.x2 = track_left + track_width; - output->initialTrackingArea.y2 = track_top + track_height; - /* fall through */ - case 4: - output->initialTotalArea.x1 = left; - output->initialTotalArea.y1 = top; - /* fall through */ - case 2: - output->initialTotalArea.x2 = output->initialTotalArea.x1 + width; - output->initialTotalArea.y2 = output->initialTotalArea.y1 + height; - break; - default: - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Broken panning specification '%s' for output %s in config file\n", - panning, output->name); - } - } -} - -/** Return - 0 + if a should be earlier, same or later than b in list - */ -static int -xf86ModeCompare (DisplayModePtr a, DisplayModePtr b) -{ - int diff; - - diff = ((b->type & M_T_PREFERRED) != 0) - ((a->type & M_T_PREFERRED) != 0); - if (diff) - return diff; - diff = b->HDisplay * b->VDisplay - a->HDisplay * a->VDisplay; - if (diff) - return diff; - diff = b->Clock - a->Clock; - return diff; -} - -/** - * Insertion sort input in-place and return the resulting head - */ -static DisplayModePtr -xf86SortModes (DisplayModePtr input) -{ - DisplayModePtr output = NULL, i, o, n, *op, prev; - - /* sort by preferred status and pixel area */ - while (input) - { - i = input; - input = input->next; - for (op = &output; (o = *op); op = &o->next) - if (xf86ModeCompare (o, i) > 0) - break; - i->next = *op; - *op = i; - } - /* prune identical modes */ - for (o = output; o && (n = o->next); o = n) - { - if (!strcmp (o->name, n->name) && xf86ModesEqual (o, n)) - { - o->next = n->next; - xfree (n->name); - xfree (n); - n = o; - } - } - /* hook up backward links */ - prev = NULL; - for (o = output; o; o = o->next) - { - o->prev = prev; - prev = o; - } - return output; -} - -static char * -preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output) -{ - char *preferred_mode = NULL; - - /* Check for a configured preference for a particular mode */ - preferred_mode = xf86GetOptValString (output->options, - OPTION_PREFERRED_MODE); - if (preferred_mode) - return preferred_mode; - - if (pScrn->display->modes && *pScrn->display->modes) - preferred_mode = *pScrn->display->modes; - - return preferred_mode; -} - -static void -GuessRangeFromModes(MonPtr mon, DisplayModePtr mode) -{ - if (!mon || !mode) - return; - - mon->nHsync = 1; - mon->hsync[0].lo = 1024.0; - mon->hsync[0].hi = 0.0; - - mon->nVrefresh = 1; - mon->vrefresh[0].lo = 1024.0; - mon->vrefresh[0].hi = 0.0; - - while (mode) { - if (!mode->HSync) - mode->HSync = ((float) mode->Clock ) / ((float) mode->HTotal); - - if (!mode->VRefresh) - mode->VRefresh = (1000.0 * ((float) mode->Clock)) / - ((float) (mode->HTotal * mode->VTotal)); - - if (mode->HSync < mon->hsync[0].lo) - mon->hsync[0].lo = mode->HSync; - - if (mode->HSync > mon->hsync[0].hi) - mon->hsync[0].hi = mode->HSync; - - if (mode->VRefresh < mon->vrefresh[0].lo) - mon->vrefresh[0].lo = mode->VRefresh; - - if (mode->VRefresh > mon->vrefresh[0].hi) - mon->vrefresh[0].hi = mode->VRefresh; - - mode = mode->next; - } - - /* stretch out the bottom to fit 640x480@60 */ - if (mon->hsync[0].lo > 31.0) - mon->hsync[0].lo = 31.0; - if (mon->vrefresh[0].lo > 58.0) - mon->vrefresh[0].lo = 58.0; -} - -struct det_monrec_parameter { - MonRec *mon_rec; - int *max_clock; - Bool set_hsync; - Bool set_vrefresh; - enum { sync_config, sync_edid, sync_default } *sync_source; -}; - -static void handle_detailed_monrec(struct detailed_monitor_section *det_mon, - void *data) -{ - enum { sync_config, sync_edid, sync_default }; - struct det_monrec_parameter *p; - p = (struct det_monrec_parameter *)data; - - if (det_mon->type == DS_RANGES) { - struct monitor_ranges *ranges = &det_mon->section.ranges; - if (p->set_hsync && ranges->max_h) { - p->mon_rec->hsync[p->mon_rec->nHsync].lo = ranges->min_h; - p->mon_rec->hsync[p->mon_rec->nHsync].hi = ranges->max_h; - p->mon_rec->nHsync++; - if (*p->sync_source == sync_default) - *p->sync_source = sync_edid; - } - if (p->set_vrefresh && ranges->max_v) { - p->mon_rec->vrefresh[p->mon_rec->nVrefresh].lo = ranges->min_v; - p->mon_rec->vrefresh[p->mon_rec->nVrefresh].hi = ranges->max_v; - p->mon_rec->nVrefresh++; - if (*p->sync_source == sync_default) - *p->sync_source = sync_edid; - } - if (ranges->max_clock * 1000 > *p->max_clock) - *p->max_clock = ranges->max_clock * 1000; - } -} - -void -xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - /* When canGrow was TRUE in the initial configuration we have to - * compare against the maximum values so that we don't drop modes. - * When canGrow was FALSE, the maximum values would have been clamped - * anyway. - */ - if (maxX == 0 || maxY == 0) { - maxX = config->maxWidth; - maxY = config->maxHeight; - } - - /* Probe the list of modes for each output. */ - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - DisplayModePtr mode; - DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL; - char *preferred_mode; - xf86MonPtr edid_monitor; - XF86ConfMonitorPtr conf_monitor; - MonRec mon_rec; - int min_clock = 0; - int max_clock = 0; - double clock; - Bool add_default_modes = TRUE; - Bool debug_modes = config->debug_modes || - xf86Initialising; - enum { sync_config, sync_edid, sync_default } sync_source = sync_default; - - while (output->probed_modes != NULL) - xf86DeleteMode(&output->probed_modes, output->probed_modes); - - /* - * Check connection status - */ - output->status = (*output->funcs->detect)(output); - - if (output->status == XF86OutputStatusDisconnected) - { - xf86OutputSetEDID (output, NULL); - continue; - } - - memset (&mon_rec, '\0', sizeof (mon_rec)); - - conf_monitor = output->conf_monitor; - - if (conf_monitor) - { - int i; - - for (i = 0; i < conf_monitor->mon_n_hsync; i++) - { - mon_rec.hsync[mon_rec.nHsync].lo = conf_monitor->mon_hsync[i].lo; - mon_rec.hsync[mon_rec.nHsync].hi = conf_monitor->mon_hsync[i].hi; - mon_rec.nHsync++; - sync_source = sync_config; - } - for (i = 0; i < conf_monitor->mon_n_vrefresh; i++) - { - mon_rec.vrefresh[mon_rec.nVrefresh].lo = conf_monitor->mon_vrefresh[i].lo; - mon_rec.vrefresh[mon_rec.nVrefresh].hi = conf_monitor->mon_vrefresh[i].hi; - mon_rec.nVrefresh++; - sync_source = sync_config; - } - config_modes = xf86GetMonitorModes (scrn, conf_monitor); - } - - output_modes = (*output->funcs->get_modes) (output); - - edid_monitor = output->MonInfo; - - if (edid_monitor) - { - struct det_monrec_parameter p; - struct disp_features *features = &edid_monitor->features; - - /* if display is not continuous-frequency, don't add default modes */ - if (!GTF_SUPPORTED(features->msc)) - add_default_modes = FALSE; - - p.mon_rec = &mon_rec; - p.max_clock = &max_clock; - p.set_hsync = mon_rec.nHsync == 0; - p.set_vrefresh = mon_rec.nVrefresh == 0; - p.sync_source = &sync_source; - - xf86ForEachDetailedBlock(edid_monitor, - handle_detailed_monrec, - &p); - } - - if (xf86GetOptValFreq (output->options, OPTION_MIN_CLOCK, - OPTUNITS_KHZ, &clock)) - min_clock = (int) clock; - if (xf86GetOptValFreq (output->options, OPTION_MAX_CLOCK, - OPTUNITS_KHZ, &clock)) - max_clock = (int) clock; - - /* If we still don't have a sync range, guess wildly */ - if (!mon_rec.nHsync || !mon_rec.nVrefresh) - GuessRangeFromModes(&mon_rec, output_modes); - - /* - * These limits will end up setting a 1024x768@60Hz mode by default, - * which seems like a fairly good mode to use when nothing else is - * specified - */ - if (mon_rec.nHsync == 0) - { - mon_rec.hsync[0].lo = 31.0; - mon_rec.hsync[0].hi = 55.0; - mon_rec.nHsync = 1; - } - if (mon_rec.nVrefresh == 0) - { - mon_rec.vrefresh[0].lo = 58.0; - mon_rec.vrefresh[0].hi = 62.0; - mon_rec.nVrefresh = 1; - } - - if (add_default_modes) - default_modes = xf86GetDefaultModes (); - - /* - * If this is not an RB monitor, remove RB modes from the default - * pool. RB modes from the config or the monitor itself are fine. - */ - if (!mon_rec.reducedblanking) - xf86ValidateModesReducedBlanking (scrn, default_modes); - - if (sync_source == sync_config) - { - /* - * Check output and config modes against sync range from config file - */ - xf86ValidateModesSync (scrn, output_modes, &mon_rec); - xf86ValidateModesSync (scrn, config_modes, &mon_rec); - } - /* - * Check default modes against sync range - */ - xf86ValidateModesSync (scrn, default_modes, &mon_rec); - /* - * Check default modes against monitor max clock - */ - if (max_clock) { - xf86ValidateModesClocks(scrn, default_modes, - &min_clock, &max_clock, 1); - xf86ValidateModesClocks(scrn, output_modes, - &min_clock, &max_clock, 1); - } - - output->probed_modes = NULL; - output->probed_modes = xf86ModesAdd (output->probed_modes, config_modes); - output->probed_modes = xf86ModesAdd (output->probed_modes, output_modes); - output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes); - - /* - * Check all modes against max size, interlace, and doublescan - */ - if (maxX && maxY) - xf86ValidateModesSize (scrn, output->probed_modes, - maxX, maxY, 0); - - { - int flags = (output->interlaceAllowed ? V_INTERLACE : 0) | - (output->doubleScanAllowed ? V_DBLSCAN : 0); - xf86ValidateModesFlags (scrn, output->probed_modes, flags); - } - - /* - * Check all modes against output - */ - for (mode = output->probed_modes; mode != NULL; mode = mode->next) - if (mode->status == MODE_OK) - mode->status = (*output->funcs->mode_valid)(output, mode); - - xf86PruneInvalidModes(scrn, &output->probed_modes, debug_modes); - - output->probed_modes = xf86SortModes (output->probed_modes); - - /* Check for a configured preference for a particular mode */ - preferred_mode = preferredMode(scrn, output); - - if (preferred_mode) - { - for (mode = output->probed_modes; mode; mode = mode->next) - { - if (!strcmp (preferred_mode, mode->name)) - { - if (mode != output->probed_modes) - { - if (mode->prev) - mode->prev->next = mode->next; - if (mode->next) - mode->next->prev = mode->prev; - mode->next = output->probed_modes; - output->probed_modes->prev = mode; - mode->prev = NULL; - output->probed_modes = mode; - } - mode->type |= (M_T_PREFERRED|M_T_USERPREF); - break; - } - } - } - - output->initial_rotation = xf86OutputInitialRotation (output); - - if (debug_modes) { - if (output->probed_modes != NULL) { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Printing probed modes for output %s\n", - output->name); - } else { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "No remaining probed modes for output %s\n", - output->name); - } - } - for (mode = output->probed_modes; mode != NULL; mode = mode->next) - { - /* The code to choose the best mode per pipe later on will require - * VRefresh to be set. - */ - mode->VRefresh = xf86ModeVRefresh(mode); - xf86SetModeCrtc(mode, INTERLACE_HALVE_V); - - if (debug_modes) - xf86PrintModeline(scrn->scrnIndex, mode); - } - } -} - - -/** - * Copy one of the output mode lists to the ScrnInfo record - */ - -/* XXX where does this function belong? Here? */ -void -xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y); - -static DisplayModePtr -biggestMode(DisplayModePtr a, DisplayModePtr b) -{ - int A, B; - - if (!a) - return b; - if (!b) - return a; - - A = a->HDisplay * a->VDisplay; - B = b->HDisplay * b->VDisplay; - - if (A > B) - return a; - - return b; -} - -static xf86OutputPtr -SetCompatOutput(xf86CrtcConfigPtr config) -{ - xf86OutputPtr output = NULL, test = NULL; - DisplayModePtr maxmode = NULL, testmode, mode; - int o, compat = -1, count, mincount = 0; - - /* Look for one that's definitely connected */ - for (o = 0; o < config->num_output; o++) - { - test = config->output[o]; - if (!test->crtc) - continue; - if (test->status != XF86OutputStatusConnected) - continue; - if (!test->probed_modes) - continue; - - testmode = mode = test->probed_modes; - for (count = 0; mode; mode = mode->next, count++) - testmode = biggestMode(testmode, mode); - - if (!output) { - output = test; - compat = o; - maxmode = testmode; - mincount = count; - } else if (maxmode == biggestMode(maxmode, testmode)) { - output = test; - compat = o; - maxmode = testmode; - mincount = count; - } else if ((maxmode->HDisplay == testmode->HDisplay) && - (maxmode->VDisplay == testmode->VDisplay) && - count <= mincount) { - output = test; - compat = o; - maxmode = testmode; - mincount = count; - } - } - - /* If we didn't find one, take anything we can get */ - if (!output) - { - for (o = 0; o < config->num_output; o++) - { - test = config->output[o]; - if (!test->crtc) - continue; - if (!test->probed_modes) - continue; - - if (!output) { - output = test; - compat = o; - } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) { - output = test; - compat = o; - } - } - } - - if (compat >= 0) { - config->compat_output = compat; - } else { - /* Don't change the compat output when no valid outputs found */ - output = config->output[config->compat_output]; - } - - return output; -} - -void -xf86SetScrnInfoModes (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - xf86OutputPtr output; - xf86CrtcPtr crtc; - DisplayModePtr last, mode = NULL; - - output = SetCompatOutput(config); - - if (!output) - return; /* punt */ - - crtc = output->crtc; - - /* Clear any existing modes from scrn->modes */ - while (scrn->modes != NULL) - xf86DeleteMode(&scrn->modes, scrn->modes); - - /* Set scrn->modes to the mode list for the 'compat' output */ - scrn->modes = xf86DuplicateModes(scrn, output->probed_modes); - - if (crtc) { - for (mode = scrn->modes; mode; mode = mode->next) - if (xf86ModesEqual (mode, &crtc->desiredMode)) - break; - } - - if (scrn->modes != NULL) { - /* For some reason, scrn->modes is circular, unlike the other mode - * lists. How great is that? - */ - for (last = scrn->modes; last && last->next; last = last->next) - ; - last->next = scrn->modes; - scrn->modes->prev = last; - if (mode) { - while (scrn->modes != mode) - scrn->modes = scrn->modes->next; - } - } - scrn->currentMode = scrn->modes; -#ifdef XFreeXDGA - if (scrn->pScreen) - _xf86_di_dga_reinit_internal(scrn->pScreen); -#endif -} - -static void -xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - Bool *enabled) -{ - Bool any_enabled = FALSE; - int o; - - for (o = 0; o < config->num_output; o++) - any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE); - - if (!any_enabled) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "No outputs definitely connected, trying again...\n"); - - for (o = 0; o < config->num_output; o++) - enabled[o] = xf86OutputEnabled(config->output[o], FALSE); - } -} - -static Bool -nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index) -{ - int o = *index; - - for (o++; o < config->num_output; o++) { - if (enabled[o]) { - *index = o; - return TRUE; - } - } - - return FALSE; -} - -static Bool -aspectMatch(float a, float b) -{ - return fabs(1 - (a / b)) < 0.05; -} - -static DisplayModePtr -nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect) -{ - DisplayModePtr m = NULL; - - if (!o) - return NULL; - - if (!last) - m = o->probed_modes; - else - m = last->next; - - for (; m; m = m->next) - if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay)) - return m; - - return NULL; -} - -static DisplayModePtr -bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) -{ - int o = -1, p; - DisplayModePtr mode = NULL, test = NULL, match = NULL; - - if (!nextEnabledOutput(config, enabled, &o)) - return NULL; - while ((mode = nextAspectMode(config->output[o], mode, aspect))) { - test = mode; - for (p = o; nextEnabledOutput(config, enabled, &p); ) { - test = xf86OutputFindClosestMode(config->output[p], mode); - if (!test) - break; - if (test->HDisplay != mode->HDisplay || - test->VDisplay != mode->VDisplay) { - test = NULL; - break; - } - } - - /* if we didn't match it on all outputs, try the next one */ - if (!test) - continue; - - /* if it's bigger than the last one, save it */ - if (!match || (test->HDisplay > match->HDisplay)) - match = test; - } - - /* return the biggest one found */ - return match; -} - -static Bool -xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - int o, p; - int max_pref_width = 0, max_pref_height = 0; - DisplayModePtr *preferred, *preferred_match; - Bool ret = FALSE; - - preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); - preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); - - /* Check if the preferred mode is available on all outputs */ - for (p = -1; nextEnabledOutput(config, enabled, &p); ) { - Rotation r = config->output[p]->initial_rotation; - DisplayModePtr mode; - if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p], - width, height))) { - int pref_width = xf86ModeWidth(preferred[p], r); - int pref_height = xf86ModeHeight(preferred[p], r); - Bool all_match = TRUE; - - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - Bool match = FALSE; - xf86OutputPtr output = config->output[o]; - if (o == p) - continue; - - for (mode = output->probed_modes; mode; mode = mode->next) { - Rotation r = output->initial_rotation; - if (xf86ModeWidth(mode, r) == pref_width && - xf86ModeHeight(mode, r) == pref_height) { - preferred[o] = mode; - match = TRUE; - } - } - - all_match &= match; - } - - if (all_match && - (pref_width*pref_height > max_pref_width*max_pref_height)) { - for (o = -1; nextEnabledOutput(config, enabled, &o); ) - preferred_match[o] = preferred[o]; - max_pref_width = pref_width; - max_pref_height = pref_height; - ret = TRUE; - } - } - } - - /* - * If there's no preferred mode, but only one monitor, pick the - * biggest mode for its aspect ratio, assuming one exists. - */ - if (!ret) do { - int i = 0; - float aspect = 0.0; - - /* count the number of enabled outputs */ - for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ; - - if (i != 1) - break; - - p = -1; - nextEnabledOutput(config, enabled, &p); - if (config->output[p]->mm_height) - aspect = (float)config->output[p]->mm_width / - (float)config->output[p]->mm_height; - - if (aspect) - preferred_match[p] = bestModeForAspect(config, enabled, aspect); - - if (preferred_match[p]) - ret = TRUE; - - } while (0); - - if (ret) { - /* oh good, there is a match. stash the selected modes and return. */ - memcpy(modes, preferred_match, - config->num_output * sizeof(DisplayModePtr)); - } - - xfree(preferred); - xfree(preferred_match); - return ret; -} - -static Bool -xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - int o; - float aspect = 0.0, *aspects; - xf86OutputPtr output; - Bool ret = FALSE; - DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL; - - aspects = xnfcalloc(config->num_output, sizeof(float)); - - /* collect the aspect ratios */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - output = config->output[o]; - if (output->mm_height) - aspects[o] = (float)output->mm_width / (float)output->mm_height; - else - aspects[o] = 4.0 / 3.0; - } - - /* check that they're all the same */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - output = config->output[o]; - if (!aspect) { - aspect = aspects[o]; - } else if (!aspectMatch(aspect, aspects[o])) { - goto no_aspect_match; - } - } - - /* if they're all 4:3, just skip ahead and save effort */ - if (!aspectMatch(aspect, 4.0/3.0)) - aspect_guess = bestModeForAspect(config, enabled, aspect); - -no_aspect_match: - base_guess = bestModeForAspect(config, enabled, 4.0/3.0); - - guess = biggestMode(base_guess, aspect_guess); - - if (!guess) - goto out; - - /* found a mode that works everywhere, now apply it */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - modes[o] = xf86OutputFindClosestMode(config->output[o], guess); - } - ret = TRUE; - -out: - xfree(aspects); - return ret; -} - -static Bool -xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - DisplayModePtr target_mode = NULL; - Rotation target_rotation = RR_Rotate_0; - DisplayModePtr default_mode; - int default_preferred, target_preferred = 0, o; - - /* User preferred > preferred > other modes */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - default_mode = xf86DefaultMode (config->output[o], width, height); - if (!default_mode) - continue; - - default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) + - ((default_mode->type & M_T_USERPREF) != 0)); - - if (default_preferred > target_preferred || !target_mode) { - target_mode = default_mode; - target_preferred = default_preferred; - target_rotation = config->output[o]->initial_rotation; - config->compat_output = o; - } - } - - if (target_mode) - modes[config->compat_output] = target_mode; - - /* Fill in other output modes */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - if (!modes[o]) - modes[o] = xf86ClosestMode(config->output[o], target_mode, - target_rotation, width, height); - } - - return (target_mode != NULL); -} - -static Bool -xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - int o; - - if (xf86UserConfiguredOutputs(scrn, modes)) - return xf86TargetFallback(scrn, config, modes, enabled, width, height); - - for (o = -1; nextEnabledOutput(config, enabled, &o); ) - if (xf86OutputHasUserPreferredMode(config->output[o])) - return - xf86TargetFallback(scrn, config, modes, enabled, width, height); - - return FALSE; -} - -static Bool -xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, - float gamma_blue) -{ - int i, size = 256; - CARD16 *red, *green, *blue; - - red = malloc(3 * size * sizeof(CARD16)); - green = red + size; - blue = green + size; - - /* Only cause warning if user wanted gamma to be set. */ - if (!crtc->funcs->gamma_set && (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) { - free(red); - return FALSE; - } else if (!crtc->funcs->gamma_set) { - free(red); - return TRUE; - } - - /* At this early stage none of the randr-interface stuff is up. - * So take the default gamma size for lack of something better. - */ - for (i = 0; i < size; i++) { - if (gamma_red == 1.0) - red[i] = i << 8; - else - red[i] = (CARD16)(pow((double)i/(double)(size - 1), - 1. / (double)gamma_red) * (double)(size - 1) * 256); - - if (gamma_green == 1.0) - green[i] = i << 8; - else - green[i] = (CARD16)(pow((double)i/(double)(size - 1), - 1. / (double)gamma_green) * (double)(size - 1) * 256); - - if (gamma_blue == 1.0) - blue[i] = i << 8; - else - blue[i] = (CARD16)(pow((double)i/(double)(size - 1), - 1. / (double)gamma_blue) * (double)(size - 1) * 256); - } - - /* Default size is 256, so anything else is failure. */ - if (size != crtc->gamma_size) { - free(red); - return FALSE; - } - - crtc->gamma_size = size; - memcpy (crtc->gamma_red, red, crtc->gamma_size * sizeof (CARD16)); - memcpy (crtc->gamma_green, green, crtc->gamma_size * sizeof (CARD16)); - memcpy (crtc->gamma_blue, blue, crtc->gamma_size * sizeof (CARD16)); - - /* Do not set gamma now, delay until the crtc is activated. */ - - free(red); - - return TRUE; -} - -static Bool -xf86OutputSetInitialGamma(xf86OutputPtr output) -{ - XF86ConfMonitorPtr mon = output->conf_monitor; - float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; - - if (!mon) - return TRUE; - - if (!output->crtc) - return FALSE; - - /* Get configured values, where they exist. */ - if (mon->mon_gamma_red >= GAMMA_MIN && - mon->mon_gamma_red <= GAMMA_MAX) - gamma_red = mon->mon_gamma_red; - - if (mon->mon_gamma_green >= GAMMA_MIN && - mon->mon_gamma_green <= GAMMA_MAX) - gamma_green = mon->mon_gamma_green; - - if (mon->mon_gamma_blue >= GAMMA_MIN && - mon->mon_gamma_blue <= GAMMA_MAX) - gamma_blue = mon->mon_gamma_blue; - - /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */ - if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { - xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", output->name, gamma_red, gamma_green, gamma_blue); - return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, gamma_blue); - }else - return TRUE; -} - -/** - * Construct default screen configuration - * - * Given auto-detected (and, eventually, configured) values, - * construct a usable configuration for the system - * - * canGrow indicates that the driver can resize the screen to larger than its - * initially configured size via the config->funcs->resize hook. If TRUE, this - * function will set virtualX and virtualY to match the initial configuration - * and leave config->max{Width,Height} alone. If FALSE, it will bloat - * virtual[XY] to include the largest modes and set config->max{Width,Height} - * accordingly. - */ - -Bool -xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o, c; - xf86CrtcPtr *crtcs; - DisplayModePtr *modes; - Bool *enabled; - int width, height; - int i = scrn->scrnIndex; - - /* Set up the device options */ - config->options = xnfalloc (sizeof (xf86DeviceOptions)); - memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions)); - xf86ProcessOptions (scrn->scrnIndex, - scrn->options, - config->options); - config->debug_modes = xf86ReturnOptValBool (config->options, - OPTION_MODEDEBUG, FALSE); - - if (scrn->display->virtualX) - width = scrn->display->virtualX; - else - width = config->maxWidth; - if (scrn->display->virtualY) - height = scrn->display->virtualY; - else - height = config->maxHeight; - - xf86ProbeOutputModes (scrn, width, height); - - crtcs = xnfcalloc (config->num_output, sizeof (xf86CrtcPtr)); - modes = xnfcalloc (config->num_output, sizeof (DisplayModePtr)); - enabled = xnfcalloc (config->num_output, sizeof (Bool)); - - xf86CollectEnabledOutputs(scrn, config, enabled); - - if (xf86TargetUserpref(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n"); - else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n"); - else if (xf86TargetAspect(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n"); - else if (xf86TargetFallback(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using sloppy heuristic for initial modes\n"); - else - xf86DrvMsg(i, X_WARNING, "Unable to find initial modes\n"); - - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - if (!modes[o]) - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Output %s enabled but has no modes\n", - config->output[o]->name); - else - xf86DrvMsg (scrn->scrnIndex, X_INFO, - "Output %s using initial mode %s\n", - config->output[o]->name, modes[o]->name); - } - - /* - * Set the position of each output - */ - if (!xf86InitialOutputPositions (scrn, modes)) - { - xfree (crtcs); - xfree (modes); - return FALSE; - } - - /* - * Set initial panning of each output - */ - xf86InitialPanning (scrn); - - /* - * Assign CRTCs to fit output configuration - */ - if (!xf86PickCrtcs (scrn, crtcs, modes, 0, width, height)) - { - xfree (crtcs); - xfree (modes); - return FALSE; - } - - /* XXX override xf86 common frame computation code */ - - scrn->display->frameX0 = 0; - scrn->display->frameY0 = 0; - - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - - crtc->enabled = FALSE; - memset (&crtc->desiredMode, '\0', sizeof (crtc->desiredMode)); - /* Set default gamma for all crtc's. */ - /* This is done to avoid problems later on with cloned outputs. */ - xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0); - } - - if (xf86_crtc_supports_gamma(scrn)) - xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n"); - - /* - * Set initial configuration - */ - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - DisplayModePtr mode = modes[o]; - xf86CrtcPtr crtc = crtcs[o]; - - if (mode && crtc) - { - crtc->desiredMode = *mode; - crtc->desiredRotation = output->initial_rotation; - crtc->desiredX = output->initial_x; - crtc->desiredY = output->initial_y; - crtc->desiredTransformPresent = FALSE; - crtc->enabled = TRUE; - memcpy (&crtc->panningTotalArea, &output->initialTotalArea, sizeof(BoxRec)); - memcpy (&crtc->panningTrackingArea, &output->initialTrackingArea, sizeof(BoxRec)); - memcpy (crtc->panningBorder, output->initialBorder, 4*sizeof(INT16)); - output->crtc = crtc; - if (!xf86OutputSetInitialGamma(output)) - xf86DrvMsg (scrn->scrnIndex, X_WARNING, "Initial gamma correction for output %s: failed.\n", output->name); - } else { - output->crtc = NULL; - } - } - - if (scrn->display->virtualX == 0) - { - /* - * Expand virtual size to cover the current config and potential mode - * switches, if the driver can't enlarge the screen later. - */ - xf86DefaultScreenLimits (scrn, &width, &height, canGrow); - - scrn->display->virtualX = width; - scrn->display->virtualY = height; - } - - if (width > scrn->virtualX) - scrn->virtualX = width; - if (height > scrn->virtualY) - scrn->virtualY = height; - - /* - * Make sure the configuration isn't too small. - */ - if (width < config->minWidth || height < config->minHeight) - return FALSE; - - /* - * Limit the crtc config to virtual[XY] if the driver can't grow the - * desktop. - */ - if (!canGrow) - { - xf86CrtcSetSizeRange (scrn, config->minWidth, config->minHeight, - width, height); - } - - /* Mirror output modes to scrn mode list */ - xf86SetScrnInfoModes (scrn); - - xfree (crtcs); - xfree (modes); - return TRUE; -} - -/* - * Check the CRTC we're going to map each output to vs. it's current - * CRTC. If they don't match, we have to disable the output and the CRTC - * since the driver will have to re-route things. - */ -static void -xf86PrepareOutputs (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - for (o = 0; o < config->num_output; o++) { - xf86OutputPtr output = config->output[o]; -#if RANDR_GET_CRTC_INTERFACE - /* Disable outputs that are unused or will be re-routed */ - if (!output->funcs->get_crtc || - output->crtc != (*output->funcs->get_crtc)(output) || - output->crtc == NULL) -#endif - (*output->funcs->dpms)(output, DPMSModeOff); - } -} - -static void -xf86PrepareCrtcs (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c; - - for (c = 0; c < config->num_crtc; c++) { -#if RANDR_GET_CRTC_INTERFACE - xf86CrtcPtr crtc = config->crtc[c]; - xf86OutputPtr output = NULL; - uint32_t desired_outputs = 0, current_outputs = 0; - int o; - - for (o = 0; o < config->num_output; o++) { - output = config->output[o]; - if (output->crtc == crtc) - desired_outputs |= (1<<o); - /* If we can't tell where it's mapped, force it off */ - if (!output->funcs->get_crtc) { - desired_outputs = 0; - break; - } - if ((*output->funcs->get_crtc)(output) == crtc) - current_outputs |= (1<<o); - } - - /* - * If mappings are different or the CRTC is unused, - * we need to disable it - */ - if (desired_outputs != current_outputs || - !desired_outputs) - (*crtc->funcs->dpms)(crtc, DPMSModeOff); -#else - (*crtc->funcs->dpms)(crtc, DPMSModeOff); -#endif - } -} - -/* - * Using the desired mode information in each crtc, set - * modes (used in EnterVT functions, or at server startup) - */ - -Bool -xf86SetDesiredModes (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CrtcPtr crtc = config->crtc[0]; - int c; - - /* A driver with this hook will take care of this */ - if (!crtc->funcs->set_mode_major) { - xf86PrepareOutputs(scrn); - xf86PrepareCrtcs(scrn); - } - - for (c = 0; c < config->num_crtc; c++) - { - xf86OutputPtr output = NULL; - int o; - RRTransformPtr transform; - - crtc = config->crtc[c]; - - /* Skip disabled CRTCs */ - if (!crtc->enabled) - continue; - - if (config->output[config->compat_output]->crtc == crtc) - output = config->output[config->compat_output]; - else - { - for (o = 0; o < config->num_output; o++) - if (config->output[o]->crtc == crtc) - { - output = config->output[o]; - break; - } - } - /* paranoia */ - if (!output) - continue; - - /* Mark that we'll need to re-set the mode for sure */ - memset(&crtc->mode, 0, sizeof(crtc->mode)); - if (!crtc->desiredMode.CrtcHDisplay) - { - DisplayModePtr mode = xf86OutputFindClosestMode (output, scrn->currentMode); - - if (!mode) - return FALSE; - crtc->desiredMode = *mode; - crtc->desiredRotation = RR_Rotate_0; - crtc->desiredTransformPresent = FALSE; - crtc->desiredX = 0; - crtc->desiredY = 0; - } - - if (crtc->desiredTransformPresent) - transform = &crtc->desiredTransform; - else - transform = NULL; - if (!xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation, - transform, crtc->desiredX, crtc->desiredY)) - return FALSE; - } - - xf86DisableUnusedFunctions(scrn); - return TRUE; -} - -/** - * In the current world order, there are lists of modes per output, which may - * or may not include the mode that was asked to be set by XFree86's mode - * selection. Find the closest one, in the following preference order: - * - * - Equality - * - Closer in size to the requested mode, but no larger - * - Closer in refresh rate to the requested mode. - */ - -DisplayModePtr -xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired) -{ - DisplayModePtr best = NULL, scan = NULL; - - for (scan = output->probed_modes; scan != NULL; scan = scan->next) - { - /* If there's an exact match, we're done. */ - if (xf86ModesEqual(scan, desired)) { - best = desired; - break; - } - - /* Reject if it's larger than the desired mode. */ - if (scan->HDisplay > desired->HDisplay || - scan->VDisplay > desired->VDisplay) - { - continue; - } - - /* - * If we haven't picked a best mode yet, use the first - * one in the size range - */ - if (best == NULL) - { - best = scan; - continue; - } - - /* Find if it's closer to the right size than the current best - * option. - */ - if ((scan->HDisplay > best->HDisplay && - scan->VDisplay >= best->VDisplay) || - (scan->HDisplay >= best->HDisplay && - scan->VDisplay > best->VDisplay)) - { - best = scan; - continue; - } - - /* Find if it's still closer to the right refresh than the current - * best resolution. - */ - if (scan->HDisplay == best->HDisplay && - scan->VDisplay == best->VDisplay && - (fabs(scan->VRefresh - desired->VRefresh) < - fabs(best->VRefresh - desired->VRefresh))) { - best = scan; - } - } - return best; -} - -/** - * When setting a mode through XFree86-VidModeExtension or XFree86-DGA, - * take the specified mode and apply it to the crtc connected to the compat - * output. Then, find similar modes for the other outputs, as with the - * InitialConfiguration code above. The goal is to clone the desired - * mode across all outputs that are currently active. - */ - -Bool -xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - Bool ok = TRUE; - xf86OutputPtr compat_output = config->output[config->compat_output]; - DisplayModePtr compat_mode; - int c; - - /* - * Let the compat output drive the final mode selection - */ - compat_mode = xf86OutputFindClosestMode (compat_output, desired); - if (compat_mode) - desired = compat_mode; - - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - DisplayModePtr crtc_mode = NULL; - int o; - - if (!crtc->enabled) - continue; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - DisplayModePtr output_mode; - - /* skip outputs not on this crtc */ - if (output->crtc != crtc) - continue; - - if (crtc_mode) - { - output_mode = xf86OutputFindClosestMode (output, crtc_mode); - if (output_mode != crtc_mode) - output->crtc = NULL; - } - else - crtc_mode = xf86OutputFindClosestMode (output, desired); - } - if (!crtc_mode) - { - crtc->enabled = FALSE; - continue; - } - if (!xf86CrtcSetModeTransform (crtc, crtc_mode, rotation, NULL, 0, 0)) - ok = FALSE; - else - { - crtc->desiredMode = *crtc_mode; - crtc->desiredRotation = rotation; - crtc->desiredTransformPresent = FALSE; - crtc->desiredX = 0; - crtc->desiredY = 0; - } - } - xf86DisableUnusedFunctions(pScrn); -#ifdef RANDR_12_INTERFACE - xf86RandR12TellChanged (pScrn->pScreen); -#endif - return ok; -} - - -/** - * Set the DPMS power mode of all outputs and CRTCs. - * - * If the new mode is off, it will turn off outputs and then CRTCs. - * Otherwise, it will affect CRTCs before outputs. - */ -void -xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int i; - - if (!scrn->vtSema) - return; - - if (mode == DPMSModeOff) { - for (i = 0; i < config->num_output; i++) { - xf86OutputPtr output = config->output[i]; - if (output->crtc != NULL) - (*output->funcs->dpms) (output, mode); - } - } - - for (i = 0; i < config->num_crtc; i++) { - xf86CrtcPtr crtc = config->crtc[i]; - if (crtc->enabled) - (*crtc->funcs->dpms) (crtc, mode); - } - - if (mode != DPMSModeOff) { - for (i = 0; i < config->num_output; i++) { - xf86OutputPtr output = config->output[i]; - if (output->crtc != NULL) - (*output->funcs->dpms) (output, mode); - } - } -} - -/** - * Implement the screensaver by just calling down into the driver DPMS hooks. - * - * Even for monitors with no DPMS support, by the definition of our DPMS hooks, - * the outputs will still get disabled (blanked). - */ -Bool -xf86SaveScreen(ScreenPtr pScreen, int mode) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - - if (xf86IsUnblank(mode)) - xf86DPMSSet(pScrn, DPMSModeOn, 0); - else - xf86DPMSSet(pScrn, DPMSModeOff, 0); - - return TRUE; -} - -/** - * Disable all inactive crtcs and outputs - */ -void -xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int o, c; - - for (o = 0; o < xf86_config->num_output; o++) - { - xf86OutputPtr output = xf86_config->output[o]; - if (!output->crtc) - (*output->funcs->dpms)(output, DPMSModeOff); - } - - for (c = 0; c < xf86_config->num_crtc; c++) - { - xf86CrtcPtr crtc = xf86_config->crtc[c]; - - if (!crtc->enabled) - { - crtc->funcs->dpms(crtc, DPMSModeOff); - memset(&crtc->mode, 0, sizeof(crtc->mode)); - xf86RotateDestroy(crtc); - crtc->active = FALSE; - } - } - if (pScrn->pScreen) - xf86_crtc_notify(pScrn->pScreen); -} - -#ifdef RANDR_12_INTERFACE - -#define EDID_ATOM_NAME "EDID" - -/** - * Set the RandR EDID property - */ -static void -xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len) -{ - Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE); - - /* This may get called before the RandR resources have been created */ - if (output->randr_output == NULL) - return; - - if (data_len != 0) { - RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8, - PropModeReplace, data_len, data, FALSE, TRUE); - } else { - RRDeleteOutputProperty(output->randr_output, edid_atom); - } -} - -#endif - -/* Pull out a phyiscal size from a detailed timing if available. */ -struct det_phySize_parameter { - xf86OutputPtr output; - ddc_quirk_t quirks; - Bool ret; -}; - -static void handle_detailed_physical_size(struct detailed_monitor_section - *det_mon, void *data) -{ - struct det_phySize_parameter *p; - p = (struct det_phySize_parameter *)data; - - if (p->ret == TRUE ) - return ; - - xf86DetTimingApplyQuirks(det_mon, p->quirks, - p->output->MonInfo->features.hsize, - p->output->MonInfo->features.vsize); - if (det_mon->type == DT && - det_mon->section.d_timings.h_size != 0 && - det_mon->section.d_timings.v_size != 0) { - - p->output->mm_width = det_mon->section.d_timings.h_size; - p->output->mm_height = det_mon->section.d_timings.v_size; - p->ret = TRUE; - } -} - -/** - * Set the EDID information for the specified output - */ -void -xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) -{ - ScrnInfoPtr scrn = output->scrn; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - Bool debug_modes = config->debug_modes || xf86Initialising; -#ifdef RANDR_12_INTERFACE - int size; -#endif - - if (output->MonInfo != NULL) - xfree(output->MonInfo); - - output->MonInfo = edid_mon; - - if (debug_modes) { - xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", - output->name); - xf86PrintEDID(edid_mon); - } - - /* Set the DDC properties for the 'compat' output */ - if (output == config->output[config->compat_output]) - xf86SetDDCproperties(scrn, edid_mon); - -#ifdef RANDR_12_INTERFACE - /* Set the RandR output properties */ - size = 0; - if (edid_mon) - { - if (edid_mon->ver.version == 1) { - size = 128; - if (edid_mon->flags & EDID_COMPLETE_RAWDATA) - size += edid_mon->no_sections * 128; - } else if (edid_mon->ver.version == 2) - size = 256; - } - xf86OutputSetEDIDProperty (output, edid_mon ? edid_mon->rawData : NULL, size); -#endif - - if (edid_mon) { - - struct det_phySize_parameter p; - p.output = output; - p.quirks = xf86DDCDetectQuirks(scrn->scrnIndex,edid_mon, FALSE); - p.ret = FALSE; - xf86ForEachDetailedBlock(edid_mon, - handle_detailed_physical_size, &p); - - /* if no mm size is available from a detailed timing, check the max size field */ - if ((!output->mm_width || !output->mm_height) && - (edid_mon->features.hsize && edid_mon->features.vsize)) - { - output->mm_width = edid_mon->features.hsize * 10; - output->mm_height = edid_mon->features.vsize * 10; - } - } -} - -/** - * Return the list of modes supported by the EDID information - * stored in 'output' - */ -DisplayModePtr -xf86OutputGetEDIDModes (xf86OutputPtr output) -{ - ScrnInfoPtr scrn = output->scrn; - xf86MonPtr edid_mon = output->MonInfo; - - if (!edid_mon) - return NULL; - return xf86DDCGetModes(scrn->scrnIndex, edid_mon); -} - -/* maybe we should care about DDC1? meh. */ -xf86MonPtr -xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) -{ - ScrnInfoPtr scrn = output->scrn; - xf86MonPtr mon; - - mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE); - if (mon) - xf86DDCApplyQuirks(scrn->scrnIndex, mon); - - return mon; -} - -static char *_xf86ConnectorNames[] = { - "None", "VGA", "DVI-I", "DVI-D", - "DVI-A", "Composite", "S-Video", - "Component", "LFP", "Proprietary", - "HDMI", "DisplayPort", - }; -char * -xf86ConnectorGetName(xf86ConnectorType connector) -{ - return _xf86ConnectorNames[connector]; -} - -static void -x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) -{ - dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1; - dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; - dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; - dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; - - if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2) - dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; -} - -static void -x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) -{ - if (crtc->enabled) { - crtc_box->x1 = crtc->x; - crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); - crtc_box->y1 = crtc->y; - crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); - } else - crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; -} - -static int -xf86_crtc_box_area(BoxPtr box) -{ - return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); -} - -/* - * Return the crtc covering 'box'. If two crtcs cover a portion of - * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc - * with greater coverage - */ - -static xf86CrtcPtr -xf86_covering_crtc(ScrnInfoPtr pScrn, - BoxPtr box, - xf86CrtcPtr desired, - BoxPtr crtc_box_ret) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - xf86CrtcPtr crtc, best_crtc; - int coverage, best_coverage; - int c; - BoxRec crtc_box, cover_box; - - best_crtc = NULL; - best_coverage = 0; - crtc_box_ret->x1 = 0; - crtc_box_ret->x2 = 0; - crtc_box_ret->y1 = 0; - crtc_box_ret->y2 = 0; - for (c = 0; c < xf86_config->num_crtc; c++) { - crtc = xf86_config->crtc[c]; - x86_crtc_box(crtc, &crtc_box); - x86_crtc_box_intersect(&cover_box, &crtc_box, box); - coverage = xf86_crtc_box_area(&cover_box); - if (coverage && crtc == desired) { - *crtc_box_ret = crtc_box; - return crtc; - } else if (coverage > best_coverage) { - *crtc_box_ret = crtc_box; - best_crtc = crtc; - best_coverage = coverage; - } - } - return best_crtc; -} - -/* - * For overlay video, compute the relevant CRTC and - * clip video to that. - * - * returning FALSE means there was a memory failure of some kind, - * not that the video shouldn't be displayed - */ - -Bool -xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, - xf86CrtcPtr *crtc_ret, - xf86CrtcPtr desired_crtc, - BoxPtr dst, - INT32 *xa, - INT32 *xb, - INT32 *ya, - INT32 *yb, - RegionPtr reg, - INT32 width, - INT32 height) -{ - Bool ret; - RegionRec crtc_region_local; - RegionPtr crtc_region = reg; - - if (crtc_ret) { - BoxRec crtc_box; - xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst, - desired_crtc, - &crtc_box); - - if (crtc) { - REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1); - crtc_region = &crtc_region_local; - REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg); - } - *crtc_ret = crtc; - } - - ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb, - crtc_region, width, height); - - if (crtc_region != reg) - REGION_UNINIT (pScreen, &crtc_region_local); - - return ret; -} - -xf86_crtc_notify_proc_ptr -xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new) -{ - if (xf86CrtcConfigPrivateIndex != -1) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - xf86_crtc_notify_proc_ptr old; - - old = config->xf86_crtc_notify; - config->xf86_crtc_notify = new; - return old; - } - return NULL; -} - -void -xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) -{ - if (xf86CrtcConfigPrivateIndex != -1) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - config->xf86_crtc_notify = old; - } -} - -void -xf86_crtc_notify(ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - if (config->xf86_crtc_notify) - config->xf86_crtc_notify(screen); -} - -Bool -xf86_crtc_supports_gamma(ScrnInfoPtr pScrn) -{ - if (xf86CrtcConfigPrivateIndex != -1) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - xf86CrtcPtr crtc; - - /* for multiple drivers loaded we need this */ - if (!xf86_config) - return FALSE; - if (xf86_config->num_crtc == 0) - return FALSE; - crtc = xf86_config->crtc[0]; - - return (crtc->funcs->gamma_set != NULL); - } - - return FALSE; -} +/*
+ * Copyright © 2006 Keith Packard
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * 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 name 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>
+#else
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "xf86.h"
+#include "xf86DDC.h"
+#include "xf86Crtc.h"
+#include "xf86Modes.h"
+#include "xf86Priv.h"
+#include "xf86RandR12.h"
+#include "X11/extensions/render.h"
+#include "X11/extensions/dpmsconst.h"
+#include "X11/Xatom.h"
+#ifdef RENDER
+#include "picturestr.h"
+#endif
+
+#include "xf86xv.h"
+
+/*
+ * Initialize xf86CrtcConfig structure
+ */
+
+int xf86CrtcConfigPrivateIndex = -1;
+
+void
+xf86CrtcConfigInit (ScrnInfoPtr scrn,
+ const xf86CrtcConfigFuncsRec *funcs)
+{
+ xf86CrtcConfigPtr config;
+
+ if (xf86CrtcConfigPrivateIndex == -1)
+ xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
+ config = xnfcalloc (1, sizeof (xf86CrtcConfigRec));
+
+ config->funcs = funcs;
+
+ scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config;
+}
+
+void
+xf86CrtcSetSizeRange (ScrnInfoPtr scrn,
+ int minWidth, int minHeight,
+ int maxWidth, int maxHeight)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ config->minWidth = minWidth;
+ config->minHeight = minHeight;
+ config->maxWidth = maxWidth;
+ config->maxHeight = maxHeight;
+}
+
+/*
+ * Crtc functions
+ */
+xf86CrtcPtr
+xf86CrtcCreate (ScrnInfoPtr scrn,
+ const xf86CrtcFuncsRec *funcs)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86CrtcPtr crtc, *crtcs;
+
+ crtc = xcalloc (sizeof (xf86CrtcRec), 1);
+ if (!crtc)
+ return NULL;
+ crtc->version = XF86_CRTC_VERSION;
+ crtc->scrn = scrn;
+ crtc->funcs = funcs;
+#ifdef RANDR_12_INTERFACE
+ crtc->randr_crtc = NULL;
+#endif
+ crtc->rotation = RR_Rotate_0;
+ crtc->desiredRotation = RR_Rotate_0;
+ pixman_transform_init_identity (&crtc->crtc_to_framebuffer);
+ pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer);
+ pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc);
+ crtc->filter = NULL;
+ crtc->params = NULL;
+ crtc->nparams = 0;
+ crtc->filter_width = 0;
+ crtc->filter_height = 0;
+ crtc->transform_in_use = FALSE;
+ crtc->transformPresent = FALSE;
+ crtc->desiredTransformPresent = FALSE;
+ memset (&crtc->bounds, '\0', sizeof (crtc->bounds));
+
+ /* Preallocate gamma at a sensible size. */
+ crtc->gamma_size = 256;
+ crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16));
+ if (!crtc->gamma_red) {
+ xfree (crtc);
+ return NULL;
+ }
+ crtc->gamma_green = crtc->gamma_red + crtc->gamma_size;
+ crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size;
+
+ if (xf86_config->crtc)
+ crtcs = xrealloc (xf86_config->crtc,
+ (xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
+ else
+ crtcs = xalloc ((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
+ if (!crtcs)
+ {
+ xfree (crtc);
+ return NULL;
+ }
+ xf86_config->crtc = crtcs;
+ xf86_config->crtc[xf86_config->num_crtc++] = crtc;
+ return crtc;
+}
+
+void
+xf86CrtcDestroy (xf86CrtcPtr crtc)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+ int c;
+
+ (*crtc->funcs->destroy) (crtc);
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ if (xf86_config->crtc[c] == crtc)
+ {
+ memmove (&xf86_config->crtc[c],
+ &xf86_config->crtc[c+1],
+ ((xf86_config->num_crtc - (c + 1)) * sizeof(void*)));
+ xf86_config->num_crtc--;
+ break;
+ }
+ if (crtc->params)
+ xfree (crtc->params);
+ free(crtc->gamma_red);
+ xfree (crtc);
+}
+
+
+/**
+ * Return whether any outputs are connected to the specified pipe
+ */
+
+Bool
+xf86CrtcInUse (xf86CrtcPtr crtc)
+{
+ ScrnInfoPtr pScrn = crtc->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int o;
+
+ for (o = 0; o < xf86_config->num_output; o++)
+ if (xf86_config->output[o]->crtc == crtc)
+ return TRUE;
+ return FALSE;
+}
+
+void
+xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen)
+{
+#ifdef RENDER
+ int subpixel_order = SubPixelUnknown;
+ Bool has_none = FALSE;
+ ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c, o;
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+ for (o = 0; o < xf86_config->num_output; o++)
+ {
+ xf86OutputPtr output = xf86_config->output[o];
+
+ if (output->crtc == crtc)
+ {
+ switch (output->subpixel_order) {
+ case SubPixelNone:
+ has_none = TRUE;
+ break;
+ case SubPixelUnknown:
+ break;
+ default:
+ subpixel_order = output->subpixel_order;
+ break;
+ }
+ }
+ if (subpixel_order != SubPixelUnknown)
+ break;
+ }
+ if (subpixel_order != SubPixelUnknown)
+ {
+ static const int circle[4] = {
+ SubPixelHorizontalRGB,
+ SubPixelVerticalRGB,
+ SubPixelHorizontalBGR,
+ SubPixelVerticalBGR,
+ };
+ int rotate;
+ int c;
+ for (rotate = 0; rotate < 4; rotate++)
+ if (crtc->rotation & (1 << rotate))
+ break;
+ for (c = 0; c < 4; c++)
+ if (circle[c] == subpixel_order)
+ break;
+ c = (c + rotate) & 0x3;
+ if ((crtc->rotation & RR_Reflect_X) && !(c & 1))
+ c ^= 2;
+ if ((crtc->rotation & RR_Reflect_Y) && (c & 1))
+ c ^= 2;
+ subpixel_order = circle[c];
+ break;
+ }
+ }
+ if (subpixel_order == SubPixelUnknown && has_none)
+ subpixel_order = SubPixelNone;
+ PictureSetSubpixelOrder (pScreen, subpixel_order);
+#endif
+}
+
+/**
+ * Sets the given video mode on the given crtc
+ */
+Bool
+xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ RRTransformPtr transform, int x, int y)
+{
+ ScrnInfoPtr scrn = crtc->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int i;
+ Bool ret = FALSE;
+ Bool didLock = FALSE;
+ DisplayModePtr adjusted_mode;
+ DisplayModeRec saved_mode;
+ int saved_x, saved_y;
+ Rotation saved_rotation;
+ RRTransformRec saved_transform;
+ Bool saved_transform_present;
+
+ crtc->enabled = xf86CrtcInUse (crtc);
+
+ /* We only hit this if someone explicitly sends a "disabled" modeset. */
+ if (!crtc->enabled)
+ {
+ /* Check everything for stuff that should be off. */
+ xf86DisableUnusedFunctions(scrn);
+ return TRUE;
+ }
+
+ adjusted_mode = xf86DuplicateMode(mode);
+
+
+ saved_mode = crtc->mode;
+ saved_x = crtc->x;
+ saved_y = crtc->y;
+ saved_rotation = crtc->rotation;
+ if (crtc->transformPresent) {
+ RRTransformInit (&saved_transform);
+ RRTransformCopy (&saved_transform, &crtc->transform);
+ }
+ saved_transform_present = crtc->transformPresent;
+
+ /* Update crtc values up front so the driver can rely on them for mode
+ * setting.
+ */
+ crtc->mode = *mode;
+ crtc->x = x;
+ crtc->y = y;
+ crtc->rotation = rotation;
+ if (transform) {
+ RRTransformCopy (&crtc->transform, transform);
+ crtc->transformPresent = TRUE;
+ } else
+ crtc->transformPresent = FALSE;
+
+ if (crtc->funcs->set_mode_major) {
+ ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
+ goto done;
+ }
+
+ didLock = crtc->funcs->lock (crtc);
+ /* Pass our mode to the outputs and the CRTC to give them a chance to
+ * adjust it according to limitations or output properties, and also
+ * a chance to reject the mode entirely.
+ */
+ for (i = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[i];
+
+ if (output->crtc != crtc)
+ continue;
+
+ if (!output->funcs->mode_fixup(output, mode, adjusted_mode)) {
+ goto done;
+ }
+ }
+
+ if (!crtc->funcs->mode_fixup(crtc, mode, adjusted_mode)) {
+ goto done;
+ }
+
+ if (!xf86CrtcRotate (crtc))
+ goto done;
+
+ /* Prepare the outputs and CRTCs before setting the mode. */
+ for (i = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[i];
+
+ if (output->crtc != crtc)
+ continue;
+
+ /* Disable the output as the first thing we do. */
+ output->funcs->prepare(output);
+ }
+
+ crtc->funcs->prepare(crtc);
+
+ /* Set up the DPLL and any output state that needs to adjust or depend
+ * on the DPLL.
+ */
+ crtc->funcs->mode_set(crtc, mode, adjusted_mode, crtc->x, crtc->y);
+ for (i = 0; i < xf86_config->num_output; i++)
+ {
+ xf86OutputPtr output = xf86_config->output[i];
+ if (output->crtc == crtc)
+ output->funcs->mode_set(output, mode, adjusted_mode);
+ }
+
+ /* Only upload when needed, to avoid unneeded delays. */
+ if (!crtc->active && crtc->funcs->gamma_set)
+ crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green,
+ crtc->gamma_blue, crtc->gamma_size);
+
+ /* Now, enable the clocks, plane, pipe, and outputs that we set up. */
+ crtc->funcs->commit(crtc);
+ for (i = 0; i < xf86_config->num_output; i++)
+ {
+ xf86OutputPtr output = xf86_config->output[i];
+ if (output->crtc == crtc)
+ output->funcs->commit(output);
+ }
+
+ ret = TRUE;
+
+done:
+ if (ret) {
+ crtc->active = TRUE;
+ if (scrn->pScreen)
+ xf86CrtcSetScreenSubpixelOrder (scrn->pScreen);
+ } else {
+ crtc->x = saved_x;
+ crtc->y = saved_y;
+ crtc->rotation = saved_rotation;
+ crtc->mode = saved_mode;
+ if (saved_transform_present)
+ RRTransformCopy (&crtc->transform, &saved_transform);
+ crtc->transformPresent = saved_transform_present;
+ }
+
+ if (adjusted_mode->name)
+ xfree(adjusted_mode->name);
+ xfree(adjusted_mode);
+
+ if (didLock)
+ crtc->funcs->unlock (crtc);
+
+ return ret;
+}
+
+/**
+ * Sets the given video mode on the given crtc, but without providing
+ * a transform
+ */
+Bool
+xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ int x, int y)
+{
+ return xf86CrtcSetModeTransform (crtc, mode, rotation, NULL, x, y);
+}
+
+/**
+ * Pans the screen, does not change the mode
+ */
+void
+xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y)
+{
+ crtc->x = x;
+ crtc->y = y;
+ if (crtc->funcs->set_origin) {
+ if (!xf86CrtcRotate (crtc))
+ return;
+ crtc->funcs->set_origin (crtc, x, y);
+ }
+ else
+ xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y);
+}
+
+/*
+ * Output functions
+ */
+
+extern XF86ConfigPtr xf86configptr;
+
+typedef enum {
+ OPTION_PREFERRED_MODE,
+ OPTION_POSITION,
+ OPTION_BELOW,
+ OPTION_RIGHT_OF,
+ OPTION_ABOVE,
+ OPTION_LEFT_OF,
+ OPTION_ENABLE,
+ OPTION_DISABLE,
+ OPTION_MIN_CLOCK,
+ OPTION_MAX_CLOCK,
+ OPTION_IGNORE,
+ OPTION_ROTATE,
+ OPTION_PANNING,
+ OPTION_PRIMARY,
+} OutputOpts;
+
+static OptionInfoRec xf86OutputOptions[] = {
+ {OPTION_PREFERRED_MODE, "PreferredMode", OPTV_STRING, {0}, FALSE },
+ {OPTION_POSITION, "Position", OPTV_STRING, {0}, FALSE },
+ {OPTION_BELOW, "Below", OPTV_STRING, {0}, FALSE },
+ {OPTION_RIGHT_OF, "RightOf", OPTV_STRING, {0}, FALSE },
+ {OPTION_ABOVE, "Above", OPTV_STRING, {0}, FALSE },
+ {OPTION_LEFT_OF, "LeftOf", OPTV_STRING, {0}, FALSE },
+ {OPTION_ENABLE, "Enable", OPTV_BOOLEAN, {0}, FALSE },
+ {OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE },
+ {OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE },
+ {OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE },
+ {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE },
+ {OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE },
+ {OPTION_PANNING, "Panning", OPTV_STRING, {0}, FALSE },
+ {OPTION_PRIMARY, "Primary", OPTV_BOOLEAN, {0}, FALSE },
+ {-1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+enum {
+ OPTION_MODEDEBUG,
+};
+
+static OptionInfoRec xf86DeviceOptions[] = {
+ {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE },
+ {-1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+static void
+xf86OutputSetMonitor (xf86OutputPtr output)
+{
+ char *option_name;
+ static const char monitor_prefix[] = "monitor-";
+ char *monitor;
+
+ if (!output->name)
+ return;
+
+ if (output->options)
+ xfree (output->options);
+
+ output->options = xnfalloc (sizeof (xf86OutputOptions));
+ memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions));
+
+ option_name = xnfalloc (strlen (monitor_prefix) +
+ strlen (output->name) + 1);
+ strcpy (option_name, monitor_prefix);
+ strcat (option_name, output->name);
+ monitor = xf86findOptionValue (output->scrn->options, option_name);
+ if (!monitor)
+ monitor = output->name;
+ else
+ xf86MarkOptionUsedByName (output->scrn->options, option_name);
+ xfree (option_name);
+ output->conf_monitor = xf86findMonitor (monitor,
+ xf86configptr->conf_monitor_lst);
+ /*
+ * Find the monitor section of the screen and use that
+ */
+ if (!output->conf_monitor && output->use_screen_monitor)
+ output->conf_monitor = xf86findMonitor (output->scrn->monitor->id,
+ xf86configptr->conf_monitor_lst);
+ if (output->conf_monitor)
+ {
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s using monitor section %s\n",
+ output->name, output->conf_monitor->mon_identifier);
+ xf86ProcessOptions (output->scrn->scrnIndex,
+ output->conf_monitor->mon_option_lst,
+ output->options);
+ }
+ else
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s has no monitor section\n",
+ output->name);
+}
+
+static Bool
+xf86OutputEnabled (xf86OutputPtr output, Bool strict)
+{
+ Bool enable, disable;
+
+ /* check to see if this output was enabled in the config file */
+ if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable)
+ {
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s enabled by config file\n", output->name);
+ return TRUE;
+ }
+ /* or if this output was disabled in the config file */
+ if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable)
+ {
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s disabled by config file\n", output->name);
+ return FALSE;
+ }
+
+ /* If not, try to only light up the ones we know are connected */
+ if (strict) {
+ enable = output->status == XF86OutputStatusConnected;
+ }
+ /* But if that fails, try to light up even outputs we're unsure of */
+ else {
+ enable = output->status != XF86OutputStatusDisconnected;
+ }
+
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s %sconnected\n", output->name, enable ? "" : "dis");
+ return enable;
+}
+
+static Bool
+xf86OutputIgnored (xf86OutputPtr output)
+{
+ return xf86ReturnOptValBool (output->options, OPTION_IGNORE, FALSE);
+}
+
+static char *direction[4] = {
+ "normal",
+ "left",
+ "inverted",
+ "right"
+};
+
+static Rotation
+xf86OutputInitialRotation (xf86OutputPtr output)
+{
+ char *rotate_name = xf86GetOptValString (output->options,
+ OPTION_ROTATE);
+ int i;
+
+ if (!rotate_name)
+ return RR_Rotate_0;
+
+ for (i = 0; i < 4; i++)
+ if (xf86nameCompare (direction[i], rotate_name) == 0)
+ return (1 << i);
+ return RR_Rotate_0;
+}
+
+xf86OutputPtr
+xf86OutputCreate (ScrnInfoPtr scrn,
+ const xf86OutputFuncsRec *funcs,
+ const char *name)
+{
+ xf86OutputPtr output, *outputs;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int len;
+ Bool primary;
+
+ if (name)
+ len = strlen (name) + 1;
+ else
+ len = 0;
+
+ output = xcalloc (sizeof (xf86OutputRec) + len, 1);
+ if (!output)
+ return NULL;
+ output->scrn = scrn;
+ output->funcs = funcs;
+ if (name)
+ {
+ output->name = (char *) (output + 1);
+ strcpy (output->name, name);
+ }
+ output->subpixel_order = SubPixelUnknown;
+ /*
+ * Use the old per-screen monitor section for the first output
+ */
+ output->use_screen_monitor = (xf86_config->num_output == 0);
+#ifdef RANDR_12_INTERFACE
+ output->randr_output = NULL;
+#endif
+ if (name)
+ {
+ xf86OutputSetMonitor (output);
+ if (xf86OutputIgnored (output))
+ {
+ xfree (output);
+ return FALSE;
+ }
+ }
+
+
+ if (xf86_config->output)
+ outputs = xrealloc (xf86_config->output,
+ (xf86_config->num_output + 1) * sizeof (xf86OutputPtr));
+ else
+ outputs = xalloc ((xf86_config->num_output + 1) * sizeof (xf86OutputPtr));
+ if (!outputs)
+ {
+ xfree (output);
+ return NULL;
+ }
+
+ xf86_config->output = outputs;
+
+ if (xf86GetOptValBool (output->options, OPTION_PRIMARY, &primary) && primary)
+ {
+ memmove(xf86_config->output + 1, xf86_config->output,
+ xf86_config->num_output * sizeof (xf86OutputPtr));
+ xf86_config->output[0] = output;
+ }
+ else
+ {
+ xf86_config->output[xf86_config->num_output] = output;
+ }
+
+ xf86_config->num_output++;
+
+ return output;
+}
+
+Bool
+xf86OutputRename (xf86OutputPtr output, const char *name)
+{
+ int len = strlen(name) + 1;
+ char *newname = xalloc (len);
+
+ if (!newname)
+ return FALSE; /* so sorry... */
+
+ strcpy (newname, name);
+ if (output->name && output->name != (char *) (output + 1))
+ xfree (output->name);
+ output->name = newname;
+ xf86OutputSetMonitor (output);
+ if (xf86OutputIgnored (output))
+ return FALSE;
+ return TRUE;
+}
+
+void
+xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor)
+{
+ if (use_screen_monitor != output->use_screen_monitor)
+ {
+ output->use_screen_monitor = use_screen_monitor;
+ xf86OutputSetMonitor (output);
+ }
+}
+
+void
+xf86OutputDestroy (xf86OutputPtr output)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ (*output->funcs->destroy) (output);
+ while (output->probed_modes)
+ xf86DeleteMode (&output->probed_modes, output->probed_modes);
+ for (o = 0; o < xf86_config->num_output; o++)
+ if (xf86_config->output[o] == output)
+ {
+ memmove (&xf86_config->output[o],
+ &xf86_config->output[o+1],
+ ((xf86_config->num_output - (o + 1)) * sizeof(void*)));
+ xf86_config->num_output--;
+ break;
+ }
+ if (output->name && output->name != (char *) (output + 1))
+ xfree (output->name);
+ xfree (output);
+}
+
+/*
+ * Called during CreateScreenResources to hook up RandR
+ */
+static Bool
+xf86CrtcCreateScreenResources (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ screen->CreateScreenResources = config->CreateScreenResources;
+
+ if (!(*screen->CreateScreenResources)(screen))
+ return FALSE;
+
+ if (!xf86RandR12CreateScreenResources (screen))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * Clean up config on server reset
+ */
+static Bool
+xf86CrtcCloseScreen (int index, ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o, c;
+
+ screen->CloseScreen = config->CloseScreen;
+
+ xf86RotateCloseScreen (screen);
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->randr_output = NULL;
+ }
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ crtc->randr_crtc = NULL;
+ }
+ return screen->CloseScreen (index, screen);
+}
+
+/*
+ * Called at ScreenInit time to set up
+ */
+#ifdef RANDR_13_INTERFACE
+int
+#else
+Bool
+#endif
+xf86CrtcScreenInit (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c;
+
+ /* Rotation */
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n");
+ xf86DisableRandR(); /* Disable old RandR extension support */
+ xf86RandR12Init (screen);
+
+ /* support all rotations if every crtc has the shadow alloc funcs */
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+ if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create)
+ break;
+ }
+ if (c == config->num_crtc)
+ {
+ xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 |
+ RR_Rotate_180 | RR_Rotate_270 |
+ RR_Reflect_X | RR_Reflect_Y);
+ xf86RandR12SetTransformSupport (screen, TRUE);
+ }
+ else
+ {
+ xf86RandR12SetRotations (screen, RR_Rotate_0);
+ xf86RandR12SetTransformSupport (screen, FALSE);
+ }
+
+ /* Wrap CreateScreenResources so we can initialize the RandR code */
+ config->CreateScreenResources = screen->CreateScreenResources;
+ screen->CreateScreenResources = xf86CrtcCreateScreenResources;
+
+ config->CloseScreen = screen->CloseScreen;
+ screen->CloseScreen = xf86CrtcCloseScreen;
+
+#ifdef XFreeXDGA
+ _xf86_di_dga_init_internal(screen);
+#endif
+#ifdef RANDR_13_INTERFACE
+ return RANDR_INTERFACE_VERSION;
+#else
+ return TRUE;
+#endif
+}
+
+static DisplayModePtr
+xf86DefaultMode (xf86OutputPtr output, int width, int height)
+{
+ DisplayModePtr target_mode = NULL;
+ DisplayModePtr mode;
+ int target_diff = 0;
+ int target_preferred = 0;
+ int mm_height;
+
+ mm_height = output->mm_height;
+ if (!mm_height)
+ mm_height = (768 * 25.4) / DEFAULT_DPI;
+ /*
+ * Pick a mode closest to DEFAULT_DPI
+ */
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ int dpi;
+ int preferred = (((mode->type & M_T_PREFERRED) != 0) +
+ ((mode->type & M_T_USERPREF) != 0));
+ int diff;
+
+ if (xf86ModeWidth (mode, output->initial_rotation) > width ||
+ xf86ModeHeight (mode, output->initial_rotation) > height)
+ continue;
+
+ /* yes, use VDisplay here, not xf86ModeHeight */
+ dpi = (mode->VDisplay * 254) / (mm_height * 10);
+ diff = dpi - DEFAULT_DPI;
+ diff = diff < 0 ? -diff : diff;
+ if (target_mode == NULL || (preferred > target_preferred) ||
+ (preferred == target_preferred && diff < target_diff))
+ {
+ target_mode = mode;
+ target_diff = diff;
+ target_preferred = preferred;
+ }
+ }
+ return target_mode;
+}
+
+static DisplayModePtr
+xf86ClosestMode (xf86OutputPtr output,
+ DisplayModePtr match, Rotation match_rotation,
+ int width, int height)
+{
+ DisplayModePtr target_mode = NULL;
+ DisplayModePtr mode;
+ int target_diff = 0;
+
+ /*
+ * Pick a mode closest to the specified mode
+ */
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ int dx, dy;
+ int diff;
+
+ if (xf86ModeWidth (mode, output->initial_rotation) > width ||
+ xf86ModeHeight (mode, output->initial_rotation) > height)
+ continue;
+
+ /* exact matches are preferred */
+ if (output->initial_rotation == match_rotation &&
+ xf86ModesEqual (mode, match))
+ return mode;
+
+ dx = xf86ModeWidth (match, match_rotation) - xf86ModeWidth (mode, output->initial_rotation);
+ dy = xf86ModeHeight (match, match_rotation) - xf86ModeHeight (mode, output->initial_rotation);
+ diff = dx * dx + dy * dy;
+ if (target_mode == NULL || diff < target_diff)
+ {
+ target_mode = mode;
+ target_diff = diff;
+ }
+ }
+ return target_mode;
+}
+
+static DisplayModePtr
+xf86OutputHasPreferredMode (xf86OutputPtr output, int width, int height)
+{
+ DisplayModePtr mode;
+
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ if (xf86ModeWidth (mode, output->initial_rotation) > width ||
+ xf86ModeHeight (mode, output->initial_rotation) > height)
+ continue;
+
+ if (mode->type & M_T_PREFERRED)
+ return mode;
+ }
+ return NULL;
+}
+
+static DisplayModePtr
+xf86OutputHasUserPreferredMode (xf86OutputPtr output)
+{
+ DisplayModePtr mode, first = output->probed_modes;
+
+ for (mode = first; mode && mode->next != first; mode = mode->next)
+ if (mode->type & M_T_USERPREF)
+ return mode;
+
+ return NULL;
+}
+
+static int
+xf86PickCrtcs (ScrnInfoPtr scrn,
+ xf86CrtcPtr *best_crtcs,
+ DisplayModePtr *modes,
+ int n,
+ int width,
+ int height)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c, o;
+ xf86OutputPtr output;
+ xf86CrtcPtr crtc;
+ xf86CrtcPtr *crtcs;
+ xf86CrtcPtr best_crtc;
+ int best_score;
+ int score;
+ int my_score;
+
+ if (n == config->num_output)
+ return 0;
+ output = config->output[n];
+
+ /*
+ * Compute score with this output disabled
+ */
+ best_crtcs[n] = NULL;
+ best_crtc = NULL;
+ best_score = xf86PickCrtcs (scrn, best_crtcs, modes, n+1, width, height);
+ if (modes[n] == NULL)
+ return best_score;
+
+ crtcs = xalloc (config->num_output * sizeof (xf86CrtcPtr));
+ if (!crtcs)
+ return best_score;
+
+ my_score = 1;
+ /* Score outputs that are known to be connected higher */
+ if (output->status == XF86OutputStatusConnected)
+ my_score++;
+ /* Score outputs with preferred modes higher */
+ if (xf86OutputHasPreferredMode (output, width, height))
+ my_score++;
+ /*
+ * Select a crtc for this output and
+ * then attempt to configure the remaining
+ * outputs
+ */
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ if ((output->possible_crtcs & (1 << c)) == 0)
+ continue;
+
+ crtc = config->crtc[c];
+ /*
+ * Check to see if some other output is
+ * using this crtc
+ */
+ for (o = 0; o < n; o++)
+ if (best_crtcs[o] == crtc)
+ break;
+ if (o < n)
+ {
+ /*
+ * If the two outputs desire the same mode,
+ * see if they can be cloned
+ */
+ if (xf86ModesEqual (modes[o], modes[n]) &&
+ config->output[o]->initial_rotation == config->output[n]->initial_rotation &&
+ config->output[o]->initial_x == config->output[n]->initial_x &&
+ config->output[o]->initial_y == config->output[n]->initial_y)
+ {
+ if ((output->possible_clones & (1 << o)) == 0)
+ continue; /* nope, try next CRTC */
+ }
+ else
+ continue; /* different modes, can't clone */
+ }
+ crtcs[n] = crtc;
+ memcpy (crtcs, best_crtcs, n * sizeof (xf86CrtcPtr));
+ score = my_score + xf86PickCrtcs (scrn, crtcs, modes, n+1, width, height);
+ if (score > best_score)
+ {
+ best_crtc = crtc;
+ best_score = score;
+ memcpy (best_crtcs, crtcs, config->num_output * sizeof (xf86CrtcPtr));
+ }
+ }
+ xfree (crtcs);
+ return best_score;
+}
+
+
+/*
+ * Compute the virtual size necessary to place all of the available
+ * crtcs in the specified configuration.
+ *
+ * canGrow indicates that the driver can make the screen larger than its initial
+ * configuration. If FALSE, this function will enlarge the screen to include
+ * the largest available mode.
+ */
+
+static void
+xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp,
+ Bool canGrow)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int width = 0, height = 0;
+ int o;
+ int c;
+ int s;
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ int crtc_width = 0, crtc_height = 0;
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ if (crtc->enabled)
+ {
+ crtc_width = crtc->x + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation);
+ crtc_height = crtc->y + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation);
+ }
+ if (!canGrow) {
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ for (s = 0; s < config->num_crtc; s++)
+ if (output->possible_crtcs & (1 << s))
+ {
+ DisplayModePtr mode;
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ if (mode->HDisplay > crtc_width)
+ crtc_width = mode->HDisplay;
+ if (mode->VDisplay > crtc_width)
+ crtc_width = mode->VDisplay;
+ if (mode->VDisplay > crtc_height)
+ crtc_height = mode->VDisplay;
+ if (mode->HDisplay > crtc_height)
+ crtc_height = mode->HDisplay;
+ }
+ }
+ }
+ }
+ if (crtc_width > width)
+ width = crtc_width;
+ if (crtc_height > height)
+ height = crtc_height;
+ }
+ if (config->maxWidth && width > config->maxWidth) width = config->maxWidth;
+ if (config->maxHeight && height > config->maxHeight) height = config->maxHeight;
+ if (config->minWidth && width < config->minWidth) width = config->minWidth;
+ if (config->minHeight && height < config->minHeight) height = config->minHeight;
+ *widthp = width;
+ *heightp = height;
+}
+
+#define POSITION_UNSET -100000
+
+/*
+ * check if the user configured any outputs at all
+ * with either a position or a relative setting or a mode.
+ */
+static Bool
+xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+ Bool user_conf = FALSE;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ char *position;
+ char *relative_name;
+ OutputOpts relation;
+ int r;
+ static const OutputOpts relations[] = {
+ OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
+ };
+
+ position = xf86GetOptValString (output->options,
+ OPTION_POSITION);
+ if (position)
+ user_conf = TRUE;
+
+ relation = 0;
+ relative_name = NULL;
+ for (r = 0; r < 4; r++)
+ {
+ relation = relations[r];
+ relative_name = xf86GetOptValString (output->options,
+ relation);
+ if (relative_name)
+ break;
+ }
+ if (relative_name)
+ user_conf = TRUE;
+
+ modes[o] = xf86OutputHasUserPreferredMode(output);
+ if (modes[o])
+ user_conf = TRUE;
+ }
+
+ return user_conf;
+}
+
+static Bool
+xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+ int min_x, min_y;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->initial_x = output->initial_y = POSITION_UNSET;
+ }
+
+ /*
+ * Loop until all outputs are set
+ */
+ for (;;)
+ {
+ Bool any_set = FALSE;
+ Bool keep_going = FALSE;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ static const OutputOpts relations[] = {
+ OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
+ };
+ xf86OutputPtr output = config->output[o];
+ xf86OutputPtr relative;
+ char *relative_name;
+ char *position;
+ OutputOpts relation;
+ int r;
+
+ if (output->initial_x != POSITION_UNSET)
+ continue;
+ position = xf86GetOptValString (output->options,
+ OPTION_POSITION);
+ /*
+ * Absolute position wins
+ */
+ if (position)
+ {
+ int x, y;
+ if (sscanf (position, "%d %d", &x, &y) == 2)
+ {
+ output->initial_x = x;
+ output->initial_y = y;
+ }
+ else
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Output %s position not of form \"x y\"\n",
+ output->name);
+ output->initial_x = output->initial_y = 0;
+ }
+ any_set = TRUE;
+ continue;
+ }
+ /*
+ * Next comes relative positions
+ */
+ relation = 0;
+ relative_name = NULL;
+ for (r = 0; r < 4; r++)
+ {
+ relation = relations[r];
+ relative_name = xf86GetOptValString (output->options,
+ relation);
+ if (relative_name)
+ break;
+ }
+ if (relative_name)
+ {
+ int or;
+ relative = NULL;
+ for (or = 0; or < config->num_output; or++)
+ {
+ xf86OutputPtr out_rel = config->output[or];
+ XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor;
+
+ if (rel_mon)
+ {
+ if (xf86nameCompare (rel_mon->mon_identifier,
+ relative_name) == 0)
+ {
+ relative = config->output[or];
+ break;
+ }
+ }
+ if (strcmp (out_rel->name, relative_name) == 0)
+ {
+ relative = config->output[or];
+ break;
+ }
+ }
+ if (!relative)
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Cannot position output %s relative to unknown output %s\n",
+ output->name, relative_name);
+ output->initial_x = 0;
+ output->initial_y = 0;
+ any_set = TRUE;
+ continue;
+ }
+ if (!modes[or])
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Cannot position output %s relative to output %s without modes\n",
+ output->name, relative_name);
+ output->initial_x = 0;
+ output->initial_y = 0;
+ any_set = TRUE;
+ continue;
+ }
+ if (relative->initial_x == POSITION_UNSET)
+ {
+ keep_going = TRUE;
+ continue;
+ }
+ output->initial_x = relative->initial_x;
+ output->initial_y = relative->initial_y;
+ switch (relation) {
+ case OPTION_BELOW:
+ output->initial_y += xf86ModeHeight (modes[or], relative->initial_rotation);
+ break;
+ case OPTION_RIGHT_OF:
+ output->initial_x += xf86ModeWidth (modes[or], relative->initial_rotation);
+ break;
+ case OPTION_ABOVE:
+ if (modes[o])
+ output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation);
+ break;
+ case OPTION_LEFT_OF:
+ if (modes[o])
+ output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation);
+ break;
+ default:
+ break;
+ }
+ any_set = TRUE;
+ continue;
+ }
+
+ /* Nothing set, just stick them at 0,0 */
+ output->initial_x = 0;
+ output->initial_y = 0;
+ any_set = TRUE;
+ }
+ if (!keep_going)
+ break;
+ if (!any_set)
+ {
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ if (output->initial_x == POSITION_UNSET)
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Output position loop. Moving %s to 0,0\n",
+ output->name);
+ output->initial_x = output->initial_y = 0;
+ break;
+ }
+ }
+ }
+ }
+
+ /*
+ * normalize positions
+ */
+ min_x = 1000000;
+ min_y = 1000000;
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ if (output->initial_x < min_x)
+ min_x = output->initial_x;
+ if (output->initial_y < min_y)
+ min_y = output->initial_y;
+ }
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->initial_x -= min_x;
+ output->initial_y -= min_y;
+ }
+ return TRUE;
+}
+
+static void
+xf86InitialPanning (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ char *panning = xf86GetOptValString (output->options, OPTION_PANNING);
+ int width, height, left, top;
+ int track_width, track_height, track_left, track_top;
+ int brdr[4];
+
+ memset (&output->initialTotalArea, 0, sizeof(BoxRec));
+ memset (&output->initialTrackingArea, 0, sizeof(BoxRec));
+ memset (output->initialBorder, 0, 4*sizeof(INT16));
+
+ if (! panning)
+ continue;
+
+ switch (sscanf (panning, "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d",
+ &width, &height, &left, &top,
+ &track_width, &track_height, &track_left, &track_top,
+ &brdr[0], &brdr[1], &brdr[2], &brdr[3])) {
+ case 12:
+ output->initialBorder[0] = brdr[0];
+ output->initialBorder[1] = brdr[1];
+ output->initialBorder[2] = brdr[2];
+ output->initialBorder[3] = brdr[3];
+ /* fall through */
+ case 8:
+ output->initialTrackingArea.x1 = track_left;
+ output->initialTrackingArea.y1 = track_top;
+ output->initialTrackingArea.x2 = track_left + track_width;
+ output->initialTrackingArea.y2 = track_top + track_height;
+ /* fall through */
+ case 4:
+ output->initialTotalArea.x1 = left;
+ output->initialTotalArea.y1 = top;
+ /* fall through */
+ case 2:
+ output->initialTotalArea.x2 = output->initialTotalArea.x1 + width;
+ output->initialTotalArea.y2 = output->initialTotalArea.y1 + height;
+ break;
+ default:
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Broken panning specification '%s' for output %s in config file\n",
+ panning, output->name);
+ }
+ }
+}
+
+/** Return - 0 + if a should be earlier, same or later than b in list
+ */
+static int
+xf86ModeCompare (DisplayModePtr a, DisplayModePtr b)
+{
+ int diff;
+
+ diff = ((b->type & M_T_PREFERRED) != 0) - ((a->type & M_T_PREFERRED) != 0);
+ if (diff)
+ return diff;
+ diff = b->HDisplay * b->VDisplay - a->HDisplay * a->VDisplay;
+ if (diff)
+ return diff;
+ diff = b->Clock - a->Clock;
+ return diff;
+}
+
+/**
+ * Insertion sort input in-place and return the resulting head
+ */
+static DisplayModePtr
+xf86SortModes (DisplayModePtr input)
+{
+ DisplayModePtr output = NULL, i, o, n, *op, prev;
+
+ /* sort by preferred status and pixel area */
+ while (input)
+ {
+ i = input;
+ input = input->next;
+ for (op = &output; (o = *op); op = &o->next)
+ if (xf86ModeCompare (o, i) > 0)
+ break;
+ i->next = *op;
+ *op = i;
+ }
+ /* prune identical modes */
+ for (o = output; o && (n = o->next); o = n)
+ {
+ if (!strcmp (o->name, n->name) && xf86ModesEqual (o, n))
+ {
+ o->next = n->next;
+ xfree (n->name);
+ xfree (n);
+ n = o;
+ }
+ }
+ /* hook up backward links */
+ prev = NULL;
+ for (o = output; o; o = o->next)
+ {
+ o->prev = prev;
+ prev = o;
+ }
+ return output;
+}
+
+static char *
+preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output)
+{
+ char *preferred_mode = NULL;
+
+ /* Check for a configured preference for a particular mode */
+ preferred_mode = xf86GetOptValString (output->options,
+ OPTION_PREFERRED_MODE);
+ if (preferred_mode)
+ return preferred_mode;
+
+ if (pScrn->display->modes && *pScrn->display->modes)
+ preferred_mode = *pScrn->display->modes;
+
+ return preferred_mode;
+}
+
+static void
+GuessRangeFromModes(MonPtr mon, DisplayModePtr mode)
+{
+ if (!mon || !mode)
+ return;
+
+ mon->nHsync = 1;
+ mon->hsync[0].lo = 1024.0;
+ mon->hsync[0].hi = 0.0;
+
+ mon->nVrefresh = 1;
+ mon->vrefresh[0].lo = 1024.0;
+ mon->vrefresh[0].hi = 0.0;
+
+ while (mode) {
+ if (!mode->HSync)
+ mode->HSync = ((float) mode->Clock ) / ((float) mode->HTotal);
+
+ if (!mode->VRefresh)
+ mode->VRefresh = (1000.0 * ((float) mode->Clock)) /
+ ((float) (mode->HTotal * mode->VTotal));
+
+ if (mode->HSync < mon->hsync[0].lo)
+ mon->hsync[0].lo = mode->HSync;
+
+ if (mode->HSync > mon->hsync[0].hi)
+ mon->hsync[0].hi = mode->HSync;
+
+ if (mode->VRefresh < mon->vrefresh[0].lo)
+ mon->vrefresh[0].lo = mode->VRefresh;
+
+ if (mode->VRefresh > mon->vrefresh[0].hi)
+ mon->vrefresh[0].hi = mode->VRefresh;
+
+ mode = mode->next;
+ }
+
+ /* stretch out the bottom to fit 640x480@60 */
+ if (mon->hsync[0].lo > 31.0)
+ mon->hsync[0].lo = 31.0;
+ if (mon->vrefresh[0].lo > 58.0)
+ mon->vrefresh[0].lo = 58.0;
+}
+
+struct det_monrec_parameter {
+ MonRec *mon_rec;
+ int *max_clock;
+ Bool set_hsync;
+ Bool set_vrefresh;
+ enum { sync_config, sync_edid, sync_default } *sync_source;
+};
+
+static void handle_detailed_monrec(struct detailed_monitor_section *det_mon,
+ void *data)
+{
+ enum { sync_config, sync_edid, sync_default };
+ struct det_monrec_parameter *p;
+ p = (struct det_monrec_parameter *)data;
+
+ if (det_mon->type == DS_RANGES) {
+ struct monitor_ranges *ranges = &det_mon->section.ranges;
+ if (p->set_hsync && ranges->max_h) {
+ p->mon_rec->hsync[p->mon_rec->nHsync].lo = ranges->min_h;
+ p->mon_rec->hsync[p->mon_rec->nHsync].hi = ranges->max_h;
+ p->mon_rec->nHsync++;
+ if (*p->sync_source == sync_default)
+ *p->sync_source = sync_edid;
+ }
+ if (p->set_vrefresh && ranges->max_v) {
+ p->mon_rec->vrefresh[p->mon_rec->nVrefresh].lo = ranges->min_v;
+ p->mon_rec->vrefresh[p->mon_rec->nVrefresh].hi = ranges->max_v;
+ p->mon_rec->nVrefresh++;
+ if (*p->sync_source == sync_default)
+ *p->sync_source = sync_edid;
+ }
+ if (ranges->max_clock * 1000 > *p->max_clock)
+ *p->max_clock = ranges->max_clock * 1000;
+ }
+}
+
+void
+xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ /* When canGrow was TRUE in the initial configuration we have to
+ * compare against the maximum values so that we don't drop modes.
+ * When canGrow was FALSE, the maximum values would have been clamped
+ * anyway.
+ */
+ if (maxX == 0 || maxY == 0) {
+ maxX = config->maxWidth;
+ maxY = config->maxHeight;
+ }
+
+ /* Probe the list of modes for each output. */
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ DisplayModePtr mode;
+ DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL;
+ char *preferred_mode;
+ xf86MonPtr edid_monitor;
+ XF86ConfMonitorPtr conf_monitor;
+ MonRec mon_rec;
+ int min_clock = 0;
+ int max_clock = 0;
+ double clock;
+ Bool add_default_modes = TRUE;
+ Bool debug_modes = config->debug_modes ||
+ xf86Initialising;
+ enum { sync_config, sync_edid, sync_default } sync_source = sync_default;
+
+ while (output->probed_modes != NULL)
+ xf86DeleteMode(&output->probed_modes, output->probed_modes);
+
+ /*
+ * Check connection status
+ */
+ output->status = (*output->funcs->detect)(output);
+
+ if (output->status == XF86OutputStatusDisconnected)
+ {
+ xf86OutputSetEDID (output, NULL);
+ continue;
+ }
+
+ memset (&mon_rec, '\0', sizeof (mon_rec));
+
+ conf_monitor = output->conf_monitor;
+
+ if (conf_monitor)
+ {
+ int i;
+
+ for (i = 0; i < conf_monitor->mon_n_hsync; i++)
+ {
+ mon_rec.hsync[mon_rec.nHsync].lo = conf_monitor->mon_hsync[i].lo;
+ mon_rec.hsync[mon_rec.nHsync].hi = conf_monitor->mon_hsync[i].hi;
+ mon_rec.nHsync++;
+ sync_source = sync_config;
+ }
+ for (i = 0; i < conf_monitor->mon_n_vrefresh; i++)
+ {
+ mon_rec.vrefresh[mon_rec.nVrefresh].lo = conf_monitor->mon_vrefresh[i].lo;
+ mon_rec.vrefresh[mon_rec.nVrefresh].hi = conf_monitor->mon_vrefresh[i].hi;
+ mon_rec.nVrefresh++;
+ sync_source = sync_config;
+ }
+ config_modes = xf86GetMonitorModes (scrn, conf_monitor);
+ }
+
+ output_modes = (*output->funcs->get_modes) (output);
+
+ edid_monitor = output->MonInfo;
+
+ if (edid_monitor)
+ {
+ struct det_monrec_parameter p;
+ struct disp_features *features = &edid_monitor->features;
+
+ /* if display is not continuous-frequency, don't add default modes */
+ if (!GTF_SUPPORTED(features->msc))
+ add_default_modes = FALSE;
+
+ p.mon_rec = &mon_rec;
+ p.max_clock = &max_clock;
+ p.set_hsync = mon_rec.nHsync == 0;
+ p.set_vrefresh = mon_rec.nVrefresh == 0;
+ p.sync_source = &sync_source;
+
+ xf86ForEachDetailedBlock(edid_monitor,
+ handle_detailed_monrec,
+ &p);
+ }
+
+ if (xf86GetOptValFreq (output->options, OPTION_MIN_CLOCK,
+ OPTUNITS_KHZ, &clock))
+ min_clock = (int) clock;
+ if (xf86GetOptValFreq (output->options, OPTION_MAX_CLOCK,
+ OPTUNITS_KHZ, &clock))
+ max_clock = (int) clock;
+
+ /* If we still don't have a sync range, guess wildly */
+ if (!mon_rec.nHsync || !mon_rec.nVrefresh)
+ GuessRangeFromModes(&mon_rec, output_modes);
+
+ /*
+ * These limits will end up setting a 1024x768@60Hz mode by default,
+ * which seems like a fairly good mode to use when nothing else is
+ * specified
+ */
+ if (mon_rec.nHsync == 0)
+ {
+ mon_rec.hsync[0].lo = 31.0;
+ mon_rec.hsync[0].hi = 55.0;
+ mon_rec.nHsync = 1;
+ }
+ if (mon_rec.nVrefresh == 0)
+ {
+ mon_rec.vrefresh[0].lo = 58.0;
+ mon_rec.vrefresh[0].hi = 62.0;
+ mon_rec.nVrefresh = 1;
+ }
+
+ if (add_default_modes)
+ default_modes = xf86GetDefaultModes ();
+
+ /*
+ * If this is not an RB monitor, remove RB modes from the default
+ * pool. RB modes from the config or the monitor itself are fine.
+ */
+ if (!mon_rec.reducedblanking)
+ xf86ValidateModesReducedBlanking (scrn, default_modes);
+
+ if (sync_source == sync_config)
+ {
+ /*
+ * Check output and config modes against sync range from config file
+ */
+ xf86ValidateModesSync (scrn, output_modes, &mon_rec);
+ xf86ValidateModesSync (scrn, config_modes, &mon_rec);
+ }
+ /*
+ * Check default modes against sync range
+ */
+ xf86ValidateModesSync (scrn, default_modes, &mon_rec);
+ /*
+ * Check default modes against monitor max clock
+ */
+ if (max_clock) {
+ xf86ValidateModesClocks(scrn, default_modes,
+ &min_clock, &max_clock, 1);
+ xf86ValidateModesClocks(scrn, output_modes,
+ &min_clock, &max_clock, 1);
+ }
+
+ output->probed_modes = NULL;
+ output->probed_modes = xf86ModesAdd (output->probed_modes, config_modes);
+ output->probed_modes = xf86ModesAdd (output->probed_modes, output_modes);
+ output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes);
+
+ /*
+ * Check all modes against max size, interlace, and doublescan
+ */
+ if (maxX && maxY)
+ xf86ValidateModesSize (scrn, output->probed_modes,
+ maxX, maxY, 0);
+
+ {
+ int flags = (output->interlaceAllowed ? V_INTERLACE : 0) |
+ (output->doubleScanAllowed ? V_DBLSCAN : 0);
+ xf86ValidateModesFlags (scrn, output->probed_modes, flags);
+ }
+
+ /*
+ * Check all modes against output
+ */
+ for (mode = output->probed_modes; mode != NULL; mode = mode->next)
+ if (mode->status == MODE_OK)
+ mode->status = (*output->funcs->mode_valid)(output, mode);
+
+ xf86PruneInvalidModes(scrn, &output->probed_modes, debug_modes);
+
+ output->probed_modes = xf86SortModes (output->probed_modes);
+
+ /* Check for a configured preference for a particular mode */
+ preferred_mode = preferredMode(scrn, output);
+
+ if (preferred_mode)
+ {
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ if (!strcmp (preferred_mode, mode->name))
+ {
+ if (mode != output->probed_modes)
+ {
+ if (mode->prev)
+ mode->prev->next = mode->next;
+ if (mode->next)
+ mode->next->prev = mode->prev;
+ mode->next = output->probed_modes;
+ output->probed_modes->prev = mode;
+ mode->prev = NULL;
+ output->probed_modes = mode;
+ }
+ mode->type |= (M_T_PREFERRED|M_T_USERPREF);
+ break;
+ }
+ }
+ }
+
+ output->initial_rotation = xf86OutputInitialRotation (output);
+
+ if (debug_modes) {
+ if (output->probed_modes != NULL) {
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "Printing probed modes for output %s\n",
+ output->name);
+ } else {
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "No remaining probed modes for output %s\n",
+ output->name);
+ }
+ }
+ for (mode = output->probed_modes; mode != NULL; mode = mode->next)
+ {
+ /* The code to choose the best mode per pipe later on will require
+ * VRefresh to be set.
+ */
+ mode->VRefresh = xf86ModeVRefresh(mode);
+ xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
+
+ if (debug_modes)
+ xf86PrintModeline(scrn->scrnIndex, mode);
+ }
+ }
+}
+
+
+/**
+ * Copy one of the output mode lists to the ScrnInfo record
+ */
+
+/* XXX where does this function belong? Here? */
+void
+xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y);
+
+static DisplayModePtr
+biggestMode(DisplayModePtr a, DisplayModePtr b)
+{
+ int A, B;
+
+ if (!a)
+ return b;
+ if (!b)
+ return a;
+
+ A = a->HDisplay * a->VDisplay;
+ B = b->HDisplay * b->VDisplay;
+
+ if (A > B)
+ return a;
+
+ return b;
+}
+
+static xf86OutputPtr
+SetCompatOutput(xf86CrtcConfigPtr config)
+{
+ xf86OutputPtr output = NULL, test = NULL;
+ DisplayModePtr maxmode = NULL, testmode, mode;
+ int o, compat = -1, count, mincount = 0;
+
+ /* Look for one that's definitely connected */
+ for (o = 0; o < config->num_output; o++)
+ {
+ test = config->output[o];
+ if (!test->crtc)
+ continue;
+ if (test->status != XF86OutputStatusConnected)
+ continue;
+ if (!test->probed_modes)
+ continue;
+
+ testmode = mode = test->probed_modes;
+ for (count = 0; mode; mode = mode->next, count++)
+ testmode = biggestMode(testmode, mode);
+
+ if (!output) {
+ output = test;
+ compat = o;
+ maxmode = testmode;
+ mincount = count;
+ } else if (maxmode == biggestMode(maxmode, testmode)) {
+ output = test;
+ compat = o;
+ maxmode = testmode;
+ mincount = count;
+ } else if ((maxmode->HDisplay == testmode->HDisplay) &&
+ (maxmode->VDisplay == testmode->VDisplay) &&
+ count <= mincount) {
+ output = test;
+ compat = o;
+ maxmode = testmode;
+ mincount = count;
+ }
+ }
+
+ /* If we didn't find one, take anything we can get */
+ if (!output)
+ {
+ for (o = 0; o < config->num_output; o++)
+ {
+ test = config->output[o];
+ if (!test->crtc)
+ continue;
+ if (!test->probed_modes)
+ continue;
+
+ if (!output) {
+ output = test;
+ compat = o;
+ } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) {
+ output = test;
+ compat = o;
+ }
+ }
+ }
+
+ if (compat >= 0) {
+ config->compat_output = compat;
+ } else {
+ /* Don't change the compat output when no valid outputs found */
+ output = config->output[config->compat_output];
+ }
+
+ return output;
+}
+
+void
+xf86SetScrnInfoModes (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86OutputPtr output;
+ xf86CrtcPtr crtc;
+ DisplayModePtr last, mode = NULL;
+
+ output = SetCompatOutput(config);
+
+ if (!output)
+ return; /* punt */
+
+ crtc = output->crtc;
+
+ /* Clear any existing modes from scrn->modes */
+ while (scrn->modes != NULL)
+ xf86DeleteMode(&scrn->modes, scrn->modes);
+
+ /* Set scrn->modes to the mode list for the 'compat' output */
+ scrn->modes = xf86DuplicateModes(scrn, output->probed_modes);
+
+ if (crtc) {
+ for (mode = scrn->modes; mode; mode = mode->next)
+ if (xf86ModesEqual (mode, &crtc->desiredMode))
+ break;
+ }
+
+ if (scrn->modes != NULL) {
+ /* For some reason, scrn->modes is circular, unlike the other mode
+ * lists. How great is that?
+ */
+ for (last = scrn->modes; last && last->next; last = last->next)
+ ;
+ last->next = scrn->modes;
+ scrn->modes->prev = last;
+ if (mode) {
+ while (scrn->modes != mode)
+ scrn->modes = scrn->modes->next;
+ }
+ }
+ scrn->currentMode = scrn->modes;
+#ifdef XFreeXDGA
+ if (scrn->pScreen)
+ _xf86_di_dga_reinit_internal(scrn->pScreen);
+#endif
+}
+
+static void
+xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ Bool *enabled)
+{
+ Bool any_enabled = FALSE;
+ int o;
+
+ for (o = 0; o < config->num_output; o++)
+ any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE);
+
+ if (!any_enabled) {
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+ "No outputs definitely connected, trying again...\n");
+
+ for (o = 0; o < config->num_output; o++)
+ enabled[o] = xf86OutputEnabled(config->output[o], FALSE);
+ }
+}
+
+static Bool
+nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index)
+{
+ int o = *index;
+
+ for (o++; o < config->num_output; o++) {
+ if (enabled[o]) {
+ *index = o;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+static Bool
+aspectMatch(float a, float b)
+{
+ return fabs(1 - (a / b)) < 0.05;
+}
+
+static DisplayModePtr
+nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect)
+{
+ DisplayModePtr m = NULL;
+
+ if (!o)
+ return NULL;
+
+ if (!last)
+ m = o->probed_modes;
+ else
+ m = last->next;
+
+ for (; m; m = m->next)
+ if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
+ return m;
+
+ return NULL;
+}
+
+static DisplayModePtr
+bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
+{
+ int o = -1, p;
+ DisplayModePtr mode = NULL, test = NULL, match = NULL;
+
+ if (!nextEnabledOutput(config, enabled, &o))
+ return NULL;
+ while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
+ test = mode;
+ for (p = o; nextEnabledOutput(config, enabled, &p); ) {
+ test = xf86OutputFindClosestMode(config->output[p], mode);
+ if (!test)
+ break;
+ if (test->HDisplay != mode->HDisplay ||
+ test->VDisplay != mode->VDisplay) {
+ test = NULL;
+ break;
+ }
+ }
+
+ /* if we didn't match it on all outputs, try the next one */
+ if (!test)
+ continue;
+
+ /* if it's bigger than the last one, save it */
+ if (!match || (test->HDisplay > match->HDisplay))
+ match = test;
+ }
+
+ /* return the biggest one found */
+ return match;
+}
+
+static Bool
+xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ int o, p;
+ int max_pref_width = 0, max_pref_height = 0;
+ DisplayModePtr *preferred, *preferred_match;
+ Bool ret = FALSE;
+
+ preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
+ preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
+
+ /* Check if the preferred mode is available on all outputs */
+ for (p = -1; nextEnabledOutput(config, enabled, &p); ) {
+ Rotation r = config->output[p]->initial_rotation;
+ DisplayModePtr mode;
+ if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p],
+ width, height))) {
+ int pref_width = xf86ModeWidth(preferred[p], r);
+ int pref_height = xf86ModeHeight(preferred[p], r);
+ Bool all_match = TRUE;
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ Bool match = FALSE;
+ xf86OutputPtr output = config->output[o];
+ if (o == p)
+ continue;
+
+ for (mode = output->probed_modes; mode; mode = mode->next) {
+ Rotation r = output->initial_rotation;
+ if (xf86ModeWidth(mode, r) == pref_width &&
+ xf86ModeHeight(mode, r) == pref_height) {
+ preferred[o] = mode;
+ match = TRUE;
+ }
+ }
+
+ all_match &= match;
+ }
+
+ if (all_match &&
+ (pref_width*pref_height > max_pref_width*max_pref_height)) {
+ for (o = -1; nextEnabledOutput(config, enabled, &o); )
+ preferred_match[o] = preferred[o];
+ max_pref_width = pref_width;
+ max_pref_height = pref_height;
+ ret = TRUE;
+ }
+ }
+ }
+
+ /*
+ * If there's no preferred mode, but only one monitor, pick the
+ * biggest mode for its aspect ratio, assuming one exists.
+ */
+ if (!ret) do {
+ int i = 0;
+ float aspect = 0.0;
+
+ /* count the number of enabled outputs */
+ for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
+
+ if (i != 1)
+ break;
+
+ p = -1;
+ nextEnabledOutput(config, enabled, &p);
+ if (config->output[p]->mm_height)
+ aspect = (float)config->output[p]->mm_width /
+ (float)config->output[p]->mm_height;
+
+ if (aspect)
+ preferred_match[p] = bestModeForAspect(config, enabled, aspect);
+
+ if (preferred_match[p])
+ ret = TRUE;
+
+ } while (0);
+
+ if (ret) {
+ /* oh good, there is a match. stash the selected modes and return. */
+ memcpy(modes, preferred_match,
+ config->num_output * sizeof(DisplayModePtr));
+ }
+
+ xfree(preferred);
+ xfree(preferred_match);
+ return ret;
+}
+
+static Bool
+xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ int o;
+ float aspect = 0.0, *aspects;
+ xf86OutputPtr output;
+ Bool ret = FALSE;
+ DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL;
+
+ aspects = xnfcalloc(config->num_output, sizeof(float));
+
+ /* collect the aspect ratios */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ output = config->output[o];
+ if (output->mm_height)
+ aspects[o] = (float)output->mm_width / (float)output->mm_height;
+ else
+ aspects[o] = 4.0 / 3.0;
+ }
+
+ /* check that they're all the same */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ output = config->output[o];
+ if (!aspect) {
+ aspect = aspects[o];
+ } else if (!aspectMatch(aspect, aspects[o])) {
+ goto no_aspect_match;
+ }
+ }
+
+ /* if they're all 4:3, just skip ahead and save effort */
+ if (!aspectMatch(aspect, 4.0/3.0))
+ aspect_guess = bestModeForAspect(config, enabled, aspect);
+
+no_aspect_match:
+ base_guess = bestModeForAspect(config, enabled, 4.0/3.0);
+
+ guess = biggestMode(base_guess, aspect_guess);
+
+ if (!guess)
+ goto out;
+
+ /* found a mode that works everywhere, now apply it */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ modes[o] = xf86OutputFindClosestMode(config->output[o], guess);
+ }
+ ret = TRUE;
+
+out:
+ xfree(aspects);
+ return ret;
+}
+
+static Bool
+xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ DisplayModePtr target_mode = NULL;
+ Rotation target_rotation = RR_Rotate_0;
+ DisplayModePtr default_mode;
+ int default_preferred, target_preferred = 0, o;
+
+ /* User preferred > preferred > other modes */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ default_mode = xf86DefaultMode (config->output[o], width, height);
+ if (!default_mode)
+ continue;
+
+ default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) +
+ ((default_mode->type & M_T_USERPREF) != 0));
+
+ if (default_preferred > target_preferred || !target_mode) {
+ target_mode = default_mode;
+ target_preferred = default_preferred;
+ target_rotation = config->output[o]->initial_rotation;
+ config->compat_output = o;
+ }
+ }
+
+ if (target_mode)
+ modes[config->compat_output] = target_mode;
+
+ /* Fill in other output modes */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ if (!modes[o])
+ modes[o] = xf86ClosestMode(config->output[o], target_mode,
+ target_rotation, width, height);
+ }
+
+ return (target_mode != NULL);
+}
+
+static Bool
+xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ int o;
+
+ if (xf86UserConfiguredOutputs(scrn, modes))
+ return xf86TargetFallback(scrn, config, modes, enabled, width, height);
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); )
+ if (xf86OutputHasUserPreferredMode(config->output[o]))
+ return
+ xf86TargetFallback(scrn, config, modes, enabled, width, height);
+
+ return FALSE;
+}
+
+static Bool
+xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green,
+ float gamma_blue)
+{
+ int i, size = 256;
+ CARD16 *red, *green, *blue;
+
+ red = malloc(3 * size * sizeof(CARD16));
+ green = red + size;
+ blue = green + size;
+
+ /* Only cause warning if user wanted gamma to be set. */
+ if (!crtc->funcs->gamma_set && (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) {
+ free(red);
+ return FALSE;
+ } else if (!crtc->funcs->gamma_set) {
+ free(red);
+ return TRUE;
+ }
+
+ /* At this early stage none of the randr-interface stuff is up.
+ * So take the default gamma size for lack of something better.
+ */
+ for (i = 0; i < size; i++) {
+ if (gamma_red == 1.0)
+ red[i] = i << 8;
+ else
+ red[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ 1. / (double)gamma_red) * (double)(size - 1) * 256);
+
+ if (gamma_green == 1.0)
+ green[i] = i << 8;
+ else
+ green[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ 1. / (double)gamma_green) * (double)(size - 1) * 256);
+
+ if (gamma_blue == 1.0)
+ blue[i] = i << 8;
+ else
+ blue[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ 1. / (double)gamma_blue) * (double)(size - 1) * 256);
+ }
+
+ /* Default size is 256, so anything else is failure. */
+ if (size != crtc->gamma_size) {
+ free(red);
+ return FALSE;
+ }
+
+ crtc->gamma_size = size;
+ memcpy (crtc->gamma_red, red, crtc->gamma_size * sizeof (CARD16));
+ memcpy (crtc->gamma_green, green, crtc->gamma_size * sizeof (CARD16));
+ memcpy (crtc->gamma_blue, blue, crtc->gamma_size * sizeof (CARD16));
+
+ /* Do not set gamma now, delay until the crtc is activated. */
+
+ free(red);
+
+ return TRUE;
+}
+
+static Bool
+xf86OutputSetInitialGamma(xf86OutputPtr output)
+{
+ XF86ConfMonitorPtr mon = output->conf_monitor;
+ float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0;
+
+ if (!mon)
+ return TRUE;
+
+ if (!output->crtc)
+ return FALSE;
+
+ /* Get configured values, where they exist. */
+ if (mon->mon_gamma_red >= GAMMA_MIN &&
+ mon->mon_gamma_red <= GAMMA_MAX)
+ gamma_red = mon->mon_gamma_red;
+
+ if (mon->mon_gamma_green >= GAMMA_MIN &&
+ mon->mon_gamma_green <= GAMMA_MAX)
+ gamma_green = mon->mon_gamma_green;
+
+ if (mon->mon_gamma_blue >= GAMMA_MIN &&
+ mon->mon_gamma_blue <= GAMMA_MAX)
+ gamma_blue = mon->mon_gamma_blue;
+
+ /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */
+ if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) {
+ xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", output->name, gamma_red, gamma_green, gamma_blue);
+ return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, gamma_blue);
+ }else
+ return TRUE;
+}
+
+/**
+ * Construct default screen configuration
+ *
+ * Given auto-detected (and, eventually, configured) values,
+ * construct a usable configuration for the system
+ *
+ * canGrow indicates that the driver can resize the screen to larger than its
+ * initially configured size via the config->funcs->resize hook. If TRUE, this
+ * function will set virtualX and virtualY to match the initial configuration
+ * and leave config->max{Width,Height} alone. If FALSE, it will bloat
+ * virtual[XY] to include the largest modes and set config->max{Width,Height}
+ * accordingly.
+ */
+
+Bool
+xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o, c;
+ xf86CrtcPtr *crtcs;
+ DisplayModePtr *modes;
+ Bool *enabled;
+ int width, height;
+ int i = scrn->scrnIndex;
+
+ /* Set up the device options */
+ config->options = xnfalloc (sizeof (xf86DeviceOptions));
+ memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions));
+ xf86ProcessOptions (scrn->scrnIndex,
+ scrn->options,
+ config->options);
+ config->debug_modes = xf86ReturnOptValBool (config->options,
+ OPTION_MODEDEBUG, FALSE);
+
+ if (scrn->display->virtualX)
+ width = scrn->display->virtualX;
+ else
+ width = config->maxWidth;
+ if (scrn->display->virtualY)
+ height = scrn->display->virtualY;
+ else
+ height = config->maxHeight;
+
+ xf86ProbeOutputModes (scrn, width, height);
+
+ crtcs = xnfcalloc (config->num_output, sizeof (xf86CrtcPtr));
+ modes = xnfcalloc (config->num_output, sizeof (DisplayModePtr));
+ enabled = xnfcalloc (config->num_output, sizeof (Bool));
+
+ xf86CollectEnabledOutputs(scrn, config, enabled);
+
+ if (xf86TargetUserpref(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n");
+ else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n");
+ else if (xf86TargetAspect(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n");
+ else if (xf86TargetFallback(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using sloppy heuristic for initial modes\n");
+ else
+ xf86DrvMsg(i, X_WARNING, "Unable to find initial modes\n");
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ if (!modes[o])
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Output %s enabled but has no modes\n",
+ config->output[o]->name);
+ else
+ xf86DrvMsg (scrn->scrnIndex, X_INFO,
+ "Output %s using initial mode %s\n",
+ config->output[o]->name, modes[o]->name);
+ }
+
+ /*
+ * Set the position of each output
+ */
+ if (!xf86InitialOutputPositions (scrn, modes))
+ {
+ xfree (crtcs);
+ xfree (modes);
+ return FALSE;
+ }
+
+ /*
+ * Set initial panning of each output
+ */
+ xf86InitialPanning (scrn);
+
+ /*
+ * Assign CRTCs to fit output configuration
+ */
+ if (!xf86PickCrtcs (scrn, crtcs, modes, 0, width, height))
+ {
+ xfree (crtcs);
+ xfree (modes);
+ return FALSE;
+ }
+
+ /* XXX override xf86 common frame computation code */
+
+ scrn->display->frameX0 = 0;
+ scrn->display->frameY0 = 0;
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ crtc->enabled = FALSE;
+ memset (&crtc->desiredMode, '\0', sizeof (crtc->desiredMode));
+ /* Set default gamma for all crtc's. */
+ /* This is done to avoid problems later on with cloned outputs. */
+ xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0);
+ }
+
+ if (xf86_crtc_supports_gamma(scrn))
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n");
+
+ /*
+ * Set initial configuration
+ */
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ DisplayModePtr mode = modes[o];
+ xf86CrtcPtr crtc = crtcs[o];
+
+ if (mode && crtc)
+ {
+ crtc->desiredMode = *mode;
+ crtc->desiredRotation = output->initial_rotation;
+ crtc->desiredX = output->initial_x;
+ crtc->desiredY = output->initial_y;
+ crtc->desiredTransformPresent = FALSE;
+ crtc->enabled = TRUE;
+ memcpy (&crtc->panningTotalArea, &output->initialTotalArea, sizeof(BoxRec));
+ memcpy (&crtc->panningTrackingArea, &output->initialTrackingArea, sizeof(BoxRec));
+ memcpy (crtc->panningBorder, output->initialBorder, 4*sizeof(INT16));
+ output->crtc = crtc;
+ if (!xf86OutputSetInitialGamma(output))
+ xf86DrvMsg (scrn->scrnIndex, X_WARNING, "Initial gamma correction for output %s: failed.\n", output->name);
+ } else {
+ output->crtc = NULL;
+ }
+ }
+
+ if (scrn->display->virtualX == 0)
+ {
+ /*
+ * Expand virtual size to cover the current config and potential mode
+ * switches, if the driver can't enlarge the screen later.
+ */
+ xf86DefaultScreenLimits (scrn, &width, &height, canGrow);
+
+ scrn->display->virtualX = width;
+ scrn->display->virtualY = height;
+ }
+
+ if (width > scrn->virtualX)
+ scrn->virtualX = width;
+ if (height > scrn->virtualY)
+ scrn->virtualY = height;
+
+ /*
+ * Make sure the configuration isn't too small.
+ */
+ if (width < config->minWidth || height < config->minHeight)
+ return FALSE;
+
+ /*
+ * Limit the crtc config to virtual[XY] if the driver can't grow the
+ * desktop.
+ */
+ if (!canGrow)
+ {
+ xf86CrtcSetSizeRange (scrn, config->minWidth, config->minHeight,
+ width, height);
+ }
+
+ /* Mirror output modes to scrn mode list */
+ xf86SetScrnInfoModes (scrn);
+
+ xfree (crtcs);
+ xfree (modes);
+ return TRUE;
+}
+
+/*
+ * Check the CRTC we're going to map each output to vs. it's current
+ * CRTC. If they don't match, we have to disable the output and the CRTC
+ * since the driver will have to re-route things.
+ */
+static void
+xf86PrepareOutputs (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ for (o = 0; o < config->num_output; o++) {
+ xf86OutputPtr output = config->output[o];
+#if RANDR_GET_CRTC_INTERFACE
+ /* Disable outputs that are unused or will be re-routed */
+ if (!output->funcs->get_crtc ||
+ output->crtc != (*output->funcs->get_crtc)(output) ||
+ output->crtc == NULL)
+#endif
+ (*output->funcs->dpms)(output, DPMSModeOff);
+ }
+}
+
+static void
+xf86PrepareCrtcs (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c;
+
+ for (c = 0; c < config->num_crtc; c++) {
+#if RANDR_GET_CRTC_INTERFACE
+ xf86CrtcPtr crtc = config->crtc[c];
+ xf86OutputPtr output = NULL;
+ uint32_t desired_outputs = 0, current_outputs = 0;
+ int o;
+
+ for (o = 0; o < config->num_output; o++) {
+ output = config->output[o];
+ if (output->crtc == crtc)
+ desired_outputs |= (1<<o);
+ /* If we can't tell where it's mapped, force it off */
+ if (!output->funcs->get_crtc) {
+ desired_outputs = 0;
+ break;
+ }
+ if ((*output->funcs->get_crtc)(output) == crtc)
+ current_outputs |= (1<<o);
+ }
+
+ /*
+ * If mappings are different or the CRTC is unused,
+ * we need to disable it
+ */
+ if (desired_outputs != current_outputs ||
+ !desired_outputs)
+ (*crtc->funcs->dpms)(crtc, DPMSModeOff);
+#else
+ (*crtc->funcs->dpms)(crtc, DPMSModeOff);
+#endif
+ }
+}
+
+/*
+ * Using the desired mode information in each crtc, set
+ * modes (used in EnterVT functions, or at server startup)
+ */
+
+Bool
+xf86SetDesiredModes (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86CrtcPtr crtc = config->crtc[0];
+ int c;
+
+ /* A driver with this hook will take care of this */
+ if (!crtc->funcs->set_mode_major) {
+ xf86PrepareOutputs(scrn);
+ xf86PrepareCrtcs(scrn);
+ }
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86OutputPtr output = NULL;
+ int o;
+ RRTransformPtr transform;
+
+ crtc = config->crtc[c];
+
+ /* Skip disabled CRTCs */
+ if (!crtc->enabled)
+ continue;
+
+ if (config->output[config->compat_output]->crtc == crtc)
+ output = config->output[config->compat_output];
+ else
+ {
+ for (o = 0; o < config->num_output; o++)
+ if (config->output[o]->crtc == crtc)
+ {
+ output = config->output[o];
+ break;
+ }
+ }
+ /* paranoia */
+ if (!output)
+ continue;
+
+ /* Mark that we'll need to re-set the mode for sure */
+ memset(&crtc->mode, 0, sizeof(crtc->mode));
+ if (!crtc->desiredMode.CrtcHDisplay)
+ {
+ DisplayModePtr mode = xf86OutputFindClosestMode (output, scrn->currentMode);
+
+ if (!mode)
+ return FALSE;
+ crtc->desiredMode = *mode;
+ crtc->desiredRotation = RR_Rotate_0;
+ crtc->desiredTransformPresent = FALSE;
+ crtc->desiredX = 0;
+ crtc->desiredY = 0;
+ }
+
+ if (crtc->desiredTransformPresent)
+ transform = &crtc->desiredTransform;
+ else
+ transform = NULL;
+ if (!xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation,
+ transform, crtc->desiredX, crtc->desiredY))
+ return FALSE;
+ }
+
+ xf86DisableUnusedFunctions(scrn);
+ return TRUE;
+}
+
+/**
+ * In the current world order, there are lists of modes per output, which may
+ * or may not include the mode that was asked to be set by XFree86's mode
+ * selection. Find the closest one, in the following preference order:
+ *
+ * - Equality
+ * - Closer in size to the requested mode, but no larger
+ * - Closer in refresh rate to the requested mode.
+ */
+
+DisplayModePtr
+xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired)
+{
+ DisplayModePtr best = NULL, scan = NULL;
+
+ for (scan = output->probed_modes; scan != NULL; scan = scan->next)
+ {
+ /* If there's an exact match, we're done. */
+ if (xf86ModesEqual(scan, desired)) {
+ best = desired;
+ break;
+ }
+
+ /* Reject if it's larger than the desired mode. */
+ if (scan->HDisplay > desired->HDisplay ||
+ scan->VDisplay > desired->VDisplay)
+ {
+ continue;
+ }
+
+ /*
+ * If we haven't picked a best mode yet, use the first
+ * one in the size range
+ */
+ if (best == NULL)
+ {
+ best = scan;
+ continue;
+ }
+
+ /* Find if it's closer to the right size than the current best
+ * option.
+ */
+ if ((scan->HDisplay > best->HDisplay &&
+ scan->VDisplay >= best->VDisplay) ||
+ (scan->HDisplay >= best->HDisplay &&
+ scan->VDisplay > best->VDisplay))
+ {
+ best = scan;
+ continue;
+ }
+
+ /* Find if it's still closer to the right refresh than the current
+ * best resolution.
+ */
+ if (scan->HDisplay == best->HDisplay &&
+ scan->VDisplay == best->VDisplay &&
+ (fabs(scan->VRefresh - desired->VRefresh) <
+ fabs(best->VRefresh - desired->VRefresh))) {
+ best = scan;
+ }
+ }
+ return best;
+}
+
+/**
+ * When setting a mode through XFree86-VidModeExtension or XFree86-DGA,
+ * take the specified mode and apply it to the crtc connected to the compat
+ * output. Then, find similar modes for the other outputs, as with the
+ * InitialConfiguration code above. The goal is to clone the desired
+ * mode across all outputs that are currently active.
+ */
+
+Bool
+xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ Bool ok = TRUE;
+ xf86OutputPtr compat_output = config->output[config->compat_output];
+ DisplayModePtr compat_mode;
+ int c;
+
+ /*
+ * Let the compat output drive the final mode selection
+ */
+ compat_mode = xf86OutputFindClosestMode (compat_output, desired);
+ if (compat_mode)
+ desired = compat_mode;
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+ DisplayModePtr crtc_mode = NULL;
+ int o;
+
+ if (!crtc->enabled)
+ continue;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ DisplayModePtr output_mode;
+
+ /* skip outputs not on this crtc */
+ if (output->crtc != crtc)
+ continue;
+
+ if (crtc_mode)
+ {
+ output_mode = xf86OutputFindClosestMode (output, crtc_mode);
+ if (output_mode != crtc_mode)
+ output->crtc = NULL;
+ }
+ else
+ crtc_mode = xf86OutputFindClosestMode (output, desired);
+ }
+ if (!crtc_mode)
+ {
+ crtc->enabled = FALSE;
+ continue;
+ }
+ if (!xf86CrtcSetModeTransform (crtc, crtc_mode, rotation, NULL, 0, 0))
+ ok = FALSE;
+ else
+ {
+ crtc->desiredMode = *crtc_mode;
+ crtc->desiredRotation = rotation;
+ crtc->desiredTransformPresent = FALSE;
+ crtc->desiredX = 0;
+ crtc->desiredY = 0;
+ }
+ }
+ xf86DisableUnusedFunctions(pScrn);
+#ifdef RANDR_12_INTERFACE
+ xf86RandR12TellChanged (pScrn->pScreen);
+#endif
+ return ok;
+}
+
+
+/**
+ * Set the DPMS power mode of all outputs and CRTCs.
+ *
+ * If the new mode is off, it will turn off outputs and then CRTCs.
+ * Otherwise, it will affect CRTCs before outputs.
+ */
+void
+xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int i;
+
+ if (!scrn->vtSema)
+ return;
+
+ if (mode == DPMSModeOff) {
+ for (i = 0; i < config->num_output; i++) {
+ xf86OutputPtr output = config->output[i];
+ if (output->crtc != NULL)
+ (*output->funcs->dpms) (output, mode);
+ }
+ }
+
+ for (i = 0; i < config->num_crtc; i++) {
+ xf86CrtcPtr crtc = config->crtc[i];
+ if (crtc->enabled)
+ (*crtc->funcs->dpms) (crtc, mode);
+ }
+
+ if (mode != DPMSModeOff) {
+ for (i = 0; i < config->num_output; i++) {
+ xf86OutputPtr output = config->output[i];
+ if (output->crtc != NULL)
+ (*output->funcs->dpms) (output, mode);
+ }
+ }
+}
+
+/**
+ * Implement the screensaver by just calling down into the driver DPMS hooks.
+ *
+ * Even for monitors with no DPMS support, by the definition of our DPMS hooks,
+ * the outputs will still get disabled (blanked).
+ */
+Bool
+xf86SaveScreen(ScreenPtr pScreen, int mode)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (xf86IsUnblank(mode))
+ xf86DPMSSet(pScrn, DPMSModeOn, 0);
+ else
+ xf86DPMSSet(pScrn, DPMSModeOff, 0);
+
+ return TRUE;
+}
+
+/**
+ * Disable all inactive crtcs and outputs
+ */
+void
+xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int o, c;
+
+ for (o = 0; o < xf86_config->num_output; o++)
+ {
+ xf86OutputPtr output = xf86_config->output[o];
+ if (!output->crtc)
+ (*output->funcs->dpms)(output, DPMSModeOff);
+ }
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+ if (!crtc->enabled)
+ {
+ crtc->funcs->dpms(crtc, DPMSModeOff);
+ memset(&crtc->mode, 0, sizeof(crtc->mode));
+ xf86RotateDestroy(crtc);
+ crtc->active = FALSE;
+ }
+ }
+ if (pScrn->pScreen)
+ xf86_crtc_notify(pScrn->pScreen);
+}
+
+#ifdef RANDR_12_INTERFACE
+
+#define EDID_ATOM_NAME "EDID"
+
+/**
+ * Set the RandR EDID property
+ */
+static void
+xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len)
+{
+ Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE);
+
+ /* This may get called before the RandR resources have been created */
+ if (output->randr_output == NULL)
+ return;
+
+ if (data_len != 0) {
+ RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8,
+ PropModeReplace, data_len, data, FALSE, TRUE);
+ } else {
+ RRDeleteOutputProperty(output->randr_output, edid_atom);
+ }
+}
+
+#endif
+
+/* Pull out a phyiscal size from a detailed timing if available. */
+struct det_phySize_parameter {
+ xf86OutputPtr output;
+ ddc_quirk_t quirks;
+ Bool ret;
+};
+
+static void handle_detailed_physical_size(struct detailed_monitor_section
+ *det_mon, void *data)
+{
+ struct det_phySize_parameter *p;
+ p = (struct det_phySize_parameter *)data;
+
+ if (p->ret == TRUE )
+ return ;
+
+ xf86DetTimingApplyQuirks(det_mon, p->quirks,
+ p->output->MonInfo->features.hsize,
+ p->output->MonInfo->features.vsize);
+ if (det_mon->type == DT &&
+ det_mon->section.d_timings.h_size != 0 &&
+ det_mon->section.d_timings.v_size != 0) {
+
+ p->output->mm_width = det_mon->section.d_timings.h_size;
+ p->output->mm_height = det_mon->section.d_timings.v_size;
+ p->ret = TRUE;
+ }
+}
+
+/**
+ * Set the EDID information for the specified output
+ */
+void
+xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ Bool debug_modes = config->debug_modes || xf86Initialising;
+#ifdef RANDR_12_INTERFACE
+ int size;
+#endif
+
+ if (output->MonInfo != NULL)
+ xfree(output->MonInfo);
+
+ output->MonInfo = edid_mon;
+
+ if (debug_modes) {
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n",
+ output->name);
+ xf86PrintEDID(edid_mon);
+ }
+
+ /* Set the DDC properties for the 'compat' output */
+ if (output == config->output[config->compat_output])
+ xf86SetDDCproperties(scrn, edid_mon);
+
+#ifdef RANDR_12_INTERFACE
+ /* Set the RandR output properties */
+ size = 0;
+ if (edid_mon)
+ {
+ if (edid_mon->ver.version == 1) {
+ size = 128;
+ if (edid_mon->flags & EDID_COMPLETE_RAWDATA)
+ size += edid_mon->no_sections * 128;
+ } else if (edid_mon->ver.version == 2)
+ size = 256;
+ }
+ xf86OutputSetEDIDProperty (output, edid_mon ? edid_mon->rawData : NULL, size);
+#endif
+
+ if (edid_mon) {
+
+ struct det_phySize_parameter p;
+ p.output = output;
+ p.quirks = xf86DDCDetectQuirks(scrn->scrnIndex,edid_mon, FALSE);
+ p.ret = FALSE;
+ xf86ForEachDetailedBlock(edid_mon,
+ handle_detailed_physical_size, &p);
+
+ /* if no mm size is available from a detailed timing, check the max size field */
+ if ((!output->mm_width || !output->mm_height) &&
+ (edid_mon->features.hsize && edid_mon->features.vsize))
+ {
+ output->mm_width = edid_mon->features.hsize * 10;
+ output->mm_height = edid_mon->features.vsize * 10;
+ }
+ }
+}
+
+/**
+ * Return the list of modes supported by the EDID information
+ * stored in 'output'
+ */
+DisplayModePtr
+xf86OutputGetEDIDModes (xf86OutputPtr output)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86MonPtr edid_mon = output->MonInfo;
+
+ if (!edid_mon)
+ return NULL;
+ return xf86DDCGetModes(scrn->scrnIndex, edid_mon);
+}
+
+/* maybe we should care about DDC1? meh. */
+xf86MonPtr
+xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86MonPtr mon;
+
+ mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE);
+ if (mon)
+ xf86DDCApplyQuirks(scrn->scrnIndex, mon);
+
+ return mon;
+}
+
+static char *_xf86ConnectorNames[] = {
+ "None", "VGA", "DVI-I", "DVI-D",
+ "DVI-A", "Composite", "S-Video",
+ "Component", "LFP", "Proprietary",
+ "HDMI", "DisplayPort",
+ };
+char *
+xf86ConnectorGetName(xf86ConnectorType connector)
+{
+ return _xf86ConnectorNames[connector];
+}
+
+static void
+x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
+{
+ dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
+ dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
+ dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1;
+ dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2;
+
+ if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2)
+ dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
+}
+
+static void
+x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box)
+{
+ if (crtc->enabled) {
+ crtc_box->x1 = crtc->x;
+ crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation);
+ crtc_box->y1 = crtc->y;
+ crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation);
+ } else
+ crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
+}
+
+static int
+xf86_crtc_box_area(BoxPtr box)
+{
+ return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
+}
+
+/*
+ * Return the crtc covering 'box'. If two crtcs cover a portion of
+ * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
+ * with greater coverage
+ */
+
+static xf86CrtcPtr
+xf86_covering_crtc(ScrnInfoPtr pScrn,
+ BoxPtr box,
+ xf86CrtcPtr desired,
+ BoxPtr crtc_box_ret)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ xf86CrtcPtr crtc, best_crtc;
+ int coverage, best_coverage;
+ int c;
+ BoxRec crtc_box, cover_box;
+
+ best_crtc = NULL;
+ best_coverage = 0;
+ crtc_box_ret->x1 = 0;
+ crtc_box_ret->x2 = 0;
+ crtc_box_ret->y1 = 0;
+ crtc_box_ret->y2 = 0;
+ for (c = 0; c < xf86_config->num_crtc; c++) {
+ crtc = xf86_config->crtc[c];
+ x86_crtc_box(crtc, &crtc_box);
+ x86_crtc_box_intersect(&cover_box, &crtc_box, box);
+ coverage = xf86_crtc_box_area(&cover_box);
+ if (coverage && crtc == desired) {
+ *crtc_box_ret = crtc_box;
+ return crtc;
+ } else if (coverage > best_coverage) {
+ *crtc_box_ret = crtc_box;
+ best_crtc = crtc;
+ best_coverage = coverage;
+ }
+ }
+ return best_crtc;
+}
+
+/*
+ * For overlay video, compute the relevant CRTC and
+ * clip video to that.
+ *
+ * returning FALSE means there was a memory failure of some kind,
+ * not that the video shouldn't be displayed
+ */
+
+Bool
+xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+ xf86CrtcPtr *crtc_ret,
+ xf86CrtcPtr desired_crtc,
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg,
+ INT32 width,
+ INT32 height)
+{
+ Bool ret;
+ RegionRec crtc_region_local;
+ RegionPtr crtc_region = reg;
+
+ if (crtc_ret) {
+ BoxRec crtc_box;
+ xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst,
+ desired_crtc,
+ &crtc_box);
+
+ if (crtc) {
+ REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1);
+ crtc_region = &crtc_region_local;
+ REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg);
+ }
+ *crtc_ret = crtc;
+ }
+
+ ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb,
+ crtc_region, width, height);
+
+ if (crtc_region != reg)
+ REGION_UNINIT (pScreen, &crtc_region_local);
+
+ return ret;
+}
+
+xf86_crtc_notify_proc_ptr
+xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
+{
+ if (xf86CrtcConfigPrivateIndex != -1)
+ {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86_crtc_notify_proc_ptr old;
+
+ old = config->xf86_crtc_notify;
+ config->xf86_crtc_notify = new;
+ return old;
+ }
+ return NULL;
+}
+
+void
+xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old)
+{
+ if (xf86CrtcConfigPrivateIndex != -1)
+ {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ config->xf86_crtc_notify = old;
+ }
+}
+
+void
+xf86_crtc_notify(ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ if (config->xf86_crtc_notify)
+ config->xf86_crtc_notify(screen);
+}
+
+Bool
+xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
+{
+ if (xf86CrtcConfigPrivateIndex != -1) {
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ xf86CrtcPtr crtc;
+
+ /* for multiple drivers loaded we need this */
+ if (!xf86_config)
+ return FALSE;
+ if (xf86_config->num_crtc == 0)
+ return FALSE;
+ crtc = xf86_config->crtc[0];
+
+ return (crtc->funcs->gamma_set != NULL);
+ }
+
+ return FALSE;
+}
diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_VTsw.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_VTsw.c index 476a0e957..90c9c30b1 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/bsd_VTsw.c +++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_VTsw.c @@ -1,94 +1,103 @@ -/* - * Derived from VTsw_usl.c which is - * Copyright 1993 by David Wexelblat <dwex@goblin.org> - * by S_ren Schmidt (sos@login.dkuug.dk) - * - * 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 name of David Wexelblat not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. David Wexelblat makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -/* - * Handle the VT-switching interface for OSs that use USL-style ioctl()s - * (the bsd, sysv, sco, and linux subdirs). - */ - -/* - * This function is the signal handler for the VT-switching signal. It - * is only referenced inside the OS-support layer. - */ -void -xf86VTRequest(int sig) -{ -#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) - if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { - xf86Info.vtRequestsPending = TRUE; - } -#endif - return; -} - -Bool -xf86VTSwitchPending() -{ -#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) - if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { - return(xf86Info.vtRequestsPending ? TRUE : FALSE); - } -#endif - return FALSE; -} - -Bool -xf86VTSwitchAway() -{ -#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) - if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) - return(FALSE); - else - return(TRUE); - } -#endif - return FALSE; -} - -Bool -xf86VTSwitchTo() -{ -#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) - if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) - return(FALSE); - else - return(TRUE); - } -#endif - return(TRUE); -} +/*
+ * Derived from VTsw_usl.c which is
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * by S_ren Schmidt (sos@login.dkuug.dk)
+ *
+ * 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 name of David Wexelblat not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. David Wexelblat makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+/*
+ * Handle the VT-switching interface for OSs that use USL-style ioctl()s
+ * (the bsd, sysv, sco, and linux subdirs).
+ */
+
+/*
+ * This function is the signal handler for the VT-switching signal. It
+ * is only referenced inside the OS-support layer.
+ */
+void
+xf86VTRequest(int sig)
+{
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
+ xf86Info.vtRequestsPending = TRUE;
+ }
+#endif
+ return;
+}
+
+Bool
+xf86VTSwitchPending()
+{
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
+ return(xf86Info.vtRequestsPending ? TRUE : FALSE);
+ }
+#endif
+ return FALSE;
+}
+
+Bool
+xf86VTSwitchAway()
+{
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
+ return(FALSE);
+ else
+ return(TRUE);
+ }
+#endif
+ return FALSE;
+}
+
+Bool
+xf86VTSwitchTo()
+{
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
+ return(FALSE);
+ else
+ return(TRUE);
+ }
+#endif
+ return(TRUE);
+}
+
+Bool
+xf86VTActivate(int vtno)
+{
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) {
+ return(FALSE);
+ }
+ return(TRUE);
+}
diff --git a/xorg-server/hw/xfree86/os-support/sco/VTsw_sco.c b/xorg-server/hw/xfree86/os-support/sco/VTsw_sco.c index d126e7869..9300b13b9 100644 --- a/xorg-server/hw/xfree86/os-support/sco/VTsw_sco.c +++ b/xorg-server/hw/xfree86/os-support/sco/VTsw_sco.c @@ -1,117 +1,127 @@ -/* - * Copyright 1993 by David Wexelblat <dwex@goblin.org> - * Copyright 1993 by David McCullough <davidm@stallion.oz.au> - * - * 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 name of David Wexelblat not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. David Wexelblat makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -/* For the event driver prototypes */ -#include <sys/event.h> -#include <mouse.h> - -/* - * Handle the VT-switching interface for SCO - */ - -/* - * This function is the signal handler for the VT-switching signal. It - * is only referenced inside the OS-support layer. NOTE: we do NOT need - * to re-arm the signal here, since we used sigaction() to set the signal - * disposition in sco_init.c. If we had used signal(), we would need to - * re-arm the signal here. All we need to do now is record the fact that - * we got the signal. XFree86 handles the rest. - */ -void -xf86VTRequest(int sig) -{ - xf86Info.vtRequestsPending = TRUE; - return; -} - -Bool -xf86VTSwitchPending(void) -{ - return(xf86Info.vtRequestsPending ? TRUE : FALSE); -} - -/* - * When we switch away, we need to flush and suspend the event driver - * before the VT_RELDISP. We also need to get the current LED status - * and preserve it, so that we can restore it when we come back. - */ -static int sco_ledstatus = -1; -static unsigned int sco_ledstate = 0; - -Bool -xf86VTSwitchAway(void) -{ - ev_flush(); - ev_suspend(); - - sco_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &sco_ledstate); - - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) { - return(FALSE); - } else { - return(TRUE); - } -} - -/* - * When we come back to the X server, we need to resume the event driver, - * and we need to restore the LED settings to what they were when we - * switched away. - */ -Bool -xf86VTSwitchTo(void) -{ - ev_resume(); - - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) { - return(FALSE); - } else { - if (sco_ledstatus >= 0) { - ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate); - } - sco_ledstatus = -1; - - /* - * Convince the console driver this screen is in graphics mode, - * otherwise it assumes it can do more to the screen than it should. - */ - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { - ErrorF("Failed to set graphics mode (%s)\n", strerror(errno)); - } - - return TRUE; - } -} +/*
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * Copyright 1993 by David McCullough <davidm@stallion.oz.au>
+ *
+ * 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 name of David Wexelblat not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. David Wexelblat makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+/* For the event driver prototypes */
+#include <sys/event.h>
+#include <mouse.h>
+
+/*
+ * Handle the VT-switching interface for SCO
+ */
+
+/*
+ * This function is the signal handler for the VT-switching signal. It
+ * is only referenced inside the OS-support layer. NOTE: we do NOT need
+ * to re-arm the signal here, since we used sigaction() to set the signal
+ * disposition in sco_init.c. If we had used signal(), we would need to
+ * re-arm the signal here. All we need to do now is record the fact that
+ * we got the signal. XFree86 handles the rest.
+ */
+void
+xf86VTRequest(int sig)
+{
+ xf86Info.vtRequestsPending = TRUE;
+ return;
+}
+
+Bool
+xf86VTSwitchPending(void)
+{
+ return(xf86Info.vtRequestsPending ? TRUE : FALSE);
+}
+
+/*
+ * When we switch away, we need to flush and suspend the event driver
+ * before the VT_RELDISP. We also need to get the current LED status
+ * and preserve it, so that we can restore it when we come back.
+ */
+static int sco_ledstatus = -1;
+static unsigned int sco_ledstate = 0;
+
+Bool
+xf86VTSwitchAway(void)
+{
+ ev_flush();
+ ev_suspend();
+
+ sco_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &sco_ledstate);
+
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) {
+ return(FALSE);
+ } else {
+ return(TRUE);
+ }
+}
+
+/*
+ * When we come back to the X server, we need to resume the event driver,
+ * and we need to restore the LED settings to what they were when we
+ * switched away.
+ */
+Bool
+xf86VTSwitchTo(void)
+{
+ ev_resume();
+
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) {
+ return(FALSE);
+ } else {
+ if (sco_ledstatus >= 0) {
+ ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate);
+ }
+ sco_ledstatus = -1;
+
+ /*
+ * Convince the console driver this screen is in graphics mode,
+ * otherwise it assumes it can do more to the screen than it should.
+ */
+ if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
+ ErrorF("Failed to set graphics mode (%s)\n", strerror(errno));
+ }
+
+ return TRUE;
+ }
+}
+
+Bool
+xf86VTActivate(int vtno)
+{
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno - 1) < 0) {
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
diff --git a/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c b/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c index 78cbe0e34..f3ddb29c9 100644 --- a/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c +++ b/xorg-server/hw/xfree86/os-support/shared/VTsw_noop.c @@ -1,54 +1,60 @@ -/* - * Copyright 1993 by David Wexelblat <dwex@XFree86.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 name of David Wexelblat not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. David Wexelblat makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -/* - * No-op functions for OSs without VTs - */ - -Bool -xf86VTSwitchPending(void) -{ - return(FALSE); -} - -Bool -xf86VTSwitchAway(void) -{ - return(FALSE); -} - -Bool -xf86VTSwitchTo(void) -{ - return(TRUE); -} +/*
+ * Copyright 1993 by David Wexelblat <dwex@XFree86.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 name of David Wexelblat not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. David Wexelblat makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+/*
+ * No-op functions for OSs without VTs
+ */
+
+Bool
+xf86VTSwitchPending(void)
+{
+ return(FALSE);
+}
+
+Bool
+xf86VTSwitchAway(void)
+{
+ return(FALSE);
+}
+
+Bool
+xf86VTSwitchTo(void)
+{
+ return(TRUE);
+}
+
+Bool
+xf86VTActivate(int vtno)
+{
+ return(TRUE);
+}
diff --git a/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c b/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c index 9308640e2..34bca7ae2 100644 --- a/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c +++ b/xorg-server/hw/xfree86/os-support/shared/VTsw_usl.c @@ -1,90 +1,101 @@ -/* - * Copyright 1993 by David Wexelblat <dwex@XFree86.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 name of David Wexelblat not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. David Wexelblat makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -#ifdef OSHEADER -# include OSHEADER -#endif - -/* - * Handle the VT-switching interface for OSs that use USL-style ioctl()s - * (the sysv, sco, and linux subdirs). - */ - -/* - * This function is the signal handler for the VT-switching signal. It - * is only referenced inside the OS-support layer. - */ -void -xf86VTRequest(int sig) -{ - signal(sig, (void(*)(int))xf86VTRequest); - xf86Info.vtRequestsPending = TRUE; - return; -} - -Bool -xf86VTSwitchPending(void) -{ - return(xf86Info.vtRequestsPending ? TRUE : FALSE); -} - -Bool -xf86VTSwitchAway(void) -{ - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) - { - return(FALSE); - } - else - { -#ifdef OSSWITCHAWAY - OSSWITCHAWAY; -#endif - return(TRUE); - } -} - -Bool -xf86VTSwitchTo(void) -{ - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) - { - return(FALSE); - } - else - { - return(TRUE); - } -} +/*
+ * Copyright 1993 by David Wexelblat <dwex@XFree86.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 name of David Wexelblat not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. David Wexelblat makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifdef OSHEADER
+# include OSHEADER
+#endif
+
+/*
+ * Handle the VT-switching interface for OSs that use USL-style ioctl()s
+ * (the sysv, sco, and linux subdirs).
+ */
+
+/*
+ * This function is the signal handler for the VT-switching signal. It
+ * is only referenced inside the OS-support layer.
+ */
+void
+xf86VTRequest(int sig)
+{
+ signal(sig, (void(*)(int))xf86VTRequest);
+ xf86Info.vtRequestsPending = TRUE;
+ return;
+}
+
+Bool
+xf86VTSwitchPending(void)
+{
+ return(xf86Info.vtRequestsPending ? TRUE : FALSE);
+}
+
+Bool
+xf86VTSwitchAway(void)
+{
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
+ {
+ return(FALSE);
+ }
+ else
+ {
+#ifdef OSSWITCHAWAY
+ OSSWITCHAWAY;
+#endif
+ return(TRUE);
+ }
+}
+
+Bool
+xf86VTSwitchTo(void)
+{
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
+ {
+ return(FALSE);
+ }
+ else
+ {
+ return(TRUE);
+ }
+}
+
+Bool
+xf86VTActivate(int vtno)
+{
+#ifdef VT_ACTIVATE
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) {
+ return(FALSE);
+ }
+#endif
+ return(TRUE);
+}
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_VTsw.c b/xorg-server/hw/xfree86/os-support/solaris/sun_VTsw.c index ded2f271e..ee5c7c064 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/sun_VTsw.c +++ b/xorg-server/hw/xfree86/os-support/solaris/sun_VTsw.c @@ -1,104 +1,137 @@ -/* - * Copyright 2009 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, 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 (including the next - * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. - */ - -#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 <door.h> -#include <sys/vtdaemon.h> - -/* - * Handle the VT-switching interface for Solaris/OpenSolaris - */ - -void -xf86VTRequest(int sig) -{ - if (xf86Info.vtPendingNum != -1) - { - ioctl(xf86Info.consoleFd, VT_RELDISP, 1); - xf86Info.vtPendingNum = -1; - - return; - } - - xf86Info.vtRequestsPending = TRUE; - return; -} - -Bool -xf86VTSwitchPending(void) -{ - return(xf86Info.vtRequestsPending ? TRUE : FALSE); -} - -Bool -xf86VTSwitchAway(void) -{ - int door_fd; - vt_cmd_arg_t vt_door_arg; - door_arg_t door_arg; - - xf86Info.vtRequestsPending = FALSE; - - vt_door_arg.vt_ev = VT_EV_HOTKEYS; - vt_door_arg.vt_num = xf86Info.vtPendingNum; - door_arg.data_ptr = (char *)&vt_door_arg; - door_arg.data_size = sizeof (vt_cmd_arg_t); - door_arg.rbuf = NULL; - door_arg.rsize = 0; - door_arg.desc_ptr = NULL; - door_arg.desc_num = 0; - - if ((door_fd = open(VT_DAEMON_DOOR_FILE, O_RDONLY)) < 0) - return (FALSE); - - if (door_call(door_fd, &door_arg) != 0) { - close(door_fd); - return (FALSE); - } - - close(door_fd); - return (TRUE); -} - -Bool -xf86VTSwitchTo(void) -{ - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) - { - return(FALSE); - } - else - { - return(TRUE); - } -} +/*
+ * Copyright 2009 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, 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
+ */
+
+#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 <door.h>
+#include <sys/vtdaemon.h>
+
+/*
+ * Handle the VT-switching interface for Solaris/OpenSolaris
+ */
+
+static int xf86VTPruneDoor = 0;
+
+void
+xf86VTRelease(int sig)
+{
+ if (xf86Info.vtPendingNum == -1)
+ {
+ xf86VTPruneDoor = 1;
+ xf86Info.vtRequestsPending = TRUE;
+ return;
+ }
+
+ ioctl(xf86Info.consoleFd, VT_RELDISP, 1);
+ xf86Info.vtPendingNum = -1;
+
+ return;
+}
+
+void
+xf86VTAcquire(int sig)
+{
+ xf86Info.vtRequestsPending = TRUE;
+ return;
+}
+
+Bool
+xf86VTSwitchPending(void)
+{
+ return(xf86Info.vtRequestsPending ? TRUE : FALSE);
+}
+
+Bool
+xf86VTSwitchAway(void)
+{
+ int door_fd;
+ vt_cmd_arg_t vt_door_arg;
+ door_arg_t door_arg;
+
+ xf86Info.vtRequestsPending = FALSE;
+
+ if (xf86VTPruneDoor) {
+ xf86VTPruneDoor = 0;
+ ioctl(xf86Info.consoleFd, VT_RELDISP, 1);
+ return (TRUE);
+ }
+
+ vt_door_arg.vt_ev = VT_EV_HOTKEYS;
+ vt_door_arg.vt_num = xf86Info.vtPendingNum;
+ door_arg.data_ptr = (char *)&vt_door_arg;
+ door_arg.data_size = sizeof (vt_cmd_arg_t);
+ door_arg.rbuf = NULL;
+ door_arg.rsize = 0;
+ door_arg.desc_ptr = NULL;
+ door_arg.desc_num = 0;
+
+ if ((door_fd = open(VT_DAEMON_DOOR_FILE, O_RDONLY)) < 0)
+ return (FALSE);
+
+ if (door_call(door_fd, &door_arg) != 0) {
+ close(door_fd);
+ return (FALSE);
+ }
+
+ close(door_fd);
+ return (TRUE);
+}
+
+Bool
+xf86VTSwitchTo(void)
+{
+ xf86Info.vtRequestsPending = FALSE;
+ if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
+ {
+ return(FALSE);
+ }
+ else
+ {
+ return(TRUE);
+ }
+}
+
+Bool
+xf86VTActivate(int vtno)
+{
+ struct vt_stat state;
+
+ if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0)
+ return(FALSE);
+
+ if ((state.v_state & (1 << vtno)) == 0)
+ return(FALSE);
+
+ xf86Info.vtRequestsPending = TRUE;
+ xf86Info.vtPendingNum = vtno;
+
+ return(TRUE);
+}
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_init.c b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c index 2c569f02c..82df2e9dd 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/sun_init.c +++ b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c @@ -1,360 +1,367 @@ -/* - * 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" -#ifdef HAVE_SYS_KD_H -# 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; -static int vtEnabled = 0; -#endif - -/* Device to open as xf86Info.consoleFd */ -static char consoleDev[PATH_MAX] = "/dev/fb"; - -/* Set by -dev argument on CLI - Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */ -_X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb"; - -void -xf86OpenConsole(void) -{ - int i; -#ifdef HAS_USL_VTS - int fd; - 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 ((fd = open("/dev/vt/0",O_RDWR,0)) == -1) - { - xf86ErrorF("xf86OpenConsole: Cannot open /dev/vt/0 (%s)\n", - strerror(errno)); - vtEnabled = 0; - } - else - { - if (ioctl(fd, VT_ENABLED, &vtEnabled) < 0) - { - xf86ErrorF("xf86OpenConsole: VT_ENABLED failed (%s)\n", - strerror(errno)); - vtEnabled = 0; - } - } - - - if (vtEnabled == 0) - { - /* VT not enabled - kernel too old or Sparc platforms - without visual_io support */ - xf86Msg(from, "VT infrastructure is not available\n"); - - xf86StartVT = 0; - xf86Info.vtno = 0; - strlcpy(consoleDev, xf86SolarisFbDev, sizeof(consoleDev)); - } - else - { - if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0) - FatalError("xf86OpenConsole: Cannot determine current VT\n"); - - xf86StartVT = vtinfo.v_active; - - if (VTnum != -1) - { - xf86Info.vtno = VTnum; - from = X_CMDLINE; - } - else - { - if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || - (xf86Info.vtno == -1)) { - FatalError("xf86OpenConsole: Cannot find a free VT\n"); - } - } - - xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno); - snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno); - } - - if (fd != -1) { - close(fd); - } - -#endif /* HAS_USL_VTS */ - - if (!KeepTty) - setpgrp(); - - if (((xf86Info.consoleFd = open(consoleDev, O_RDWR | O_NDELAY, 0)) < 0)) - FatalError("xf86OpenConsole: Cannot open %s (%s)\n", - consoleDev, strerror(errno)); - -#ifdef HAS_USL_VTS - - /* Change ownership of the vt */ - chown(consoleDev, getuid(), getgid()); - - if (vtEnabled) - { - /* - * 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"); - - OsSignal(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"); - - if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0) - xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n"); - } -#endif - -#ifdef KDSETMODE - SYSCALL(i = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS)); - if (i < 0) { - xf86Msg(X_WARNING, - "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n", - consoleDev, strerror(errno)); - } -#endif - } - else /* serverGeneration != 1 */ - { -#ifdef HAS_USL_VTS - if (vtEnabled) { - /* - * 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 (!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(xf86SolarisFbDev, 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 { - memset(fbdata, 0, fbattr.fbtype.fb_size); - munmap(fbdata, fbattr.fbtype.fb_size); - } - } - - close(fd); - } - } - -#endif - -#ifdef KDSETMODE - /* Reset the display back to text mode */ - SYSCALL(ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT)); -#endif - -#ifdef HAS_USL_VTS - if (vtEnabled == 1) { - 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%d", &VTnum) == 0) - { - UseMsg(); - VTnum = -1; - return 0; - } - - return 1; - } - -#endif /* HAS_USL_VTS */ - - if ((i + 1) < argc) { - if (!strcmp(argv[i], "-dev")) { - strlcpy(xf86SolarisFbDev, argv[i+1], sizeof(xf86SolarisFbDev)); - return 2; - } - } - - return 0; -} - -void xf86UseMsg() -{ -#ifdef HAS_USL_VTS - ErrorF("vtX Use the specified VT number\n"); -#endif - ErrorF("-dev <fb> Framebuffer device\n"); - ErrorF("-keeptty Don't detach controlling tty\n"); - ErrorF(" (for debugging only)\n"); -} +/*
+ * 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"
+#ifdef HAVE_SYS_KD_H
+# 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;
+static int vtEnabled = 0;
+extern void xf86VTAcquire(int);
+extern void xf86VTRelease(int);
+#endif
+
+/* Device to open as xf86Info.consoleFd */
+static char consoleDev[PATH_MAX] = "/dev/fb";
+
+/* Set by -dev argument on CLI
+ Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
+_X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
+
+void
+xf86OpenConsole(void)
+{
+ int i;
+#ifdef HAS_USL_VTS
+ int fd;
+ 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 ((fd = open("/dev/vt/0",O_RDWR,0)) == -1)
+ {
+ xf86ErrorF("xf86OpenConsole: Cannot open /dev/vt/0 (%s)\n",
+ strerror(errno));
+ vtEnabled = 0;
+ }
+ else
+ {
+ if (ioctl(fd, VT_ENABLED, &vtEnabled) < 0)
+ {
+ xf86ErrorF("xf86OpenConsole: VT_ENABLED failed (%s)\n",
+ strerror(errno));
+ vtEnabled = 0;
+ }
+ }
+
+
+ if (vtEnabled == 0)
+ {
+ /* VT not enabled - kernel too old or Sparc platforms
+ without visual_io support */
+ xf86Msg(from, "VT infrastructure is not available\n");
+
+ xf86StartVT = 0;
+ xf86Info.vtno = 0;
+ strlcpy(consoleDev, xf86SolarisFbDev, sizeof(consoleDev));
+ }
+ else
+ {
+ if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
+ FatalError("xf86OpenConsole: Cannot determine current VT\n");
+
+ xf86StartVT = vtinfo.v_active;
+
+ if (VTnum != -1)
+ {
+ xf86Info.vtno = VTnum;
+ from = X_CMDLINE;
+ }
+ else
+ {
+ if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
+ (xf86Info.vtno == -1))
+ {
+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
+ }
+ }
+
+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
+ snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
+ }
+
+ if (fd != -1)
+ {
+ close(fd);
+ }
+
+#endif /* HAS_USL_VTS */
+
+ if (!KeepTty)
+ setpgrp();
+
+ if (((xf86Info.consoleFd = open(consoleDev, O_RDWR | O_NDELAY, 0)) < 0))
+ FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
+ consoleDev, strerror(errno));
+
+#ifdef HAS_USL_VTS
+
+ /* Change ownership of the vt */
+ chown(consoleDev, getuid(), getgid());
+
+ if (vtEnabled)
+ {
+ /*
+ * 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");
+
+ OsSignal(SIGUSR1, xf86VTAcquire);
+ OsSignal(SIGUSR2, xf86VTRelease);
+
+ VT.mode = VT_PROCESS;
+ VT.acqsig = SIGUSR1;
+ VT.relsig = SIGUSR2;
+
+ if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
+ }
+#endif
+
+#ifdef KDSETMODE
+ SYSCALL(i = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS));
+ if (i < 0) {
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n",
+ consoleDev, strerror(errno));
+ }
+#endif
+ }
+ else /* serverGeneration != 1 */
+ {
+#ifdef HAS_USL_VTS
+ if (vtEnabled)
+ {
+ /*
+ * 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 (!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(xf86SolarisFbDev, 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 {
+ memset(fbdata, 0, fbattr.fbtype.fb_size);
+ munmap(fbdata, fbattr.fbtype.fb_size);
+ }
+ }
+
+ close(fd);
+ }
+ }
+
+#endif
+
+#ifdef KDSETMODE
+ /* Reset the display back to text mode */
+ SYSCALL(ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT));
+#endif
+
+#ifdef HAS_USL_VTS
+ if (vtEnabled)
+ {
+ 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%d", &VTnum) == 0)
+ {
+ UseMsg();
+ VTnum = -1;
+ return 0;
+ }
+
+ return 1;
+ }
+
+#endif /* HAS_USL_VTS */
+
+ if ((i + 1) < argc) {
+ if (!strcmp(argv[i], "-dev")) {
+ strlcpy(xf86SolarisFbDev, argv[i+1], sizeof(xf86SolarisFbDev));
+ return 2;
+ }
+ }
+
+ return 0;
+}
+
+void xf86UseMsg()
+{
+#ifdef HAS_USL_VTS
+ ErrorF("vtX Use the specified VT number\n");
+#endif
+ ErrorF("-dev <fb> Framebuffer device\n");
+ ErrorF("-keeptty Don't detach controlling tty\n");
+ ErrorF(" (for debugging only)\n");
+}
diff --git a/xorg-server/hw/xfree86/os-support/xf86_OSproc.h b/xorg-server/hw/xfree86/os-support/xf86_OSproc.h index c1a117334..3fc332e13 100644 --- a/xorg-server/hw/xfree86/os-support/xf86_OSproc.h +++ b/xorg-server/hw/xfree86/os-support/xf86_OSproc.h @@ -1,219 +1,220 @@ -/* - * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany - * Copyright 1992 by David Dawes <dawes@XFree86.org> - * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu> - * Copyright 1992 by Rich Murphey <Rich@Rice.edu> - * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu> - * Copyright 1992 by Orest Zborowski <obz@eskimo.com> - * Copyright 1993 by Vrije Universiteit, The Netherlands - * Copyright 1993 by David Wexelblat <dwex@XFree86.org> - * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de> - * Copyright 1994-2003 by The XFree86 Project, Inc - * - * 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 above listed copyright holders - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. The above listed - * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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. - * - */ - -/* - * The ARM32 code here carries the following copyright: - * - * Copyright 1997 - * Digital Equipment Corporation. All rights reserved. - * This software is furnished under license and may be used and copied only in - * accordance with the following terms and conditions. Subject to these - * conditions, you may download, copy, install, use, modify and distribute - * this software in source and/or binary form. No title or ownership is - * transferred hereby. - * - * 1) Any source code used, modified or distributed must reproduce and retain - * this copyright notice and list of conditions as they appear in the - * source file. - * - * 2) No right is granted to use any trade name, trademark, or logo of Digital - * Equipment Corporation. Neither the "Digital Equipment Corporation" - * name nor any trademark or logo of Digital Equipment Corporation may be - * used to endorse or promote products derived from this software without - * the prior written permission of Digital Equipment Corporation. - * - * 3) This software is provided "AS-IS" and any express or implied warranties, - * including but not limited to, any implied warranties of merchantability, - * fitness for a particular purpose, or non-infringement are disclaimed. - * In no event shall DIGITAL be liable for any damages whatsoever, and in - * particular, DIGITAL shall not be liable for special, indirect, - * consequential, or incidental damages or damages for lost profits, loss - * of revenue or loss of use, whether such damages arise in contract, - * negligence, tort, under statute, in equity, at law or otherwise, even - * if advised of the possibility of such damage. - * - */ - - -#ifndef _XF86_OSPROC_H -#define _XF86_OSPROC_H - -/* - * The actual prototypes have been pulled into this seperate file so - * that they can can be used without pulling in all of the OS specific - * stuff like sys/stat.h, etc. This casues problem for loadable modules. - */ - -/* - * Flags for xf86MapVidMem(). Multiple flags can be or'd together. The - * flags may be used as hints. For example it would be permissible to - * enable write combining for memory marked only for framebuffer use. - */ - -#define VIDMEM_FRAMEBUFFER 0x01 /* memory for framebuffer use */ -#define VIDMEM_MMIO 0x02 /* memory for I/O use */ -#define VIDMEM_MMIO_32BIT 0x04 /* memory accesses >= 32bit */ -#define VIDMEM_READSIDEEFFECT 0x08 /* reads can have side-effects */ -#define VIDMEM_SPARSE 0x10 /* sparse mapping required - * assumed when VIDMEM_MMIO is - * set. May be used with - * VIDMEM_FRAMEBUFFER) */ -#define VIDMEM_READONLY 0x20 /* read-only mapping - * used when reading BIOS images - * through xf86MapVidMem() */ - -/* - * OS-independent modem state flags for xf86SetSerialModemState() and - * xf86GetSerialModemState(). - */ -#define XF86_M_LE 0x001 /* line enable */ -#define XF86_M_DTR 0x002 /* data terminal ready */ -#define XF86_M_RTS 0x004 /* request to send */ -#define XF86_M_ST 0x008 /* secondary transmit */ -#define XF86_M_SR 0x010 /* secondary receive */ -#define XF86_M_CTS 0x020 /* clear to send */ -#define XF86_M_CAR 0x040 /* carrier detect */ -#define XF86_M_RNG 0x080 /* ring */ -#define XF86_M_DSR 0x100 /* data set ready */ - -#ifndef NO_OSLIB_PROTOTYPES -/* - * This is to prevent re-entrancy to FatalError() when aborting. - * Anything that can be called as a result of AbortDDX() should use this - * instead of FatalError(). - */ - -#define xf86FatalError(a, b) \ - if (dispatchException & DE_TERMINATE) { \ - ErrorF(a, b); \ - ErrorF("\n"); \ - return; \ - } else FatalError(a, b) - -/***************************************************************************/ -/* Prototypes */ -/***************************************************************************/ - -#include <X11/Xfuncproto.h> -#include "opaque.h" - -_XFUNCPROTOBEGIN - -/* public functions */ -extern _X_EXPORT Bool xf86LinearVidMem(void); -extern _X_EXPORT Bool xf86CheckMTRR(int); -extern _X_EXPORT pointer xf86MapVidMem(int, int, unsigned long, unsigned long); -extern _X_EXPORT void xf86UnMapVidMem(int, pointer, unsigned long); -extern _X_EXPORT void xf86MapReadSideEffects(int, int, pointer, unsigned long); -extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int); -extern _X_EXPORT Bool xf86EnableIO(void); -extern _X_EXPORT void xf86DisableIO(void); -#ifdef __NetBSD__ -extern _X_EXPORT void xf86SetTVOut(int); -extern _X_EXPORT void xf86SetRGBOut(void); -#endif -extern _X_EXPORT void xf86OSRingBell(int, int, int); -extern _X_EXPORT void xf86SetReallySlowBcopy(void); -extern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int); -extern _X_EXPORT int xf86OpenSerial(pointer options); -extern _X_EXPORT int xf86SetSerial(int fd, pointer options); -extern _X_EXPORT int xf86SetSerialSpeed(int fd, int speed); -extern _X_EXPORT int xf86ReadSerial(int fd, void *buf, int count); -extern _X_EXPORT int xf86WriteSerial(int fd, const void *buf, int count); -extern _X_EXPORT int xf86CloseSerial(int fd); -extern _X_EXPORT int xf86FlushInput(int fd); -extern _X_EXPORT int xf86WaitForInput(int fd, int timeout); -extern _X_EXPORT int xf86SerialSendBreak(int fd, int duration); -extern _X_EXPORT int xf86SetSerialModemState(int fd, int state); -extern _X_EXPORT int xf86GetSerialModemState(int fd); -extern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits); -extern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits); -extern _X_EXPORT int xf86LoadKernelModule(const char *pathname); - -/* AGP GART interface */ - -typedef struct _AgpInfo { - CARD32 bridgeId; - CARD32 agpMode; - unsigned long base; - unsigned long size; - unsigned long totalPages; - unsigned long systemPages; - unsigned long usedPages; -} AgpInfo, *AgpInfoPtr; - -extern _X_EXPORT Bool xf86AgpGARTSupported(void); -extern _X_EXPORT AgpInfoPtr xf86GetAGPInfo(int screenNum); -extern _X_EXPORT Bool xf86AcquireGART(int screenNum); -extern _X_EXPORT Bool xf86ReleaseGART(int screenNum); -extern _X_EXPORT int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type, - unsigned long *physical); -extern _X_EXPORT Bool xf86DeallocateGARTMemory(int screenNum, int key); -extern _X_EXPORT Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset); -extern _X_EXPORT Bool xf86UnbindGARTMemory(int screenNum, int key); -extern _X_EXPORT Bool xf86EnableAGP(int screenNum, CARD32 mode); -extern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum); - -/* These routines are in shared/sigio.c and are not loaded as part of the - module. These routines are small, and the code if very POSIX-signal (or - OS-signal) specific, so it seemed better to provide more complex - wrappers than to wrap each individual function called. */ -extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *); -extern _X_EXPORT int xf86RemoveSIGIOHandler(int fd); -extern _X_EXPORT int xf86BlockSIGIO (void); -extern _X_EXPORT void xf86UnblockSIGIO (int); -extern _X_EXPORT void xf86AssertBlockedSIGIO (char *); -extern _X_EXPORT Bool xf86SIGIOSupported (void); - -#ifdef XF86_OS_PRIVS -typedef void (*PMClose)(void); -extern _X_EXPORT void xf86OpenConsole(void); -extern _X_EXPORT void xf86CloseConsole(void); -extern _X_EXPORT Bool xf86VTSwitchPending(void); -extern _X_EXPORT Bool xf86VTSwitchAway(void); -extern _X_EXPORT Bool xf86VTSwitchTo(void); -extern _X_EXPORT void xf86VTRequest(int sig); -extern _X_EXPORT int xf86ProcessArgument(int, char **, int); -extern _X_EXPORT void xf86UseMsg(void); -extern _X_EXPORT PMClose xf86OSPMOpen(void); - -extern _X_EXPORT void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer); -extern _X_EXPORT void xf86InitVidMem(void); - -#endif /* XF86_OS_PRIVS */ - - -_XFUNCPROTOEND -#endif /* NO_OSLIB_PROTOTYPES */ - -#endif /* _XF86_OSPROC_H */ +/*
+ * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1992 by David Dawes <dawes@XFree86.org>
+ * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
+ * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
+ * Copyright 1993 by Vrije Universiteit, The Netherlands
+ * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
+ * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
+ * Copyright 1994-2003 by The XFree86 Project, Inc
+ *
+ * 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 above listed copyright holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ * This software is furnished under license and may be used and copied only in
+ * accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * this software in source and/or binary form. No title or ownership is
+ * transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and retain
+ * this copyright notice and list of conditions as they appear in the
+ * source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied warranties,
+ * including but not limited to, any implied warranties of merchantability,
+ * fitness for a particular purpose, or non-infringement are disclaimed.
+ * In no event shall DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+
+#ifndef _XF86_OSPROC_H
+#define _XF86_OSPROC_H
+
+/*
+ * The actual prototypes have been pulled into this seperate file so
+ * that they can can be used without pulling in all of the OS specific
+ * stuff like sys/stat.h, etc. This casues problem for loadable modules.
+ */
+
+/*
+ * Flags for xf86MapVidMem(). Multiple flags can be or'd together. The
+ * flags may be used as hints. For example it would be permissible to
+ * enable write combining for memory marked only for framebuffer use.
+ */
+
+#define VIDMEM_FRAMEBUFFER 0x01 /* memory for framebuffer use */
+#define VIDMEM_MMIO 0x02 /* memory for I/O use */
+#define VIDMEM_MMIO_32BIT 0x04 /* memory accesses >= 32bit */
+#define VIDMEM_READSIDEEFFECT 0x08 /* reads can have side-effects */
+#define VIDMEM_SPARSE 0x10 /* sparse mapping required
+ * assumed when VIDMEM_MMIO is
+ * set. May be used with
+ * VIDMEM_FRAMEBUFFER) */
+#define VIDMEM_READONLY 0x20 /* read-only mapping
+ * used when reading BIOS images
+ * through xf86MapVidMem() */
+
+/*
+ * OS-independent modem state flags for xf86SetSerialModemState() and
+ * xf86GetSerialModemState().
+ */
+#define XF86_M_LE 0x001 /* line enable */
+#define XF86_M_DTR 0x002 /* data terminal ready */
+#define XF86_M_RTS 0x004 /* request to send */
+#define XF86_M_ST 0x008 /* secondary transmit */
+#define XF86_M_SR 0x010 /* secondary receive */
+#define XF86_M_CTS 0x020 /* clear to send */
+#define XF86_M_CAR 0x040 /* carrier detect */
+#define XF86_M_RNG 0x080 /* ring */
+#define XF86_M_DSR 0x100 /* data set ready */
+
+#ifndef NO_OSLIB_PROTOTYPES
+/*
+ * This is to prevent re-entrancy to FatalError() when aborting.
+ * Anything that can be called as a result of AbortDDX() should use this
+ * instead of FatalError().
+ */
+
+#define xf86FatalError(a, b) \
+ if (dispatchException & DE_TERMINATE) { \
+ ErrorF(a, b); \
+ ErrorF("\n"); \
+ return; \
+ } else FatalError(a, b)
+
+/***************************************************************************/
+/* Prototypes */
+/***************************************************************************/
+
+#include <X11/Xfuncproto.h>
+#include "opaque.h"
+
+_XFUNCPROTOBEGIN
+
+/* public functions */
+extern _X_EXPORT Bool xf86LinearVidMem(void);
+extern _X_EXPORT Bool xf86CheckMTRR(int);
+extern _X_EXPORT pointer xf86MapVidMem(int, int, unsigned long, unsigned long);
+extern _X_EXPORT void xf86UnMapVidMem(int, pointer, unsigned long);
+extern _X_EXPORT void xf86MapReadSideEffects(int, int, pointer, unsigned long);
+extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int);
+extern _X_EXPORT Bool xf86EnableIO(void);
+extern _X_EXPORT void xf86DisableIO(void);
+#ifdef __NetBSD__
+extern _X_EXPORT void xf86SetTVOut(int);
+extern _X_EXPORT void xf86SetRGBOut(void);
+#endif
+extern _X_EXPORT void xf86OSRingBell(int, int, int);
+extern _X_EXPORT void xf86SetReallySlowBcopy(void);
+extern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int);
+extern _X_EXPORT int xf86OpenSerial(pointer options);
+extern _X_EXPORT int xf86SetSerial(int fd, pointer options);
+extern _X_EXPORT int xf86SetSerialSpeed(int fd, int speed);
+extern _X_EXPORT int xf86ReadSerial(int fd, void *buf, int count);
+extern _X_EXPORT int xf86WriteSerial(int fd, const void *buf, int count);
+extern _X_EXPORT int xf86CloseSerial(int fd);
+extern _X_EXPORT int xf86FlushInput(int fd);
+extern _X_EXPORT int xf86WaitForInput(int fd, int timeout);
+extern _X_EXPORT int xf86SerialSendBreak(int fd, int duration);
+extern _X_EXPORT int xf86SetSerialModemState(int fd, int state);
+extern _X_EXPORT int xf86GetSerialModemState(int fd);
+extern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits);
+extern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits);
+extern _X_EXPORT int xf86LoadKernelModule(const char *pathname);
+
+/* AGP GART interface */
+
+typedef struct _AgpInfo {
+ CARD32 bridgeId;
+ CARD32 agpMode;
+ unsigned long base;
+ unsigned long size;
+ unsigned long totalPages;
+ unsigned long systemPages;
+ unsigned long usedPages;
+} AgpInfo, *AgpInfoPtr;
+
+extern _X_EXPORT Bool xf86AgpGARTSupported(void);
+extern _X_EXPORT AgpInfoPtr xf86GetAGPInfo(int screenNum);
+extern _X_EXPORT Bool xf86AcquireGART(int screenNum);
+extern _X_EXPORT Bool xf86ReleaseGART(int screenNum);
+extern _X_EXPORT int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
+ unsigned long *physical);
+extern _X_EXPORT Bool xf86DeallocateGARTMemory(int screenNum, int key);
+extern _X_EXPORT Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset);
+extern _X_EXPORT Bool xf86UnbindGARTMemory(int screenNum, int key);
+extern _X_EXPORT Bool xf86EnableAGP(int screenNum, CARD32 mode);
+extern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum);
+
+/* These routines are in shared/sigio.c and are not loaded as part of the
+ module. These routines are small, and the code if very POSIX-signal (or
+ OS-signal) specific, so it seemed better to provide more complex
+ wrappers than to wrap each individual function called. */
+extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
+extern _X_EXPORT int xf86RemoveSIGIOHandler(int fd);
+extern _X_EXPORT int xf86BlockSIGIO (void);
+extern _X_EXPORT void xf86UnblockSIGIO (int);
+extern _X_EXPORT void xf86AssertBlockedSIGIO (char *);
+extern _X_EXPORT Bool xf86SIGIOSupported (void);
+
+#ifdef XF86_OS_PRIVS
+typedef void (*PMClose)(void);
+extern _X_EXPORT void xf86OpenConsole(void);
+extern _X_EXPORT void xf86CloseConsole(void);
+extern _X_HIDDEN Bool xf86VTActivate(int vtno);
+extern _X_EXPORT Bool xf86VTSwitchPending(void);
+extern _X_EXPORT Bool xf86VTSwitchAway(void);
+extern _X_EXPORT Bool xf86VTSwitchTo(void);
+extern _X_EXPORT void xf86VTRequest(int sig);
+extern _X_EXPORT int xf86ProcessArgument(int, char **, int);
+extern _X_EXPORT void xf86UseMsg(void);
+extern _X_EXPORT PMClose xf86OSPMOpen(void);
+
+extern _X_EXPORT void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer);
+extern _X_EXPORT void xf86InitVidMem(void);
+
+#endif /* XF86_OS_PRIVS */
+
+
+_XFUNCPROTOEND
+#endif /* NO_OSLIB_PROTOTYPES */
+
+#endif /* _XF86_OSPROC_H */
diff --git a/xorg-server/hw/xfree86/x86emu/ops.c b/xorg-server/hw/xfree86/x86emu/ops.c index 37ae2c9c9..740a3a58d 100644 --- a/xorg-server/hw/xfree86/x86emu/ops.c +++ b/xorg-server/hw/xfree86/x86emu/ops.c @@ -1,11697 +1,11717 @@ -/**************************************************************************** -* -* Realmode X86 Emulator Library -* -* Copyright (C) 1996-1999 SciTech Software, Inc. -* Copyright (C) David Mosberger-Tang -* Copyright (C) 1999 Egbert Eich -* -* ======================================================================== -* -* 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 name of the authors not be used -* in advertising or publicity pertaining to distribution of the software -* without specific, written prior permission. The authors makes no -* representations about the suitability of this software for any purpose. -* It is provided "as is" without express or implied warranty. -* -* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -* EVENT SHALL THE AUTHORS 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. -* -* ======================================================================== -* -* Language: ANSI C -* Environment: Any -* Developer: Kendall Bennett -* -* Description: This file includes subroutines to implement the decoding -* and emulation of all the x86 processor instructions. -* -* There are approximately 250 subroutines in here, which correspond -* to the 256 byte-"opcodes" found on the 8086. The table which -* dispatches this is found in the files optab.[ch]. -* -* Each opcode proc has a comment preceeding it which gives it's table -* address. Several opcodes are missing (undefined) in the table. -* -* Each proc includes information for decoding (DECODE_PRINTF and -* DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc -* functions (START_OF_INSTR, END_OF_INSTR). -* -* Many of the procedures are *VERY* similar in coding. This has -* allowed for a very large amount of code to be generated in a fairly -* short amount of time (i.e. cut, paste, and modify). The result is -* that much of the code below could have been folded into subroutines -* for a large reduction in size of this file. The downside would be -* that there would be a penalty in execution speed. The file could -* also have been *MUCH* larger by inlining certain functions which -* were called. This could have resulted even faster execution. The -* prime directive I used to decide whether to inline the code or to -* modularize it, was basically: 1) no unnecessary subroutine calls, -* 2) no routines more than about 200 lines in size, and 3) modularize -* any code that I might not get right the first time. The fetch_* -* subroutines fall into the latter category. The The decode_* fall -* into the second category. The coding of the "switch(mod){ .... }" -* in many of the subroutines below falls into the first category. -* Especially, the coding of {add,and,or,sub,...}_{byte,word} -* subroutines are an especially glaring case of the third guideline. -* Since so much of the code is cloned from other modules (compare -* opcode #00 to opcode #01), making the basic operations subroutine -* calls is especially important; otherwise mistakes in coding an -* "add" would represent a nightmare in maintenance. -* -****************************************************************************/ - -#include "x86emu/x86emui.h" - -/*----------------------------- Implementation ----------------------------*/ - -/**************************************************************************** -PARAMETERS: -op1 - Instruction op code - -REMARKS: -Handles illegal opcodes. -****************************************************************************/ -static void x86emuOp_illegal_op( - u8 op1) -{ - START_OF_INSTR(); - if (M.x86.R_SP != 0) { - DECODE_PRINTF("ILLEGAL X86 OPCODE\n"); - TRACE_REGS(); - DB( printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n", - M.x86.R_CS, M.x86.R_IP-1,op1)); - HALT_SYS(); - } - else { - /* If we get here, it means the stack pointer is back to zero - * so we are just returning from an emulator service call - * so therte is no need to display an error message. We trap - * the emulator with an 0xF1 opcode to finish the service - * call. - */ - X86EMU_halt_sys(); - } - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x00 -****************************************************************************/ -static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - u8 *destreg, *srcreg; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("ADD\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x01 -****************************************************************************/ -static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("ADD\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = add_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x02 -****************************************************************************/ -static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("ADD\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x03 -****************************************************************************/ -static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("ADD\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_word(*destreg, srcval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = add_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x04 -****************************************************************************/ -static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("ADD\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - M.x86.R_AL = add_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x05 -****************************************************************************/ -static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("ADD\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("ADD\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = add_long(M.x86.R_EAX, srcval); - } else { - M.x86.R_AX = add_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x06 -****************************************************************************/ -static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("PUSH\tES\n"); - TRACE_AND_STEP(); - push_word(M.x86.R_ES); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x07 -****************************************************************************/ -static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("POP\tES\n"); - TRACE_AND_STEP(); - M.x86.R_ES = pop_word(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x08 -****************************************************************************/ -static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("OR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x09 -****************************************************************************/ -static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("OR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = or_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x0a -****************************************************************************/ -static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("OR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x0b -****************************************************************************/ -static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("OR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_word(*destreg, srcval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = or_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x0c -****************************************************************************/ -static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("OR\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - M.x86.R_AL = or_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x0d -****************************************************************************/ -static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("OR\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("OR\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = or_long(M.x86.R_EAX, srcval); - } else { - M.x86.R_AX = or_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x0e -****************************************************************************/ -static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("PUSH\tCS\n"); - TRACE_AND_STEP(); - push_word(M.x86.R_CS); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x0f. Escape for two-byte opcode (286 or better) -****************************************************************************/ -static void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1)) -{ - u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++)); - INC_DECODED_INST_LEN(1); - (*x86emu_optab2[op2])(op2); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x10 -****************************************************************************/ -static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("ADC\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x11 -****************************************************************************/ -static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("ADC\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = adc_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x12 -****************************************************************************/ -static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("ADC\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x13 -****************************************************************************/ -static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("ADC\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_word(*destreg, srcval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = adc_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x14 -****************************************************************************/ -static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("ADC\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - M.x86.R_AL = adc_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x15 -****************************************************************************/ -static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("ADC\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("ADC\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval); - } else { - M.x86.R_AX = adc_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x16 -****************************************************************************/ -static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("PUSH\tSS\n"); - TRACE_AND_STEP(); - push_word(M.x86.R_SS); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x17 -****************************************************************************/ -static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("POP\tSS\n"); - TRACE_AND_STEP(); - M.x86.R_SS = pop_word(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x18 -****************************************************************************/ -static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("SBB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x19 -****************************************************************************/ -static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("SBB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sbb_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x1a -****************************************************************************/ -static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("SBB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x1b -****************************************************************************/ -static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("SBB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_word(*destreg, srcval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sbb_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x1c -****************************************************************************/ -static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("SBB\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - M.x86.R_AL = sbb_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x1d -****************************************************************************/ -static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("SBB\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("SBB\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval); - } else { - M.x86.R_AX = sbb_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x1e -****************************************************************************/ -static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("PUSH\tDS\n"); - TRACE_AND_STEP(); - push_word(M.x86.R_DS); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x1f -****************************************************************************/ -static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("POP\tDS\n"); - TRACE_AND_STEP(); - M.x86.R_DS = pop_word(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x20 -****************************************************************************/ -static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("AND\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x21 -****************************************************************************/ -static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("AND\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = and_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x22 -****************************************************************************/ -static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("AND\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x23 -****************************************************************************/ -static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("AND\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_long(*destreg, srcval); - break; - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_word(*destreg, srcval); - break; - } - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = and_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x24 -****************************************************************************/ -static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("AND\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - M.x86.R_AL = and_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x25 -****************************************************************************/ -static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("AND\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("AND\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = and_long(M.x86.R_EAX, srcval); - } else { - M.x86.R_AX = and_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x26 -****************************************************************************/ -static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("ES:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_SEGOVR_ES; - /* - * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4 - * opcode subroutines we do not want to do this. - */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x27 -****************************************************************************/ -static void x86emuOp_daa(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("DAA\n"); - TRACE_AND_STEP(); - M.x86.R_AL = daa_byte(M.x86.R_AL); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x28 -****************************************************************************/ -static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("SUB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x29 -****************************************************************************/ -static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("SUB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = sub_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x2a -****************************************************************************/ -static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("SUB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x2b -****************************************************************************/ -static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("SUB\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_word(*destreg, srcval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = sub_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x2c -****************************************************************************/ -static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("SUB\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - M.x86.R_AL = sub_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x2d -****************************************************************************/ -static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("SUB\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("SUB\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval); - } else { - M.x86.R_AX = sub_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x2e -****************************************************************************/ -static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("CS:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_SEGOVR_CS; - /* note no DECODE_CLEAR_SEGOVR here. */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x2f -****************************************************************************/ -static void x86emuOp_das(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("DAS\n"); - TRACE_AND_STEP(); - M.x86.R_AL = das_byte(M.x86.R_AL); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x30 -****************************************************************************/ -static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("XOR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_byte(destval, *srcreg); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x31 -****************************************************************************/ -static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("XOR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_long(destval, *srcreg); - store_data_long(destoffset, destval); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = xor_word(destval, *srcreg); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x32 -****************************************************************************/ -static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("XOR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x33 -****************************************************************************/ -static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("XOR\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_word(*destreg, srcval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = xor_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x34 -****************************************************************************/ -static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("XOR\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - M.x86.R_AL = xor_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x35 -****************************************************************************/ -static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XOR\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("XOR\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval); - } else { - M.x86.R_AX = xor_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x36 -****************************************************************************/ -static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("SS:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_SEGOVR_SS; - /* no DECODE_CLEAR_SEGOVR ! */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x37 -****************************************************************************/ -static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("AAA\n"); - TRACE_AND_STEP(); - M.x86.R_AX = aaa_word(M.x86.R_AX); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x38 -****************************************************************************/ -static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - u8 *destreg, *srcreg; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("CMP\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(destval, *srcreg); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(destval, *srcreg); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(destval, *srcreg); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x39 -****************************************************************************/ -static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("CMP\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(destval, *srcreg); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(destval, *srcreg); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(destval, *srcreg); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(destval, *srcreg); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(destval, *srcreg); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(destval, *srcreg); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x3a -****************************************************************************/ -static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("CMP\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(*destreg, srcval); - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(*destreg, srcval); - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(*destreg, srcval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x3b -****************************************************************************/ -static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("CMP\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(*destreg, srcval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(*destreg, srcval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(*destreg, srcval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - cmp_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x3c -****************************************************************************/ -static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("CMP\tAL,"); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - cmp_byte(M.x86.R_AL, srcval); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x3d -****************************************************************************/ -static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("CMP\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("CMP\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - cmp_long(M.x86.R_EAX, srcval); - } else { - cmp_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x3e -****************************************************************************/ -static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("DS:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_SEGOVR_DS; - /* NO DECODE_CLEAR_SEGOVR! */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x3f -****************************************************************************/ -static void x86emuOp_aas(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("AAS\n"); - TRACE_AND_STEP(); - M.x86.R_AX = aas_word(M.x86.R_AX); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x40 -****************************************************************************/ -static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tEAX\n"); - } else { - DECODE_PRINTF("INC\tAX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = inc_long(M.x86.R_EAX); - } else { - M.x86.R_AX = inc_word(M.x86.R_AX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x41 -****************************************************************************/ -static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tECX\n"); - } else { - DECODE_PRINTF("INC\tCX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ECX = inc_long(M.x86.R_ECX); - } else { - M.x86.R_CX = inc_word(M.x86.R_CX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x42 -****************************************************************************/ -static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tEDX\n"); - } else { - DECODE_PRINTF("INC\tDX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDX = inc_long(M.x86.R_EDX); - } else { - M.x86.R_DX = inc_word(M.x86.R_DX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x43 -****************************************************************************/ -static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tEBX\n"); - } else { - DECODE_PRINTF("INC\tBX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBX = inc_long(M.x86.R_EBX); - } else { - M.x86.R_BX = inc_word(M.x86.R_BX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x44 -****************************************************************************/ -static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tESP\n"); - } else { - DECODE_PRINTF("INC\tSP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESP = inc_long(M.x86.R_ESP); - } else { - M.x86.R_SP = inc_word(M.x86.R_SP); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x45 -****************************************************************************/ -static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tEBP\n"); - } else { - DECODE_PRINTF("INC\tBP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBP = inc_long(M.x86.R_EBP); - } else { - M.x86.R_BP = inc_word(M.x86.R_BP); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x46 -****************************************************************************/ -static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tESI\n"); - } else { - DECODE_PRINTF("INC\tSI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESI = inc_long(M.x86.R_ESI); - } else { - M.x86.R_SI = inc_word(M.x86.R_SI); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x47 -****************************************************************************/ -static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tEDI\n"); - } else { - DECODE_PRINTF("INC\tDI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDI = inc_long(M.x86.R_EDI); - } else { - M.x86.R_DI = inc_word(M.x86.R_DI); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x48 -****************************************************************************/ -static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tEAX\n"); - } else { - DECODE_PRINTF("DEC\tAX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = dec_long(M.x86.R_EAX); - } else { - M.x86.R_AX = dec_word(M.x86.R_AX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x49 -****************************************************************************/ -static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tECX\n"); - } else { - DECODE_PRINTF("DEC\tCX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ECX = dec_long(M.x86.R_ECX); - } else { - M.x86.R_CX = dec_word(M.x86.R_CX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x4a -****************************************************************************/ -static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tEDX\n"); - } else { - DECODE_PRINTF("DEC\tDX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDX = dec_long(M.x86.R_EDX); - } else { - M.x86.R_DX = dec_word(M.x86.R_DX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x4b -****************************************************************************/ -static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tEBX\n"); - } else { - DECODE_PRINTF("DEC\tBX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBX = dec_long(M.x86.R_EBX); - } else { - M.x86.R_BX = dec_word(M.x86.R_BX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x4c -****************************************************************************/ -static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tESP\n"); - } else { - DECODE_PRINTF("DEC\tSP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESP = dec_long(M.x86.R_ESP); - } else { - M.x86.R_SP = dec_word(M.x86.R_SP); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x4d -****************************************************************************/ -static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tEBP\n"); - } else { - DECODE_PRINTF("DEC\tBP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBP = dec_long(M.x86.R_EBP); - } else { - M.x86.R_BP = dec_word(M.x86.R_BP); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x4e -****************************************************************************/ -static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tESI\n"); - } else { - DECODE_PRINTF("DEC\tSI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESI = dec_long(M.x86.R_ESI); - } else { - M.x86.R_SI = dec_word(M.x86.R_SI); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x4f -****************************************************************************/ -static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tEDI\n"); - } else { - DECODE_PRINTF("DEC\tDI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDI = dec_long(M.x86.R_EDI); - } else { - M.x86.R_DI = dec_word(M.x86.R_DI); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x50 -****************************************************************************/ -static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tEAX\n"); - } else { - DECODE_PRINTF("PUSH\tAX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_EAX); - } else { - push_word(M.x86.R_AX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x51 -****************************************************************************/ -static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tECX\n"); - } else { - DECODE_PRINTF("PUSH\tCX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_ECX); - } else { - push_word(M.x86.R_CX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x52 -****************************************************************************/ -static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tEDX\n"); - } else { - DECODE_PRINTF("PUSH\tDX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_EDX); - } else { - push_word(M.x86.R_DX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x53 -****************************************************************************/ -static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tEBX\n"); - } else { - DECODE_PRINTF("PUSH\tBX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_EBX); - } else { - push_word(M.x86.R_BX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x54 -****************************************************************************/ -static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tESP\n"); - } else { - DECODE_PRINTF("PUSH\tSP\n"); - } - TRACE_AND_STEP(); - /* Always push (E)SP, since we are emulating an i386 and above - * processor. This is necessary as some BIOS'es use this to check - * what type of processor is in the system. - */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_ESP); - } else { - push_word((u16)(M.x86.R_SP)); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x55 -****************************************************************************/ -static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tEBP\n"); - } else { - DECODE_PRINTF("PUSH\tBP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_EBP); - } else { - push_word(M.x86.R_BP); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x56 -****************************************************************************/ -static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tESI\n"); - } else { - DECODE_PRINTF("PUSH\tSI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_ESI); - } else { - push_word(M.x86.R_SI); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x57 -****************************************************************************/ -static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSH\tEDI\n"); - } else { - DECODE_PRINTF("PUSH\tDI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(M.x86.R_EDI); - } else { - push_word(M.x86.R_DI); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x58 -****************************************************************************/ -static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tEAX\n"); - } else { - DECODE_PRINTF("POP\tAX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = pop_long(); - } else { - M.x86.R_AX = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x59 -****************************************************************************/ -static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tECX\n"); - } else { - DECODE_PRINTF("POP\tCX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ECX = pop_long(); - } else { - M.x86.R_CX = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x5a -****************************************************************************/ -static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tEDX\n"); - } else { - DECODE_PRINTF("POP\tDX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDX = pop_long(); - } else { - M.x86.R_DX = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x5b -****************************************************************************/ -static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tEBX\n"); - } else { - DECODE_PRINTF("POP\tBX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBX = pop_long(); - } else { - M.x86.R_BX = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x5c -****************************************************************************/ -static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tESP\n"); - } else { - DECODE_PRINTF("POP\tSP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESP = pop_long(); - } else { - M.x86.R_SP = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x5d -****************************************************************************/ -static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tEBP\n"); - } else { - DECODE_PRINTF("POP\tBP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBP = pop_long(); - } else { - M.x86.R_BP = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x5e -****************************************************************************/ -static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tESI\n"); - } else { - DECODE_PRINTF("POP\tSI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESI = pop_long(); - } else { - M.x86.R_SI = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x5f -****************************************************************************/ -static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POP\tEDI\n"); - } else { - DECODE_PRINTF("POP\tDI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDI = pop_long(); - } else { - M.x86.R_DI = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x60 -****************************************************************************/ -static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSHAD\n"); - } else { - DECODE_PRINTF("PUSHA\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 old_sp = M.x86.R_ESP; - - push_long(M.x86.R_EAX); - push_long(M.x86.R_ECX); - push_long(M.x86.R_EDX); - push_long(M.x86.R_EBX); - push_long(old_sp); - push_long(M.x86.R_EBP); - push_long(M.x86.R_ESI); - push_long(M.x86.R_EDI); - } else { - u16 old_sp = M.x86.R_SP; - - push_word(M.x86.R_AX); - push_word(M.x86.R_CX); - push_word(M.x86.R_DX); - push_word(M.x86.R_BX); - push_word(old_sp); - push_word(M.x86.R_BP); - push_word(M.x86.R_SI); - push_word(M.x86.R_DI); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x61 -****************************************************************************/ -static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POPAD\n"); - } else { - DECODE_PRINTF("POPA\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDI = pop_long(); - M.x86.R_ESI = pop_long(); - M.x86.R_EBP = pop_long(); - M.x86.R_ESP += 4; /* skip ESP */ - M.x86.R_EBX = pop_long(); - M.x86.R_EDX = pop_long(); - M.x86.R_ECX = pop_long(); - M.x86.R_EAX = pop_long(); - } else { - M.x86.R_DI = pop_word(); - M.x86.R_SI = pop_word(); - M.x86.R_BP = pop_word(); - M.x86.R_SP += 2; /* skip SP */ - M.x86.R_BX = pop_word(); - M.x86.R_DX = pop_word(); - M.x86.R_CX = pop_word(); - M.x86.R_AX = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/*opcode 0x62 ILLEGAL OP, calls x86emuOp_illegal_op() */ -/*opcode 0x63 ILLEGAL OP, calls x86emuOp_illegal_op() */ - -/**************************************************************************** -REMARKS: -Handles opcode 0x64 -****************************************************************************/ -static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("FS:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_SEGOVR_FS; - /* - * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4 - * opcode subroutines we do not want to do this. - */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x65 -****************************************************************************/ -static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("GS:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_SEGOVR_GS; - /* - * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4 - * opcode subroutines we do not want to do this. - */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x66 - prefix for 32-bit register -****************************************************************************/ -static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("DATA:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_PREFIX_DATA; - /* note no DECODE_CLEAR_SEGOVR here. */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x67 - prefix for 32-bit address -****************************************************************************/ -static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("ADDR:\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_PREFIX_ADDR; - /* note no DECODE_CLEAR_SEGOVR here. */ - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x68 -****************************************************************************/ -static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 imm; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - imm = fetch_long_imm(); - } else { - imm = fetch_word_imm(); - } - DECODE_PRINTF2("PUSH\t%x\n", imm); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(imm); - } else { - push_word((u16)imm); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x69 -****************************************************************************/ -static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("IMUL\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - u32 res_lo,res_hi; - s32 imm; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg; - u16 srcval; - u32 res; - s16 imm; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - res = (s16)srcval * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - u32 res_lo,res_hi; - s32 imm; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg; - u16 srcval; - u32 res; - s16 imm; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - res = (s16)srcval * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - u32 res_lo,res_hi; - s32 imm; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg; - u16 srcval; - u32 res; - s16 imm; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - res = (s16)srcval * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - u32 res_lo,res_hi; - s32 imm; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg,*srcreg; - u32 res; - s16 imm; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - res = (s16)*srcreg * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x6a -****************************************************************************/ -static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1)) -{ - s16 imm; - - START_OF_INSTR(); - imm = (s8)fetch_byte_imm(); - DECODE_PRINTF2("PUSH\t%d\n", imm); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long((s32)imm); - } else { - push_word(imm); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x6b -****************************************************************************/ -static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - s8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("IMUL\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - u32 res_lo,res_hi; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg; - u16 srcval; - u32 res; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - res = (s16)srcval * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - u32 res_lo,res_hi; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg; - u16 srcval; - u32 res; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - res = (s16)srcval * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - u32 res_lo,res_hi; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg; - u16 srcval; - u32 res; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - res = (s16)srcval * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - u32 res_lo,res_hi; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - TRACE_AND_STEP(); - imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm); - if (res_hi != 0) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u32)res_lo; - } else { - u16 *destreg,*srcreg; - u32 res; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%d\n", (s32)imm); - res = (s16)*srcreg * (s16)imm; - if (res > 0xFFFF) { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } else { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } - *destreg = (u16)res; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x6c -****************************************************************************/ -static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("INSB\n"); - ins(1); - TRACE_AND_STEP(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x6d -****************************************************************************/ -static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INSD\n"); - ins(4); - } else { - DECODE_PRINTF("INSW\n"); - ins(2); - } - TRACE_AND_STEP(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x6e -****************************************************************************/ -static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("OUTSB\n"); - outs(1); - TRACE_AND_STEP(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x6f -****************************************************************************/ -static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("OUTSD\n"); - outs(4); - } else { - DECODE_PRINTF("OUTSW\n"); - outs(2); - } - TRACE_AND_STEP(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x70 -****************************************************************************/ -static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if overflow flag is set */ - START_OF_INSTR(); - DECODE_PRINTF("JO\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_OF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x71 -****************************************************************************/ -static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if overflow is not set */ - START_OF_INSTR(); - DECODE_PRINTF("JNO\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (!ACCESS_FLAG(F_OF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x72 -****************************************************************************/ -static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if carry flag is set. */ - START_OF_INSTR(); - DECODE_PRINTF("JB\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_CF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x73 -****************************************************************************/ -static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if carry flag is clear. */ - START_OF_INSTR(); - DECODE_PRINTF("JNB\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (!ACCESS_FLAG(F_CF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x74 -****************************************************************************/ -static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if zero flag is set. */ - START_OF_INSTR(); - DECODE_PRINTF("JZ\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_ZF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x75 -****************************************************************************/ -static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if zero flag is clear. */ - START_OF_INSTR(); - DECODE_PRINTF("JNZ\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (!ACCESS_FLAG(F_ZF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x76 -****************************************************************************/ -static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if carry flag is set or if the zero - flag is set. */ - START_OF_INSTR(); - DECODE_PRINTF("JBE\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x77 -****************************************************************************/ -static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if carry flag is clear and if the zero - flag is clear */ - START_OF_INSTR(); - DECODE_PRINTF("JNBE\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x78 -****************************************************************************/ -static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if sign flag is set */ - START_OF_INSTR(); - DECODE_PRINTF("JS\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_SF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x79 -****************************************************************************/ -static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if sign flag is clear */ - START_OF_INSTR(); - DECODE_PRINTF("JNS\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (!ACCESS_FLAG(F_SF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x7a -****************************************************************************/ -static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if parity flag is set (even parity) */ - START_OF_INSTR(); - DECODE_PRINTF("JP\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_PF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x7b -****************************************************************************/ -static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - - /* jump to byte offset if parity flag is clear (odd parity) */ - START_OF_INSTR(); - DECODE_PRINTF("JNP\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (!ACCESS_FLAG(F_PF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x7c -****************************************************************************/ -static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - int sf, of; - - /* jump to byte offset if sign flag not equal to overflow flag. */ - START_OF_INSTR(); - DECODE_PRINTF("JL\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - sf = ACCESS_FLAG(F_SF) != 0; - of = ACCESS_FLAG(F_OF) != 0; - if (sf ^ of) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x7d -****************************************************************************/ -static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - int sf, of; - - /* jump to byte offset if sign flag not equal to overflow flag. */ - START_OF_INSTR(); - DECODE_PRINTF("JNL\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - sf = ACCESS_FLAG(F_SF) != 0; - of = ACCESS_FLAG(F_OF) != 0; - /* note: inverse of above, but using == instead of xor. */ - if (sf == of) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x7e -****************************************************************************/ -static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - int sf, of; - - /* jump to byte offset if sign flag not equal to overflow flag - or the zero flag is set */ - START_OF_INSTR(); - DECODE_PRINTF("JLE\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - sf = ACCESS_FLAG(F_SF) != 0; - of = ACCESS_FLAG(F_OF) != 0; - if ((sf ^ of) || ACCESS_FLAG(F_ZF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x7f -****************************************************************************/ -static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1)) -{ - s8 offset; - u16 target; - int sf, of; - - /* jump to byte offset if sign flag equal to overflow flag. - and the zero flag is clear */ - START_OF_INSTR(); - DECODE_PRINTF("JNLE\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + (s16)offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - sf = ACCESS_FLAG(F_SF) != 0; - of = ACCESS_FLAG(F_OF) != 0; - if ((sf == of) && !ACCESS_FLAG(F_ZF)) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -static u8 (*opc80_byte_operation[])(u8 d, u8 s) = -{ - add_byte, /* 00 */ - or_byte, /* 01 */ - adc_byte, /* 02 */ - sbb_byte, /* 03 */ - and_byte, /* 04 */ - sub_byte, /* 05 */ - xor_byte, /* 06 */ - cmp_byte, /* 07 */ -}; - -/**************************************************************************** -REMARKS: -Handles opcode 0x80 -****************************************************************************/ -static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg; - uint destoffset; - u8 imm; - u8 destval; - - /* - * Weirdo special case instruction format. Part of the opcode - * held below in "RH". Doubly nested case would result, except - * that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - - switch (rh) { - case 0: - DECODE_PRINTF("ADD\t"); - break; - case 1: - DECODE_PRINTF("OR\t"); - break; - case 2: - DECODE_PRINTF("ADC\t"); - break; - case 3: - DECODE_PRINTF("SBB\t"); - break; - case 4: - DECODE_PRINTF("AND\t"); - break; - case 5: - DECODE_PRINTF("SUB\t"); - break; - case 6: - DECODE_PRINTF("XOR\t"); - break; - case 7: - DECODE_PRINTF("CMP\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - switch (mod) { - case 0: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc80_byte_operation[rh]) (destval, imm); - if (rh != 7) - store_data_byte(destoffset, destval); - break; - case 1: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc80_byte_operation[rh]) (destval, imm); - if (rh != 7) - store_data_byte(destoffset, destval); - break; - case 2: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc80_byte_operation[rh]) (destval, imm); - if (rh != 7) - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc80_byte_operation[rh]) (*destreg, imm); - if (rh != 7) - *destreg = destval; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -static u16 (*opc81_word_operation[])(u16 d, u16 s) = -{ - add_word, /*00 */ - or_word, /*01 */ - adc_word, /*02 */ - sbb_word, /*03 */ - and_word, /*04 */ - sub_word, /*05 */ - xor_word, /*06 */ - cmp_word, /*07 */ -}; - -static u32 (*opc81_long_operation[])(u32 d, u32 s) = -{ - add_long, /*00 */ - or_long, /*01 */ - adc_long, /*02 */ - sbb_long, /*03 */ - and_long, /*04 */ - sub_long, /*05 */ - xor_long, /*06 */ - cmp_long, /*07 */ -}; - -/**************************************************************************** -REMARKS: -Handles opcode 0x81 -****************************************************************************/ -static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - /* - * Weirdo special case instruction format. Part of the opcode - * held below in "RH". Doubly nested case would result, except - * that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - - switch (rh) { - case 0: - DECODE_PRINTF("ADD\t"); - break; - case 1: - DECODE_PRINTF("OR\t"); - break; - case 2: - DECODE_PRINTF("ADC\t"); - break; - case 3: - DECODE_PRINTF("SBB\t"); - break; - case 4: - DECODE_PRINTF("AND\t"); - break; - case 5: - DECODE_PRINTF("SUB\t"); - break; - case 6: - DECODE_PRINTF("XOR\t"); - break; - case 7: - DECODE_PRINTF("CMP\t"); - break; - } - } -#endif - /* - * Know operation, decode the mod byte to find the addressing - * mode. - */ - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - imm = fetch_long_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_long_operation[rh]) (destval, imm); - if (rh != 7) - store_data_long(destoffset, destval); - } else { - u16 destval,imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - imm = fetch_word_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_word_operation[rh]) (destval, imm); - if (rh != 7) - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - imm = fetch_long_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_long_operation[rh]) (destval, imm); - if (rh != 7) - store_data_long(destoffset, destval); - } else { - u16 destval,imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - imm = fetch_word_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_word_operation[rh]) (destval, imm); - if (rh != 7) - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - imm = fetch_long_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_long_operation[rh]) (destval, imm); - if (rh != 7) - store_data_long(destoffset, destval); - } else { - u16 destval,imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - imm = fetch_word_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_word_operation[rh]) (destval, imm); - if (rh != 7) - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 destval,imm; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - imm = fetch_long_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_long_operation[rh]) (*destreg, imm); - if (rh != 7) - *destreg = destval; - } else { - u16 *destreg; - u16 destval,imm; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - imm = fetch_word_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc81_word_operation[rh]) (*destreg, imm); - if (rh != 7) - *destreg = destval; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -static u8 (*opc82_byte_operation[])(u8 s, u8 d) = -{ - add_byte, /*00 */ - or_byte, /*01 *//*YYY UNUSED ???? */ - adc_byte, /*02 */ - sbb_byte, /*03 */ - and_byte, /*04 *//*YYY UNUSED ???? */ - sub_byte, /*05 */ - xor_byte, /*06 *//*YYY UNUSED ???? */ - cmp_byte, /*07 */ -}; - -/**************************************************************************** -REMARKS: -Handles opcode 0x82 -****************************************************************************/ -static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg; - uint destoffset; - u8 imm; - u8 destval; - - /* - * Weirdo special case instruction format. Part of the opcode - * held below in "RH". Doubly nested case would result, except - * that the decoded instruction Similar to opcode 81, except that - * the immediate byte is sign extended to a word length. - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - switch (rh) { - case 0: - DECODE_PRINTF("ADD\t"); - break; - case 1: - DECODE_PRINTF("OR\t"); - break; - case 2: - DECODE_PRINTF("ADC\t"); - break; - case 3: - DECODE_PRINTF("SBB\t"); - break; - case 4: - DECODE_PRINTF("AND\t"); - break; - case 5: - DECODE_PRINTF("SUB\t"); - break; - case 6: - DECODE_PRINTF("XOR\t"); - break; - case 7: - DECODE_PRINTF("CMP\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - switch (mod) { - case 0: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm00_address(rl); - destval = fetch_data_byte(destoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc82_byte_operation[rh]) (destval, imm); - if (rh != 7) - store_data_byte(destoffset, destval); - break; - case 1: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm01_address(rl); - destval = fetch_data_byte(destoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc82_byte_operation[rh]) (destval, imm); - if (rh != 7) - store_data_byte(destoffset, destval); - break; - case 2: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - destval = fetch_data_byte(destoffset); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc82_byte_operation[rh]) (destval, imm); - if (rh != 7) - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc82_byte_operation[rh]) (*destreg, imm); - if (rh != 7) - *destreg = destval; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -static u16 (*opc83_word_operation[])(u16 s, u16 d) = -{ - add_word, /*00 */ - or_word, /*01 *//*YYY UNUSED ???? */ - adc_word, /*02 */ - sbb_word, /*03 */ - and_word, /*04 *//*YYY UNUSED ???? */ - sub_word, /*05 */ - xor_word, /*06 *//*YYY UNUSED ???? */ - cmp_word, /*07 */ -}; - -static u32 (*opc83_long_operation[])(u32 s, u32 d) = -{ - add_long, /*00 */ - or_long, /*01 *//*YYY UNUSED ???? */ - adc_long, /*02 */ - sbb_long, /*03 */ - and_long, /*04 *//*YYY UNUSED ???? */ - sub_long, /*05 */ - xor_long, /*06 *//*YYY UNUSED ???? */ - cmp_long, /*07 */ -}; - -/**************************************************************************** -REMARKS: -Handles opcode 0x83 -****************************************************************************/ -static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - /* - * Weirdo special case instruction format. Part of the opcode - * held below in "RH". Doubly nested case would result, except - * that the decoded instruction Similar to opcode 81, except that - * the immediate byte is sign extended to a word length. - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - switch (rh) { - case 0: - DECODE_PRINTF("ADD\t"); - break; - case 1: - DECODE_PRINTF("OR\t"); - break; - case 2: - DECODE_PRINTF("ADC\t"); - break; - case 3: - DECODE_PRINTF("SBB\t"); - break; - case 4: - DECODE_PRINTF("AND\t"); - break; - case 5: - DECODE_PRINTF("SUB\t"); - break; - case 6: - DECODE_PRINTF("XOR\t"); - break; - case 7: - DECODE_PRINTF("CMP\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm00_address(rl); - destval = fetch_data_long(destoffset); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_long_operation[rh]) (destval, imm); - if (rh != 7) - store_data_long(destoffset, destval); - } else { - u16 destval,imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm00_address(rl); - destval = fetch_data_word(destoffset); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_word_operation[rh]) (destval, imm); - if (rh != 7) - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm01_address(rl); - destval = fetch_data_long(destoffset); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_long_operation[rh]) (destval, imm); - if (rh != 7) - store_data_long(destoffset, destval); - } else { - u16 destval,imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm01_address(rl); - destval = fetch_data_word(destoffset); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_word_operation[rh]) (destval, imm); - if (rh != 7) - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm10_address(rl); - destval = fetch_data_long(destoffset); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_long_operation[rh]) (destval, imm); - if (rh != 7) - store_data_long(destoffset, destval); - } else { - u16 destval,imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm10_address(rl); - destval = fetch_data_word(destoffset); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_word_operation[rh]) (destval, imm); - if (rh != 7) - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 destval,imm; - - destreg = DECODE_RM_LONG_REGISTER(rl); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_long_operation[rh]) (*destreg, imm); - if (rh != 7) - *destreg = destval; - } else { - u16 *destreg; - u16 destval,imm; - - destreg = DECODE_RM_WORD_REGISTER(rl); - imm = (s8) fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - destval = (*opc83_word_operation[rh]) (*destreg, imm); - if (rh != 7) - *destreg = destval; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x84 -****************************************************************************/ -static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - - START_OF_INSTR(); - DECODE_PRINTF("TEST\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_byte(destval, *srcreg); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_byte(destval, *srcreg); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_byte(destval, *srcreg); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_byte(*destreg, *srcreg); - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x85 -****************************************************************************/ -static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("TEST\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_long(destval, *srcreg); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_word(destval, *srcreg); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_long(destval, *srcreg); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_word(destval, *srcreg); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_long(destval, *srcreg); - } else { - u16 destval; - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_word(destval, *srcreg); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_long(*destreg, *srcreg); - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - test_word(*destreg, *srcreg); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x86 -****************************************************************************/ -static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - u8 destval; - u8 tmp; - - START_OF_INSTR(); - DECODE_PRINTF("XCHG\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_byte(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_byte(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_byte(destoffset); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = *destreg; - *destreg = tmp; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x87 -****************************************************************************/ -static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("XCHG\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *srcreg; - u32 destval,tmp; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_long(destoffset, destval); - } else { - u16 *srcreg; - u16 destval,tmp; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *srcreg; - u32 destval,tmp; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_long(destoffset, destval); - } else { - u16 *srcreg; - u16 destval,tmp; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *srcreg; - u32 destval,tmp; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_long(destoffset); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_long(destoffset, destval); - } else { - u16 *srcreg; - u16 destval,tmp; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - destval = fetch_data_word(destoffset); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = destval; - destval = tmp; - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - u32 tmp; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = *destreg; - *destreg = tmp; - } else { - u16 *destreg,*srcreg; - u16 tmp; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - tmp = *srcreg; - *srcreg = *destreg; - *destreg = tmp; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x88 -****************************************************************************/ -static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_byte(destoffset, *srcreg); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_byte(destoffset, *srcreg); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_byte(destoffset, *srcreg); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x89 -****************************************************************************/ -static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u32 destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_long(destoffset, *srcreg); - } else { - u16 *srcreg; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_word(destoffset, *srcreg); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_long(destoffset, *srcreg); - } else { - u16 *srcreg; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_word(destoffset, *srcreg); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_long(destoffset, *srcreg); - } else { - u16 *srcreg; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - store_data_word(destoffset, *srcreg); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg,*srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - } else { - u16 *destreg,*srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x8a -****************************************************************************/ -static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg, *srcreg; - uint srcoffset; - u8 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - break; - case 1: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - break; - case 2: - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_byte(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x8b -****************************************************************************/ -static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_long(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - } else { - u16 *destreg; - u16 srcval; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg, *srcreg; - - destreg = DECODE_RM_LONG_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - } else { - u16 *destreg, *srcreg; - - destreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x8c -****************************************************************************/ -static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u16 *destreg, *srcreg; - uint destoffset; - u16 destval; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - srcreg = decode_rm_seg_register(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = *srcreg; - store_data_word(destoffset, destval); - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - srcreg = decode_rm_seg_register(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = *srcreg; - store_data_word(destoffset, destval); - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - srcreg = decode_rm_seg_register(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = *srcreg; - store_data_word(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcreg = decode_rm_seg_register(rh); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x8d -****************************************************************************/ -static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u16 *srcreg; - uint destoffset; - -/* - * TODO: Need to handle address size prefix! - * - * lea eax,[eax+ebx*2] ?? - */ - - START_OF_INSTR(); - DECODE_PRINTF("LEA\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *srcreg = (u16)destoffset; - break; - case 1: - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *srcreg = (u16)destoffset; - break; - case 2: - srcreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *srcreg = (u16)destoffset; - break; - case 3: /* register to register */ - /* undefined. Do nothing. */ - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x8e -****************************************************************************/ -static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u16 *destreg, *srcreg; - uint srcoffset; - u16 srcval; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - destreg = decode_rm_seg_register(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - break; - case 1: - destreg = decode_rm_seg_register(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - break; - case 2: - destreg = decode_rm_seg_register(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - srcval = fetch_data_word(srcoffset); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = srcval; - break; - case 3: /* register to register */ - destreg = decode_rm_seg_register(rh); - DECODE_PRINTF(","); - srcreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = *srcreg; - break; - } - /* - * Clean up, and reset all the R_xSP pointers to the correct - * locations. This is about 3x too much overhead (doing all the - * segreg ptrs when only one is needed, but this instruction - * *cannot* be that common, and this isn't too much work anyway. - */ - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x8f -****************************************************************************/ -static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("POP\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - if (rh != 0) { - DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n"); - HALT_SYS(); - } - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = pop_long(); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = pop_word(); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = pop_long(); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = pop_word(); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = pop_long(); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - destval = pop_word(); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = pop_long(); - } else { - u16 *destreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = pop_word(); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x90 -****************************************************************************/ -static void x86emuOp_nop(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("NOP\n"); - TRACE_AND_STEP(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x91 -****************************************************************************/ -static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1)) -{ - u32 tmp; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XCHG\tEAX,ECX\n"); - } else { - DECODE_PRINTF("XCHG\tAX,CX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - tmp = M.x86.R_EAX; - M.x86.R_EAX = M.x86.R_ECX; - M.x86.R_ECX = tmp; - } else { - tmp = M.x86.R_AX; - M.x86.R_AX = M.x86.R_CX; - M.x86.R_CX = (u16)tmp; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x92 -****************************************************************************/ -static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1)) -{ - u32 tmp; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XCHG\tEAX,EDX\n"); - } else { - DECODE_PRINTF("XCHG\tAX,DX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - tmp = M.x86.R_EAX; - M.x86.R_EAX = M.x86.R_EDX; - M.x86.R_EDX = tmp; - } else { - tmp = M.x86.R_AX; - M.x86.R_AX = M.x86.R_DX; - M.x86.R_DX = (u16)tmp; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x93 -****************************************************************************/ -static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1)) -{ - u32 tmp; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XCHG\tEAX,EBX\n"); - } else { - DECODE_PRINTF("XCHG\tAX,BX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - tmp = M.x86.R_EAX; - M.x86.R_EAX = M.x86.R_EBX; - M.x86.R_EBX = tmp; - } else { - tmp = M.x86.R_AX; - M.x86.R_AX = M.x86.R_BX; - M.x86.R_BX = (u16)tmp; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x94 -****************************************************************************/ -static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1)) -{ - u32 tmp; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XCHG\tEAX,ESP\n"); - } else { - DECODE_PRINTF("XCHG\tAX,SP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - tmp = M.x86.R_EAX; - M.x86.R_EAX = M.x86.R_ESP; - M.x86.R_ESP = tmp; - } else { - tmp = M.x86.R_AX; - M.x86.R_AX = M.x86.R_SP; - M.x86.R_SP = (u16)tmp; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x95 -****************************************************************************/ -static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1)) -{ - u32 tmp; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XCHG\tEAX,EBP\n"); - } else { - DECODE_PRINTF("XCHG\tAX,BP\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - tmp = M.x86.R_EAX; - M.x86.R_EAX = M.x86.R_EBP; - M.x86.R_EBP = tmp; - } else { - tmp = M.x86.R_AX; - M.x86.R_AX = M.x86.R_BP; - M.x86.R_BP = (u16)tmp; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x96 -****************************************************************************/ -static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1)) -{ - u32 tmp; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XCHG\tEAX,ESI\n"); - } else { - DECODE_PRINTF("XCHG\tAX,SI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - tmp = M.x86.R_EAX; - M.x86.R_EAX = M.x86.R_ESI; - M.x86.R_ESI = tmp; - } else { - tmp = M.x86.R_AX; - M.x86.R_AX = M.x86.R_SI; - M.x86.R_SI = (u16)tmp; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x97 -****************************************************************************/ -static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1)) -{ - u32 tmp; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("XCHG\tEAX,EDI\n"); - } else { - DECODE_PRINTF("XCHG\tAX,DI\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - tmp = M.x86.R_EAX; - M.x86.R_EAX = M.x86.R_EDI; - M.x86.R_EDI = tmp; - } else { - tmp = M.x86.R_AX; - M.x86.R_AX = M.x86.R_DI; - M.x86.R_DI = (u16)tmp; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x98 -****************************************************************************/ -static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("CWDE\n"); - } else { - DECODE_PRINTF("CBW\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - if (M.x86.R_AX & 0x8000) { - M.x86.R_EAX |= 0xffff0000; - } else { - M.x86.R_EAX &= 0x0000ffff; - } - } else { - if (M.x86.R_AL & 0x80) { - M.x86.R_AH = 0xff; - } else { - M.x86.R_AH = 0x0; - } - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x99 -****************************************************************************/ -static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("CDQ\n"); - } else { - DECODE_PRINTF("CWD\n"); - } - DECODE_PRINTF("CWD\n"); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - if (M.x86.R_EAX & 0x80000000) { - M.x86.R_EDX = 0xffffffff; - } else { - M.x86.R_EDX = 0x0; - } - } else { - if (M.x86.R_AX & 0x8000) { - M.x86.R_DX = 0xffff; - } else { - M.x86.R_DX = 0x0; - } - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x9a -****************************************************************************/ -static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 farseg, faroff; - - START_OF_INSTR(); - DECODE_PRINTF("CALL\t"); - faroff = fetch_word_imm(); - farseg = fetch_word_imm(); - DECODE_PRINTF2("%04x:", farseg); - DECODE_PRINTF2("%04x\n", faroff); - CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR "); - - /* XXX - * - * Hooked interrupt vectors calling into our "BIOS" will cause - * problems unless all intersegment stuff is checked for BIOS - * access. Check needed here. For moment, let it alone. - */ - TRACE_AND_STEP(); - push_word(M.x86.R_CS); - M.x86.R_CS = farseg; - push_word(M.x86.R_IP); - M.x86.R_IP = faroff; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x9b -****************************************************************************/ -static void x86emuOp_wait(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("WAIT"); - TRACE_AND_STEP(); - /* NADA. */ - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x9c -****************************************************************************/ -static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1)) -{ - u32 flags; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("PUSHFD\n"); - } else { - DECODE_PRINTF("PUSHF\n"); - } - TRACE_AND_STEP(); - - /* clear out *all* bits not representing flags, and turn on real bits */ - flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON; - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - push_long(flags); - } else { - push_word((u16)flags); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x9d -****************************************************************************/ -static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("POPFD\n"); - } else { - DECODE_PRINTF("POPF\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EFLG = pop_long(); - } else { - M.x86.R_FLG = pop_word(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x9e -****************************************************************************/ -static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("SAHF\n"); - TRACE_AND_STEP(); - /* clear the lower bits of the flag register */ - M.x86.R_FLG &= 0xffffff00; - /* or in the AH register into the flags register */ - M.x86.R_FLG |= M.x86.R_AH; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0x9f -****************************************************************************/ -static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("LAHF\n"); - TRACE_AND_STEP(); - M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff); - /*undocumented TC++ behavior??? Nope. It's documented, but - you have too look real hard to notice it. */ - M.x86.R_AH |= 0x2; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa0 -****************************************************************************/ -static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 offset; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tAL,"); - offset = fetch_word_imm(); - DECODE_PRINTF2("[%04x]\n", offset); - TRACE_AND_STEP(); - M.x86.R_AL = fetch_data_byte(offset); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa1 -****************************************************************************/ -static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 offset; - - START_OF_INSTR(); - offset = fetch_word_imm(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset); - } else { - DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = fetch_data_long(offset); - } else { - M.x86.R_AX = fetch_data_word(offset); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa2 -****************************************************************************/ -static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 offset; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - offset = fetch_word_imm(); - DECODE_PRINTF2("[%04x],AL\n", offset); - TRACE_AND_STEP(); - store_data_byte(offset, M.x86.R_AL); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa3 -****************************************************************************/ -static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 offset; - - START_OF_INSTR(); - offset = fetch_word_imm(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset); - } else { - DECODE_PRINTF2("MOV\t[%04x],AX\n", offset); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - store_data_long(offset, M.x86.R_EAX); - } else { - store_data_word(offset, M.x86.R_AX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa4 -****************************************************************************/ -static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1)) -{ - u8 val; - u32 count; - int inc; - - START_OF_INSTR(); - DECODE_PRINTF("MOVS\tBYTE\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -1; - else - inc = 1; - TRACE_AND_STEP(); - count = 1; - if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { - /* dont care whether REPE or REPNE */ - /* move them until CX is ZERO. */ - count = M.x86.R_CX; - M.x86.R_CX = 0; - M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); - } - while (count--) { - val = fetch_data_byte(M.x86.R_SI); - store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, val); - M.x86.R_SI += inc; - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa5 -****************************************************************************/ -static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1)) -{ - u32 val; - int inc; - u32 count; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOVS\tDWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -4; - else - inc = 4; - } else { - DECODE_PRINTF("MOVS\tWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -2; - else - inc = 2; - } - TRACE_AND_STEP(); - count = 1; - if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { - /* dont care whether REPE or REPNE */ - /* move them until CX is ZERO. */ - count = M.x86.R_CX; - M.x86.R_CX = 0; - M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); - } - while (count--) { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - val = fetch_data_long(M.x86.R_SI); - store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val); - } else { - val = fetch_data_word(M.x86.R_SI); - store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val); - } - M.x86.R_SI += inc; - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa6 -****************************************************************************/ -static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1)) -{ - s8 val1, val2; - int inc; - - START_OF_INSTR(); - DECODE_PRINTF("CMPS\tBYTE\n"); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -1; - else - inc = 1; - - if (M.x86.mode & SYSMODE_PREFIX_REPE) { - /* REPE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - val1 = fetch_data_byte(M.x86.R_SI); - val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); - cmp_byte(val1, val2); - M.x86.R_CX -= 1; - M.x86.R_SI += inc; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF) == 0) - break; - } - M.x86.mode &= ~SYSMODE_PREFIX_REPE; - } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { - /* REPNE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - val1 = fetch_data_byte(M.x86.R_SI); - val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); - cmp_byte(val1, val2); - M.x86.R_CX -= 1; - M.x86.R_SI += inc; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF)) - break; /* zero flag set means equal */ - } - M.x86.mode &= ~SYSMODE_PREFIX_REPNE; - } else { - val1 = fetch_data_byte(M.x86.R_SI); - val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); - cmp_byte(val1, val2); - M.x86.R_SI += inc; - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa7 -****************************************************************************/ -static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1)) -{ - u32 val1,val2; - int inc; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("CMPS\tDWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -4; - else - inc = 4; - } else { - DECODE_PRINTF("CMPS\tWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -2; - else - inc = 2; - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_REPE) { - /* REPE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - val1 = fetch_data_long(M.x86.R_SI); - val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); - cmp_long(val1, val2); - } else { - val1 = fetch_data_word(M.x86.R_SI); - val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); - cmp_word((u16)val1, (u16)val2); - } - M.x86.R_CX -= 1; - M.x86.R_SI += inc; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF) == 0) - break; - } - M.x86.mode &= ~SYSMODE_PREFIX_REPE; - } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { - /* REPNE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - val1 = fetch_data_long(M.x86.R_SI); - val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); - cmp_long(val1, val2); - } else { - val1 = fetch_data_word(M.x86.R_SI); - val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); - cmp_word((u16)val1, (u16)val2); - } - M.x86.R_CX -= 1; - M.x86.R_SI += inc; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF)) - break; /* zero flag set means equal */ - } - M.x86.mode &= ~SYSMODE_PREFIX_REPNE; - } else { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - val1 = fetch_data_long(M.x86.R_SI); - val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); - cmp_long(val1, val2); - } else { - val1 = fetch_data_word(M.x86.R_SI); - val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); - cmp_word((u16)val1, (u16)val2); - } - M.x86.R_SI += inc; - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa8 -****************************************************************************/ -static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - int imm; - - START_OF_INSTR(); - DECODE_PRINTF("TEST\tAL,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%04x\n", imm); - TRACE_AND_STEP(); - test_byte(M.x86.R_AL, (u8)imm); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xa9 -****************************************************************************/ -static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("TEST\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("TEST\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - test_long(M.x86.R_EAX, srcval); - } else { - test_word(M.x86.R_AX, (u16)srcval); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xaa -****************************************************************************/ -static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1)) -{ - int inc; - - START_OF_INSTR(); - DECODE_PRINTF("STOS\tBYTE\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -1; - else - inc = 1; - TRACE_AND_STEP(); - if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { - /* dont care whether REPE or REPNE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL); - M.x86.R_CX -= 1; - M.x86.R_DI += inc; - } - M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); - } else { - store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL); - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xab -****************************************************************************/ -static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1)) -{ - int inc; - u32 count; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("STOS\tDWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -4; - else - inc = 4; - } else { - DECODE_PRINTF("STOS\tWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -2; - else - inc = 2; - } - TRACE_AND_STEP(); - count = 1; - if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { - /* dont care whether REPE or REPNE */ - /* move them until CX is ZERO. */ - count = M.x86.R_CX; - M.x86.R_CX = 0; - M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); - } - while (count--) { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX); - } else { - store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX); - } - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xac -****************************************************************************/ -static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1)) -{ - int inc; - - START_OF_INSTR(); - DECODE_PRINTF("LODS\tBYTE\n"); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -1; - else - inc = 1; - if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { - /* dont care whether REPE or REPNE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - M.x86.R_AL = fetch_data_byte(M.x86.R_SI); - M.x86.R_CX -= 1; - M.x86.R_SI += inc; - } - M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); - } else { - M.x86.R_AL = fetch_data_byte(M.x86.R_SI); - M.x86.R_SI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xad -****************************************************************************/ -static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1)) -{ - int inc; - u32 count; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("LODS\tDWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -4; - else - inc = 4; - } else { - DECODE_PRINTF("LODS\tWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -2; - else - inc = 2; - } - TRACE_AND_STEP(); - count = 1; - if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) { - /* dont care whether REPE or REPNE */ - /* move them until CX is ZERO. */ - count = M.x86.R_CX; - M.x86.R_CX = 0; - M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE); - } - while (count--) { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = fetch_data_long(M.x86.R_SI); - } else { - M.x86.R_AX = fetch_data_word(M.x86.R_SI); - } - M.x86.R_SI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xae -****************************************************************************/ -static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1)) -{ - s8 val2; - int inc; - - START_OF_INSTR(); - DECODE_PRINTF("SCAS\tBYTE\n"); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -1; - else - inc = 1; - if (M.x86.mode & SYSMODE_PREFIX_REPE) { - /* REPE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); - cmp_byte(M.x86.R_AL, val2); - M.x86.R_CX -= 1; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF) == 0) - break; - } - M.x86.mode &= ~SYSMODE_PREFIX_REPE; - } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { - /* REPNE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); - cmp_byte(M.x86.R_AL, val2); - M.x86.R_CX -= 1; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF)) - break; /* zero flag set means equal */ - } - M.x86.mode &= ~SYSMODE_PREFIX_REPNE; - } else { - val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI); - cmp_byte(M.x86.R_AL, val2); - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xaf -****************************************************************************/ -static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1)) -{ - int inc; - u32 val; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("SCAS\tDWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -4; - else - inc = 4; - } else { - DECODE_PRINTF("SCAS\tWORD\n"); - if (ACCESS_FLAG(F_DF)) /* down */ - inc = -2; - else - inc = 2; - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_REPE) { - /* REPE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); - cmp_long(M.x86.R_EAX, val); - } else { - val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); - cmp_word(M.x86.R_AX, (u16)val); - } - M.x86.R_CX -= 1; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF) == 0) - break; - } - M.x86.mode &= ~SYSMODE_PREFIX_REPE; - } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) { - /* REPNE */ - /* move them until CX is ZERO. */ - while (M.x86.R_CX != 0) { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); - cmp_long(M.x86.R_EAX, val); - } else { - val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); - cmp_word(M.x86.R_AX, (u16)val); - } - M.x86.R_CX -= 1; - M.x86.R_DI += inc; - if (ACCESS_FLAG(F_ZF)) - break; /* zero flag set means equal */ - } - M.x86.mode &= ~SYSMODE_PREFIX_REPNE; - } else { - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI); - cmp_long(M.x86.R_EAX, val); - } else { - val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI); - cmp_word(M.x86.R_AX, (u16)val); - } - M.x86.R_DI += inc; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb0 -****************************************************************************/ -static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tAL,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_AL = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb1 -****************************************************************************/ -static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tCL,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_CL = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb2 -****************************************************************************/ -static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tDL,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_DL = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb3 -****************************************************************************/ -static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tBL,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_BL = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb4 -****************************************************************************/ -static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tAH,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_AH = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb5 -****************************************************************************/ -static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tCH,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_CH = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb6 -****************************************************************************/ -static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tDH,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_DH = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb7 -****************************************************************************/ -static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\tBH,"); - imm = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", imm); - TRACE_AND_STEP(); - M.x86.R_BH = imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb8 -****************************************************************************/ -static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tEAX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tAX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = srcval; - } else { - M.x86.R_AX = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xb9 -****************************************************************************/ -static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tECX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tCX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ECX = srcval; - } else { - M.x86.R_CX = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xba -****************************************************************************/ -static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tEDX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tDX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDX = srcval; - } else { - M.x86.R_DX = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xbb -****************************************************************************/ -static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tEBX,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tBX,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBX = srcval; - } else { - M.x86.R_BX = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xbc -****************************************************************************/ -static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tESP,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tSP,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESP = srcval; - } else { - M.x86.R_SP = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xbd -****************************************************************************/ -static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tEBP,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tBP,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EBP = srcval; - } else { - M.x86.R_BP = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xbe -****************************************************************************/ -static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tESI,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tSI,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_ESI = srcval; - } else { - M.x86.R_SI = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xbf -****************************************************************************/ -static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1)) -{ - u32 srcval; - - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("MOV\tEDI,"); - srcval = fetch_long_imm(); - } else { - DECODE_PRINTF("MOV\tDI,"); - srcval = fetch_word_imm(); - } - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EDI = srcval; - } else { - M.x86.R_DI = (u16)srcval; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/* used by opcodes c0, d0, and d2. */ -static u8(*opcD0_byte_operation[])(u8 d, u8 s) = -{ - rol_byte, - ror_byte, - rcl_byte, - rcr_byte, - shl_byte, - shr_byte, - shl_byte, /* sal_byte === shl_byte by definition */ - sar_byte, -}; - -/**************************************************************************** -REMARKS: -Handles opcode 0xc0 -****************************************************************************/ -static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg; - uint destoffset; - u8 destval; - u8 amt; - - /* - * Yet another weirdo special case instruction format. Part of - * the opcode held below in "RH". Doubly nested case would - * result, except that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - - switch (rh) { - case 0: - DECODE_PRINTF("ROL\t"); - break; - case 1: - DECODE_PRINTF("ROR\t"); - break; - case 2: - DECODE_PRINTF("RCL\t"); - break; - case 3: - DECODE_PRINTF("RCR\t"); - break; - case 4: - DECODE_PRINTF("SHL\t"); - break; - case 5: - DECODE_PRINTF("SHR\t"); - break; - case 6: - DECODE_PRINTF("SAL\t"); - break; - case 7: - DECODE_PRINTF("SAR\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - switch (mod) { - case 0: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm00_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, amt); - store_data_byte(destoffset, destval); - break; - case 1: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm01_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, amt); - store_data_byte(destoffset, destval); - break; - case 2: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, amt); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (*destreg, amt); - *destreg = destval; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/* used by opcodes c1, d1, and d3. */ -static u16(*opcD1_word_operation[])(u16 s, u8 d) = -{ - rol_word, - ror_word, - rcl_word, - rcr_word, - shl_word, - shr_word, - shl_word, /* sal_byte === shl_byte by definition */ - sar_word, -}; - -/* used by opcodes c1, d1, and d3. */ -static u32 (*opcD1_long_operation[])(u32 s, u8 d) = -{ - rol_long, - ror_long, - rcl_long, - rcr_long, - shl_long, - shr_long, - shl_long, /* sal_byte === shl_byte by definition */ - sar_long, -}; - -/**************************************************************************** -REMARKS: -Handles opcode 0xc1 -****************************************************************************/ -static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - u8 amt; - - /* - * Yet another weirdo special case instruction format. Part of - * the opcode held below in "RH". Doubly nested case would - * result, except that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - - switch (rh) { - case 0: - DECODE_PRINTF("ROL\t"); - break; - case 1: - DECODE_PRINTF("ROR\t"); - break; - case 2: - DECODE_PRINTF("RCL\t"); - break; - case 3: - DECODE_PRINTF("RCR\t"); - break; - case 4: - DECODE_PRINTF("SHL\t"); - break; - case 5: - DECODE_PRINTF("SHR\t"); - break; - case 6: - DECODE_PRINTF("SAL\t"); - break; - case 7: - DECODE_PRINTF("SAR\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm00_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, amt); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm00_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, amt); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm01_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, amt); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm01_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, amt); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm10_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, amt); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm10_address(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, amt); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - TRACE_AND_STEP(); - *destreg = (*opcD1_long_operation[rh]) (*destreg, amt); - } else { - u16 *destreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - amt = fetch_byte_imm(); - DECODE_PRINTF2(",%x\n", amt); - TRACE_AND_STEP(); - *destreg = (*opcD1_word_operation[rh]) (*destreg, amt); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc2 -****************************************************************************/ -static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 imm; - - START_OF_INSTR(); - DECODE_PRINTF("RET\t"); - imm = fetch_word_imm(); - DECODE_PRINTF2("%x\n", imm); - RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip); - TRACE_AND_STEP(); - M.x86.R_IP = pop_word(); - M.x86.R_SP += imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc3 -****************************************************************************/ -static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("RET\n"); - RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip); - TRACE_AND_STEP(); - M.x86.R_IP = pop_word(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc4 -****************************************************************************/ -static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rh, rl; - u16 *dstreg; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("LES\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - dstreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *dstreg = fetch_data_word(srcoffset); - M.x86.R_ES = fetch_data_word(srcoffset + 2); - break; - case 1: - dstreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *dstreg = fetch_data_word(srcoffset); - M.x86.R_ES = fetch_data_word(srcoffset + 2); - break; - case 2: - dstreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *dstreg = fetch_data_word(srcoffset); - M.x86.R_ES = fetch_data_word(srcoffset + 2); - break; - case 3: /* register to register */ - /* UNDEFINED! */ - TRACE_AND_STEP(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc5 -****************************************************************************/ -static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rh, rl; - u16 *dstreg; - uint srcoffset; - - START_OF_INSTR(); - DECODE_PRINTF("LDS\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: - dstreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *dstreg = fetch_data_word(srcoffset); - M.x86.R_DS = fetch_data_word(srcoffset + 2); - break; - case 1: - dstreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *dstreg = fetch_data_word(srcoffset); - M.x86.R_DS = fetch_data_word(srcoffset + 2); - break; - case 2: - dstreg = DECODE_RM_WORD_REGISTER(rh); - DECODE_PRINTF(","); - srcoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *dstreg = fetch_data_word(srcoffset); - M.x86.R_DS = fetch_data_word(srcoffset + 2); - break; - case 3: /* register to register */ - /* UNDEFINED! */ - TRACE_AND_STEP(); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc6 -****************************************************************************/ -static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg; - uint destoffset; - u8 imm; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - if (rh != 0) { - DECODE_PRINTF("ILLEGAL DECODE OF OPCODE c6\n"); - HALT_SYS(); - } - switch (mod) { - case 0: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm00_address(rl); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%2x\n", imm); - TRACE_AND_STEP(); - store_data_byte(destoffset, imm); - break; - case 1: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm01_address(rl); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%2x\n", imm); - TRACE_AND_STEP(); - store_data_byte(destoffset, imm); - break; - case 2: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%2x\n", imm); - TRACE_AND_STEP(); - store_data_byte(destoffset, imm); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - imm = fetch_byte_imm(); - DECODE_PRINTF2(",%2x\n", imm); - TRACE_AND_STEP(); - *destreg = imm; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc7 -****************************************************************************/ -static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - START_OF_INSTR(); - DECODE_PRINTF("MOV\t"); - FETCH_DECODE_MODRM(mod, rh, rl); - if (rh != 0) { - DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n"); - HALT_SYS(); - } - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm00_address(rl); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - store_data_long(destoffset, imm); - } else { - u16 imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm00_address(rl); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - store_data_word(destoffset, imm); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm01_address(rl); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - store_data_long(destoffset, imm); - } else { - u16 imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm01_address(rl); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - store_data_word(destoffset, imm); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 imm; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm10_address(rl); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - store_data_long(destoffset, imm); - } else { - u16 imm; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm10_address(rl); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - store_data_word(destoffset, imm); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 imm; - - destreg = DECODE_RM_LONG_REGISTER(rl); - imm = fetch_long_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - *destreg = imm; - } else { - u16 *destreg; - u16 imm; - - destreg = DECODE_RM_WORD_REGISTER(rl); - imm = fetch_word_imm(); - DECODE_PRINTF2(",%x\n", imm); - TRACE_AND_STEP(); - *destreg = imm; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc8 -****************************************************************************/ -static void x86emuOp_enter(u8 X86EMU_UNUSED(op1)) -{ - u16 local,frame_pointer; - u8 nesting; - int i; - - START_OF_INSTR(); - local = fetch_word_imm(); - nesting = fetch_byte_imm(); - DECODE_PRINTF2("ENTER %x\n", local); - DECODE_PRINTF2(",%x\n", nesting); - TRACE_AND_STEP(); - push_word(M.x86.R_BP); - frame_pointer = M.x86.R_SP; - if (nesting > 0) { - for (i = 1; i < nesting; i++) { - M.x86.R_BP -= 2; - push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP)); - } - push_word(frame_pointer); - } - M.x86.R_BP = frame_pointer; - M.x86.R_SP = (u16)(M.x86.R_SP - local); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xc9 -****************************************************************************/ -static void x86emuOp_leave(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("LEAVE\n"); - TRACE_AND_STEP(); - M.x86.R_SP = M.x86.R_BP; - M.x86.R_BP = pop_word(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xca -****************************************************************************/ -static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 imm; - - START_OF_INSTR(); - DECODE_PRINTF("RETF\t"); - imm = fetch_word_imm(); - DECODE_PRINTF2("%x\n", imm); - RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip); - TRACE_AND_STEP(); - M.x86.R_IP = pop_word(); - M.x86.R_CS = pop_word(); - M.x86.R_SP += imm; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xcb -****************************************************************************/ -static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("RETF\n"); - RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip); - TRACE_AND_STEP(); - M.x86.R_IP = pop_word(); - M.x86.R_CS = pop_word(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xcc -****************************************************************************/ -static void x86emuOp_int3(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("INT 3\n"); - TRACE_AND_STEP(); - if (_X86EMU_intrTab[3]) { - (*_X86EMU_intrTab[3])(3); - } else { - push_word((u16)M.x86.R_FLG); - CLEAR_FLAG(F_IF); - CLEAR_FLAG(F_TF); - push_word(M.x86.R_CS); - M.x86.R_CS = mem_access_word(3 * 4 + 2); - push_word(M.x86.R_IP); - M.x86.R_IP = mem_access_word(3 * 4); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xcd -****************************************************************************/ -static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 intnum; - - START_OF_INSTR(); - DECODE_PRINTF("INT\t"); - intnum = fetch_byte_imm(); - DECODE_PRINTF2("%x\n", intnum); - TRACE_AND_STEP(); - if (_X86EMU_intrTab[intnum]) { - (*_X86EMU_intrTab[intnum])(intnum); - } else { - push_word((u16)M.x86.R_FLG); - CLEAR_FLAG(F_IF); - CLEAR_FLAG(F_TF); - push_word(M.x86.R_CS); - M.x86.R_CS = mem_access_word(intnum * 4 + 2); - push_word(M.x86.R_IP); - M.x86.R_IP = mem_access_word(intnum * 4); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xce -****************************************************************************/ -static void x86emuOp_into(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("INTO\n"); - TRACE_AND_STEP(); - if (ACCESS_FLAG(F_OF)) { - if (_X86EMU_intrTab[4]) { - (*_X86EMU_intrTab[4])(4); - } else { - push_word((u16)M.x86.R_FLG); - CLEAR_FLAG(F_IF); - CLEAR_FLAG(F_TF); - push_word(M.x86.R_CS); - M.x86.R_CS = mem_access_word(4 * 4 + 2); - push_word(M.x86.R_IP); - M.x86.R_IP = mem_access_word(4 * 4); - } - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xcf -****************************************************************************/ -static void x86emuOp_iret(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("IRET\n"); - - TRACE_AND_STEP(); - - M.x86.R_IP = pop_word(); - M.x86.R_CS = pop_word(); - M.x86.R_FLG = pop_word(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xd0 -****************************************************************************/ -static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg; - uint destoffset; - u8 destval; - - /* - * Yet another weirdo special case instruction format. Part of - * the opcode held below in "RH". Doubly nested case would - * result, except that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - switch (rh) { - case 0: - DECODE_PRINTF("ROL\t"); - break; - case 1: - DECODE_PRINTF("ROR\t"); - break; - case 2: - DECODE_PRINTF("RCL\t"); - break; - case 3: - DECODE_PRINTF("RCR\t"); - break; - case 4: - DECODE_PRINTF("SHL\t"); - break; - case 5: - DECODE_PRINTF("SHR\t"); - break; - case 6: - DECODE_PRINTF("SAL\t"); - break; - case 7: - DECODE_PRINTF("SAR\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - switch (mod) { - case 0: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, 1); - store_data_byte(destoffset, destval); - break; - case 1: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, 1); - store_data_byte(destoffset, destval); - break; - case 2: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, 1); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(",1\n"); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (*destreg, 1); - *destreg = destval; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xd1 -****************************************************************************/ -static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - /* - * Yet another weirdo special case instruction format. Part of - * the opcode held below in "RH". Doubly nested case would - * result, except that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - switch (rh) { - case 0: - DECODE_PRINTF("ROL\t"); - break; - case 1: - DECODE_PRINTF("ROR\t"); - break; - case 2: - DECODE_PRINTF("RCL\t"); - break; - case 3: - DECODE_PRINTF("RCR\t"); - break; - case 4: - DECODE_PRINTF("SHL\t"); - break; - case 5: - DECODE_PRINTF("SHR\t"); - break; - case 6: - DECODE_PRINTF("SAL\t"); - break; - case 7: - DECODE_PRINTF("SAR\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, 1); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, 1); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, 1); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, 1); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, 1); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(",1\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, 1); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - u32 *destreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(",1\n"); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (*destreg, 1); - *destreg = destval; - } else { - u16 destval; - u16 *destreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(",1\n"); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (*destreg, 1); - *destreg = destval; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xd2 -****************************************************************************/ -static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg; - uint destoffset; - u8 destval; - u8 amt; - - /* - * Yet another weirdo special case instruction format. Part of - * the opcode held below in "RH". Doubly nested case would - * result, except that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - switch (rh) { - case 0: - DECODE_PRINTF("ROL\t"); - break; - case 1: - DECODE_PRINTF("ROR\t"); - break; - case 2: - DECODE_PRINTF("RCL\t"); - break; - case 3: - DECODE_PRINTF("RCR\t"); - break; - case 4: - DECODE_PRINTF("SHL\t"); - break; - case 5: - DECODE_PRINTF("SHR\t"); - break; - case 6: - DECODE_PRINTF("SAL\t"); - break; - case 7: - DECODE_PRINTF("SAR\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - amt = M.x86.R_CL; - switch (mod) { - case 0: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, amt); - store_data_byte(destoffset, destval); - break; - case 1: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, amt); - store_data_byte(destoffset, destval); - break; - case 2: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (destval, amt); - store_data_byte(destoffset, destval); - break; - case 3: /* register to register */ - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(",CL\n"); - TRACE_AND_STEP(); - destval = (*opcD0_byte_operation[rh]) (*destreg, amt); - *destreg = destval; - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xd3 -****************************************************************************/ -static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - u8 amt; - - /* - * Yet another weirdo special case instruction format. Part of - * the opcode held below in "RH". Doubly nested case would - * result, except that the decoded instruction - */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - switch (rh) { - case 0: - DECODE_PRINTF("ROL\t"); - break; - case 1: - DECODE_PRINTF("ROR\t"); - break; - case 2: - DECODE_PRINTF("RCL\t"); - break; - case 3: - DECODE_PRINTF("RCR\t"); - break; - case 4: - DECODE_PRINTF("SHL\t"); - break; - case 5: - DECODE_PRINTF("SHR\t"); - break; - case 6: - DECODE_PRINTF("SAL\t"); - break; - case 7: - DECODE_PRINTF("SAR\t"); - break; - } - } -#endif - /* know operation, decode the mod byte to find the addressing - mode. */ - amt = M.x86.R_CL; - switch (mod) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, amt); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, amt); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, amt); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, amt); - store_data_word(destoffset, destval); - } - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_long_operation[rh]) (destval, amt); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("WORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(",CL\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = (*opcD1_word_operation[rh]) (destval, amt); - store_data_word(destoffset, destval); - } - break; - case 3: /* register to register */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(",CL\n"); - TRACE_AND_STEP(); - *destreg = (*opcD1_long_operation[rh]) (*destreg, amt); - } else { - u16 *destreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(",CL\n"); - TRACE_AND_STEP(); - *destreg = (*opcD1_word_operation[rh]) (*destreg, amt); - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xd4 -****************************************************************************/ -static void x86emuOp_aam(u8 X86EMU_UNUSED(op1)) -{ - u8 a; - - START_OF_INSTR(); - DECODE_PRINTF("AAM\n"); - a = fetch_byte_imm(); /* this is a stupid encoding. */ - if (a != 10) { - /* fix: add base decoding - aam_word(u8 val, int base a) */ - DECODE_PRINTF("ERROR DECODING AAM\n"); - TRACE_REGS(); - HALT_SYS(); - } - TRACE_AND_STEP(); - /* note the type change here --- returning AL and AH in AX. */ - M.x86.R_AX = aam_word(M.x86.R_AL); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xd5 -****************************************************************************/ -static void x86emuOp_aad(u8 X86EMU_UNUSED(op1)) -{ - u8 a; - - START_OF_INSTR(); - DECODE_PRINTF("AAD\n"); - a = fetch_byte_imm(); - if (a != 10) { - /* fix: add base decoding - aad_word(u16 val, int base a) */ - DECODE_PRINTF("ERROR DECODING AAM\n"); - TRACE_REGS(); - HALT_SYS(); - } - TRACE_AND_STEP(); - M.x86.R_AX = aad_word(M.x86.R_AX); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/* opcode 0xd6 ILLEGAL OPCODE */ - -/**************************************************************************** -REMARKS: -Handles opcode 0xd7 -****************************************************************************/ -static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1)) -{ - u16 addr; - - START_OF_INSTR(); - DECODE_PRINTF("XLAT\n"); - TRACE_AND_STEP(); - addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL); - M.x86.R_AL = fetch_data_byte(addr); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/* instuctions D8 .. DF are in i87_ops.c */ - -/**************************************************************************** -REMARKS: -Handles opcode 0xe0 -****************************************************************************/ -static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1)) -{ - s16 ip; - - START_OF_INSTR(); - DECODE_PRINTF("LOOPNE\t"); - ip = (s8) fetch_byte_imm(); - ip += (s16) M.x86.R_IP; - DECODE_PRINTF2("%04x\n", ip); - TRACE_AND_STEP(); - M.x86.R_CX -= 1; - if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */ - M.x86.R_IP = ip; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe1 -****************************************************************************/ -static void x86emuOp_loope(u8 X86EMU_UNUSED(op1)) -{ - s16 ip; - - START_OF_INSTR(); - DECODE_PRINTF("LOOPE\t"); - ip = (s8) fetch_byte_imm(); - ip += (s16) M.x86.R_IP; - DECODE_PRINTF2("%04x\n", ip); - TRACE_AND_STEP(); - M.x86.R_CX -= 1; - if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */ - M.x86.R_IP = ip; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe2 -****************************************************************************/ -static void x86emuOp_loop(u8 X86EMU_UNUSED(op1)) -{ - s16 ip; - - START_OF_INSTR(); - DECODE_PRINTF("LOOP\t"); - ip = (s8) fetch_byte_imm(); - ip += (s16) M.x86.R_IP; - DECODE_PRINTF2("%04x\n", ip); - TRACE_AND_STEP(); - M.x86.R_CX -= 1; - if (M.x86.R_CX != 0) - M.x86.R_IP = ip; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe3 -****************************************************************************/ -static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1)) -{ - u16 target; - s8 offset; - - /* jump to byte offset if overflow flag is set */ - START_OF_INSTR(); - DECODE_PRINTF("JCXZ\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - if (M.x86.R_CX == 0) - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe4 -****************************************************************************/ -static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 port; - - START_OF_INSTR(); - DECODE_PRINTF("IN\t"); - port = (u8) fetch_byte_imm(); - DECODE_PRINTF2("%x,AL\n", port); - TRACE_AND_STEP(); - M.x86.R_AL = (*sys_inb)(port); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe5 -****************************************************************************/ -static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1)) -{ - u8 port; - - START_OF_INSTR(); - DECODE_PRINTF("IN\t"); - port = (u8) fetch_byte_imm(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF2("EAX,%x\n", port); - } else { - DECODE_PRINTF2("AX,%x\n", port); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = (*sys_inl)(port); - } else { - M.x86.R_AX = (*sys_inw)(port); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe6 -****************************************************************************/ -static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1)) -{ - u8 port; - - START_OF_INSTR(); - DECODE_PRINTF("OUT\t"); - port = (u8) fetch_byte_imm(); - DECODE_PRINTF2("%x,AL\n", port); - TRACE_AND_STEP(); - (*sys_outb)(port, M.x86.R_AL); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe7 -****************************************************************************/ -static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1)) -{ - u8 port; - - START_OF_INSTR(); - DECODE_PRINTF("OUT\t"); - port = (u8) fetch_byte_imm(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF2("%x,EAX\n", port); - } else { - DECODE_PRINTF2("%x,AX\n", port); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - (*sys_outl)(port, M.x86.R_EAX); - } else { - (*sys_outw)(port, M.x86.R_AX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe8 -****************************************************************************/ -static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1)) -{ - s16 ip; - - START_OF_INSTR(); - DECODE_PRINTF("CALL\t"); - ip = (s16) fetch_word_imm(); - ip += (s16) M.x86.R_IP; /* CHECK SIGN */ - DECODE_PRINTF2("%04x\n", (u16)ip); - CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, ""); - TRACE_AND_STEP(); - push_word(M.x86.R_IP); - M.x86.R_IP = ip; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xe9 -****************************************************************************/ -static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1)) -{ - int ip; - - START_OF_INSTR(); - DECODE_PRINTF("JMP\t"); - ip = (s16)fetch_word_imm(); - ip += (s16)M.x86.R_IP; - DECODE_PRINTF2("%04x\n", (u16)ip); - TRACE_AND_STEP(); - M.x86.R_IP = (u16)ip; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xea -****************************************************************************/ -static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 cs, ip; - - START_OF_INSTR(); - DECODE_PRINTF("JMP\tFAR "); - ip = fetch_word_imm(); - cs = fetch_word_imm(); - DECODE_PRINTF2("%04x:", cs); - DECODE_PRINTF2("%04x\n", ip); - TRACE_AND_STEP(); - M.x86.R_IP = ip; - M.x86.R_CS = cs; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xeb -****************************************************************************/ -static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1)) -{ - u16 target; - s8 offset; - - START_OF_INSTR(); - DECODE_PRINTF("JMP\t"); - offset = (s8)fetch_byte_imm(); - target = (u16)(M.x86.R_IP + offset); - DECODE_PRINTF2("%x\n", target); - TRACE_AND_STEP(); - M.x86.R_IP = target; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xec -****************************************************************************/ -static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("IN\tAL,DX\n"); - TRACE_AND_STEP(); - M.x86.R_AL = (*sys_inb)(M.x86.R_DX); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xed -****************************************************************************/ -static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("IN\tEAX,DX\n"); - } else { - DECODE_PRINTF("IN\tAX,DX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - M.x86.R_EAX = (*sys_inl)(M.x86.R_DX); - } else { - M.x86.R_AX = (*sys_inw)(M.x86.R_DX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xee -****************************************************************************/ -static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("OUT\tDX,AL\n"); - TRACE_AND_STEP(); - (*sys_outb)(M.x86.R_DX, M.x86.R_AL); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xef -****************************************************************************/ -static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("OUT\tDX,EAX\n"); - } else { - DECODE_PRINTF("OUT\tDX,AX\n"); - } - TRACE_AND_STEP(); - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - (*sys_outl)(M.x86.R_DX, M.x86.R_EAX); - } else { - (*sys_outw)(M.x86.R_DX, M.x86.R_AX); - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf0 -****************************************************************************/ -static void x86emuOp_lock(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("LOCK:\n"); - TRACE_AND_STEP(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/*opcode 0xf1 ILLEGAL OPERATION */ - -/**************************************************************************** -REMARKS: -Handles opcode 0xf2 -****************************************************************************/ -static void x86emuOp_repne(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("REPNE\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_PREFIX_REPNE; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf3 -****************************************************************************/ -static void x86emuOp_repe(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("REPE\n"); - TRACE_AND_STEP(); - M.x86.mode |= SYSMODE_PREFIX_REPE; - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf4 -****************************************************************************/ -static void x86emuOp_halt(u8 X86EMU_UNUSED(op1)) -{ - START_OF_INSTR(); - DECODE_PRINTF("HALT\n"); - TRACE_AND_STEP(); - HALT_SYS(); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf5 -****************************************************************************/ -static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1)) -{ - /* complement the carry flag. */ - START_OF_INSTR(); - DECODE_PRINTF("CMC\n"); - TRACE_AND_STEP(); - TOGGLE_FLAG(F_CF); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf6 -****************************************************************************/ -static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - u8 *destreg; - uint destoffset; - u8 destval, srcval; - - /* long, drawn out code follows. Double switch for a total - of 32 cases. */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: /* mod=00 */ - switch (rh) { - case 0: /* test byte imm */ - DECODE_PRINTF("TEST\tBYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%02x\n", srcval); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - test_byte(destval, srcval); - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n"); - HALT_SYS(); - break; - case 2: - DECODE_PRINTF("NOT\tBYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = not_byte(destval); - store_data_byte(destoffset, destval); - break; - case 3: - DECODE_PRINTF("NEG\tBYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = neg_byte(destval); - store_data_byte(destoffset, destval); - break; - case 4: - DECODE_PRINTF("MUL\tBYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - mul_byte(destval); - break; - case 5: - DECODE_PRINTF("IMUL\tBYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - imul_byte(destval); - break; - case 6: - DECODE_PRINTF("DIV\tBYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - div_byte(destval); - break; - case 7: - DECODE_PRINTF("IDIV\tBYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - idiv_byte(destval); - break; - } - break; /* end mod==00 */ - case 1: /* mod=01 */ - switch (rh) { - case 0: /* test byte imm */ - DECODE_PRINTF("TEST\tBYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%02x\n", srcval); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - test_byte(destval, srcval); - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n"); - HALT_SYS(); - break; - case 2: - DECODE_PRINTF("NOT\tBYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = not_byte(destval); - store_data_byte(destoffset, destval); - break; - case 3: - DECODE_PRINTF("NEG\tBYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = neg_byte(destval); - store_data_byte(destoffset, destval); - break; - case 4: - DECODE_PRINTF("MUL\tBYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - mul_byte(destval); - break; - case 5: - DECODE_PRINTF("IMUL\tBYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - imul_byte(destval); - break; - case 6: - DECODE_PRINTF("DIV\tBYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - div_byte(destval); - break; - case 7: - DECODE_PRINTF("IDIV\tBYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - idiv_byte(destval); - break; - } - break; /* end mod==01 */ - case 2: /* mod=10 */ - switch (rh) { - case 0: /* test byte imm */ - DECODE_PRINTF("TEST\tBYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%02x\n", srcval); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - test_byte(destval, srcval); - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n"); - HALT_SYS(); - break; - case 2: - DECODE_PRINTF("NOT\tBYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = not_byte(destval); - store_data_byte(destoffset, destval); - break; - case 3: - DECODE_PRINTF("NEG\tBYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = neg_byte(destval); - store_data_byte(destoffset, destval); - break; - case 4: - DECODE_PRINTF("MUL\tBYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - mul_byte(destval); - break; - case 5: - DECODE_PRINTF("IMUL\tBYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - imul_byte(destval); - break; - case 6: - DECODE_PRINTF("DIV\tBYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - div_byte(destval); - break; - case 7: - DECODE_PRINTF("IDIV\tBYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - idiv_byte(destval); - break; - } - break; /* end mod==10 */ - case 3: /* mod=11 */ - switch (rh) { - case 0: /* test byte imm */ - DECODE_PRINTF("TEST\t"); - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF(","); - srcval = fetch_byte_imm(); - DECODE_PRINTF2("%02x\n", srcval); - TRACE_AND_STEP(); - test_byte(*destreg, srcval); - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n"); - HALT_SYS(); - break; - case 2: - DECODE_PRINTF("NOT\t"); - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = not_byte(*destreg); - break; - case 3: - DECODE_PRINTF("NEG\t"); - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = neg_byte(*destreg); - break; - case 4: - DECODE_PRINTF("MUL\t"); - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - mul_byte(*destreg); /*!!! */ - break; - case 5: - DECODE_PRINTF("IMUL\t"); - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - imul_byte(*destreg); - break; - case 6: - DECODE_PRINTF("DIV\t"); - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - div_byte(*destreg); - break; - case 7: - DECODE_PRINTF("IDIV\t"); - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - idiv_byte(*destreg); - break; - } - break; /* end mod==11 */ - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf7 -****************************************************************************/ -static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rl, rh; - uint destoffset; - - /* long, drawn out code follows. Double switch for a total - of 32 cases. */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); - switch (mod) { - case 0: /* mod=00 */ - switch (rh) { - case 0: /* test word imm */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,srcval; - - DECODE_PRINTF("TEST\tDWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - srcval = fetch_long_imm(); - DECODE_PRINTF2("%x\n", srcval); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - test_long(destval, srcval); - } else { - u16 destval,srcval; - - DECODE_PRINTF("TEST\tWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF(","); - srcval = fetch_word_imm(); - DECODE_PRINTF2("%x\n", srcval); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - test_word(destval, srcval); - } - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n"); - HALT_SYS(); - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("NOT\tDWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = not_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("NOT\tWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = not_word(destval); - store_data_word(destoffset, destval); - } - break; - case 3: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("NEG\tDWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = neg_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("NEG\tWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = neg_word(destval); - store_data_word(destoffset, destval); - } - break; - case 4: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("MUL\tDWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - mul_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("MUL\tWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - mul_word(destval); - } - break; - case 5: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("IMUL\tDWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - imul_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("IMUL\tWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - imul_word(destval); - } - break; - case 6: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DIV\tDWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - div_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("DIV\tWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - div_word(destval); - } - break; - case 7: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("IDIV\tDWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - idiv_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("IDIV\tWORD PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - idiv_word(destval); - } - break; - } - break; /* end mod==00 */ - case 1: /* mod=01 */ - switch (rh) { - case 0: /* test word imm */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,srcval; - - DECODE_PRINTF("TEST\tDWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - srcval = fetch_long_imm(); - DECODE_PRINTF2("%x\n", srcval); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - test_long(destval, srcval); - } else { - u16 destval,srcval; - - DECODE_PRINTF("TEST\tWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF(","); - srcval = fetch_word_imm(); - DECODE_PRINTF2("%x\n", srcval); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - test_word(destval, srcval); - } - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n"); - HALT_SYS(); - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("NOT\tDWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = not_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("NOT\tWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = not_word(destval); - store_data_word(destoffset, destval); - } - break; - case 3: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("NEG\tDWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = neg_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("NEG\tWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = neg_word(destval); - store_data_word(destoffset, destval); - } - break; - case 4: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("MUL\tDWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - mul_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("MUL\tWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - mul_word(destval); - } - break; - case 5: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("IMUL\tDWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - imul_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("IMUL\tWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - imul_word(destval); - } - break; - case 6: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DIV\tDWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - div_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("DIV\tWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - div_word(destval); - } - break; - case 7: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("IDIV\tDWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - idiv_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("IDIV\tWORD PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - idiv_word(destval); - } - break; - } - break; /* end mod==01 */ - case 2: /* mod=10 */ - switch (rh) { - case 0: /* test word imm */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval,srcval; - - DECODE_PRINTF("TEST\tDWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - srcval = fetch_long_imm(); - DECODE_PRINTF2("%x\n", srcval); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - test_long(destval, srcval); - } else { - u16 destval,srcval; - - DECODE_PRINTF("TEST\tWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF(","); - srcval = fetch_word_imm(); - DECODE_PRINTF2("%x\n", srcval); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - test_word(destval, srcval); - } - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n"); - HALT_SYS(); - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("NOT\tDWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = not_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("NOT\tWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = not_word(destval); - store_data_word(destoffset, destval); - } - break; - case 3: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("NEG\tDWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = neg_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - DECODE_PRINTF("NEG\tWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = neg_word(destval); - store_data_word(destoffset, destval); - } - break; - case 4: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("MUL\tDWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - mul_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("MUL\tWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - mul_word(destval); - } - break; - case 5: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("IMUL\tDWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - imul_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("IMUL\tWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - imul_word(destval); - } - break; - case 6: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("DIV\tDWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - div_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("DIV\tWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - div_word(destval); - } - break; - case 7: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - DECODE_PRINTF("IDIV\tDWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - idiv_long(destval); - } else { - u16 destval; - - DECODE_PRINTF("IDIV\tWORD PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - idiv_word(destval); - } - break; - } - break; /* end mod==10 */ - case 3: /* mod=11 */ - switch (rh) { - case 0: /* test word imm */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - u32 srcval; - - DECODE_PRINTF("TEST\t"); - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF(","); - srcval = fetch_long_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - test_long(*destreg, srcval); - } else { - u16 *destreg; - u16 srcval; - - DECODE_PRINTF("TEST\t"); - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF(","); - srcval = fetch_word_imm(); - DECODE_PRINTF2("%x\n", srcval); - TRACE_AND_STEP(); - test_word(*destreg, srcval); - } - break; - case 1: - DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n"); - HALT_SYS(); - break; - case 2: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - DECODE_PRINTF("NOT\t"); - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = not_long(*destreg); - } else { - u16 *destreg; - - DECODE_PRINTF("NOT\t"); - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = not_word(*destreg); - } - break; - case 3: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - DECODE_PRINTF("NEG\t"); - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = neg_long(*destreg); - } else { - u16 *destreg; - - DECODE_PRINTF("NEG\t"); - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = neg_word(*destreg); - } - break; - case 4: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - DECODE_PRINTF("MUL\t"); - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - mul_long(*destreg); /*!!! */ - } else { - u16 *destreg; - - DECODE_PRINTF("MUL\t"); - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - mul_word(*destreg); /*!!! */ - } - break; - case 5: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - DECODE_PRINTF("IMUL\t"); - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - imul_long(*destreg); - } else { - u16 *destreg; - - DECODE_PRINTF("IMUL\t"); - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - imul_word(*destreg); - } - break; - case 6: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - DECODE_PRINTF("DIV\t"); - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - div_long(*destreg); - } else { - u16 *destreg; - - DECODE_PRINTF("DIV\t"); - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - div_word(*destreg); - } - break; - case 7: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - DECODE_PRINTF("IDIV\t"); - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - idiv_long(*destreg); - } else { - u16 *destreg; - - DECODE_PRINTF("IDIV\t"); - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - idiv_word(*destreg); - } - break; - } - break; /* end mod==11 */ - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf8 -****************************************************************************/ -static void x86emuOp_clc(u8 X86EMU_UNUSED(op1)) -{ - /* clear the carry flag. */ - START_OF_INSTR(); - DECODE_PRINTF("CLC\n"); - TRACE_AND_STEP(); - CLEAR_FLAG(F_CF); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xf9 -****************************************************************************/ -static void x86emuOp_stc(u8 X86EMU_UNUSED(op1)) -{ - /* set the carry flag. */ - START_OF_INSTR(); - DECODE_PRINTF("STC\n"); - TRACE_AND_STEP(); - SET_FLAG(F_CF); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xfa -****************************************************************************/ -static void x86emuOp_cli(u8 X86EMU_UNUSED(op1)) -{ - /* clear interrupts. */ - START_OF_INSTR(); - DECODE_PRINTF("CLI\n"); - TRACE_AND_STEP(); - CLEAR_FLAG(F_IF); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xfb -****************************************************************************/ -static void x86emuOp_sti(u8 X86EMU_UNUSED(op1)) -{ - /* enable interrupts. */ - START_OF_INSTR(); - DECODE_PRINTF("STI\n"); - TRACE_AND_STEP(); - SET_FLAG(F_IF); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xfc -****************************************************************************/ -static void x86emuOp_cld(u8 X86EMU_UNUSED(op1)) -{ - /* clear interrupts. */ - START_OF_INSTR(); - DECODE_PRINTF("CLD\n"); - TRACE_AND_STEP(); - CLEAR_FLAG(F_DF); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xfd -****************************************************************************/ -static void x86emuOp_std(u8 X86EMU_UNUSED(op1)) -{ - /* clear interrupts. */ - START_OF_INSTR(); - DECODE_PRINTF("STD\n"); - TRACE_AND_STEP(); - SET_FLAG(F_DF); - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xfe -****************************************************************************/ -static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rh, rl; - u8 destval; - uint destoffset; - u8 *destreg; - - /* Yet another special case instruction. */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - - switch (rh) { - case 0: - DECODE_PRINTF("INC\t"); - break; - case 1: - DECODE_PRINTF("DEC\t"); - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - DECODE_PRINTF2("ILLEGAL OP MAJOR OP 0xFE MINOR OP %x \n", mod); - HALT_SYS(); - break; - } - } -#endif - switch (mod) { - case 0: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - switch (rh) { - case 0: /* inc word ptr ... */ - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = inc_byte(destval); - store_data_byte(destoffset, destval); - break; - case 1: /* dec word ptr ... */ - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = dec_byte(destval); - store_data_byte(destoffset, destval); - break; - } - break; - case 1: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - switch (rh) { - case 0: - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = inc_byte(destval); - store_data_byte(destoffset, destval); - break; - case 1: - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = dec_byte(destval); - store_data_byte(destoffset, destval); - break; - } - break; - case 2: - DECODE_PRINTF("BYTE PTR "); - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - switch (rh) { - case 0: - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = inc_byte(destval); - store_data_byte(destoffset, destval); - break; - case 1: - destval = fetch_data_byte(destoffset); - TRACE_AND_STEP(); - destval = dec_byte(destval); - store_data_byte(destoffset, destval); - break; - } - break; - case 3: - destreg = DECODE_RM_BYTE_REGISTER(rl); - DECODE_PRINTF("\n"); - switch (rh) { - case 0: - TRACE_AND_STEP(); - *destreg = inc_byte(*destreg); - break; - case 1: - TRACE_AND_STEP(); - *destreg = dec_byte(*destreg); - break; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/**************************************************************************** -REMARKS: -Handles opcode 0xff -****************************************************************************/ -static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1)) -{ - int mod, rh, rl; - uint destoffset = 0; - u16 *destreg; - u16 destval,destval2; - - /* Yet another special case instruction. */ - START_OF_INSTR(); - FETCH_DECODE_MODRM(mod, rh, rl); -#ifdef DEBUG - if (DEBUG_DECODE()) { - /* XXX DECODE_PRINTF may be changed to something more - general, so that it is important to leave the strings - in the same format, even though the result is that the - above test is done twice. */ - - switch (rh) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("INC\tDWORD PTR "); - } else { - DECODE_PRINTF("INC\tWORD PTR "); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - DECODE_PRINTF("DEC\tDWORD PTR "); - } else { - DECODE_PRINTF("DEC\tWORD PTR "); - } - break; - case 2: - DECODE_PRINTF("CALL\t"); - break; - case 3: - DECODE_PRINTF("CALL\tFAR "); - break; - case 4: - DECODE_PRINTF("JMP\t"); - break; - case 5: - DECODE_PRINTF("JMP\tFAR "); - break; - case 6: - DECODE_PRINTF("PUSH\t"); - break; - case 7: - DECODE_PRINTF("ILLEGAL DECODING OF OPCODE FF\t"); - HALT_SYS(); - break; - } - } -#endif - switch (mod) { - case 0: - destoffset = decode_rm00_address(rl); - DECODE_PRINTF("\n"); - switch (rh) { - case 0: /* inc word ptr ... */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = inc_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = inc_word(destval); - store_data_word(destoffset, destval); - } - break; - case 1: /* dec word ptr ... */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = dec_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = dec_word(destval); - store_data_word(destoffset, destval); - } - break; - case 2: /* call word ptr ... */ - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - push_word(M.x86.R_IP); - M.x86.R_IP = destval; - break; - case 3: /* call far ptr ... */ - destval = fetch_data_word(destoffset); - destval2 = fetch_data_word(destoffset + 2); - TRACE_AND_STEP(); - push_word(M.x86.R_CS); - M.x86.R_CS = destval2; - push_word(M.x86.R_IP); - M.x86.R_IP = destval; - break; - case 4: /* jmp word ptr ... */ - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - M.x86.R_IP = destval; - break; - case 5: /* jmp far ptr ... */ - destval = fetch_data_word(destoffset); - destval2 = fetch_data_word(destoffset + 2); - TRACE_AND_STEP(); - M.x86.R_IP = destval; - M.x86.R_CS = destval2; - break; - case 6: /* push word ptr ... */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - push_long(destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - push_word(destval); - } - break; - } - break; - case 1: - destoffset = decode_rm01_address(rl); - DECODE_PRINTF("\n"); - switch (rh) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = inc_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = inc_word(destval); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = dec_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = dec_word(destval); - store_data_word(destoffset, destval); - } - break; - case 2: /* call word ptr ... */ - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - push_word(M.x86.R_IP); - M.x86.R_IP = destval; - break; - case 3: /* call far ptr ... */ - destval = fetch_data_word(destoffset); - destval2 = fetch_data_word(destoffset + 2); - TRACE_AND_STEP(); - push_word(M.x86.R_CS); - M.x86.R_CS = destval2; - push_word(M.x86.R_IP); - M.x86.R_IP = destval; - break; - case 4: /* jmp word ptr ... */ - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - M.x86.R_IP = destval; - break; - case 5: /* jmp far ptr ... */ - destval = fetch_data_word(destoffset); - destval2 = fetch_data_word(destoffset + 2); - TRACE_AND_STEP(); - M.x86.R_IP = destval; - M.x86.R_CS = destval2; - break; - case 6: /* push word ptr ... */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - push_long(destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - push_word(destval); - } - break; - } - break; - case 2: - destoffset = decode_rm10_address(rl); - DECODE_PRINTF("\n"); - switch (rh) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = inc_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = inc_word(destval); - store_data_word(destoffset, destval); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - destval = dec_long(destval); - store_data_long(destoffset, destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - destval = dec_word(destval); - store_data_word(destoffset, destval); - } - break; - case 2: /* call word ptr ... */ - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - push_word(M.x86.R_IP); - M.x86.R_IP = destval; - break; - case 3: /* call far ptr ... */ - destval = fetch_data_word(destoffset); - destval2 = fetch_data_word(destoffset + 2); - TRACE_AND_STEP(); - push_word(M.x86.R_CS); - M.x86.R_CS = destval2; - push_word(M.x86.R_IP); - M.x86.R_IP = destval; - break; - case 4: /* jmp word ptr ... */ - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - M.x86.R_IP = destval; - break; - case 5: /* jmp far ptr ... */ - destval = fetch_data_word(destoffset); - destval2 = fetch_data_word(destoffset + 2); - TRACE_AND_STEP(); - M.x86.R_IP = destval; - M.x86.R_CS = destval2; - break; - case 6: /* push word ptr ... */ - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 destval; - - destval = fetch_data_long(destoffset); - TRACE_AND_STEP(); - push_long(destval); - } else { - u16 destval; - - destval = fetch_data_word(destoffset); - TRACE_AND_STEP(); - push_word(destval); - } - break; - } - break; - case 3: - switch (rh) { - case 0: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = inc_long(*destreg); - } else { - u16 *destreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = inc_word(*destreg); - } - break; - case 1: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = dec_long(*destreg); - } else { - u16 *destreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - *destreg = dec_word(*destreg); - } - break; - case 2: /* call word ptr ... */ - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - push_word(M.x86.R_IP); - M.x86.R_IP = *destreg; - break; - case 3: /* jmp far ptr ... */ - DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n"); - TRACE_AND_STEP(); - HALT_SYS(); - break; - - case 4: /* jmp ... */ - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - M.x86.R_IP = (u16) (*destreg); - break; - case 5: /* jmp far ptr ... */ - DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n"); - TRACE_AND_STEP(); - HALT_SYS(); - break; - case 6: - if (M.x86.mode & SYSMODE_PREFIX_DATA) { - u32 *destreg; - - destreg = DECODE_RM_LONG_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - push_long(*destreg); - } else { - u16 *destreg; - - destreg = DECODE_RM_WORD_REGISTER(rl); - DECODE_PRINTF("\n"); - TRACE_AND_STEP(); - push_word(*destreg); - } - break; - } - break; - } - DECODE_CLEAR_SEGOVR(); - END_OF_INSTR(); -} - -/*************************************************************************** - * Single byte operation code table: - **************************************************************************/ -void (*x86emu_optab[256])(u8) = -{ -/* 0x00 */ x86emuOp_add_byte_RM_R, -/* 0x01 */ x86emuOp_add_word_RM_R, -/* 0x02 */ x86emuOp_add_byte_R_RM, -/* 0x03 */ x86emuOp_add_word_R_RM, -/* 0x04 */ x86emuOp_add_byte_AL_IMM, -/* 0x05 */ x86emuOp_add_word_AX_IMM, -/* 0x06 */ x86emuOp_push_ES, -/* 0x07 */ x86emuOp_pop_ES, - -/* 0x08 */ x86emuOp_or_byte_RM_R, -/* 0x09 */ x86emuOp_or_word_RM_R, -/* 0x0a */ x86emuOp_or_byte_R_RM, -/* 0x0b */ x86emuOp_or_word_R_RM, -/* 0x0c */ x86emuOp_or_byte_AL_IMM, -/* 0x0d */ x86emuOp_or_word_AX_IMM, -/* 0x0e */ x86emuOp_push_CS, -/* 0x0f */ x86emuOp_two_byte, - -/* 0x10 */ x86emuOp_adc_byte_RM_R, -/* 0x11 */ x86emuOp_adc_word_RM_R, -/* 0x12 */ x86emuOp_adc_byte_R_RM, -/* 0x13 */ x86emuOp_adc_word_R_RM, -/* 0x14 */ x86emuOp_adc_byte_AL_IMM, -/* 0x15 */ x86emuOp_adc_word_AX_IMM, -/* 0x16 */ x86emuOp_push_SS, -/* 0x17 */ x86emuOp_pop_SS, - -/* 0x18 */ x86emuOp_sbb_byte_RM_R, -/* 0x19 */ x86emuOp_sbb_word_RM_R, -/* 0x1a */ x86emuOp_sbb_byte_R_RM, -/* 0x1b */ x86emuOp_sbb_word_R_RM, -/* 0x1c */ x86emuOp_sbb_byte_AL_IMM, -/* 0x1d */ x86emuOp_sbb_word_AX_IMM, -/* 0x1e */ x86emuOp_push_DS, -/* 0x1f */ x86emuOp_pop_DS, - -/* 0x20 */ x86emuOp_and_byte_RM_R, -/* 0x21 */ x86emuOp_and_word_RM_R, -/* 0x22 */ x86emuOp_and_byte_R_RM, -/* 0x23 */ x86emuOp_and_word_R_RM, -/* 0x24 */ x86emuOp_and_byte_AL_IMM, -/* 0x25 */ x86emuOp_and_word_AX_IMM, -/* 0x26 */ x86emuOp_segovr_ES, -/* 0x27 */ x86emuOp_daa, - -/* 0x28 */ x86emuOp_sub_byte_RM_R, -/* 0x29 */ x86emuOp_sub_word_RM_R, -/* 0x2a */ x86emuOp_sub_byte_R_RM, -/* 0x2b */ x86emuOp_sub_word_R_RM, -/* 0x2c */ x86emuOp_sub_byte_AL_IMM, -/* 0x2d */ x86emuOp_sub_word_AX_IMM, -/* 0x2e */ x86emuOp_segovr_CS, -/* 0x2f */ x86emuOp_das, - -/* 0x30 */ x86emuOp_xor_byte_RM_R, -/* 0x31 */ x86emuOp_xor_word_RM_R, -/* 0x32 */ x86emuOp_xor_byte_R_RM, -/* 0x33 */ x86emuOp_xor_word_R_RM, -/* 0x34 */ x86emuOp_xor_byte_AL_IMM, -/* 0x35 */ x86emuOp_xor_word_AX_IMM, -/* 0x36 */ x86emuOp_segovr_SS, -/* 0x37 */ x86emuOp_aaa, - -/* 0x38 */ x86emuOp_cmp_byte_RM_R, -/* 0x39 */ x86emuOp_cmp_word_RM_R, -/* 0x3a */ x86emuOp_cmp_byte_R_RM, -/* 0x3b */ x86emuOp_cmp_word_R_RM, -/* 0x3c */ x86emuOp_cmp_byte_AL_IMM, -/* 0x3d */ x86emuOp_cmp_word_AX_IMM, -/* 0x3e */ x86emuOp_segovr_DS, -/* 0x3f */ x86emuOp_aas, - -/* 0x40 */ x86emuOp_inc_AX, -/* 0x41 */ x86emuOp_inc_CX, -/* 0x42 */ x86emuOp_inc_DX, -/* 0x43 */ x86emuOp_inc_BX, -/* 0x44 */ x86emuOp_inc_SP, -/* 0x45 */ x86emuOp_inc_BP, -/* 0x46 */ x86emuOp_inc_SI, -/* 0x47 */ x86emuOp_inc_DI, - -/* 0x48 */ x86emuOp_dec_AX, -/* 0x49 */ x86emuOp_dec_CX, -/* 0x4a */ x86emuOp_dec_DX, -/* 0x4b */ x86emuOp_dec_BX, -/* 0x4c */ x86emuOp_dec_SP, -/* 0x4d */ x86emuOp_dec_BP, -/* 0x4e */ x86emuOp_dec_SI, -/* 0x4f */ x86emuOp_dec_DI, - -/* 0x50 */ x86emuOp_push_AX, -/* 0x51 */ x86emuOp_push_CX, -/* 0x52 */ x86emuOp_push_DX, -/* 0x53 */ x86emuOp_push_BX, -/* 0x54 */ x86emuOp_push_SP, -/* 0x55 */ x86emuOp_push_BP, -/* 0x56 */ x86emuOp_push_SI, -/* 0x57 */ x86emuOp_push_DI, - -/* 0x58 */ x86emuOp_pop_AX, -/* 0x59 */ x86emuOp_pop_CX, -/* 0x5a */ x86emuOp_pop_DX, -/* 0x5b */ x86emuOp_pop_BX, -/* 0x5c */ x86emuOp_pop_SP, -/* 0x5d */ x86emuOp_pop_BP, -/* 0x5e */ x86emuOp_pop_SI, -/* 0x5f */ x86emuOp_pop_DI, - -/* 0x60 */ x86emuOp_push_all, -/* 0x61 */ x86emuOp_pop_all, -/* 0x62 */ x86emuOp_illegal_op, /* bound */ -/* 0x63 */ x86emuOp_illegal_op, /* arpl */ -/* 0x64 */ x86emuOp_segovr_FS, -/* 0x65 */ x86emuOp_segovr_GS, -/* 0x66 */ x86emuOp_prefix_data, -/* 0x67 */ x86emuOp_prefix_addr, - -/* 0x68 */ x86emuOp_push_word_IMM, -/* 0x69 */ x86emuOp_imul_word_IMM, -/* 0x6a */ x86emuOp_push_byte_IMM, -/* 0x6b */ x86emuOp_imul_byte_IMM, -/* 0x6c */ x86emuOp_ins_byte, -/* 0x6d */ x86emuOp_ins_word, -/* 0x6e */ x86emuOp_outs_byte, -/* 0x6f */ x86emuOp_outs_word, - -/* 0x70 */ x86emuOp_jump_near_O, -/* 0x71 */ x86emuOp_jump_near_NO, -/* 0x72 */ x86emuOp_jump_near_B, -/* 0x73 */ x86emuOp_jump_near_NB, -/* 0x74 */ x86emuOp_jump_near_Z, -/* 0x75 */ x86emuOp_jump_near_NZ, -/* 0x76 */ x86emuOp_jump_near_BE, -/* 0x77 */ x86emuOp_jump_near_NBE, - -/* 0x78 */ x86emuOp_jump_near_S, -/* 0x79 */ x86emuOp_jump_near_NS, -/* 0x7a */ x86emuOp_jump_near_P, -/* 0x7b */ x86emuOp_jump_near_NP, -/* 0x7c */ x86emuOp_jump_near_L, -/* 0x7d */ x86emuOp_jump_near_NL, -/* 0x7e */ x86emuOp_jump_near_LE, -/* 0x7f */ x86emuOp_jump_near_NLE, - -/* 0x80 */ x86emuOp_opc80_byte_RM_IMM, -/* 0x81 */ x86emuOp_opc81_word_RM_IMM, -/* 0x82 */ x86emuOp_opc82_byte_RM_IMM, -/* 0x83 */ x86emuOp_opc83_word_RM_IMM, -/* 0x84 */ x86emuOp_test_byte_RM_R, -/* 0x85 */ x86emuOp_test_word_RM_R, -/* 0x86 */ x86emuOp_xchg_byte_RM_R, -/* 0x87 */ x86emuOp_xchg_word_RM_R, - -/* 0x88 */ x86emuOp_mov_byte_RM_R, -/* 0x89 */ x86emuOp_mov_word_RM_R, -/* 0x8a */ x86emuOp_mov_byte_R_RM, -/* 0x8b */ x86emuOp_mov_word_R_RM, -/* 0x8c */ x86emuOp_mov_word_RM_SR, -/* 0x8d */ x86emuOp_lea_word_R_M, -/* 0x8e */ x86emuOp_mov_word_SR_RM, -/* 0x8f */ x86emuOp_pop_RM, - -/* 0x90 */ x86emuOp_nop, -/* 0x91 */ x86emuOp_xchg_word_AX_CX, -/* 0x92 */ x86emuOp_xchg_word_AX_DX, -/* 0x93 */ x86emuOp_xchg_word_AX_BX, -/* 0x94 */ x86emuOp_xchg_word_AX_SP, -/* 0x95 */ x86emuOp_xchg_word_AX_BP, -/* 0x96 */ x86emuOp_xchg_word_AX_SI, -/* 0x97 */ x86emuOp_xchg_word_AX_DI, - -/* 0x98 */ x86emuOp_cbw, -/* 0x99 */ x86emuOp_cwd, -/* 0x9a */ x86emuOp_call_far_IMM, -/* 0x9b */ x86emuOp_wait, -/* 0x9c */ x86emuOp_pushf_word, -/* 0x9d */ x86emuOp_popf_word, -/* 0x9e */ x86emuOp_sahf, -/* 0x9f */ x86emuOp_lahf, - -/* 0xa0 */ x86emuOp_mov_AL_M_IMM, -/* 0xa1 */ x86emuOp_mov_AX_M_IMM, -/* 0xa2 */ x86emuOp_mov_M_AL_IMM, -/* 0xa3 */ x86emuOp_mov_M_AX_IMM, -/* 0xa4 */ x86emuOp_movs_byte, -/* 0xa5 */ x86emuOp_movs_word, -/* 0xa6 */ x86emuOp_cmps_byte, -/* 0xa7 */ x86emuOp_cmps_word, -/* 0xa8 */ x86emuOp_test_AL_IMM, -/* 0xa9 */ x86emuOp_test_AX_IMM, -/* 0xaa */ x86emuOp_stos_byte, -/* 0xab */ x86emuOp_stos_word, -/* 0xac */ x86emuOp_lods_byte, -/* 0xad */ x86emuOp_lods_word, -/* 0xac */ x86emuOp_scas_byte, -/* 0xad */ x86emuOp_scas_word, - - -/* 0xb0 */ x86emuOp_mov_byte_AL_IMM, -/* 0xb1 */ x86emuOp_mov_byte_CL_IMM, -/* 0xb2 */ x86emuOp_mov_byte_DL_IMM, -/* 0xb3 */ x86emuOp_mov_byte_BL_IMM, -/* 0xb4 */ x86emuOp_mov_byte_AH_IMM, -/* 0xb5 */ x86emuOp_mov_byte_CH_IMM, -/* 0xb6 */ x86emuOp_mov_byte_DH_IMM, -/* 0xb7 */ x86emuOp_mov_byte_BH_IMM, - -/* 0xb8 */ x86emuOp_mov_word_AX_IMM, -/* 0xb9 */ x86emuOp_mov_word_CX_IMM, -/* 0xba */ x86emuOp_mov_word_DX_IMM, -/* 0xbb */ x86emuOp_mov_word_BX_IMM, -/* 0xbc */ x86emuOp_mov_word_SP_IMM, -/* 0xbd */ x86emuOp_mov_word_BP_IMM, -/* 0xbe */ x86emuOp_mov_word_SI_IMM, -/* 0xbf */ x86emuOp_mov_word_DI_IMM, - -/* 0xc0 */ x86emuOp_opcC0_byte_RM_MEM, -/* 0xc1 */ x86emuOp_opcC1_word_RM_MEM, -/* 0xc2 */ x86emuOp_ret_near_IMM, -/* 0xc3 */ x86emuOp_ret_near, -/* 0xc4 */ x86emuOp_les_R_IMM, -/* 0xc5 */ x86emuOp_lds_R_IMM, -/* 0xc6 */ x86emuOp_mov_byte_RM_IMM, -/* 0xc7 */ x86emuOp_mov_word_RM_IMM, -/* 0xc8 */ x86emuOp_enter, -/* 0xc9 */ x86emuOp_leave, -/* 0xca */ x86emuOp_ret_far_IMM, -/* 0xcb */ x86emuOp_ret_far, -/* 0xcc */ x86emuOp_int3, -/* 0xcd */ x86emuOp_int_IMM, -/* 0xce */ x86emuOp_into, -/* 0xcf */ x86emuOp_iret, - -/* 0xd0 */ x86emuOp_opcD0_byte_RM_1, -/* 0xd1 */ x86emuOp_opcD1_word_RM_1, -/* 0xd2 */ x86emuOp_opcD2_byte_RM_CL, -/* 0xd3 */ x86emuOp_opcD3_word_RM_CL, -/* 0xd4 */ x86emuOp_aam, -/* 0xd5 */ x86emuOp_aad, -/* 0xd6 */ x86emuOp_illegal_op, /* Undocumented SETALC instruction */ -/* 0xd7 */ x86emuOp_xlat, -/* 0xd8 */ x86emuOp_esc_coprocess_d8, -/* 0xd9 */ x86emuOp_esc_coprocess_d9, -/* 0xda */ x86emuOp_esc_coprocess_da, -/* 0xdb */ x86emuOp_esc_coprocess_db, -/* 0xdc */ x86emuOp_esc_coprocess_dc, -/* 0xdd */ x86emuOp_esc_coprocess_dd, -/* 0xde */ x86emuOp_esc_coprocess_de, -/* 0xdf */ x86emuOp_esc_coprocess_df, - -/* 0xe0 */ x86emuOp_loopne, -/* 0xe1 */ x86emuOp_loope, -/* 0xe2 */ x86emuOp_loop, -/* 0xe3 */ x86emuOp_jcxz, -/* 0xe4 */ x86emuOp_in_byte_AL_IMM, -/* 0xe5 */ x86emuOp_in_word_AX_IMM, -/* 0xe6 */ x86emuOp_out_byte_IMM_AL, -/* 0xe7 */ x86emuOp_out_word_IMM_AX, - -/* 0xe8 */ x86emuOp_call_near_IMM, -/* 0xe9 */ x86emuOp_jump_near_IMM, -/* 0xea */ x86emuOp_jump_far_IMM, -/* 0xeb */ x86emuOp_jump_byte_IMM, -/* 0xec */ x86emuOp_in_byte_AL_DX, -/* 0xed */ x86emuOp_in_word_AX_DX, -/* 0xee */ x86emuOp_out_byte_DX_AL, -/* 0xef */ x86emuOp_out_word_DX_AX, - -/* 0xf0 */ x86emuOp_lock, -/* 0xf1 */ x86emuOp_illegal_op, -/* 0xf2 */ x86emuOp_repne, -/* 0xf3 */ x86emuOp_repe, -/* 0xf4 */ x86emuOp_halt, -/* 0xf5 */ x86emuOp_cmc, -/* 0xf6 */ x86emuOp_opcF6_byte_RM, -/* 0xf7 */ x86emuOp_opcF7_word_RM, - -/* 0xf8 */ x86emuOp_clc, -/* 0xf9 */ x86emuOp_stc, -/* 0xfa */ x86emuOp_cli, -/* 0xfb */ x86emuOp_sti, -/* 0xfc */ x86emuOp_cld, -/* 0xfd */ x86emuOp_std, -/* 0xfe */ x86emuOp_opcFE_byte_RM, -/* 0xff */ x86emuOp_opcFF_word_RM, -}; +/****************************************************************************
+*
+* Realmode X86 Emulator Library
+*
+* Copyright (C) 1996-1999 SciTech Software, Inc.
+* Copyright (C) David Mosberger-Tang
+* Copyright (C) 1999 Egbert Eich
+*
+* ========================================================================
+*
+* 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 name of the authors not be used
+* in advertising or publicity pertaining to distribution of the software
+* without specific, written prior permission. The authors makes no
+* representations about the suitability of this software for any purpose.
+* It is provided "as is" without express or implied warranty.
+*
+* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+* EVENT SHALL THE AUTHORS 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.
+*
+* ========================================================================
+*
+* Language: ANSI C
+* Environment: Any
+* Developer: Kendall Bennett
+*
+* Description: This file includes subroutines to implement the decoding
+* and emulation of all the x86 processor instructions.
+*
+* There are approximately 250 subroutines in here, which correspond
+* to the 256 byte-"opcodes" found on the 8086. The table which
+* dispatches this is found in the files optab.[ch].
+*
+* Each opcode proc has a comment preceeding it which gives it's table
+* address. Several opcodes are missing (undefined) in the table.
+*
+* Each proc includes information for decoding (DECODE_PRINTF and
+* DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc
+* functions (START_OF_INSTR, END_OF_INSTR).
+*
+* Many of the procedures are *VERY* similar in coding. This has
+* allowed for a very large amount of code to be generated in a fairly
+* short amount of time (i.e. cut, paste, and modify). The result is
+* that much of the code below could have been folded into subroutines
+* for a large reduction in size of this file. The downside would be
+* that there would be a penalty in execution speed. The file could
+* also have been *MUCH* larger by inlining certain functions which
+* were called. This could have resulted even faster execution. The
+* prime directive I used to decide whether to inline the code or to
+* modularize it, was basically: 1) no unnecessary subroutine calls,
+* 2) no routines more than about 200 lines in size, and 3) modularize
+* any code that I might not get right the first time. The fetch_*
+* subroutines fall into the latter category. The The decode_* fall
+* into the second category. The coding of the "switch(mod){ .... }"
+* in many of the subroutines below falls into the first category.
+* Especially, the coding of {add,and,or,sub,...}_{byte,word}
+* subroutines are an especially glaring case of the third guideline.
+* Since so much of the code is cloned from other modules (compare
+* opcode #00 to opcode #01), making the basic operations subroutine
+* calls is especially important; otherwise mistakes in coding an
+* "add" would represent a nightmare in maintenance.
+*
+****************************************************************************/
+
+#include "x86emu/x86emui.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+op1 - Instruction op code
+
+REMARKS:
+Handles illegal opcodes.
+****************************************************************************/
+static void x86emuOp_illegal_op(
+ u8 op1)
+{
+ START_OF_INSTR();
+ if (M.x86.R_SP != 0) {
+ DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
+ TRACE_REGS();
+ DB( printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
+ M.x86.R_CS, M.x86.R_IP-1,op1));
+ HALT_SYS();
+ }
+ else {
+ /* If we get here, it means the stack pointer is back to zero
+ * so we are just returning from an emulator service call
+ * so therte is no need to display an error message. We trap
+ * the emulator with an 0xF1 opcode to finish the service
+ * call.
+ */
+ X86EMU_halt_sys();
+ }
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x00
+****************************************************************************/
+static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 *destreg, *srcreg;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x01
+****************************************************************************/
+static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = add_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x02
+****************************************************************************/
+static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x03
+****************************************************************************/
+static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x04
+****************************************************************************/
+static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADD\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = add_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x05
+****************************************************************************/
+static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("ADD\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("ADD\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = add_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = add_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x06
+****************************************************************************/
+static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tES\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_ES);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x07
+****************************************************************************/
+static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tES\n");
+ TRACE_AND_STEP();
+ M.x86.R_ES = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x08
+****************************************************************************/
+static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x09
+****************************************************************************/
+static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = or_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0a
+****************************************************************************/
+static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0b
+****************************************************************************/
+static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0c
+****************************************************************************/
+static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OR\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = or_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0d
+****************************************************************************/
+static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OR\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("OR\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = or_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = or_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0e
+****************************************************************************/
+static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tCS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f. Escape for two-byte opcode (286 or better)
+****************************************************************************/
+static void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
+{
+ u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+ INC_DECODED_INST_LEN(1);
+ (*x86emu_optab2[op2])(op2);
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x10
+****************************************************************************/
+static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x11
+****************************************************************************/
+static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = adc_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x12
+****************************************************************************/
+static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x13
+****************************************************************************/
+static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x14
+****************************************************************************/
+static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("ADC\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = adc_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x15
+****************************************************************************/
+static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("ADC\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("ADC\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = adc_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x16
+****************************************************************************/
+static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tSS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_SS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x17
+****************************************************************************/
+static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tSS\n");
+ TRACE_AND_STEP();
+ M.x86.R_SS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x18
+****************************************************************************/
+static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x19
+****************************************************************************/
+static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sbb_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1a
+****************************************************************************/
+static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1b
+****************************************************************************/
+static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1c
+****************************************************************************/
+static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SBB\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = sbb_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1d
+****************************************************************************/
+static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SBB\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("SBB\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = sbb_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1e
+****************************************************************************/
+static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tDS\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_DS);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x1f
+****************************************************************************/
+static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tDS\n");
+ TRACE_AND_STEP();
+ M.x86.R_DS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x20
+****************************************************************************/
+static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x21
+****************************************************************************/
+static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = and_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x22
+****************************************************************************/
+static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x23
+****************************************************************************/
+static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+ break;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, srcval);
+ break;
+ }
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x24
+****************************************************************************/
+static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AND\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = and_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x25
+****************************************************************************/
+static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("AND\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("AND\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = and_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = and_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x26
+****************************************************************************/
+static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("ES:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_ES;
+ /*
+ * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+ * opcode subroutines we do not want to do this.
+ */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x27
+****************************************************************************/
+static void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DAA\n");
+ TRACE_AND_STEP();
+ M.x86.R_AL = daa_byte(M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x28
+****************************************************************************/
+static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x29
+****************************************************************************/
+static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = sub_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2a
+****************************************************************************/
+static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2b
+****************************************************************************/
+static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2c
+****************************************************************************/
+static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SUB\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = sub_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2d
+****************************************************************************/
+static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SUB\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("SUB\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = sub_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2e
+****************************************************************************/
+static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("CS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_CS;
+ /* note no DECODE_CLEAR_SEGOVR here. */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x2f
+****************************************************************************/
+static void x86emuOp_das(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DAS\n");
+ TRACE_AND_STEP();
+ M.x86.R_AL = das_byte(M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x30
+****************************************************************************/
+static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x31
+****************************************************************************/
+static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = xor_word(destval, *srcreg);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x32
+****************************************************************************/
+static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x33
+****************************************************************************/
+static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x34
+****************************************************************************/
+static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XOR\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ M.x86.R_AL = xor_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x35
+****************************************************************************/
+static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XOR\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("XOR\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval);
+ } else {
+ M.x86.R_AX = xor_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x36
+****************************************************************************/
+static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("SS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_SS;
+ /* no DECODE_CLEAR_SEGOVR ! */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x37
+****************************************************************************/
+static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("AAA\n");
+ TRACE_AND_STEP();
+ M.x86.R_AX = aaa_word(M.x86.R_AX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x38
+****************************************************************************/
+static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 *destreg, *srcreg;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(destval, *srcreg);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(destval, *srcreg);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(destval, *srcreg);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x39
+****************************************************************************/
+static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(destval, *srcreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(destval, *srcreg);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(destval, *srcreg);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3a
+****************************************************************************/
+static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, srcval);
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, srcval);
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, srcval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3b
+****************************************************************************/
+static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, srcval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, srcval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3c
+****************************************************************************/
+static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMP\tAL,");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ cmp_byte(M.x86.R_AL, srcval);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3d
+****************************************************************************/
+static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CMP\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("CMP\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ cmp_long(M.x86.R_EAX, srcval);
+ } else {
+ cmp_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3e
+****************************************************************************/
+static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_DS;
+ /* NO DECODE_CLEAR_SEGOVR! */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x3f
+****************************************************************************/
+static void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("AAS\n");
+ TRACE_AND_STEP();
+ M.x86.R_AX = aas_word(M.x86.R_AX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x40
+****************************************************************************/
+static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEAX\n");
+ } else {
+ DECODE_PRINTF("INC\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = inc_long(M.x86.R_EAX);
+ } else {
+ M.x86.R_AX = inc_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x41
+****************************************************************************/
+static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tECX\n");
+ } else {
+ DECODE_PRINTF("INC\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = inc_long(M.x86.R_ECX);
+ } else {
+ M.x86.R_CX = inc_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x42
+****************************************************************************/
+static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEDX\n");
+ } else {
+ DECODE_PRINTF("INC\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = inc_long(M.x86.R_EDX);
+ } else {
+ M.x86.R_DX = inc_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x43
+****************************************************************************/
+static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEBX\n");
+ } else {
+ DECODE_PRINTF("INC\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = inc_long(M.x86.R_EBX);
+ } else {
+ M.x86.R_BX = inc_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x44
+****************************************************************************/
+static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tESP\n");
+ } else {
+ DECODE_PRINTF("INC\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = inc_long(M.x86.R_ESP);
+ } else {
+ M.x86.R_SP = inc_word(M.x86.R_SP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x45
+****************************************************************************/
+static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEBP\n");
+ } else {
+ DECODE_PRINTF("INC\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = inc_long(M.x86.R_EBP);
+ } else {
+ M.x86.R_BP = inc_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x46
+****************************************************************************/
+static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tESI\n");
+ } else {
+ DECODE_PRINTF("INC\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = inc_long(M.x86.R_ESI);
+ } else {
+ M.x86.R_SI = inc_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x47
+****************************************************************************/
+static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEDI\n");
+ } else {
+ DECODE_PRINTF("INC\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = inc_long(M.x86.R_EDI);
+ } else {
+ M.x86.R_DI = inc_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x48
+****************************************************************************/
+static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEAX\n");
+ } else {
+ DECODE_PRINTF("DEC\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = dec_long(M.x86.R_EAX);
+ } else {
+ M.x86.R_AX = dec_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x49
+****************************************************************************/
+static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tECX\n");
+ } else {
+ DECODE_PRINTF("DEC\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = dec_long(M.x86.R_ECX);
+ } else {
+ M.x86.R_CX = dec_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4a
+****************************************************************************/
+static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEDX\n");
+ } else {
+ DECODE_PRINTF("DEC\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = dec_long(M.x86.R_EDX);
+ } else {
+ M.x86.R_DX = dec_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4b
+****************************************************************************/
+static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEBX\n");
+ } else {
+ DECODE_PRINTF("DEC\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = dec_long(M.x86.R_EBX);
+ } else {
+ M.x86.R_BX = dec_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4c
+****************************************************************************/
+static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tESP\n");
+ } else {
+ DECODE_PRINTF("DEC\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = dec_long(M.x86.R_ESP);
+ } else {
+ M.x86.R_SP = dec_word(M.x86.R_SP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4d
+****************************************************************************/
+static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEBP\n");
+ } else {
+ DECODE_PRINTF("DEC\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = dec_long(M.x86.R_EBP);
+ } else {
+ M.x86.R_BP = dec_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4e
+****************************************************************************/
+static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tESI\n");
+ } else {
+ DECODE_PRINTF("DEC\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = dec_long(M.x86.R_ESI);
+ } else {
+ M.x86.R_SI = dec_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x4f
+****************************************************************************/
+static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEDI\n");
+ } else {
+ DECODE_PRINTF("DEC\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = dec_long(M.x86.R_EDI);
+ } else {
+ M.x86.R_DI = dec_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x50
+****************************************************************************/
+static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEAX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EAX);
+ } else {
+ push_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x51
+****************************************************************************/
+static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tECX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ECX);
+ } else {
+ push_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x52
+****************************************************************************/
+static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEDX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EDX);
+ } else {
+ push_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x53
+****************************************************************************/
+static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEBX\n");
+ } else {
+ DECODE_PRINTF("PUSH\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EBX);
+ } else {
+ push_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x54
+****************************************************************************/
+static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tESP\n");
+ } else {
+ DECODE_PRINTF("PUSH\tSP\n");
+ }
+ TRACE_AND_STEP();
+ /* Always push (E)SP, since we are emulating an i386 and above
+ * processor. This is necessary as some BIOS'es use this to check
+ * what type of processor is in the system.
+ */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ESP);
+ } else {
+ push_word((u16)(M.x86.R_SP));
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x55
+****************************************************************************/
+static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEBP\n");
+ } else {
+ DECODE_PRINTF("PUSH\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EBP);
+ } else {
+ push_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x56
+****************************************************************************/
+static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tESI\n");
+ } else {
+ DECODE_PRINTF("PUSH\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ESI);
+ } else {
+ push_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x57
+****************************************************************************/
+static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEDI\n");
+ } else {
+ DECODE_PRINTF("PUSH\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EDI);
+ } else {
+ push_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x58
+****************************************************************************/
+static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEAX\n");
+ } else {
+ DECODE_PRINTF("POP\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = pop_long();
+ } else {
+ M.x86.R_AX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x59
+****************************************************************************/
+static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tECX\n");
+ } else {
+ DECODE_PRINTF("POP\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = pop_long();
+ } else {
+ M.x86.R_CX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5a
+****************************************************************************/
+static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEDX\n");
+ } else {
+ DECODE_PRINTF("POP\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = pop_long();
+ } else {
+ M.x86.R_DX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5b
+****************************************************************************/
+static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEBX\n");
+ } else {
+ DECODE_PRINTF("POP\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = pop_long();
+ } else {
+ M.x86.R_BX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5c
+****************************************************************************/
+static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tESP\n");
+ } else {
+ DECODE_PRINTF("POP\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = pop_long();
+ } else {
+ M.x86.R_SP = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5d
+****************************************************************************/
+static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEBP\n");
+ } else {
+ DECODE_PRINTF("POP\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = pop_long();
+ } else {
+ M.x86.R_BP = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5e
+****************************************************************************/
+static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tESI\n");
+ } else {
+ DECODE_PRINTF("POP\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = pop_long();
+ } else {
+ M.x86.R_SI = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x5f
+****************************************************************************/
+static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEDI\n");
+ } else {
+ DECODE_PRINTF("POP\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = pop_long();
+ } else {
+ M.x86.R_DI = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x60
+****************************************************************************/
+static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSHAD\n");
+ } else {
+ DECODE_PRINTF("PUSHA\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 old_sp = M.x86.R_ESP;
+
+ push_long(M.x86.R_EAX);
+ push_long(M.x86.R_ECX);
+ push_long(M.x86.R_EDX);
+ push_long(M.x86.R_EBX);
+ push_long(old_sp);
+ push_long(M.x86.R_EBP);
+ push_long(M.x86.R_ESI);
+ push_long(M.x86.R_EDI);
+ } else {
+ u16 old_sp = M.x86.R_SP;
+
+ push_word(M.x86.R_AX);
+ push_word(M.x86.R_CX);
+ push_word(M.x86.R_DX);
+ push_word(M.x86.R_BX);
+ push_word(old_sp);
+ push_word(M.x86.R_BP);
+ push_word(M.x86.R_SI);
+ push_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x61
+****************************************************************************/
+static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POPAD\n");
+ } else {
+ DECODE_PRINTF("POPA\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = pop_long();
+ M.x86.R_ESI = pop_long();
+ M.x86.R_EBP = pop_long();
+ M.x86.R_ESP += 4; /* skip ESP */
+ M.x86.R_EBX = pop_long();
+ M.x86.R_EDX = pop_long();
+ M.x86.R_ECX = pop_long();
+ M.x86.R_EAX = pop_long();
+ } else {
+ M.x86.R_DI = pop_word();
+ M.x86.R_SI = pop_word();
+ M.x86.R_BP = pop_word();
+ M.x86.R_SP += 2; /* skip SP */
+ M.x86.R_BX = pop_word();
+ M.x86.R_DX = pop_word();
+ M.x86.R_CX = pop_word();
+ M.x86.R_AX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/*opcode 0x62 ILLEGAL OP, calls x86emuOp_illegal_op() */
+/*opcode 0x63 ILLEGAL OP, calls x86emuOp_illegal_op() */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x64
+****************************************************************************/
+static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("FS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_FS;
+ /*
+ * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+ * opcode subroutines we do not want to do this.
+ */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x65
+****************************************************************************/
+static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("GS:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_SEGOVR_GS;
+ /*
+ * note the lack of DECODE_CLEAR_SEGOVR(r) since, here is one of 4
+ * opcode subroutines we do not want to do this.
+ */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x66 - prefix for 32-bit register
+****************************************************************************/
+static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("DATA:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_DATA;
+ /* note no DECODE_CLEAR_SEGOVR here. */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x67 - prefix for 32-bit address
+****************************************************************************/
+static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("ADDR:\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_ADDR;
+ /* note no DECODE_CLEAR_SEGOVR here. */
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x68
+****************************************************************************/
+static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 imm;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ imm = fetch_long_imm();
+ } else {
+ imm = fetch_word_imm();
+ }
+ DECODE_PRINTF2("PUSH\t%x\n", imm);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(imm);
+ } else {
+ push_word((u16)imm);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x69
+****************************************************************************/
+static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IMUL\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+ u32 res_lo,res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg,*srcreg;
+ u32 res;
+ s16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ res = (s16)*srcreg * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6a
+****************************************************************************/
+static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+ s16 imm;
+
+ START_OF_INSTR();
+ imm = (s8)fetch_byte_imm();
+ DECODE_PRINTF2("PUSH\t%d\n", imm);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long((s32)imm);
+ } else {
+ push_word(imm);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6b
+****************************************************************************/
+static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+ s8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IMUL\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ res = (s16)srcval * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+ u32 res_lo,res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ TRACE_AND_STEP();
+ imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u32)res_lo;
+ } else {
+ u16 *destreg,*srcreg;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%d\n", (s32)imm);
+ res = (s16)*srcreg * (s16)imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+ } else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+ *destreg = (u16)res;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6c
+****************************************************************************/
+static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("INSB\n");
+ ins(1);
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6d
+****************************************************************************/
+static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INSD\n");
+ ins(4);
+ } else {
+ DECODE_PRINTF("INSW\n");
+ ins(2);
+ }
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6e
+****************************************************************************/
+static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("OUTSB\n");
+ outs(1);
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x6f
+****************************************************************************/
+static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OUTSD\n");
+ outs(4);
+ } else {
+ DECODE_PRINTF("OUTSW\n");
+ outs(2);
+ }
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x70
+****************************************************************************/
+static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if overflow flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JO\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_OF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x71
+****************************************************************************/
+static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if overflow is not set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNO\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_OF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x72
+****************************************************************************/
+static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JB\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_CF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x73
+****************************************************************************/
+static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is clear. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNB\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_CF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x74
+****************************************************************************/
+static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if zero flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JZ\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x75
+****************************************************************************/
+static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if zero flag is clear. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNZ\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x76
+****************************************************************************/
+static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is set or if the zero
+ flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JBE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x77
+****************************************************************************/
+static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if carry flag is clear and if the zero
+ flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNBE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x78
+****************************************************************************/
+static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if sign flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JS\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_SF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x79
+****************************************************************************/
+static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if sign flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNS\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_SF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7a
+****************************************************************************/
+static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if parity flag is set (even parity) */
+ START_OF_INSTR();
+ DECODE_PRINTF("JP\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_PF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7b
+****************************************************************************/
+static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+
+ /* jump to byte offset if parity flag is clear (odd parity) */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNP\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_PF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7c
+****************************************************************************/
+static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag not equal to overflow flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JL\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ if (sf ^ of)
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7d
+****************************************************************************/
+static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag not equal to overflow flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNL\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ /* note: inverse of above, but using == instead of xor. */
+ if (sf == of)
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7e
+****************************************************************************/
+static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag not equal to overflow flag
+ or the zero flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JLE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ if ((sf ^ of) || ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x7f
+****************************************************************************/
+static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+{
+ s8 offset;
+ u16 target;
+ int sf, of;
+
+ /* jump to byte offset if sign flag equal to overflow flag.
+ and the zero flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNLE\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + (s16)offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+ of = ACCESS_FLAG(F_OF) != 0;
+ if ((sf == of) && !ACCESS_FLAG(F_ZF))
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u8 (*opc80_byte_operation[])(u8 d, u8 s) =
+{
+ add_byte, /* 00 */
+ or_byte, /* 01 */
+ adc_byte, /* 02 */
+ sbb_byte, /* 03 */
+ and_byte, /* 04 */
+ sub_byte, /* 05 */
+ xor_byte, /* 06 */
+ cmp_byte, /* 07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x80
+****************************************************************************/
+static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 imm;
+ u8 destval;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc80_byte_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u16 (*opc81_word_operation[])(u16 d, u16 s) =
+{
+ add_word, /*00 */
+ or_word, /*01 */
+ adc_word, /*02 */
+ sbb_word, /*03 */
+ and_word, /*04 */
+ sub_word, /*05 */
+ xor_word, /*06 */
+ cmp_word, /*07 */
+};
+
+static u32 (*opc81_long_operation[])(u32 d, u32 s) =
+{
+ add_long, /*00 */
+ or_long, /*01 */
+ adc_long, /*02 */
+ sbb_long, /*03 */
+ and_long, /*04 */
+ sub_long, /*05 */
+ xor_long, /*06 */
+ cmp_long, /*07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x81
+****************************************************************************/
+static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /*
+ * Know operation, decode the mod byte to find the addressing
+ * mode.
+ */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 destval,imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ imm = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_long_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ } else {
+ u16 *destreg;
+ u16 destval,imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc81_word_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u8 (*opc82_byte_operation[])(u8 s, u8 d) =
+{
+ add_byte, /*00 */
+ or_byte, /*01 *//*YYY UNUSED ???? */
+ adc_byte, /*02 */
+ sbb_byte, /*03 */
+ and_byte, /*04 *//*YYY UNUSED ???? */
+ sub_byte, /*05 */
+ xor_byte, /*06 *//*YYY UNUSED ???? */
+ cmp_byte, /*07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x82
+****************************************************************************/
+static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 imm;
+ u8 destval;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction Similar to opcode 81, except that
+ * the immediate byte is sign extended to a word length.
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ destval = fetch_data_byte(destoffset);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc82_byte_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+static u16 (*opc83_word_operation[])(u16 s, u16 d) =
+{
+ add_word, /*00 */
+ or_word, /*01 *//*YYY UNUSED ???? */
+ adc_word, /*02 */
+ sbb_word, /*03 */
+ and_word, /*04 *//*YYY UNUSED ???? */
+ sub_word, /*05 */
+ xor_word, /*06 *//*YYY UNUSED ???? */
+ cmp_word, /*07 */
+};
+
+static u32 (*opc83_long_operation[])(u32 s, u32 d) =
+{
+ add_long, /*00 */
+ or_long, /*01 *//*YYY UNUSED ???? */
+ adc_long, /*02 */
+ sbb_long, /*03 */
+ and_long, /*04 *//*YYY UNUSED ???? */
+ sub_long, /*05 */
+ xor_long, /*06 *//*YYY UNUSED ???? */
+ cmp_long, /*07 */
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x83
+****************************************************************************/
+static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /*
+ * Weirdo special case instruction format. Part of the opcode
+ * held below in "RH". Doubly nested case would result, except
+ * that the decoded instruction Similar to opcode 81, except that
+ * the immediate byte is sign extended to a word length.
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+ case 1:
+ DECODE_PRINTF("OR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("ADC\t");
+ break;
+ case 3:
+ DECODE_PRINTF("SBB\t");
+ break;
+ case 4:
+ DECODE_PRINTF("AND\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SUB\t");
+ break;
+ case 6:
+ DECODE_PRINTF("XOR\t");
+ break;
+ case 7:
+ DECODE_PRINTF("CMP\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ destval = fetch_data_long(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ destval = fetch_data_word(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ destval = fetch_data_long(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ destval = fetch_data_word(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ destval = fetch_data_long(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval,imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ destval = fetch_data_word(destoffset);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 destval,imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_long_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ } else {
+ u16 *destreg;
+ u16 destval,imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ destval = (*opc83_word_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x84
+****************************************************************************/
+static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("TEST\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(destval, *srcreg);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(destval, *srcreg);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(destval, *srcreg);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_byte(*destreg, *srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x85
+****************************************************************************/
+static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("TEST\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(destval, *srcreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(destval, *srcreg);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+ } else {
+ u16 destval;
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(destval, *srcreg);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(*destreg, *srcreg);
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_word(*destreg, *srcreg);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x86
+****************************************************************************/
+static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+ u8 destval;
+ u8 tmp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XCHG\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_byte(destoffset);
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = *destreg;
+ *destreg = tmp;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x87
+****************************************************************************/
+static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XCHG\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+ u32 destval,tmp;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+ } else {
+ u16 *srcreg;
+ u16 destval,tmp;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+ u32 destval,tmp;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+ } else {
+ u16 *srcreg;
+ u16 destval,tmp;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+ u32 destval,tmp;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_long(destoffset);
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+ } else {
+ u16 *srcreg;
+ u16 destval,tmp;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ destval = fetch_data_word(destoffset);
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = destval;
+ destval = tmp;
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+ u32 tmp;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = *destreg;
+ *destreg = tmp;
+ } else {
+ u16 *destreg,*srcreg;
+ u16 tmp;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ tmp = *srcreg;
+ *srcreg = *destreg;
+ *destreg = tmp;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x88
+****************************************************************************/
+static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, *srcreg);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, *srcreg);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, *srcreg);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x89
+****************************************************************************/
+static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u32 destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+ } else {
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_word(destoffset, *srcreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+ } else {
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_word(destoffset, *srcreg);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+ } else {
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_word(destoffset, *srcreg);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg,*srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ } else {
+ u16 *destreg,*srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8a
+****************************************************************************/
+static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+ uint srcoffset;
+ u8 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 1:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 2:
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_byte(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8b
+****************************************************************************/
+static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ } else {
+ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8c
+****************************************************************************/
+static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u16 *destreg, *srcreg;
+ uint destoffset;
+ u16 destval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = *srcreg;
+ store_data_word(destoffset, destval);
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = *srcreg;
+ store_data_word(destoffset, destval);
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = *srcreg;
+ store_data_word(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8d
+****************************************************************************/
+static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LEA\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u32)destoffset;
+ } else {
+ u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u16)destoffset;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u32)destoffset;
+ } else {
+ u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u16)destoffset;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u32)destoffset;
+ } else {
+ u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *srcreg = (u16)destoffset;
+ }
+ break;
+ case 3: /* register to register */
+ /* undefined. Do nothing. */
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8e
+****************************************************************************/
+static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u16 *destreg, *srcreg;
+ uint srcoffset;
+ u16 srcval;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 1:
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 2:
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+ case 3: /* register to register */
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+ break;
+ }
+ /*
+ * Clean up, and reset all the R_xSP pointers to the correct
+ * locations. This is about 3x too much overhead (doing all the
+ * segreg ptrs when only one is needed, but this instruction
+ * *cannot* be that common, and this isn't too much work anyway.
+ */
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x8f
+****************************************************************************/
+static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ if (rh != 0) {
+ DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
+ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_word();
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_word();
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ destval = pop_word();
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = pop_long();
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = pop_word();
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x90
+****************************************************************************/
+static void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("NOP\n");
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x91
+****************************************************************************/
+static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ECX\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,CX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ECX;
+ M.x86.R_ECX = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_CX;
+ M.x86.R_CX = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x92
+****************************************************************************/
+static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EDX\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,DX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EDX;
+ M.x86.R_EDX = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_DX;
+ M.x86.R_DX = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x93
+****************************************************************************/
+static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EBX\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,BX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EBX;
+ M.x86.R_EBX = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_BX;
+ M.x86.R_BX = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x94
+****************************************************************************/
+static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ESP\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,SP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ESP;
+ M.x86.R_ESP = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_SP;
+ M.x86.R_SP = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x95
+****************************************************************************/
+static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EBP\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,BP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EBP;
+ M.x86.R_EBP = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_BP;
+ M.x86.R_BP = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x96
+****************************************************************************/
+static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ESI\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,SI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ESI;
+ M.x86.R_ESI = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_SI;
+ M.x86.R_SI = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x97
+****************************************************************************/
+static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+{
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EDI\n");
+ } else {
+ DECODE_PRINTF("XCHG\tAX,DI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EDI;
+ M.x86.R_EDI = tmp;
+ } else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_DI;
+ M.x86.R_DI = (u16)tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x98
+****************************************************************************/
+static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CWDE\n");
+ } else {
+ DECODE_PRINTF("CBW\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ if (M.x86.R_AX & 0x8000) {
+ M.x86.R_EAX |= 0xffff0000;
+ } else {
+ M.x86.R_EAX &= 0x0000ffff;
+ }
+ } else {
+ if (M.x86.R_AL & 0x80) {
+ M.x86.R_AH = 0xff;
+ } else {
+ M.x86.R_AH = 0x0;
+ }
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x99
+****************************************************************************/
+static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CDQ\n");
+ } else {
+ DECODE_PRINTF("CWD\n");
+ }
+ DECODE_PRINTF("CWD\n");
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ if (M.x86.R_EAX & 0x80000000) {
+ M.x86.R_EDX = 0xffffffff;
+ } else {
+ M.x86.R_EDX = 0x0;
+ }
+ } else {
+ if (M.x86.R_AX & 0x8000) {
+ M.x86.R_DX = 0xffff;
+ } else {
+ M.x86.R_DX = 0x0;
+ }
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9a
+****************************************************************************/
+static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 farseg, faroff;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CALL\t");
+ faroff = fetch_word_imm();
+ farseg = fetch_word_imm();
+ DECODE_PRINTF2("%04x:", farseg);
+ DECODE_PRINTF2("%04x\n", faroff);
+ CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
+
+ /* XXX
+ *
+ * Hooked interrupt vectors calling into our "BIOS" will cause
+ * problems unless all intersegment stuff is checked for BIOS
+ * access. Check needed here. For moment, let it alone.
+ */
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = farseg;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = faroff;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9b
+****************************************************************************/
+static void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("WAIT");
+ TRACE_AND_STEP();
+ /* NADA. */
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9c
+****************************************************************************/
+static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+{
+ u32 flags;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSHFD\n");
+ } else {
+ DECODE_PRINTF("PUSHF\n");
+ }
+ TRACE_AND_STEP();
+
+ /* clear out *all* bits not representing flags, and turn on real bits */
+ flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(flags);
+ } else {
+ push_word((u16)flags);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9d
+****************************************************************************/
+static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POPFD\n");
+ } else {
+ DECODE_PRINTF("POPF\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EFLG = pop_long();
+ } else {
+ M.x86.R_FLG = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9e
+****************************************************************************/
+static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("SAHF\n");
+ TRACE_AND_STEP();
+ /* clear the lower bits of the flag register */
+ M.x86.R_FLG &= 0xffffff00;
+ /* or in the AH register into the flags register */
+ M.x86.R_FLG |= M.x86.R_AH;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x9f
+****************************************************************************/
+static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("LAHF\n");
+ TRACE_AND_STEP();
+ M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff);
+ /*undocumented TC++ behavior??? Nope. It's documented, but
+ you have too look real hard to notice it. */
+ M.x86.R_AH |= 0x2;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa0
+****************************************************************************/
+static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tAL,");
+ offset = fetch_word_imm();
+ DECODE_PRINTF2("[%04x]\n", offset);
+ TRACE_AND_STEP();
+ M.x86.R_AL = fetch_data_byte(offset);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa1
+****************************************************************************/
+static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ offset = fetch_word_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset);
+ } else {
+ DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = fetch_data_long(offset);
+ } else {
+ M.x86.R_AX = fetch_data_word(offset);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa2
+****************************************************************************/
+static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ offset = fetch_word_imm();
+ DECODE_PRINTF2("[%04x],AL\n", offset);
+ TRACE_AND_STEP();
+ store_data_byte(offset, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa3
+****************************************************************************/
+static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 offset;
+
+ START_OF_INSTR();
+ offset = fetch_word_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset);
+ } else {
+ DECODE_PRINTF2("MOV\t[%04x],AX\n", offset);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ store_data_long(offset, M.x86.R_EAX);
+ } else {
+ store_data_word(offset, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa4
+****************************************************************************/
+static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
+{
+ u8 val;
+ u32 count;
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOVS\tBYTE\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ val = fetch_data_byte(M.x86.R_SI);
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, val);
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa5
+****************************************************************************/
+static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+{
+ u32 val;
+ int inc;
+ u32 count;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOVS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("MOVS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long(M.x86.R_SI);
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val);
+ } else {
+ val = fetch_data_word(M.x86.R_SI);
+ store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val);
+ }
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa6
+****************************************************************************/
+static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+{
+ s8 val1, val2;
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CMPS\tBYTE\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(val1, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(val1, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(val1, val2);
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa7
+****************************************************************************/
+static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+{
+ u32 val1,val2;
+ int inc;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CMPS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("CMPS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+ } else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word((u16)val1, (u16)val2);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+ } else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word((u16)val1, (u16)val2);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+ } else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word((u16)val1, (u16)val2);
+ }
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa8
+****************************************************************************/
+static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("TEST\tAL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%04x\n", imm);
+ TRACE_AND_STEP();
+ test_byte(M.x86.R_AL, (u8)imm);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xa9
+****************************************************************************/
+static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("TEST\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("TEST\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ test_long(M.x86.R_EAX, srcval);
+ } else {
+ test_word(M.x86.R_AX, (u16)srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xaa
+****************************************************************************/
+static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("STOS\tBYTE\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ TRACE_AND_STEP();
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ } else {
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xab
+****************************************************************************/
+static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+ u32 count;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("STOS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("STOS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX);
+ } else {
+ store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX);
+ }
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xac
+****************************************************************************/
+static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LODS\tBYTE\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ } else {
+ M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+ M.x86.R_SI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xad
+****************************************************************************/
+static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+ u32 count;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("LODS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("LODS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ count = 1;
+ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* move them until CX is ZERO. */
+ count = M.x86.R_CX;
+ M.x86.R_CX = 0;
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+ }
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = fetch_data_long(M.x86.R_SI);
+ } else {
+ M.x86.R_AX = fetch_data_word(M.x86.R_SI);
+ }
+ M.x86.R_SI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xae
+****************************************************************************/
+static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+{
+ s8 val2;
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SCAS\tBYTE\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(M.x86.R_AL, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(M.x86.R_AL, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(M.x86.R_AL, val2);
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xaf
+****************************************************************************/
+static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+{
+ int inc;
+ u32 val;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SCAS\tDWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+ } else {
+ DECODE_PRINTF("SCAS\tWORD\n");
+ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_REPE) {
+ /* REPE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+ } else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word(M.x86.R_AX, (u16)val);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF) == 0)
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+ } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+ } else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word(M.x86.R_AX, (u16)val);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+ if (ACCESS_FLAG(F_ZF))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+ } else {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+ } else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_word(M.x86.R_AX, (u16)val);
+ }
+ M.x86.R_DI += inc;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb0
+****************************************************************************/
+static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tAL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_AL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb1
+****************************************************************************/
+static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tCL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_CL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb2
+****************************************************************************/
+static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tDL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_DL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb3
+****************************************************************************/
+static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tBL,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_BL = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb4
+****************************************************************************/
+static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tAH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_AH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb5
+****************************************************************************/
+static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tCH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_CH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb6
+****************************************************************************/
+static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tDH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_DH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb7
+****************************************************************************/
+static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\tBH,");
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ TRACE_AND_STEP();
+ M.x86.R_BH = imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb8
+****************************************************************************/
+static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEAX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tAX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = srcval;
+ } else {
+ M.x86.R_AX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xb9
+****************************************************************************/
+static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tECX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tCX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = srcval;
+ } else {
+ M.x86.R_CX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xba
+****************************************************************************/
+static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEDX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tDX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = srcval;
+ } else {
+ M.x86.R_DX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbb
+****************************************************************************/
+static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEBX,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tBX,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = srcval;
+ } else {
+ M.x86.R_BX = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbc
+****************************************************************************/
+static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tESP,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tSP,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = srcval;
+ } else {
+ M.x86.R_SP = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbd
+****************************************************************************/
+static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEBP,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tBP,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = srcval;
+ } else {
+ M.x86.R_BP = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbe
+****************************************************************************/
+static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tESI,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tSI,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = srcval;
+ } else {
+ M.x86.R_SI = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xbf
+****************************************************************************/
+static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u32 srcval;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEDI,");
+ srcval = fetch_long_imm();
+ } else {
+ DECODE_PRINTF("MOV\tDI,");
+ srcval = fetch_word_imm();
+ }
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = srcval;
+ } else {
+ M.x86.R_DI = (u16)srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* used by opcodes c0, d0, and d2. */
+static u8(*opcD0_byte_operation[])(u8 d, u8 s) =
+{
+ rol_byte,
+ ror_byte,
+ rcl_byte,
+ rcr_byte,
+ shl_byte,
+ shr_byte,
+ shl_byte, /* sal_byte === shl_byte by definition */
+ sar_byte,
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc0
+****************************************************************************/
+static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* used by opcodes c1, d1, and d3. */
+static u16(*opcD1_word_operation[])(u16 s, u8 d) =
+{
+ rol_word,
+ ror_word,
+ rcl_word,
+ rcr_word,
+ shl_word,
+ shr_word,
+ shl_word, /* sal_byte === shl_byte by definition */
+ sar_word,
+};
+
+/* used by opcodes c1, d1, and d3. */
+static u32 (*opcD1_long_operation[])(u32 s, u8 d) =
+{
+ rol_long,
+ ror_long,
+ rcl_long,
+ rcr_long,
+ shl_long,
+ shr_long,
+ shl_long, /* sal_byte === shl_byte by definition */
+ sar_long,
+};
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc1
+****************************************************************************/
+static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc2
+****************************************************************************/
+static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("RET\t");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_SP += imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc3
+****************************************************************************/
+static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("RET\n");
+ RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc4
+****************************************************************************/
+static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LES\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_ES = fetch_data_word(srcoffset + 2);
+ break;
+ case 1:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_ES = fetch_data_word(srcoffset + 2);
+ break;
+ case 2:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_ES = fetch_data_word(srcoffset + 2);
+ break;
+ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc5
+****************************************************************************/
+static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LDS\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_DS = fetch_data_word(srcoffset + 2);
+ break;
+ case 1:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_DS = fetch_data_word(srcoffset + 2);
+ break;
+ case 2:
+ dstreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_DS = fetch_data_word(srcoffset + 2);
+ break;
+ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc6
+****************************************************************************/
+static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ if (rh != 0) {
+ DECODE_PRINTF("ILLEGAL DECODE OF OPCODE c6\n");
+ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, imm);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, imm);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, imm);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+ TRACE_AND_STEP();
+ *destreg = imm;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc7
+****************************************************************************/
+static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOV\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ if (rh != 0) {
+ DECODE_PRINTF("ILLEGAL DECODE OF OPCODE 8F\n");
+ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+ } else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_word(destoffset, imm);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+ } else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_word(destoffset, imm);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+ } else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_word(destoffset, imm);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ *destreg = imm;
+ } else {
+ u16 *destreg;
+ u16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_word_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ *destreg = imm;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc8
+****************************************************************************/
+static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+{
+ u16 local,frame_pointer;
+ u8 nesting;
+ int i;
+
+ START_OF_INSTR();
+ local = fetch_word_imm();
+ nesting = fetch_byte_imm();
+ DECODE_PRINTF2("ENTER %x\n", local);
+ DECODE_PRINTF2(",%x\n", nesting);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_BP);
+ frame_pointer = M.x86.R_SP;
+ if (nesting > 0) {
+ for (i = 1; i < nesting; i++) {
+ M.x86.R_BP -= 2;
+ push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
+ }
+ push_word(frame_pointer);
+ }
+ M.x86.R_BP = frame_pointer;
+ M.x86.R_SP = (u16)(M.x86.R_SP - local);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xc9
+****************************************************************************/
+static void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("LEAVE\n");
+ TRACE_AND_STEP();
+ M.x86.R_SP = M.x86.R_BP;
+ M.x86.R_BP = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xca
+****************************************************************************/
+static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("RETF\t");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+ RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ M.x86.R_SP += imm;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcb
+****************************************************************************/
+static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("RETF\n");
+ RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcc
+****************************************************************************/
+static void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("INT 3\n");
+ TRACE_AND_STEP();
+ if (_X86EMU_intrTab[3]) {
+ (*_X86EMU_intrTab[3])(3);
+ } else {
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(3 * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(3 * 4);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcd
+****************************************************************************/
+static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 intnum;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("INT\t");
+ intnum = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", intnum);
+ TRACE_AND_STEP();
+ if (_X86EMU_intrTab[intnum]) {
+ (*_X86EMU_intrTab[intnum])(intnum);
+ } else {
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(intnum * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(intnum * 4);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xce
+****************************************************************************/
+static void x86emuOp_into(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("INTO\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_OF)) {
+ if (_X86EMU_intrTab[4]) {
+ (*_X86EMU_intrTab[4])(4);
+ } else {
+ push_word((u16)M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(4 * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(4 * 4);
+ }
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xcf
+****************************************************************************/
+static void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("IRET\n");
+
+ TRACE_AND_STEP();
+
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ M.x86.R_FLG = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd0
+****************************************************************************/
+static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, 1);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, 1);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, 1);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (*destreg, 1);
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd1
+****************************************************************************/
+static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, 1);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, 1);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",1\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, 1);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (*destreg, 1);
+ *destreg = destval;
+ } else {
+ u16 destval;
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (*destreg, 1);
+ *destreg = destval;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd2
+****************************************************************************/
+static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ amt = M.x86.R_CL;
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = (*opcD0_byte_operation[rh]) (*destreg, amt);
+ *destreg = destval;
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd3
+****************************************************************************/
+static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+ u8 amt;
+
+ /*
+ * Yet another weirdo special case instruction format. Part of
+ * the opcode held below in "RH". Doubly nested case would
+ * result, except that the decoded instruction
+ */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ROL\t");
+ break;
+ case 1:
+ DECODE_PRINTF("ROR\t");
+ break;
+ case 2:
+ DECODE_PRINTF("RCL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("RCR\t");
+ break;
+ case 4:
+ DECODE_PRINTF("SHL\t");
+ break;
+ case 5:
+ DECODE_PRINTF("SHR\t");
+ break;
+ case 6:
+ DECODE_PRINTF("SAL\t");
+ break;
+ case 7:
+ DECODE_PRINTF("SAR\t");
+ break;
+ }
+ }
+#endif
+ /* know operation, decode the mod byte to find the addressing
+ mode. */
+ amt = M.x86.R_CL;
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",CL\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = (*opcD1_word_operation[rh]) (destval, amt);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_word_operation[rh]) (*destreg, amt);
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd4
+****************************************************************************/
+static void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
+{
+ u8 a;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AAM\n");
+ a = fetch_byte_imm(); /* this is a stupid encoding. */
+ if (a != 10) {
+ /* fix: add base decoding
+ aam_word(u8 val, int base a) */
+ DECODE_PRINTF("ERROR DECODING AAM\n");
+ TRACE_REGS();
+ HALT_SYS();
+ }
+ TRACE_AND_STEP();
+ /* note the type change here --- returning AL and AH in AX. */
+ M.x86.R_AX = aam_word(M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd5
+****************************************************************************/
+static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+{
+ u8 a;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AAD\n");
+ a = fetch_byte_imm();
+ if (a != 10) {
+ /* fix: add base decoding
+ aad_word(u16 val, int base a) */
+ DECODE_PRINTF("ERROR DECODING AAM\n");
+ TRACE_REGS();
+ HALT_SYS();
+ }
+ TRACE_AND_STEP();
+ M.x86.R_AX = aad_word(M.x86.R_AX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* opcode 0xd6 ILLEGAL OPCODE */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xd7
+****************************************************************************/
+static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
+{
+ u16 addr;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XLAT\n");
+ TRACE_AND_STEP();
+ addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL);
+ M.x86.R_AL = fetch_data_byte(addr);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/* instuctions D8 .. DF are in i87_ops.c */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe0
+****************************************************************************/
+static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LOOPNE\t");
+ ip = (s8) fetch_byte_imm();
+ ip += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+ if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe1
+****************************************************************************/
+static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LOOPE\t");
+ ip = (s8) fetch_byte_imm();
+ ip += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+ if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe2
+****************************************************************************/
+static void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LOOP\t");
+ ip = (s8) fetch_byte_imm();
+ ip += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+ if (M.x86.R_CX != 0)
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe3
+****************************************************************************/
+static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
+{
+ u16 target;
+ s8 offset;
+
+ /* jump to byte offset if overflow flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JCXZ\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (M.x86.R_CX == 0)
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe4
+****************************************************************************/
+static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\t");
+ port = (u8) fetch_byte_imm();
+ DECODE_PRINTF2("%x,AL\n", port);
+ TRACE_AND_STEP();
+ M.x86.R_AL = (*sys_inb)(port);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe5
+****************************************************************************/
+static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\t");
+ port = (u8) fetch_byte_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("EAX,%x\n", port);
+ } else {
+ DECODE_PRINTF2("AX,%x\n", port);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = (*sys_inl)(port);
+ } else {
+ M.x86.R_AX = (*sys_inw)(port);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe6
+****************************************************************************/
+static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\t");
+ port = (u8) fetch_byte_imm();
+ DECODE_PRINTF2("%x,AL\n", port);
+ TRACE_AND_STEP();
+ (*sys_outb)(port, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe7
+****************************************************************************/
+static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
+{
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\t");
+ port = (u8) fetch_byte_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("%x,EAX\n", port);
+ } else {
+ DECODE_PRINTF2("%x,AX\n", port);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ (*sys_outl)(port, M.x86.R_EAX);
+ } else {
+ (*sys_outw)(port, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe8
+****************************************************************************/
+static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+ s16 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("CALL\t");
+ ip = (s16) fetch_word_imm();
+ ip += (s16) M.x86.R_IP; /* CHECK SIGN */
+ DECODE_PRINTF2("%04x\n", (u16)ip);
+ CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xe9
+****************************************************************************/
+static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
+{
+ int ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\t");
+ ip = (s16)fetch_word_imm();
+ ip += (s16)M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", (u16)ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16)ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xea
+****************************************************************************/
+static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 cs, ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\tFAR ");
+ ip = fetch_word_imm();
+ cs = fetch_word_imm();
+ DECODE_PRINTF2("%04x:", cs);
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = ip;
+ M.x86.R_CS = cs;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xeb
+****************************************************************************/
+static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u16 target;
+ s8 offset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\t");
+ offset = (s8)fetch_byte_imm();
+ target = (u16)(M.x86.R_IP + offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ M.x86.R_IP = target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xec
+****************************************************************************/
+static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\tAL,DX\n");
+ TRACE_AND_STEP();
+ M.x86.R_AL = (*sys_inb)(M.x86.R_DX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xed
+****************************************************************************/
+static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("IN\tEAX,DX\n");
+ } else {
+ DECODE_PRINTF("IN\tAX,DX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = (*sys_inl)(M.x86.R_DX);
+ } else {
+ M.x86.R_AX = (*sys_inw)(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xee
+****************************************************************************/
+static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\tDX,AL\n");
+ TRACE_AND_STEP();
+ (*sys_outb)(M.x86.R_DX, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xef
+****************************************************************************/
+static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OUT\tDX,EAX\n");
+ } else {
+ DECODE_PRINTF("OUT\tDX,AX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ (*sys_outl)(M.x86.R_DX, M.x86.R_EAX);
+ } else {
+ (*sys_outw)(M.x86.R_DX, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf0
+****************************************************************************/
+static void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("LOCK:\n");
+ TRACE_AND_STEP();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/*opcode 0xf1 ILLEGAL OPERATION */
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf2
+****************************************************************************/
+static void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("REPNE\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_REPNE;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf3
+****************************************************************************/
+static void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("REPE\n");
+ TRACE_AND_STEP();
+ M.x86.mode |= SYSMODE_PREFIX_REPE;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf4
+****************************************************************************/
+static void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("HALT\n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf5
+****************************************************************************/
+static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
+{
+ /* complement the carry flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CMC\n");
+ TRACE_AND_STEP();
+ TOGGLE_FLAG(F_CF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf6
+****************************************************************************/
+static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u8 *destreg;
+ uint destoffset;
+ u8 destval, srcval;
+
+ /* long, drawn out code follows. Double switch for a total
+ of 32 cases. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0: /* mod=00 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ test_byte(destval, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = not_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ mul_byte(destval);
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ imul_byte(destval);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ div_byte(destval);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ idiv_byte(destval);
+ break;
+ }
+ break; /* end mod==00 */
+ case 1: /* mod=01 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ test_byte(destval, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = not_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ mul_byte(destval);
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ imul_byte(destval);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ div_byte(destval);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ idiv_byte(destval);
+ break;
+ }
+ break; /* end mod==01 */
+ case 2: /* mod=10 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ test_byte(destval, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = not_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ mul_byte(destval);
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ imul_byte(destval);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ div_byte(destval);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ idiv_byte(destval);
+ break;
+ }
+ break; /* end mod==10 */
+ case 3: /* mod=11 */
+ switch (rh) {
+ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_byte_imm();
+ DECODE_PRINTF2("%02x\n", srcval);
+ TRACE_AND_STEP();
+ test_byte(*destreg, srcval);
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ DECODE_PRINTF("NOT\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = not_byte(*destreg);
+ break;
+ case 3:
+ DECODE_PRINTF("NEG\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = neg_byte(*destreg);
+ break;
+ case 4:
+ DECODE_PRINTF("MUL\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ mul_byte(*destreg); /*!!! */
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ imul_byte(*destreg);
+ break;
+ case 6:
+ DECODE_PRINTF("DIV\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ div_byte(*destreg);
+ break;
+ case 7:
+ DECODE_PRINTF("IDIV\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ idiv_byte(*destreg);
+ break;
+ }
+ break; /* end mod==11 */
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf7
+****************************************************************************/
+static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ uint destoffset;
+
+ /* long, drawn out code follows. Double switch for a total
+ of 32 cases. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0: /* mod=00 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+ } else {
+ u16 destval,srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ test_word(destval, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F7\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NOT\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = not_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NEG\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("MUL\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ mul_word(destval);
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IMUL\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ imul_word(destval);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DIV\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ div_word(destval);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IDIV\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ idiv_word(destval);
+ }
+ break;
+ }
+ break; /* end mod==00 */
+ case 1: /* mod=01 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+ } else {
+ u16 destval,srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ test_word(destval, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=01 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NOT\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = not_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NEG\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("MUL\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ mul_word(destval);
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IMUL\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ imul_word(destval);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DIV\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ div_word(destval);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IDIV\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ idiv_word(destval);
+ }
+ break;
+ }
+ break; /* end mod==01 */
+ case 2: /* mod=10 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval,srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+ } else {
+ u16 destval,srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ test_word(destval, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=10 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NOT\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = not_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("NEG\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = neg_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("MUL\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ mul_word(destval);
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IMUL\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ imul_word(destval);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("DIV\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ div_word(destval);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ DECODE_PRINTF("IDIV\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+ } else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ idiv_word(destval);
+ }
+ break;
+ }
+ break; /* end mod==10 */
+ case 3: /* mod=11 */
+ switch (rh) {
+ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+
+ DECODE_PRINTF("TEST\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_long_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ test_long(*destreg, srcval);
+ } else {
+ u16 *destreg;
+ u16 srcval;
+
+ DECODE_PRINTF("TEST\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcval = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ test_word(*destreg, srcval);
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("ILLEGAL OP MOD=00 RH=01 OP=F6\n");
+ HALT_SYS();
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("NOT\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = not_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("NOT\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = not_word(*destreg);
+ }
+ break;
+ case 3:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("NEG\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = neg_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("NEG\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = neg_word(*destreg);
+ }
+ break;
+ case 4:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("MUL\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ mul_long(*destreg); /*!!! */
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("MUL\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ mul_word(*destreg); /*!!! */
+ }
+ break;
+ case 5:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("IMUL\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ imul_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("IMUL\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ imul_word(*destreg);
+ }
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("DIV\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ div_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("DIV\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ div_word(*destreg);
+ }
+ break;
+ case 7:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ DECODE_PRINTF("IDIV\t");
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ idiv_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ DECODE_PRINTF("IDIV\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ idiv_word(*destreg);
+ }
+ break;
+ }
+ break; /* end mod==11 */
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf8
+****************************************************************************/
+static void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
+{
+ /* clear the carry flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CLC\n");
+ TRACE_AND_STEP();
+ CLEAR_FLAG(F_CF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xf9
+****************************************************************************/
+static void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
+{
+ /* set the carry flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("STC\n");
+ TRACE_AND_STEP();
+ SET_FLAG(F_CF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfa
+****************************************************************************/
+static void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
+{
+ /* clear interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CLI\n");
+ TRACE_AND_STEP();
+ CLEAR_FLAG(F_IF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfb
+****************************************************************************/
+static void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
+{
+ /* enable interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("STI\n");
+ TRACE_AND_STEP();
+ SET_FLAG(F_IF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfc
+****************************************************************************/
+static void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
+{
+ /* clear interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("CLD\n");
+ TRACE_AND_STEP();
+ CLEAR_FLAG(F_DF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfd
+****************************************************************************/
+static void x86emuOp_std(u8 X86EMU_UNUSED(op1))
+{
+ /* clear interrupts. */
+ START_OF_INSTR();
+ DECODE_PRINTF("STD\n");
+ TRACE_AND_STEP();
+ SET_FLAG(F_DF);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xfe
+****************************************************************************/
+static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ u8 destval;
+ uint destoffset;
+ u8 *destreg;
+
+ /* Yet another special case instruction. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ DECODE_PRINTF("INC\t");
+ break;
+ case 1:
+ DECODE_PRINTF("DEC\t");
+ break;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ DECODE_PRINTF2("ILLEGAL OP MAJOR OP 0xFE MINOR OP %x \n", mod);
+ HALT_SYS();
+ break;
+ }
+ }
+#endif
+ switch (mod) {
+ case 0:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0: /* inc word ptr ... */
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1: /* dec word ptr ... */
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ }
+ break;
+ case 1:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ }
+ break;
+ case 2:
+ DECODE_PRINTF("BYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ case 1:
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+ }
+ break;
+ case 3:
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ TRACE_AND_STEP();
+ *destreg = inc_byte(*destreg);
+ break;
+ case 1:
+ TRACE_AND_STEP();
+ *destreg = dec_byte(*destreg);
+ break;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xff
+****************************************************************************/
+static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rh, rl;
+ uint destoffset = 0;
+ u16 *destreg;
+ u16 destval,destval2;
+
+ /* Yet another special case instruction. */
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+#ifdef DEBUG
+ if (DEBUG_DECODE()) {
+ /* XXX DECODE_PRINTF may be changed to something more
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tDWORD PTR ");
+ } else {
+ DECODE_PRINTF("INC\tWORD PTR ");
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tDWORD PTR ");
+ } else {
+ DECODE_PRINTF("DEC\tWORD PTR ");
+ }
+ break;
+ case 2:
+ DECODE_PRINTF("CALL\t");
+ break;
+ case 3:
+ DECODE_PRINTF("CALL\tFAR ");
+ break;
+ case 4:
+ DECODE_PRINTF("JMP\t");
+ break;
+ case 5:
+ DECODE_PRINTF("JMP\tFAR ");
+ break;
+ case 6:
+ DECODE_PRINTF("PUSH\t");
+ break;
+ case 7:
+ DECODE_PRINTF("ILLEGAL DECODING OF OPCODE FF\t");
+ HALT_SYS();
+ break;
+ }
+ }
+#endif
+ switch (mod) {
+ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0: /* inc word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1: /* dec word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(destval);
+ }
+ break;
+ }
+ break;
+ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(destval);
+ }
+ break;
+ }
+ break;
+ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_word(destval);
+ store_data_word(destoffset, destval);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = destval2;
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+ } else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(destval);
+ }
+ break;
+ }
+ break;
+ case 3:
+ switch (rh) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = inc_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = inc_word(*destreg);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = dec_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = dec_word(*destreg);
+ }
+ break;
+ case 2: /* call word ptr ... */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = *destreg;
+ break;
+ case 3: /* jmp far ptr ... */
+ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+ break;
+
+ case 4: /* jmp ... */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16) (*destreg);
+ break;
+ case 5: /* jmp far ptr ... */
+ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+ break;
+ case 6:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_long(*destreg);
+ } else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_word(*destreg);
+ }
+ break;
+ }
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/***************************************************************************
+ * Single byte operation code table:
+ **************************************************************************/
+void (*x86emu_optab[256])(u8) =
+{
+/* 0x00 */ x86emuOp_add_byte_RM_R,
+/* 0x01 */ x86emuOp_add_word_RM_R,
+/* 0x02 */ x86emuOp_add_byte_R_RM,
+/* 0x03 */ x86emuOp_add_word_R_RM,
+/* 0x04 */ x86emuOp_add_byte_AL_IMM,
+/* 0x05 */ x86emuOp_add_word_AX_IMM,
+/* 0x06 */ x86emuOp_push_ES,
+/* 0x07 */ x86emuOp_pop_ES,
+
+/* 0x08 */ x86emuOp_or_byte_RM_R,
+/* 0x09 */ x86emuOp_or_word_RM_R,
+/* 0x0a */ x86emuOp_or_byte_R_RM,
+/* 0x0b */ x86emuOp_or_word_R_RM,
+/* 0x0c */ x86emuOp_or_byte_AL_IMM,
+/* 0x0d */ x86emuOp_or_word_AX_IMM,
+/* 0x0e */ x86emuOp_push_CS,
+/* 0x0f */ x86emuOp_two_byte,
+
+/* 0x10 */ x86emuOp_adc_byte_RM_R,
+/* 0x11 */ x86emuOp_adc_word_RM_R,
+/* 0x12 */ x86emuOp_adc_byte_R_RM,
+/* 0x13 */ x86emuOp_adc_word_R_RM,
+/* 0x14 */ x86emuOp_adc_byte_AL_IMM,
+/* 0x15 */ x86emuOp_adc_word_AX_IMM,
+/* 0x16 */ x86emuOp_push_SS,
+/* 0x17 */ x86emuOp_pop_SS,
+
+/* 0x18 */ x86emuOp_sbb_byte_RM_R,
+/* 0x19 */ x86emuOp_sbb_word_RM_R,
+/* 0x1a */ x86emuOp_sbb_byte_R_RM,
+/* 0x1b */ x86emuOp_sbb_word_R_RM,
+/* 0x1c */ x86emuOp_sbb_byte_AL_IMM,
+/* 0x1d */ x86emuOp_sbb_word_AX_IMM,
+/* 0x1e */ x86emuOp_push_DS,
+/* 0x1f */ x86emuOp_pop_DS,
+
+/* 0x20 */ x86emuOp_and_byte_RM_R,
+/* 0x21 */ x86emuOp_and_word_RM_R,
+/* 0x22 */ x86emuOp_and_byte_R_RM,
+/* 0x23 */ x86emuOp_and_word_R_RM,
+/* 0x24 */ x86emuOp_and_byte_AL_IMM,
+/* 0x25 */ x86emuOp_and_word_AX_IMM,
+/* 0x26 */ x86emuOp_segovr_ES,
+/* 0x27 */ x86emuOp_daa,
+
+/* 0x28 */ x86emuOp_sub_byte_RM_R,
+/* 0x29 */ x86emuOp_sub_word_RM_R,
+/* 0x2a */ x86emuOp_sub_byte_R_RM,
+/* 0x2b */ x86emuOp_sub_word_R_RM,
+/* 0x2c */ x86emuOp_sub_byte_AL_IMM,
+/* 0x2d */ x86emuOp_sub_word_AX_IMM,
+/* 0x2e */ x86emuOp_segovr_CS,
+/* 0x2f */ x86emuOp_das,
+
+/* 0x30 */ x86emuOp_xor_byte_RM_R,
+/* 0x31 */ x86emuOp_xor_word_RM_R,
+/* 0x32 */ x86emuOp_xor_byte_R_RM,
+/* 0x33 */ x86emuOp_xor_word_R_RM,
+/* 0x34 */ x86emuOp_xor_byte_AL_IMM,
+/* 0x35 */ x86emuOp_xor_word_AX_IMM,
+/* 0x36 */ x86emuOp_segovr_SS,
+/* 0x37 */ x86emuOp_aaa,
+
+/* 0x38 */ x86emuOp_cmp_byte_RM_R,
+/* 0x39 */ x86emuOp_cmp_word_RM_R,
+/* 0x3a */ x86emuOp_cmp_byte_R_RM,
+/* 0x3b */ x86emuOp_cmp_word_R_RM,
+/* 0x3c */ x86emuOp_cmp_byte_AL_IMM,
+/* 0x3d */ x86emuOp_cmp_word_AX_IMM,
+/* 0x3e */ x86emuOp_segovr_DS,
+/* 0x3f */ x86emuOp_aas,
+
+/* 0x40 */ x86emuOp_inc_AX,
+/* 0x41 */ x86emuOp_inc_CX,
+/* 0x42 */ x86emuOp_inc_DX,
+/* 0x43 */ x86emuOp_inc_BX,
+/* 0x44 */ x86emuOp_inc_SP,
+/* 0x45 */ x86emuOp_inc_BP,
+/* 0x46 */ x86emuOp_inc_SI,
+/* 0x47 */ x86emuOp_inc_DI,
+
+/* 0x48 */ x86emuOp_dec_AX,
+/* 0x49 */ x86emuOp_dec_CX,
+/* 0x4a */ x86emuOp_dec_DX,
+/* 0x4b */ x86emuOp_dec_BX,
+/* 0x4c */ x86emuOp_dec_SP,
+/* 0x4d */ x86emuOp_dec_BP,
+/* 0x4e */ x86emuOp_dec_SI,
+/* 0x4f */ x86emuOp_dec_DI,
+
+/* 0x50 */ x86emuOp_push_AX,
+/* 0x51 */ x86emuOp_push_CX,
+/* 0x52 */ x86emuOp_push_DX,
+/* 0x53 */ x86emuOp_push_BX,
+/* 0x54 */ x86emuOp_push_SP,
+/* 0x55 */ x86emuOp_push_BP,
+/* 0x56 */ x86emuOp_push_SI,
+/* 0x57 */ x86emuOp_push_DI,
+
+/* 0x58 */ x86emuOp_pop_AX,
+/* 0x59 */ x86emuOp_pop_CX,
+/* 0x5a */ x86emuOp_pop_DX,
+/* 0x5b */ x86emuOp_pop_BX,
+/* 0x5c */ x86emuOp_pop_SP,
+/* 0x5d */ x86emuOp_pop_BP,
+/* 0x5e */ x86emuOp_pop_SI,
+/* 0x5f */ x86emuOp_pop_DI,
+
+/* 0x60 */ x86emuOp_push_all,
+/* 0x61 */ x86emuOp_pop_all,
+/* 0x62 */ x86emuOp_illegal_op, /* bound */
+/* 0x63 */ x86emuOp_illegal_op, /* arpl */
+/* 0x64 */ x86emuOp_segovr_FS,
+/* 0x65 */ x86emuOp_segovr_GS,
+/* 0x66 */ x86emuOp_prefix_data,
+/* 0x67 */ x86emuOp_prefix_addr,
+
+/* 0x68 */ x86emuOp_push_word_IMM,
+/* 0x69 */ x86emuOp_imul_word_IMM,
+/* 0x6a */ x86emuOp_push_byte_IMM,
+/* 0x6b */ x86emuOp_imul_byte_IMM,
+/* 0x6c */ x86emuOp_ins_byte,
+/* 0x6d */ x86emuOp_ins_word,
+/* 0x6e */ x86emuOp_outs_byte,
+/* 0x6f */ x86emuOp_outs_word,
+
+/* 0x70 */ x86emuOp_jump_near_O,
+/* 0x71 */ x86emuOp_jump_near_NO,
+/* 0x72 */ x86emuOp_jump_near_B,
+/* 0x73 */ x86emuOp_jump_near_NB,
+/* 0x74 */ x86emuOp_jump_near_Z,
+/* 0x75 */ x86emuOp_jump_near_NZ,
+/* 0x76 */ x86emuOp_jump_near_BE,
+/* 0x77 */ x86emuOp_jump_near_NBE,
+
+/* 0x78 */ x86emuOp_jump_near_S,
+/* 0x79 */ x86emuOp_jump_near_NS,
+/* 0x7a */ x86emuOp_jump_near_P,
+/* 0x7b */ x86emuOp_jump_near_NP,
+/* 0x7c */ x86emuOp_jump_near_L,
+/* 0x7d */ x86emuOp_jump_near_NL,
+/* 0x7e */ x86emuOp_jump_near_LE,
+/* 0x7f */ x86emuOp_jump_near_NLE,
+
+/* 0x80 */ x86emuOp_opc80_byte_RM_IMM,
+/* 0x81 */ x86emuOp_opc81_word_RM_IMM,
+/* 0x82 */ x86emuOp_opc82_byte_RM_IMM,
+/* 0x83 */ x86emuOp_opc83_word_RM_IMM,
+/* 0x84 */ x86emuOp_test_byte_RM_R,
+/* 0x85 */ x86emuOp_test_word_RM_R,
+/* 0x86 */ x86emuOp_xchg_byte_RM_R,
+/* 0x87 */ x86emuOp_xchg_word_RM_R,
+
+/* 0x88 */ x86emuOp_mov_byte_RM_R,
+/* 0x89 */ x86emuOp_mov_word_RM_R,
+/* 0x8a */ x86emuOp_mov_byte_R_RM,
+/* 0x8b */ x86emuOp_mov_word_R_RM,
+/* 0x8c */ x86emuOp_mov_word_RM_SR,
+/* 0x8d */ x86emuOp_lea_word_R_M,
+/* 0x8e */ x86emuOp_mov_word_SR_RM,
+/* 0x8f */ x86emuOp_pop_RM,
+
+/* 0x90 */ x86emuOp_nop,
+/* 0x91 */ x86emuOp_xchg_word_AX_CX,
+/* 0x92 */ x86emuOp_xchg_word_AX_DX,
+/* 0x93 */ x86emuOp_xchg_word_AX_BX,
+/* 0x94 */ x86emuOp_xchg_word_AX_SP,
+/* 0x95 */ x86emuOp_xchg_word_AX_BP,
+/* 0x96 */ x86emuOp_xchg_word_AX_SI,
+/* 0x97 */ x86emuOp_xchg_word_AX_DI,
+
+/* 0x98 */ x86emuOp_cbw,
+/* 0x99 */ x86emuOp_cwd,
+/* 0x9a */ x86emuOp_call_far_IMM,
+/* 0x9b */ x86emuOp_wait,
+/* 0x9c */ x86emuOp_pushf_word,
+/* 0x9d */ x86emuOp_popf_word,
+/* 0x9e */ x86emuOp_sahf,
+/* 0x9f */ x86emuOp_lahf,
+
+/* 0xa0 */ x86emuOp_mov_AL_M_IMM,
+/* 0xa1 */ x86emuOp_mov_AX_M_IMM,
+/* 0xa2 */ x86emuOp_mov_M_AL_IMM,
+/* 0xa3 */ x86emuOp_mov_M_AX_IMM,
+/* 0xa4 */ x86emuOp_movs_byte,
+/* 0xa5 */ x86emuOp_movs_word,
+/* 0xa6 */ x86emuOp_cmps_byte,
+/* 0xa7 */ x86emuOp_cmps_word,
+/* 0xa8 */ x86emuOp_test_AL_IMM,
+/* 0xa9 */ x86emuOp_test_AX_IMM,
+/* 0xaa */ x86emuOp_stos_byte,
+/* 0xab */ x86emuOp_stos_word,
+/* 0xac */ x86emuOp_lods_byte,
+/* 0xad */ x86emuOp_lods_word,
+/* 0xac */ x86emuOp_scas_byte,
+/* 0xad */ x86emuOp_scas_word,
+
+
+/* 0xb0 */ x86emuOp_mov_byte_AL_IMM,
+/* 0xb1 */ x86emuOp_mov_byte_CL_IMM,
+/* 0xb2 */ x86emuOp_mov_byte_DL_IMM,
+/* 0xb3 */ x86emuOp_mov_byte_BL_IMM,
+/* 0xb4 */ x86emuOp_mov_byte_AH_IMM,
+/* 0xb5 */ x86emuOp_mov_byte_CH_IMM,
+/* 0xb6 */ x86emuOp_mov_byte_DH_IMM,
+/* 0xb7 */ x86emuOp_mov_byte_BH_IMM,
+
+/* 0xb8 */ x86emuOp_mov_word_AX_IMM,
+/* 0xb9 */ x86emuOp_mov_word_CX_IMM,
+/* 0xba */ x86emuOp_mov_word_DX_IMM,
+/* 0xbb */ x86emuOp_mov_word_BX_IMM,
+/* 0xbc */ x86emuOp_mov_word_SP_IMM,
+/* 0xbd */ x86emuOp_mov_word_BP_IMM,
+/* 0xbe */ x86emuOp_mov_word_SI_IMM,
+/* 0xbf */ x86emuOp_mov_word_DI_IMM,
+
+/* 0xc0 */ x86emuOp_opcC0_byte_RM_MEM,
+/* 0xc1 */ x86emuOp_opcC1_word_RM_MEM,
+/* 0xc2 */ x86emuOp_ret_near_IMM,
+/* 0xc3 */ x86emuOp_ret_near,
+/* 0xc4 */ x86emuOp_les_R_IMM,
+/* 0xc5 */ x86emuOp_lds_R_IMM,
+/* 0xc6 */ x86emuOp_mov_byte_RM_IMM,
+/* 0xc7 */ x86emuOp_mov_word_RM_IMM,
+/* 0xc8 */ x86emuOp_enter,
+/* 0xc9 */ x86emuOp_leave,
+/* 0xca */ x86emuOp_ret_far_IMM,
+/* 0xcb */ x86emuOp_ret_far,
+/* 0xcc */ x86emuOp_int3,
+/* 0xcd */ x86emuOp_int_IMM,
+/* 0xce */ x86emuOp_into,
+/* 0xcf */ x86emuOp_iret,
+
+/* 0xd0 */ x86emuOp_opcD0_byte_RM_1,
+/* 0xd1 */ x86emuOp_opcD1_word_RM_1,
+/* 0xd2 */ x86emuOp_opcD2_byte_RM_CL,
+/* 0xd3 */ x86emuOp_opcD3_word_RM_CL,
+/* 0xd4 */ x86emuOp_aam,
+/* 0xd5 */ x86emuOp_aad,
+/* 0xd6 */ x86emuOp_illegal_op, /* Undocumented SETALC instruction */
+/* 0xd7 */ x86emuOp_xlat,
+/* 0xd8 */ x86emuOp_esc_coprocess_d8,
+/* 0xd9 */ x86emuOp_esc_coprocess_d9,
+/* 0xda */ x86emuOp_esc_coprocess_da,
+/* 0xdb */ x86emuOp_esc_coprocess_db,
+/* 0xdc */ x86emuOp_esc_coprocess_dc,
+/* 0xdd */ x86emuOp_esc_coprocess_dd,
+/* 0xde */ x86emuOp_esc_coprocess_de,
+/* 0xdf */ x86emuOp_esc_coprocess_df,
+
+/* 0xe0 */ x86emuOp_loopne,
+/* 0xe1 */ x86emuOp_loope,
+/* 0xe2 */ x86emuOp_loop,
+/* 0xe3 */ x86emuOp_jcxz,
+/* 0xe4 */ x86emuOp_in_byte_AL_IMM,
+/* 0xe5 */ x86emuOp_in_word_AX_IMM,
+/* 0xe6 */ x86emuOp_out_byte_IMM_AL,
+/* 0xe7 */ x86emuOp_out_word_IMM_AX,
+
+/* 0xe8 */ x86emuOp_call_near_IMM,
+/* 0xe9 */ x86emuOp_jump_near_IMM,
+/* 0xea */ x86emuOp_jump_far_IMM,
+/* 0xeb */ x86emuOp_jump_byte_IMM,
+/* 0xec */ x86emuOp_in_byte_AL_DX,
+/* 0xed */ x86emuOp_in_word_AX_DX,
+/* 0xee */ x86emuOp_out_byte_DX_AL,
+/* 0xef */ x86emuOp_out_word_DX_AX,
+
+/* 0xf0 */ x86emuOp_lock,
+/* 0xf1 */ x86emuOp_illegal_op,
+/* 0xf2 */ x86emuOp_repne,
+/* 0xf3 */ x86emuOp_repe,
+/* 0xf4 */ x86emuOp_halt,
+/* 0xf5 */ x86emuOp_cmc,
+/* 0xf6 */ x86emuOp_opcF6_byte_RM,
+/* 0xf7 */ x86emuOp_opcF7_word_RM,
+
+/* 0xf8 */ x86emuOp_clc,
+/* 0xf9 */ x86emuOp_stc,
+/* 0xfa */ x86emuOp_cli,
+/* 0xfb */ x86emuOp_sti,
+/* 0xfc */ x86emuOp_cld,
+/* 0xfd */ x86emuOp_std,
+/* 0xfe */ x86emuOp_opcFE_byte_RM,
+/* 0xff */ x86emuOp_opcFF_word_RM,
+};
diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c index 30b890589..fc8179394 100644 --- a/xorg-server/hw/xquartz/darwin.c +++ b/xorg-server/hw/xquartz/darwin.c @@ -1,947 +1,908 @@ -/************************************************************** - * - * Xquartz initialization code - * - * Copyright (c) 2007-2008 Apple Inc. - * Copyright (c) 2001-2004 Torrey T. Lyons. 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <X11/X.h> -#include <X11/Xproto.h> -#include "os.h" -#include "servermd.h" -#include "inputstr.h" -#include "scrnintstr.h" -#include "mibstore.h" // mi backing store implementation -#include "mipointer.h" // mi software cursor -#include "micmap.h" // mi colormap code -#include "fb.h" // fb framebuffer code -#include "site.h" -#include "globals.h" -#include "dix.h" - -#include <X11/extensions/XI.h> -#include <X11/extensions/XIproto.h> -#include "exevents.h" -#include "extinit.h" - -#include "xserver-properties.h" - -#include <sys/types.h> -#include <sys/time.h> -#include <sys/syslimits.h> -#include <stdio.h> -#include <fcntl.h> -#include <unistd.h> - -#define HAS_UTSNAME 1 -#include <sys/utsname.h> - -#define NO_CFPLUGIN -#include <IOKit/hidsystem/IOHIDLib.h> - -#ifdef MITSHM -#include "shmint.h" -#endif - -#include "darwin.h" -#include "darwinEvents.h" -#include "quartzKeyboard.h" -#include "quartz.h" - -#ifdef ENABLE_DEBUG_LOG -FILE *debug_log_fp = NULL; -#endif - -/* - * X server shared global variables - */ -int darwinScreensFound = 0; -static int darwinScreenKeyIndex; -DevPrivateKey darwinScreenKey = &darwinScreenKeyIndex; -io_connect_t darwinParamConnect = 0; -int darwinEventReadFD = -1; -int darwinEventWriteFD = -1; -// int darwinMouseAccelChange = 1; -int darwinFakeButtons = 0; - -// location of X11's (0,0) point in global screen coordinates -int darwinMainScreenX = 0; -int darwinMainScreenY = 0; - -// parameters read from the command line or user preferences -unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0; -int darwinDesiredDepth = -1; -int darwinDesiredRefresh = -1; -int darwinSyncKeymap = FALSE; - -// modifier masks for faking mouse buttons - ANY of these bits trigger it (not all) -#ifdef NX_DEVICELCMDKEYMASK -int darwinFakeMouse2Mask = NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK; -int darwinFakeMouse3Mask = NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK; -#else -int darwinFakeMouse2Mask = NX_ALTERNATEMASK; -int darwinFakeMouse3Mask = NX_COMMANDMASK; -#endif - -// Modifier mask for overriding event delivery to appkit (might be useful to set this to rcommand for input menu -unsigned int darwinAppKitModMask = 0; // Any of these bits - -// Modifier mask for items in the Window menu (0 and -1 cause shortcuts to be disabled) -unsigned int windowItemModMask = NX_COMMANDMASK; - -// devices -DeviceIntPtr darwinKeyboard = NULL; -DeviceIntPtr darwinPointer = NULL; -DeviceIntPtr darwinTabletCurrent = NULL; -DeviceIntPtr darwinTabletStylus = NULL; -DeviceIntPtr darwinTabletCursor = NULL; -DeviceIntPtr darwinTabletEraser = NULL; - -// Common pixmap formats -static PixmapFormatRec formats[] = { - { 1, 1, BITMAP_SCANLINE_PAD }, - { 4, 8, BITMAP_SCANLINE_PAD }, - { 8, 8, BITMAP_SCANLINE_PAD }, - { 15, 16, BITMAP_SCANLINE_PAD }, - { 16, 16, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD }, - { 32, 32, BITMAP_SCANLINE_PAD } -}; -const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); - -#ifndef OSNAME -#define OSNAME " Darwin" -#endif -#ifndef OSVENDOR -#define OSVENDOR "" -#endif -#ifndef PRE_RELEASE -#define PRE_RELEASE XORG_VERSION_SNAP -#endif -#ifndef BUILD_DATE -#define BUILD_DATE "" -#endif -#ifndef XORG_RELEASE -#define XORG_RELEASE "?" -#endif - -void -DarwinPrintBanner(void) -{ - // this should change depending on which specific server we are building - ErrorF("Xquartz starting:\n"); - ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE ); -} - - -/* - * DarwinSaveScreen - * X screensaver support. Not implemented. - */ -static Bool DarwinSaveScreen(ScreenPtr pScreen, int on) -{ - // FIXME - if (on == SCREEN_SAVER_FORCER) { - } else if (on == SCREEN_SAVER_ON) { - } else { - } - return TRUE; -} - -/* - * DarwinScreenInit - * This is a callback from dix during AddScreen() from InitOutput(). - * Initialize the screen and communicate information about it back to dix. - */ -static Bool DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) { - int dpi; - static int foundIndex = 0; - Bool ret; - DarwinFramebufferPtr dfb; - - // reset index of found screens for each server generation - if (index == 0) { - foundIndex = 0; - - // reset the visual list - miClearVisualTypes(); - } - - // allocate space for private per screen storage - dfb = xalloc(sizeof(DarwinFramebufferRec)); - - // SCREEN_PRIV(pScreen) = dfb; - dixSetPrivate(&pScreen->devPrivates, darwinScreenKey, dfb); - - // setup hardware/mode specific details - ret = QuartzAddScreen(foundIndex, pScreen); - foundIndex++; - if (! ret) - return FALSE; - - // setup a single visual appropriate for our pixel type - if(!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB, - dfb->preferredCVC, dfb->redMask, - dfb->greenMask, dfb->blueMask)) { - return FALSE; - } - -// TODO: Make PseudoColor visuals not suck in TrueColor mode -// if(dfb->depth > 8) -// miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0); - if(dfb->depth > 15) - miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor, RM_ARGB(0,5,5,5), GM_ARGB(0,5,5,5), BM_ARGB(0,5,5,5)); - if(dfb->depth > 24) - miSetVisualTypesAndMasks(24, TrueColorMask, 8, TrueColor, RM_ARGB(0,8,8,8), GM_ARGB(0,8,8,8), BM_ARGB(0,8,8,8)); - - miSetPixmapDepths(); - - // machine independent screen init - // setup _Screen structure in pScreen - if (monitorResolution) - dpi = monitorResolution; - else - dpi = 96; - - // initialize fb - if (! fbScreenInit(pScreen, - dfb->framebuffer, // pointer to screen bitmap - dfb->width, dfb->height, // screen size in pixels - dpi, dpi, // dots per inch - dfb->pitch/(dfb->bitsPerPixel/8), // pixel width of framebuffer - dfb->bitsPerPixel)) // bits per pixel for screen - { - return FALSE; - } - -#ifdef RENDER - if (! fbPictureInit(pScreen, 0, 0)) { - return FALSE; - } -#endif - -#ifdef MITSHM - ShmRegisterFbFuncs(pScreen); -#endif - - // this must be initialized (why doesn't X have a default?) - pScreen->SaveScreen = DarwinSaveScreen; - - // finish mode dependent screen setup including cursor support - if (!QuartzSetupScreen(index, pScreen)) { - return FALSE; - } - - // create and install the default colormap and - // set pScreen->blackPixel / pScreen->white - if (!miCreateDefColormap( pScreen )) { - return FALSE; - } - - dixScreenOrigins[index].x = dfb->x; - dixScreenOrigins[index].y = dfb->y; - - /* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", - index, dfb->width, dfb->height, dfb->x, dfb->y); */ - - return TRUE; -} - -/* - ============================================================================= - - mouse and keyboard callbacks - - ============================================================================= -*/ - -/* - * DarwinMouseProc: Handle the initialization, etc. of a mouse - */ -static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { -#define NBUTTONS 7 -#define NAXES 2 - // 7 buttons: left, right, middle, then four scroll wheel "buttons" - CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3, 4, 5, 6, 7}; - Atom btn_labels[NBUTTONS] = {0}; - Atom axes_labels[NAXES] = {0}; - - switch (what) { - case DEVICE_INIT: - pPointer->public.on = FALSE; - - btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); - btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); - btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); - btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); - btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); - btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); - btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); - - axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); - axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); - - - // Set button map. - InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS, - btn_labels, - (PtrCtrlProcPtr)NoopDDA, - GetMotionHistorySize(), NAXES, - axes_labels); - pPointer->valuator->mode = Absolute; // Relative - InitAbsoluteClassDeviceStruct(pPointer); -// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); -// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - break; - case DEVICE_ON: - pPointer->public.on = TRUE; - AddEnabledDevice( darwinEventReadFD ); - return Success; - case DEVICE_CLOSE: - case DEVICE_OFF: - pPointer->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); - return Success; - } - - return Success; -#undef NBUTTONS -#undef NAXES -} - -static int DarwinTabletProc(DeviceIntPtr pPointer, int what) { -#define NBUTTONS 3 -#define NAXES 5 - CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3}; - Atom btn_labels[NBUTTONS] = {0}; - Atom axes_labels[NAXES] = {0}; - - switch (what) { - case DEVICE_INIT: - pPointer->public.on = FALSE; - - btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); - btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); - btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); - - axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); - axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); - axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE); - axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X); - axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y); - - // Set button map. - InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS, - btn_labels, - (PtrCtrlProcPtr)NoopDDA, - GetMotionHistorySize(), NAXES, - axes_labels); - pPointer->valuator->mode = Absolute; // Relative - InitProximityClassDeviceStruct(pPointer); - InitAbsoluteClassDeviceStruct(pPointer); - - InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); -// pPointer->use = IsXExtensionDevice; - break; - case DEVICE_ON: - pPointer->public.on = TRUE; - AddEnabledDevice( darwinEventReadFD ); - return Success; - case DEVICE_CLOSE: - case DEVICE_OFF: - pPointer->public.on = FALSE; - RemoveEnabledDevice(darwinEventReadFD); - return Success; - } - return Success; -#undef NBUTTONS -#undef NAXES -} - -/* - * DarwinKeybdProc - * Callback from X - */ -static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff ) -{ - switch ( onoff ) { - case DEVICE_INIT: - DarwinKeyboardInit( pDev ); - break; - case DEVICE_ON: - pDev->public.on = TRUE; - AddEnabledDevice( darwinEventReadFD ); - break; - case DEVICE_OFF: - pDev->public.on = FALSE; - RemoveEnabledDevice( darwinEventReadFD ); - break; - case DEVICE_CLOSE: - break; - } - - return Success; -} - -/* -=========================================================================== - - Utility routines - -=========================================================================== -*/ - -/* - * DarwinParseModifierList - * Parse a list of modifier names and return a corresponding modifier mask - */ -int DarwinParseModifierList(const char *constmodifiers, int separatelr) -{ - int result = 0; - - if (constmodifiers) { - char *modifiers = strdup(constmodifiers); - char *modifier; - int nxkey; - char *p = modifiers; - - while (p) { - modifier = strsep(&p, " ,+&|/"); // allow lots of separators - nxkey = DarwinModifierStringToNXMask(modifier, separatelr); - if(nxkey) - result |= nxkey; - else - ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier); - } - free(modifiers); - } - return result; -} - -/* -=========================================================================== - - Functions needed to link against device independent X - -=========================================================================== -*/ - -/* - * InitInput - * Register the keyboard and mouse devices - */ -void InitInput( int argc, char **argv ) -{ - darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE); - RegisterKeyboardDevice( darwinKeyboard ); - darwinKeyboard->name = strdup("keyboard"); - - /* here's the snippet from the current gdk sources: - if (!strcmp (tmp_name, "pointer")) - gdkdev->info.source = GDK_SOURCE_MOUSE; - else if (!strcmp (tmp_name, "wacom") || - !strcmp (tmp_name, "pen")) - gdkdev->info.source = GDK_SOURCE_PEN; - else if (!strcmp (tmp_name, "eraser")) - gdkdev->info.source = GDK_SOURCE_ERASER; - else if (!strcmp (tmp_name, "cursor")) - gdkdev->info.source = GDK_SOURCE_CURSOR; - else - gdkdev->info.source = GDK_SOURCE_PEN; - */ - - darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE); - RegisterPointerDevice( darwinPointer ); - darwinPointer->name = strdup("pointer"); - - darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE); - RegisterPointerDevice( darwinTabletStylus ); - darwinTabletStylus->name = strdup("pen"); - - darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE); - RegisterPointerDevice( darwinTabletCursor ); - darwinTabletCursor->name = strdup("cursor"); - - darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE); - RegisterPointerDevice( darwinTabletEraser ); - darwinTabletEraser->name = strdup("eraser"); - - darwinTabletCurrent = darwinTabletStylus; - - DarwinEQInit(); - - QuartzInitInput(argc, argv); -} - - -/* - * DarwinAdjustScreenOrigins - * Shift all screens so the X11 (0, 0) coordinate is at the top - * left of the global screen coordinates. - * - * Screens can be arranged so the top left isn't on any screen, so - * instead use the top left of the leftmost screen as (0,0). This - * may mean some screen space is in -y, but it's better that (0,0) - * be onscreen, or else default xterms disappear. It's better that - * -y be used than -x, because when popup menus are forced - * "onscreen" by dumb window managers like twm, they'll shift the - * menus down instead of left, which still looks funny but is an - * easier target to hit. - */ -void -DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) -{ - int i, left, top; - - left = dixScreenOrigins[0].x; - top = dixScreenOrigins[0].y; - - /* Find leftmost screen. If there's a tie, take the topmost of the two. */ - for (i = 1; i < pScreenInfo->numScreens; i++) { - if (dixScreenOrigins[i].x < left || - (dixScreenOrigins[i].x == left && dixScreenOrigins[i].y < top)) - { - left = dixScreenOrigins[i].x; - top = dixScreenOrigins[i].y; - } - } - - darwinMainScreenX = left; - darwinMainScreenY = top; - - DEBUG_LOG("top = %d, left=%d\n", top, left); - - /* Shift all screens so that there is a screen whose top left - * is at X11 (0,0) and at global screen coordinate - * (darwinMainScreenX, darwinMainScreenY). - */ - - if (darwinMainScreenX != 0 || darwinMainScreenY != 0) { - for (i = 0; i < pScreenInfo->numScreens; i++) { - dixScreenOrigins[i].x -= darwinMainScreenX; - dixScreenOrigins[i].y -= darwinMainScreenY; - DEBUG_LOG("Screen %d placed at X11 coordinate (%d,%d).\n", - i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); - } - } -} - - -/* - * InitOutput - * Initialize screenInfo for all actually accessible framebuffers. - * - * The display mode dependent code gets called three times. The mode - * specific InitOutput routines are expected to discover the number - * of potentially useful screens and cache routes to them internally. - * Inside DarwinScreenInit are two other mode specific calls. - * A mode specific AddScreen routine is called for each screen to - * actually initialize the screen with the ScreenPtr structure. - * After other screen setup has been done, a mode specific - * SetupScreen function can be called to finalize screen setup. - */ -void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) -{ - int i; - - pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; - pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; - pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; - pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; - - // List how we want common pixmap formats to be padded - pScreenInfo->numPixmapFormats = NUMFORMATS; - for (i = 0; i < NUMFORMATS; i++) - pScreenInfo->formats[i] = formats[i]; - - // Discover screens and do mode specific initialization - QuartzInitOutput(argc, argv); - - // Add screens - for (i = 0; i < darwinScreensFound; i++) { - AddScreen(DarwinScreenInit, argc, argv); - } - - DarwinAdjustScreenOrigins(pScreenInfo); -} - - -/* - * OsVendorFataError - */ -void OsVendorFatalError( void ) -{ - ErrorF( " OsVendorFatalError\n" ); -} - - -/* - * OsVendorInit - * Initialization of Darwin OS support. - */ -void OsVendorInit(void) -{ - if (serverGeneration == 1) { - DarwinPrintBanner(); -#ifdef ENABLE_DEBUG_LOG - { - char *home_dir=NULL, *log_file_path=NULL; - home_dir = getenv("HOME"); - if (home_dir) asprintf(&log_file_path, "%s/%s", home_dir, DEBUG_LOG_NAME); - if (log_file_path) { - if (!access(log_file_path, F_OK)) { - debug_log_fp = fopen(log_file_path, "a"); - if (debug_log_fp) ErrorF("Debug logging enabled to %s\n", log_file_path); - } - free(log_file_path); - } - } -#endif - } -} - - -/* - * ddxProcessArgument - * Process device-dependent command line args. Returns 0 if argument is - * not device dependent, otherwise Count of number of elements of argv - * that are part of a device dependent commandline option. - */ -int ddxProcessArgument( int argc, char *argv[], int i ) -{ -// if ( !strcmp( argv[i], "-fullscreen" ) ) { -// ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" ); -// return 1; -// } - -// if ( !strcmp( argv[i], "-rootless" ) ) { -// ErrorF( "Running rootless inside Mac OS X window server.\n" ); -// return 1; -// } - - // This command line arg is passed when launched from the Aqua GUI. - if ( !strncmp( argv[i], "-psn_", 5 ) ) { - return 1; - } - - if ( !strcmp( argv[i], "-fakebuttons" ) ) { - darwinFakeButtons = TRUE; - ErrorF( "Faking a three button mouse\n" ); - return 1; - } - - if ( !strcmp( argv[i], "-nofakebuttons" ) ) { - darwinFakeButtons = FALSE; - ErrorF( "Not faking a three button mouse\n" ); - return 1; - } - - if (!strcmp( argv[i], "-fakemouse2" ) ) { - if ( i == argc-1 ) { - FatalError( "-fakemouse2 must be followed by a modifer list\n" ); - } - if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], "")) - darwinFakeMouse2Mask = 0; - else - darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1], 1); - ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n", - darwinFakeMouse2Mask); - return 2; - } - - if (!strcmp( argv[i], "-fakemouse3" ) ) { - if ( i == argc-1 ) { - FatalError( "-fakemouse3 must be followed by a modifer list\n" ); - } - if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], "")) - darwinFakeMouse3Mask = 0; - else - darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1], 1); - ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n", - darwinFakeMouse3Mask); - return 2; - } - - if ( !strcmp( argv[i], "+synckeymap" ) ) { - darwinSyncKeymap = TRUE; - return 1; - } - - if ( !strcmp( argv[i], "-synckeymap" ) ) { - darwinSyncKeymap = FALSE; - return 1; - } - - if ( !strcmp( argv[i], "-size" ) ) { - if ( i >= argc-2 ) { - FatalError( "-size must be followed by two numbers\n" ); - } -#ifdef OLD_POWERBOOK_G3 - ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n" ); -#else - darwinDesiredWidth = atoi( argv[i+1] ); - darwinDesiredHeight = atoi( argv[i+2] ); - ErrorF( "Attempting to use width x height = %i x %i\n", - darwinDesiredWidth, darwinDesiredHeight ); -#endif - return 3; - } - - if ( !strcmp( argv[i], "-depth" ) ) { - if ( i == argc-1 ) { - FatalError( "-depth must be followed by a number\n" ); - } -#ifdef OLD_POWERBOOK_G3 - ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n"); -#else - darwinDesiredDepth = atoi( argv[i+1] ); - if(darwinDesiredDepth != -1 && - darwinDesiredDepth != 8 && - darwinDesiredDepth != 15 && - darwinDesiredDepth != 24) { - FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" ); - } - - ErrorF( "Attempting to use pixel depth of %i\n", darwinDesiredDepth ); -#endif - return 2; - } - - if ( !strcmp( argv[i], "-refresh" ) ) { - if ( i == argc-1 ) { - FatalError( "-refresh must be followed by a number\n" ); - } -#ifdef OLD_POWERBOOK_G3 - ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n"); -#else - darwinDesiredRefresh = atoi( argv[i+1] ); - ErrorF( "Attempting to use refresh rate of %i\n", darwinDesiredRefresh ); -#endif - return 2; - } - - if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) { - DarwinPrintBanner(); - exit(0); - } - - return 0; -} - - -/* - * ddxUseMsg -- - * Print out correct use of device dependent commandline options. - * Maybe the user now knows what really to do ... - */ -void ddxUseMsg( void ) -{ - ErrorF("\n"); - ErrorF("\n"); - ErrorF("Device Dependent Usage:\n"); - ErrorF("\n"); - ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n"); - ErrorF("-nofakebuttons : don't fake a three button mouse.\n"); - ErrorF("-fakemouse2 <modifiers> : fake middle mouse button with modifier keys.\n"); - ErrorF("-fakemouse3 <modifiers> : fake right mouse button with modifier keys.\n"); - ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n"); - ErrorF("-version : show the server version.\n"); - ErrorF("\n"); - ErrorF("\n"); - ErrorF("Options ignored in rootless mode:\n"); - ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n"); - ErrorF("-depth <8,15,24> : use this bit depth.\n"); - ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n"); - ErrorF("\n"); -} - - -/* - * ddxGiveUp -- - * Device dependent cleanup. Called by dix before normal server death. - */ -void ddxGiveUp( void ) -{ - ErrorF( "Quitting Xquartz...\n" ); -} - - -/* - * AbortDDX -- - * DDX - specific abort routine. Called by AbortServer(). The attempt is - * made to restore all original setting of the displays. Also all devices - * are closed. - */ -void AbortDDX( void ) -{ - ErrorF( " AbortDDX\n" ); - /* - * This is needed for a abnormal server exit, since the normal exit stuff - * MUST also be performed (i.e. the vt must be left in a defined state) - */ - ddxGiveUp(); -} - -#include "mivalidate.h" // for union _Validate used by windowstr.h -#include "windowstr.h" // for struct _Window -#include "scrnintstr.h" // for struct _Screen - -// This is copied from Xserver/hw/xfree86/common/xf86Helper.c. -// Quartz mode uses this when switching in and out of Quartz. -// Quartz or IOKit can use this when waking from sleep. -// Copyright (c) 1997-1998 by The XFree86 Project, Inc. - -/* - * xf86SetRootClip -- - * Enable or disable rendering to the screen by - * setting the root clip list and revalidating - * all of the windows - */ - -void -xf86SetRootClip (ScreenPtr pScreen, int enable) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - WindowPtr pChild; - Bool WasViewable = (Bool)(pWin->viewable); - Bool anyMarked = TRUE; - RegionPtr pOldClip = NULL, bsExposed; - WindowPtr pLayerWin; - BoxRec box; - - if (WasViewable) - { - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - (void) (*pScreen->MarkOverlappedWindows)(pChild, - pChild, - &pLayerWin); - } - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - /* - * Use REGION_BREAK to avoid optimizations in ValidateTree - * that assume the root borderClip can't change well, normally - * it doesn't...) - */ - if (enable) - { - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_RESET(pScreen, &pWin->borderClip, &box); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); - } - else - { - REGION_EMPTY(pScreen, &pWin->borderClip); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); - } - - ResizeChildrenWinSize (pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } - - if (pWin->firstChild) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, - pWin->firstChild, - (WindowPtr *)NULL); - } - else - { - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - } - - - if (anyMarked) - (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); - } - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pWin); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - FlushAllOutput (); -} +/**************************************************************
+ *
+ * Xquartz initialization code
+ *
+ * Copyright (c) 2007-2008 Apple Inc.
+ * Copyright (c) 2001-2004 Torrey T. Lyons. 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "os.h"
+#include "servermd.h"
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "mibstore.h" // mi backing store implementation
+#include "mipointer.h" // mi software cursor
+#include "micmap.h" // mi colormap code
+#include "fb.h" // fb framebuffer code
+#include "site.h"
+#include "globals.h"
+#include "dix.h"
+
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "exevents.h"
+#include "extinit.h"
+
+#include "xserver-properties.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/syslimits.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define HAS_UTSNAME 1
+#include <sys/utsname.h>
+
+#define NO_CFPLUGIN
+#include <IOKit/hidsystem/IOHIDLib.h>
+
+#ifdef MITSHM
+#include "shmint.h"
+#endif
+
+#include "darwin.h"
+#include "darwinEvents.h"
+#include "quartzKeyboard.h"
+#include "quartz.h"
+
+#ifdef ENABLE_DEBUG_LOG
+FILE *debug_log_fp = NULL;
+#endif
+
+/*
+ * X server shared global variables
+ */
+int darwinScreensFound = 0;
+static int darwinScreenKeyIndex;
+DevPrivateKey darwinScreenKey = &darwinScreenKeyIndex;
+io_connect_t darwinParamConnect = 0;
+int darwinEventReadFD = -1;
+int darwinEventWriteFD = -1;
+// int darwinMouseAccelChange = 1;
+int darwinFakeButtons = 0;
+
+// location of X11's (0,0) point in global screen coordinates
+int darwinMainScreenX = 0;
+int darwinMainScreenY = 0;
+
+// parameters read from the command line or user preferences
+int darwinDesiredDepth = -1;
+int darwinSyncKeymap = FALSE;
+
+// modifier masks for faking mouse buttons - ANY of these bits trigger it (not all)
+#ifdef NX_DEVICELCMDKEYMASK
+int darwinFakeMouse2Mask = NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK;
+int darwinFakeMouse3Mask = NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK;
+#else
+int darwinFakeMouse2Mask = NX_ALTERNATEMASK;
+int darwinFakeMouse3Mask = NX_COMMANDMASK;
+#endif
+
+// Modifier mask for overriding event delivery to appkit (might be useful to set this to rcommand for input menu
+unsigned int darwinAppKitModMask = 0; // Any of these bits
+
+// Modifier mask for items in the Window menu (0 and -1 cause shortcuts to be disabled)
+unsigned int windowItemModMask = NX_COMMANDMASK;
+
+// devices
+DeviceIntPtr darwinKeyboard = NULL;
+DeviceIntPtr darwinPointer = NULL;
+DeviceIntPtr darwinTabletCurrent = NULL;
+DeviceIntPtr darwinTabletStylus = NULL;
+DeviceIntPtr darwinTabletCursor = NULL;
+DeviceIntPtr darwinTabletEraser = NULL;
+
+// Common pixmap formats
+static PixmapFormatRec formats[] = {
+ { 1, 1, BITMAP_SCANLINE_PAD },
+ { 4, 8, BITMAP_SCANLINE_PAD },
+ { 8, 8, BITMAP_SCANLINE_PAD },
+ { 15, 16, BITMAP_SCANLINE_PAD },
+ { 16, 16, BITMAP_SCANLINE_PAD },
+ { 24, 32, BITMAP_SCANLINE_PAD },
+ { 32, 32, BITMAP_SCANLINE_PAD }
+};
+const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
+
+#ifndef OSNAME
+#define OSNAME " Darwin"
+#endif
+#ifndef OSVENDOR
+#define OSVENDOR ""
+#endif
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XORG_VERSION_SNAP
+#endif
+#ifndef BUILD_DATE
+#define BUILD_DATE ""
+#endif
+#ifndef XORG_RELEASE
+#define XORG_RELEASE "?"
+#endif
+
+void
+DarwinPrintBanner(void)
+{
+ // this should change depending on which specific server we are building
+ ErrorF("Xquartz starting:\n");
+ ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE );
+}
+
+
+/*
+ * DarwinSaveScreen
+ * X screensaver support. Not implemented.
+ */
+static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
+{
+ // FIXME
+ if (on == SCREEN_SAVER_FORCER) {
+ } else if (on == SCREEN_SAVER_ON) {
+ } else {
+ }
+ return TRUE;
+}
+
+/*
+ * DarwinScreenInit
+ * This is a callback from dix during AddScreen() from InitOutput().
+ * Initialize the screen and communicate information about it back to dix.
+ */
+static Bool DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) {
+ int dpi;
+ static int foundIndex = 0;
+ Bool ret;
+ DarwinFramebufferPtr dfb;
+
+ // reset index of found screens for each server generation
+ if (index == 0) {
+ foundIndex = 0;
+
+ // reset the visual list
+ miClearVisualTypes();
+ }
+
+ // allocate space for private per screen storage
+ dfb = xalloc(sizeof(DarwinFramebufferRec));
+
+ // SCREEN_PRIV(pScreen) = dfb;
+ dixSetPrivate(&pScreen->devPrivates, darwinScreenKey, dfb);
+
+ // setup hardware/mode specific details
+ ret = QuartzAddScreen(foundIndex, pScreen);
+ foundIndex++;
+ if (! ret)
+ return FALSE;
+
+ // setup a single visual appropriate for our pixel type
+ if(!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB,
+ dfb->preferredCVC, dfb->redMask,
+ dfb->greenMask, dfb->blueMask)) {
+ return FALSE;
+ }
+
+// TODO: Make PseudoColor visuals not suck in TrueColor mode
+// if(dfb->depth > 8)
+// miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
+ if(dfb->depth > 15)
+ miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor, RM_ARGB(0,5,5,5), GM_ARGB(0,5,5,5), BM_ARGB(0,5,5,5));
+ if(dfb->depth > 24)
+ miSetVisualTypesAndMasks(24, TrueColorMask, 8, TrueColor, RM_ARGB(0,8,8,8), GM_ARGB(0,8,8,8), BM_ARGB(0,8,8,8));
+
+ miSetPixmapDepths();
+
+ // machine independent screen init
+ // setup _Screen structure in pScreen
+ if (monitorResolution)
+ dpi = monitorResolution;
+ else
+ dpi = 96;
+
+ // initialize fb
+ if (! fbScreenInit(pScreen,
+ dfb->framebuffer, // pointer to screen bitmap
+ dfb->width, dfb->height, // screen size in pixels
+ dpi, dpi, // dots per inch
+ dfb->pitch/(dfb->bitsPerPixel/8), // pixel width of framebuffer
+ dfb->bitsPerPixel)) // bits per pixel for screen
+ {
+ return FALSE;
+ }
+
+#ifdef RENDER
+ if (! fbPictureInit(pScreen, 0, 0)) {
+ return FALSE;
+ }
+#endif
+
+#ifdef MITSHM
+ ShmRegisterFbFuncs(pScreen);
+#endif
+
+ // this must be initialized (why doesn't X have a default?)
+ pScreen->SaveScreen = DarwinSaveScreen;
+
+ // finish mode dependent screen setup including cursor support
+ if (!QuartzSetupScreen(index, pScreen)) {
+ return FALSE;
+ }
+
+ // create and install the default colormap and
+ // set pScreen->blackPixel / pScreen->white
+ if (!miCreateDefColormap( pScreen )) {
+ return FALSE;
+ }
+
+ dixScreenOrigins[index].x = dfb->x;
+ dixScreenOrigins[index].y = dfb->y;
+
+ /* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
+ index, dfb->width, dfb->height, dfb->x, dfb->y); */
+
+ return TRUE;
+}
+
+/*
+ =============================================================================
+
+ mouse and keyboard callbacks
+
+ =============================================================================
+*/
+
+/*
+ * DarwinMouseProc: Handle the initialization, etc. of a mouse
+ */
+static int DarwinMouseProc(DeviceIntPtr pPointer, int what) {
+#define NBUTTONS 7
+#define NAXES 2
+ // 7 buttons: left, right, middle, then four scroll wheel "buttons"
+ CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3, 4, 5, 6, 7};
+ Atom btn_labels[NBUTTONS] = {0};
+ Atom axes_labels[NAXES] = {0};
+
+ switch (what) {
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+ btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+ btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+ btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
+ btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+
+
+ // Set button map.
+ InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS,
+ btn_labels,
+ (PtrCtrlProcPtr)NoopDDA,
+ GetMotionHistorySize(), NAXES,
+ axes_labels);
+ pPointer->valuator->mode = Absolute; // Relative
+ InitAbsoluteClassDeviceStruct(pPointer);
+// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+ break;
+ case DEVICE_ON:
+ pPointer->public.on = TRUE;
+ AddEnabledDevice( darwinEventReadFD );
+ return Success;
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pPointer->public.on = FALSE;
+ RemoveEnabledDevice(darwinEventReadFD);
+ return Success;
+ }
+
+ return Success;
+#undef NBUTTONS
+#undef NAXES
+}
+
+static int DarwinTabletProc(DeviceIntPtr pPointer, int what) {
+#define NBUTTONS 3
+#define NAXES 5
+ CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3};
+ Atom btn_labels[NBUTTONS] = {0};
+ Atom axes_labels[NAXES] = {0};
+
+ switch (what) {
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
+ axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
+ axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X);
+ axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y);
+
+ // Set button map.
+ InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS,
+ btn_labels,
+ (PtrCtrlProcPtr)NoopDDA,
+ GetMotionHistorySize(), NAXES,
+ axes_labels);
+ pPointer->valuator->mode = Absolute; // Relative
+ InitProximityClassDeviceStruct(pPointer);
+ InitAbsoluteClassDeviceStruct(pPointer);
+
+ InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+ InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+ InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+ InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+ InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+// pPointer->use = IsXExtensionDevice;
+ break;
+ case DEVICE_ON:
+ pPointer->public.on = TRUE;
+ AddEnabledDevice( darwinEventReadFD );
+ return Success;
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pPointer->public.on = FALSE;
+ RemoveEnabledDevice(darwinEventReadFD);
+ return Success;
+ }
+ return Success;
+#undef NBUTTONS
+#undef NAXES
+}
+
+/*
+ * DarwinKeybdProc
+ * Callback from X
+ */
+static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
+{
+ switch ( onoff ) {
+ case DEVICE_INIT:
+ DarwinKeyboardInit( pDev );
+ break;
+ case DEVICE_ON:
+ pDev->public.on = TRUE;
+ AddEnabledDevice( darwinEventReadFD );
+ break;
+ case DEVICE_OFF:
+ pDev->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventReadFD );
+ break;
+ case DEVICE_CLOSE:
+ break;
+ }
+
+ return Success;
+}
+
+/*
+===========================================================================
+
+ Utility routines
+
+===========================================================================
+*/
+
+/*
+ * DarwinParseModifierList
+ * Parse a list of modifier names and return a corresponding modifier mask
+ */
+int DarwinParseModifierList(const char *constmodifiers, int separatelr)
+{
+ int result = 0;
+
+ if (constmodifiers) {
+ char *modifiers = strdup(constmodifiers);
+ char *modifier;
+ int nxkey;
+ char *p = modifiers;
+
+ while (p) {
+ modifier = strsep(&p, " ,+&|/"); // allow lots of separators
+ nxkey = DarwinModifierStringToNXMask(modifier, separatelr);
+ if(nxkey)
+ result |= nxkey;
+ else
+ ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier);
+ }
+ free(modifiers);
+ }
+ return result;
+}
+
+/*
+===========================================================================
+
+ Functions needed to link against device independent X
+
+===========================================================================
+*/
+
+/*
+ * InitInput
+ * Register the keyboard and mouse devices
+ */
+void InitInput( int argc, char **argv )
+{
+ darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE);
+ RegisterKeyboardDevice( darwinKeyboard );
+ darwinKeyboard->name = strdup("keyboard");
+
+ /* here's the snippet from the current gdk sources:
+ if (!strcmp (tmp_name, "pointer"))
+ gdkdev->info.source = GDK_SOURCE_MOUSE;
+ else if (!strcmp (tmp_name, "wacom") ||
+ !strcmp (tmp_name, "pen"))
+ gdkdev->info.source = GDK_SOURCE_PEN;
+ else if (!strcmp (tmp_name, "eraser"))
+ gdkdev->info.source = GDK_SOURCE_ERASER;
+ else if (!strcmp (tmp_name, "cursor"))
+ gdkdev->info.source = GDK_SOURCE_CURSOR;
+ else
+ gdkdev->info.source = GDK_SOURCE_PEN;
+ */
+
+ darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE);
+ RegisterPointerDevice( darwinPointer );
+ darwinPointer->name = strdup("pointer");
+
+ darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
+ RegisterPointerDevice( darwinTabletStylus );
+ darwinTabletStylus->name = strdup("pen");
+
+ darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
+ RegisterPointerDevice( darwinTabletCursor );
+ darwinTabletCursor->name = strdup("cursor");
+
+ darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
+ RegisterPointerDevice( darwinTabletEraser );
+ darwinTabletEraser->name = strdup("eraser");
+
+ darwinTabletCurrent = darwinTabletStylus;
+
+ DarwinEQInit();
+
+ QuartzInitInput(argc, argv);
+}
+
+
+/*
+ * DarwinAdjustScreenOrigins
+ * Shift all screens so the X11 (0, 0) coordinate is at the top
+ * left of the global screen coordinates.
+ *
+ * Screens can be arranged so the top left isn't on any screen, so
+ * instead use the top left of the leftmost screen as (0,0). This
+ * may mean some screen space is in -y, but it's better that (0,0)
+ * be onscreen, or else default xterms disappear. It's better that
+ * -y be used than -x, because when popup menus are forced
+ * "onscreen" by dumb window managers like twm, they'll shift the
+ * menus down instead of left, which still looks funny but is an
+ * easier target to hit.
+ */
+void
+DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
+{
+ int i, left, top;
+
+ left = dixScreenOrigins[0].x;
+ top = dixScreenOrigins[0].y;
+
+ /* Find leftmost screen. If there's a tie, take the topmost of the two. */
+ for (i = 1; i < pScreenInfo->numScreens; i++) {
+ if (dixScreenOrigins[i].x < left ||
+ (dixScreenOrigins[i].x == left && dixScreenOrigins[i].y < top))
+ {
+ left = dixScreenOrigins[i].x;
+ top = dixScreenOrigins[i].y;
+ }
+ }
+
+ darwinMainScreenX = left;
+ darwinMainScreenY = top;
+
+ DEBUG_LOG("top = %d, left=%d\n", top, left);
+
+ /* Shift all screens so that there is a screen whose top left
+ * is at X11 (0,0) and at global screen coordinate
+ * (darwinMainScreenX, darwinMainScreenY).
+ */
+
+ if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
+ for (i = 0; i < pScreenInfo->numScreens; i++) {
+ dixScreenOrigins[i].x -= darwinMainScreenX;
+ dixScreenOrigins[i].y -= darwinMainScreenY;
+ DEBUG_LOG("Screen %d placed at X11 coordinate (%d,%d).\n",
+ i, dixScreenOrigins[i].x, dixScreenOrigins[i].y);
+ }
+ }
+}
+
+
+/*
+ * InitOutput
+ * Initialize screenInfo for all actually accessible framebuffers.
+ *
+ * The display mode dependent code gets called three times. The mode
+ * specific InitOutput routines are expected to discover the number
+ * of potentially useful screens and cache routes to them internally.
+ * Inside DarwinScreenInit are two other mode specific calls.
+ * A mode specific AddScreen routine is called for each screen to
+ * actually initialize the screen with the ScreenPtr structure.
+ * After other screen setup has been done, a mode specific
+ * SetupScreen function can be called to finalize screen setup.
+ */
+void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
+{
+ int i;
+
+ pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+
+ // List how we want common pixmap formats to be padded
+ pScreenInfo->numPixmapFormats = NUMFORMATS;
+ for (i = 0; i < NUMFORMATS; i++)
+ pScreenInfo->formats[i] = formats[i];
+
+ // Discover screens and do mode specific initialization
+ QuartzInitOutput(argc, argv);
+
+ // Add screens
+ for (i = 0; i < darwinScreensFound; i++) {
+ AddScreen(DarwinScreenInit, argc, argv);
+ }
+
+ DarwinAdjustScreenOrigins(pScreenInfo);
+}
+
+
+/*
+ * OsVendorFataError
+ */
+void OsVendorFatalError( void )
+{
+ ErrorF( " OsVendorFatalError\n" );
+}
+
+
+/*
+ * OsVendorInit
+ * Initialization of Darwin OS support.
+ */
+void OsVendorInit(void)
+{
+ if (serverGeneration == 1) {
+ DarwinPrintBanner();
+#ifdef ENABLE_DEBUG_LOG
+ {
+ char *home_dir=NULL, *log_file_path=NULL;
+ home_dir = getenv("HOME");
+ if (home_dir) asprintf(&log_file_path, "%s/%s", home_dir, DEBUG_LOG_NAME);
+ if (log_file_path) {
+ if (!access(log_file_path, F_OK)) {
+ debug_log_fp = fopen(log_file_path, "a");
+ if (debug_log_fp) ErrorF("Debug logging enabled to %s\n", log_file_path);
+ }
+ free(log_file_path);
+ }
+ }
+#endif
+ }
+}
+
+
+/*
+ * ddxProcessArgument
+ * Process device-dependent command line args. Returns 0 if argument is
+ * not device dependent, otherwise Count of number of elements of argv
+ * that are part of a device dependent commandline option.
+ */
+int ddxProcessArgument( int argc, char *argv[], int i )
+{
+// if ( !strcmp( argv[i], "-fullscreen" ) ) {
+// ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
+// return 1;
+// }
+
+// if ( !strcmp( argv[i], "-rootless" ) ) {
+// ErrorF( "Running rootless inside Mac OS X window server.\n" );
+// return 1;
+// }
+
+ // This command line arg is passed when launched from the Aqua GUI.
+ if ( !strncmp( argv[i], "-psn_", 5 ) ) {
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-fakebuttons" ) ) {
+ darwinFakeButtons = TRUE;
+ ErrorF( "Faking a three button mouse\n" );
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-nofakebuttons" ) ) {
+ darwinFakeButtons = FALSE;
+ ErrorF( "Not faking a three button mouse\n" );
+ return 1;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse2" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse2 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse2Mask = 0;
+ else
+ darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1], 1);
+ ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n",
+ darwinFakeMouse2Mask);
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse3" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse3 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse3Mask = 0;
+ else
+ darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1], 1);
+ ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n",
+ darwinFakeMouse3Mask);
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "+synckeymap" ) ) {
+ darwinSyncKeymap = TRUE;
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-synckeymap" ) ) {
+ darwinSyncKeymap = FALSE;
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-depth" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-depth must be followed by a number\n" );
+ }
+ darwinDesiredDepth = atoi( argv[i+1] );
+ if(darwinDesiredDepth != -1 &&
+ darwinDesiredDepth != 8 &&
+ darwinDesiredDepth != 15 &&
+ darwinDesiredDepth != 24) {
+ FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
+ }
+
+ ErrorF( "Attempting to use pixel depth of %i\n", darwinDesiredDepth );
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+
+ return 0;
+}
+
+
+/*
+ * ddxUseMsg --
+ * Print out correct use of device dependent commandline options.
+ * Maybe the user now knows what really to do ...
+ */
+void ddxUseMsg( void )
+{
+ ErrorF("\n");
+ ErrorF("\n");
+ ErrorF("Device Dependent Usage:\n");
+ ErrorF("\n");
+ ErrorF("-depth <8,15,24> : use this bit depth.\n");
+ ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n");
+ ErrorF("-nofakebuttons : don't fake a three button mouse.\n");
+ ErrorF("-fakemouse2 <modifiers> : fake middle mouse button with modifier keys.\n");
+ ErrorF("-fakemouse3 <modifiers> : fake right mouse button with modifier keys.\n");
+ ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n");
+ ErrorF("-version : show the server version.\n");
+ ErrorF("\n");
+}
+
+
+/*
+ * ddxGiveUp --
+ * Device dependent cleanup. Called by dix before normal server death.
+ */
+void ddxGiveUp( void )
+{
+ ErrorF( "Quitting Xquartz...\n" );
+}
+
+
+/*
+ * AbortDDX --
+ * DDX - specific abort routine. Called by AbortServer(). The attempt is
+ * made to restore all original setting of the displays. Also all devices
+ * are closed.
+ */
+void AbortDDX( void )
+{
+ ErrorF( " AbortDDX\n" );
+ /*
+ * This is needed for a abnormal server exit, since the normal exit stuff
+ * MUST also be performed (i.e. the vt must be left in a defined state)
+ */
+ ddxGiveUp();
+}
+
+#include "mivalidate.h" // for union _Validate used by windowstr.h
+#include "windowstr.h" // for struct _Window
+#include "scrnintstr.h" // for struct _Screen
+
+// This is copied from Xserver/hw/xfree86/common/xf86Helper.c.
+// Quartz mode uses this when switching in and out of Quartz.
+// Quartz or IOKit can use this when waking from sleep.
+// Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+
+/*
+ * xf86SetRootClip --
+ * Enable or disable rendering to the screen by
+ * setting the root clip list and revalidating
+ * all of the windows
+ */
+
+void
+xf86SetRootClip (ScreenPtr pScreen, int enable)
+{
+ WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pChild;
+ Bool WasViewable = (Bool)(pWin->viewable);
+ Bool anyMarked = TRUE;
+ RegionPtr pOldClip = NULL, bsExposed;
+ WindowPtr pLayerWin;
+ BoxRec box;
+
+ if (WasViewable)
+ {
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
+ {
+ (void) (*pScreen->MarkOverlappedWindows)(pChild,
+ pChild,
+ &pLayerWin);
+ }
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ if (pWin->valdata)
+ {
+ if (HasBorder (pWin))
+ {
+ RegionPtr borderVisible;
+
+ borderVisible = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_SUBTRACT(pScreen, borderVisible,
+ &pWin->borderClip, &pWin->winSize);
+ pWin->valdata->before.borderVisible = borderVisible;
+ }
+ pWin->valdata->before.resized = TRUE;
+ }
+ }
+
+ /*
+ * Use REGION_BREAK to avoid optimizations in ValidateTree
+ * that assume the root borderClip can't change well, normally
+ * it doesn't...)
+ */
+ if (enable)
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pScreen->width;
+ box.y2 = pScreen->height;
+ REGION_RESET(pScreen, &pWin->borderClip, &box);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+ else
+ {
+ REGION_EMPTY(pScreen, &pWin->borderClip);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+
+ ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
+
+ if (WasViewable)
+ {
+ if (pWin->backStorage)
+ {
+ pOldClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pOldClip, &pWin->clipList);
+ }
+
+ if (pWin->firstChild)
+ {
+ anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
+ pWin->firstChild,
+ (WindowPtr *)NULL);
+ }
+ else
+ {
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ }
+
+
+ if (anyMarked)
+ (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
+ }
+
+ if (pWin->backStorage &&
+ ((pWin->backingStore == Always) || WasViewable))
+ {
+ if (!WasViewable)
+ pOldClip = &pWin->clipList; /* a convenient empty region */
+ bsExposed = (*pScreen->TranslateBackingStore)
+ (pWin, 0, 0, pOldClip,
+ pWin->drawable.x, pWin->drawable.y);
+ if (WasViewable)
+ REGION_DESTROY(pScreen, pOldClip);
+ if (bsExposed)
+ {
+ RegionPtr valExposed = NullRegion;
+
+ if (pWin->valdata)
+ valExposed = &pWin->valdata->after.exposed;
+ (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
+ if (valExposed)
+ REGION_EMPTY(pScreen, valExposed);
+ REGION_DESTROY(pScreen, bsExposed);
+ }
+ }
+ if (WasViewable)
+ {
+ if (anyMarked)
+ (*pScreen->HandleExposures)(pWin);
+ if (anyMarked && pScreen->PostValidateTree)
+ (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
+ }
+ if (pWin->realized)
+ WindowsRestructured ();
+ FlushAllOutput ();
+}
diff --git a/xorg-server/hw/xquartz/darwin.h b/xorg-server/hw/xquartz/darwin.h index 586044fba..6209b5ef1 100644 --- a/xorg-server/hw/xquartz/darwin.h +++ b/xorg-server/hw/xquartz/darwin.h @@ -1,93 +1,91 @@ -/* - * Copyright (C) 2008 Apple, Inc. - * Copyright (c) 2001-2004 Torrey T. Lyons. 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifndef _DARWIN_H -#define _DARWIN_H - -#include <IOKit/IOTypes.h> -#include "inputstr.h" -#include "scrnintstr.h" -#include <X11/extensions/XKB.h> -#include <assert.h> - -#include "threadSafety.h" - -#include "darwinfb.h" - -// From darwin.c -void DarwinPrintBanner(void); -int DarwinParseModifierList(const char *constmodifiers, int separatelr); -void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); -void xf86SetRootClip (ScreenPtr pScreen, int enable); - -#define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \ - dixLookupPrivate(&pScreen->devPrivates, darwinScreenKey)) - -/* - * Global variables from darwin.c - */ -extern DevPrivateKey darwinScreenKey; // index into pScreen.devPrivates -extern int darwinScreensFound; -extern io_connect_t darwinParamConnect; -extern int darwinEventReadFD; -extern int darwinEventWriteFD; -extern DeviceIntPtr darwinPointer; -extern DeviceIntPtr darwinTabletCurrent; -extern DeviceIntPtr darwinTabletCursor; -extern DeviceIntPtr darwinTabletStylus; -extern DeviceIntPtr darwinTabletEraser; -extern DeviceIntPtr darwinKeyboard; - -// User preferences -extern int darwinMouseAccelChange; -extern int darwinFakeButtons; -extern int darwinFakeMouse2Mask; -extern int darwinFakeMouse3Mask; -extern unsigned int darwinAppKitModMask; -extern unsigned int windowItemModMask; -extern int darwinSyncKeymap; -extern unsigned int darwinDesiredWidth, darwinDesiredHeight; -extern int darwinDesiredDepth; -extern int darwinDesiredRefresh; - -// location of X11's (0,0) point in global screen coordinates -extern int darwinMainScreenX; -extern int darwinMainScreenY; - -#define ENABLE_DEBUG_LOG 1 - -#ifdef ENABLE_DEBUG_LOG -extern FILE *debug_log_fp; -#define DEBUG_LOG_NAME "x11-debug.txt" -#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%s:%d " msg, threadSafetyID(pthread_self()), __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp); -#else -#define DEBUG_LOG(msg, args...) -#endif - -#define TRACE() DEBUG_LOG("\n") - -#endif /* _DARWIN_H */ +/*
+ * Copyright (C) 2008 Apple, Inc.
+ * Copyright (c) 2001-2004 Torrey T. Lyons. 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef _DARWIN_H
+#define _DARWIN_H
+
+#include <IOKit/IOTypes.h>
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include <X11/extensions/XKB.h>
+#include <assert.h>
+
+#include "threadSafety.h"
+
+#include "darwinfb.h"
+
+// From darwin.c
+void DarwinPrintBanner(void);
+int DarwinParseModifierList(const char *constmodifiers, int separatelr);
+void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
+void xf86SetRootClip (ScreenPtr pScreen, int enable);
+
+#define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \
+ dixLookupPrivate(&pScreen->devPrivates, darwinScreenKey))
+
+/*
+ * Global variables from darwin.c
+ */
+extern DevPrivateKey darwinScreenKey; // index into pScreen.devPrivates
+extern int darwinScreensFound;
+extern io_connect_t darwinParamConnect;
+extern int darwinEventReadFD;
+extern int darwinEventWriteFD;
+extern DeviceIntPtr darwinPointer;
+extern DeviceIntPtr darwinTabletCurrent;
+extern DeviceIntPtr darwinTabletCursor;
+extern DeviceIntPtr darwinTabletStylus;
+extern DeviceIntPtr darwinTabletEraser;
+extern DeviceIntPtr darwinKeyboard;
+
+// User preferences
+extern int darwinMouseAccelChange;
+extern int darwinFakeButtons;
+extern int darwinFakeMouse2Mask;
+extern int darwinFakeMouse3Mask;
+extern unsigned int darwinAppKitModMask;
+extern unsigned int windowItemModMask;
+extern int darwinSyncKeymap;
+extern int darwinDesiredDepth;
+
+// location of X11's (0,0) point in global screen coordinates
+extern int darwinMainScreenX;
+extern int darwinMainScreenY;
+
+#define ENABLE_DEBUG_LOG 1
+
+#ifdef ENABLE_DEBUG_LOG
+extern FILE *debug_log_fp;
+#define DEBUG_LOG_NAME "x11-debug.txt"
+#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%s:%d " msg, threadSafetyID(pthread_self()), __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp);
+#else
+#define DEBUG_LOG(msg, args...)
+#endif
+
+#define TRACE() DEBUG_LOG("\n")
+
+#endif /* _DARWIN_H */
diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c index 22a727e67..44067862f 100644 --- a/xorg-server/hw/xquartz/xpr/xprScreen.c +++ b/xorg-server/hw/xquartz/xpr/xprScreen.c @@ -1,440 +1,453 @@ -/* - * Xplugin rootless implementation screen functions - * - * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. - * Copyright (c) 2004 Torrey T. Lyons. 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#include "sanitizedCarbon.h" - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "quartzCommon.h" -#include "inputstr.h" -#include "quartz.h" -#include "xpr.h" -#include "xprEvent.h" -#include "pseudoramiX.h" -#include "darwin.h" -#include "darwinEvents.h" -#include "rootless.h" -#include "dri.h" -#include "globals.h" -#include <Xplugin.h> -#include "applewmExt.h" -#include "micmap.h" - -#include "rootlessCommon.h" - -#ifdef DAMAGE -# include "damage.h" -#endif - -/* 10.4's deferred update makes X slower.. have to live with the tearing - for now.. */ -#define XP_NO_DEFERRED_UPDATES 8 - -// Name of GLX bundle for native OpenGL -static const char *xprOpenGLBundle = "glxCGL.bundle"; - -/* - * eventHandler - * Callback handler for Xplugin events. - */ -static void eventHandler(unsigned int type, const void *arg, - unsigned int arg_size, void *data) { - - switch (type) { - case XP_EVENT_DISPLAY_CHANGED: - DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n"); - DarwinSendDDXEvent(kXquartzDisplayChanged, 0); - break; - - case XP_EVENT_WINDOW_STATE_CHANGED: - if (arg_size >= sizeof(xp_window_state_event)) { - const xp_window_state_event *ws_arg = arg; - - DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: id=%d, state=%d\n", ws_arg->id, ws_arg->state); - DarwinSendDDXEvent(kXquartzWindowState, 2, - ws_arg->id, ws_arg->state); - } else { - DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n"); - } - break; - - case XP_EVENT_WINDOW_MOVED: - DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n"); - if (arg_size == sizeof(xp_window_id)) { - xp_window_id id = * (xp_window_id *) arg; - DarwinSendDDXEvent(kXquartzWindowMoved, 1, id); - } - break; - - case XP_EVENT_SURFACE_DESTROYED: - DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n"); - case XP_EVENT_SURFACE_CHANGED: - DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n"); - if (arg_size == sizeof(xp_surface_id)) { - int kind; - - if (type == XP_EVENT_SURFACE_DESTROYED) - kind = AppleDRISurfaceNotifyDestroyed; - else - kind = AppleDRISurfaceNotifyChanged; - - DRISurfaceNotify(*(xp_surface_id *) arg, kind); - } - break; -#ifdef XP_EVENT_SPACE_CHANGED - case XP_EVENT_SPACE_CHANGED: - DEBUG_LOG("XP_EVENT_SPACE_CHANGED\n"); - if(arg_size == sizeof(uint32_t)) { - uint32_t space_id = *(uint32_t *)arg; - DarwinSendDDXEvent(kXquartzSpaceChanged, 1, space_id); - } - break; -#endif - default: - ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type); - } -} - -/* - * displayAtIndex - * Return the display ID for a particular display index. - */ -static CGDirectDisplayID -displayAtIndex(int index) -{ - CGError err; - CGDisplayCount cnt; - CGDirectDisplayID dpy[index+1]; - - err = CGGetActiveDisplayList(index + 1, dpy, &cnt); - if (err == kCGErrorSuccess && cnt == index + 1) - return dpy[index]; - else - return kCGNullDirectDisplay; -} - -/* - * displayScreenBounds - * Return the bounds of a particular display. - */ -static CGRect -displayScreenBounds(CGDirectDisplayID id) -{ - CGRect frame; - - frame = CGDisplayBounds(id); - - DEBUG_LOG(" %dx%d @ (%d,%d).\n", - (int)frame.size.width, (int)frame.size.height, - (int)frame.origin.x, (int)frame.origin.y); - - /* Remove menubar to help standard X11 window managers. */ - if (quartzEnableRootless && - frame.origin.x == 0 && frame.origin.y == 0) { - frame.origin.y += aquaMenuBarHeight; - frame.size.height -= aquaMenuBarHeight; - } - - DEBUG_LOG(" %dx%d @ (%d,%d).\n", - (int)frame.size.width, (int)frame.size.height, - (int)frame.origin.x, (int)frame.origin.y); - - return frame; -} - -/* - * xprAddPseudoramiXScreens - * Add a single virtual screen encompassing all the physical screens - * with PseudoramiX. - */ -static void -xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) -{ - CGDisplayCount i, displayCount; - CGDirectDisplayID *displayList = NULL; - CGRect unionRect = CGRectNull, frame; - - // Find all the CoreGraphics displays - CGGetActiveDisplayList(0, NULL, &displayCount); - displayList = xalloc(displayCount * sizeof(CGDirectDisplayID)); - CGGetActiveDisplayList(displayCount, displayList, &displayCount); - - /* Get the union of all screens */ - for (i = 0; i < displayCount; i++) { - CGDirectDisplayID dpy = displayList[i]; - frame = displayScreenBounds(dpy); - unionRect = CGRectUnion(unionRect, frame); - } - - /* Use unionRect as the screen size for the X server. */ - *x = unionRect.origin.x; - *y = unionRect.origin.y; - *width = unionRect.size.width; - *height = unionRect.size.height; - - DEBUG_LOG(" screen union origin: (%d,%d) size: (%d,%d).\n", - *x, *y, *width, *height); - - /* Tell PseudoramiX about the real screens. */ - for (i = 0; i < displayCount; i++) - { - CGDirectDisplayID dpy = displayList[i]; - - frame = displayScreenBounds(dpy); - frame.origin.x -= unionRect.origin.x; - frame.origin.y -= unionRect.origin.y; - - DEBUG_LOG(" placed at X11 coordinate (%d,%d).\n", - (int)frame.origin.x, (int)frame.origin.y); - - PseudoramiXAddScreen(frame.origin.x, frame.origin.y, - frame.size.width, frame.size.height); - } - - xfree(displayList); -} - -/* - * xprDisplayInit - * Find number of CoreGraphics displays and initialize Xplugin. - */ -static void -xprDisplayInit(void) -{ - CGDisplayCount displayCount; - - DEBUG_LOG(""); - - CGGetActiveDisplayList(0, NULL, &displayCount); - - /* With PseudoramiX, the X server only sees one screen; only PseudoramiX - itself knows about all of the screens. */ - - if (noPseudoramiXExtension) - darwinScreensFound = displayCount; - else - darwinScreensFound = 1; - - if (xp_init(XP_BACKGROUND_EVENTS | XP_NO_DEFERRED_UPDATES) != Success) - FatalError("Could not initialize the Xplugin library."); - - xp_select_events(XP_EVENT_DISPLAY_CHANGED - | XP_EVENT_WINDOW_STATE_CHANGED - | XP_EVENT_WINDOW_MOVED -#ifdef XP_EVENT_SPACE_CHANGED - | XP_EVENT_SPACE_CHANGED -#endif - | XP_EVENT_SURFACE_CHANGED - | XP_EVENT_SURFACE_DESTROYED, - eventHandler, NULL); - - AppleDRIExtensionInit(); - xprAppleWMInit(); - - if (!quartzEnableRootless) - RootlessHideAllWindows(); -} - -/* - * xprAddScreen - * Init the framebuffer and record pixmap parameters for the screen. - */ -static Bool -xprAddScreen(int index, ScreenPtr pScreen) -{ - DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); - int depth = darwinDesiredDepth; - - DEBUG_LOG("index=%d depth=%d\n", index, depth); - - if(depth == -1) { - depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay); - } - - switch(depth) { - case 8: // pseudo-working - dfb->visuals = PseudoColorMask; - dfb->preferredCVC = PseudoColor; - dfb->depth = 8; - dfb->bitsPerRGB = 8; - dfb->bitsPerPixel = 8; - dfb->redMask = 0; - dfb->greenMask = 0; - dfb->blueMask = 0; - break; - case 15: - dfb->visuals = TrueColorMask; //LARGE_VISUALS; - dfb->preferredCVC = TrueColor; - dfb->depth = 15; - dfb->bitsPerRGB = 5; - dfb->bitsPerPixel = 16; - dfb->redMask = RM_ARGB(0,5,5,5); - dfb->greenMask = GM_ARGB(0,5,5,5); - dfb->blueMask = BM_ARGB(0,5,5,5); - break; -// case 24: - default: - if(depth != 24) - ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n", darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay)); - dfb->visuals = TrueColorMask; //LARGE_VISUALS; - dfb->preferredCVC = TrueColor; - dfb->depth = 24; - dfb->bitsPerRGB = 8; - dfb->bitsPerPixel = 32; - dfb->redMask = RM_ARGB(0,8,8,8); - dfb->greenMask = GM_ARGB(0,8,8,8); - dfb->blueMask = BM_ARGB(0,8,8,8); - break; - } - - if (noPseudoramiXExtension) - { - CGDirectDisplayID dpy; - CGRect frame; - - ErrorF("Warning: noPseudoramiXExtension!\n"); - - dpy = displayAtIndex(index); - - frame = displayScreenBounds(dpy); - - dfb->x = frame.origin.x; - dfb->y = frame.origin.y; - dfb->width = frame.size.width; - dfb->height = frame.size.height; - } - else - { - xprAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height); - } - - /* Passing zero width (pitch) makes miCreateScreenResources set the - screen pixmap to the framebuffer pointer, i.e. NULL. The generic - rootless code takes care of making this work. */ - dfb->pitch = 0; - dfb->framebuffer = NULL; - - DRIScreenInit(pScreen); - - return TRUE; -} - -/* - * xprSetupScreen - * Setup the screen for rootless access. - */ -static Bool -xprSetupScreen(int index, ScreenPtr pScreen) -{ - // Initialize accelerated rootless drawing - // Note that this must be done before DamageSetup(). - - // These are crashing ugly... better to be stable and not crash for now. - //RootlessAccelInit(pScreen); - -#ifdef DAMAGE - // The Damage extension needs to wrap underneath the - // generic rootless layer, so do it now. - if (!DamageSetup(pScreen)) - return FALSE; -#endif - - // Initialize generic rootless code - if (!xprInit(pScreen)) - return FALSE; - - return DRIFinishScreenInit(pScreen); -} - -/* - * xprUpdateScreen - * Update screen after configuation change. - */ -static void -xprUpdateScreen(ScreenPtr pScreen) -{ - rootlessGlobalOffsetX = darwinMainScreenX; - rootlessGlobalOffsetY = darwinMainScreenY; - - AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]); - - RootlessRepositionWindows(pScreen); - RootlessUpdateScreenPixmap(pScreen); -} - -/* - * xprInitInput - * Finalize xpr specific setup. - */ -static void -xprInitInput(int argc, char **argv) -{ - int i; - - rootlessGlobalOffsetX = darwinMainScreenX; - rootlessGlobalOffsetY = darwinMainScreenY; - - for (i = 0; i < screenInfo.numScreens; i++) - AppleWMSetScreenOrigin(WindowTable[i]); -} - -/* - * Quartz display mode function list. - */ -static QuartzModeProcsRec xprModeProcs = { - xprDisplayInit, - xprAddScreen, - xprSetupScreen, - xprInitInput, - QuartzInitCursor, - QuartzSuspendXCursor, - QuartzResumeXCursor, - xprAddPseudoramiXScreens, - xprUpdateScreen, - xprIsX11Window, - xprHideWindows, - RootlessFrameForWindow, - TopLevelParent, - DRICreateSurface, - DRIDestroySurface -}; - -/* - * QuartzModeBundleInit - * Initialize the display mode bundle after loading. - */ -Bool -QuartzModeBundleInit(void) -{ - quartzProcs = &xprModeProcs; - quartzOpenGLBundle = xprOpenGLBundle; - return TRUE; -} +/*
+ * Xplugin rootless implementation screen functions
+ *
+ * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 2004 Torrey T. Lyons. 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#include "sanitizedCarbon.h"
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "inputstr.h"
+#include "quartz.h"
+#include "xpr.h"
+#include "xprEvent.h"
+#include "pseudoramiX.h"
+#include "darwin.h"
+#include "darwinEvents.h"
+#include "rootless.h"
+#include "dri.h"
+#include "globals.h"
+#include <Xplugin.h>
+#include "applewmExt.h"
+#include "micmap.h"
+
+#include "rootlessCommon.h"
+
+#ifdef DAMAGE
+# include "damage.h"
+#endif
+
+/* 10.4's deferred update makes X slower.. have to live with the tearing
+ for now.. */
+#define XP_NO_DEFERRED_UPDATES 8
+
+// Name of GLX bundle for native OpenGL
+static const char *xprOpenGLBundle = "glxCGL.bundle";
+
+/*
+ * eventHandler
+ * Callback handler for Xplugin events.
+ */
+static void eventHandler(unsigned int type, const void *arg,
+ unsigned int arg_size, void *data) {
+
+ switch (type) {
+ case XP_EVENT_DISPLAY_CHANGED:
+ DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n");
+ DarwinSendDDXEvent(kXquartzDisplayChanged, 0);
+ break;
+
+ case XP_EVENT_WINDOW_STATE_CHANGED:
+ if (arg_size >= sizeof(xp_window_state_event)) {
+ const xp_window_state_event *ws_arg = arg;
+
+ DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: id=%d, state=%d\n", ws_arg->id, ws_arg->state);
+ DarwinSendDDXEvent(kXquartzWindowState, 2,
+ ws_arg->id, ws_arg->state);
+ } else {
+ DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n");
+ }
+ break;
+
+ case XP_EVENT_WINDOW_MOVED:
+ DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
+ if (arg_size == sizeof(xp_window_id)) {
+ xp_window_id id = * (xp_window_id *) arg;
+ DarwinSendDDXEvent(kXquartzWindowMoved, 1, id);
+ }
+ break;
+
+ case XP_EVENT_SURFACE_DESTROYED:
+ DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
+ case XP_EVENT_SURFACE_CHANGED:
+ DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n");
+ if (arg_size == sizeof(xp_surface_id)) {
+ int kind;
+
+ if (type == XP_EVENT_SURFACE_DESTROYED)
+ kind = AppleDRISurfaceNotifyDestroyed;
+ else
+ kind = AppleDRISurfaceNotifyChanged;
+
+ DRISurfaceNotify(*(xp_surface_id *) arg, kind);
+ }
+ break;
+#ifdef XP_EVENT_SPACE_CHANGED
+ case XP_EVENT_SPACE_CHANGED:
+ DEBUG_LOG("XP_EVENT_SPACE_CHANGED\n");
+ if(arg_size == sizeof(uint32_t)) {
+ uint32_t space_id = *(uint32_t *)arg;
+ DarwinSendDDXEvent(kXquartzSpaceChanged, 1, space_id);
+ }
+ break;
+#endif
+ default:
+ ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type);
+ }
+}
+
+/*
+ * displayAtIndex
+ * Return the display ID for a particular display index.
+ */
+static CGDirectDisplayID
+displayAtIndex(int index)
+{
+ CGError err;
+ CGDisplayCount cnt;
+ CGDirectDisplayID dpy[index+1];
+
+ err = CGGetActiveDisplayList(index + 1, dpy, &cnt);
+ if (err == kCGErrorSuccess && cnt == index + 1)
+ return dpy[index];
+ else
+ return kCGNullDirectDisplay;
+}
+
+/*
+ * displayScreenBounds
+ * Return the bounds of a particular display.
+ */
+static CGRect
+displayScreenBounds(CGDirectDisplayID id)
+{
+ CGRect frame;
+
+ frame = CGDisplayBounds(id);
+
+ DEBUG_LOG(" %dx%d @ (%d,%d).\n",
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y);
+
+ /* Remove menubar to help standard X11 window managers. */
+ if (quartzEnableRootless &&
+ frame.origin.x == 0 && frame.origin.y == 0) {
+ frame.origin.y += aquaMenuBarHeight;
+ frame.size.height -= aquaMenuBarHeight;
+ }
+
+ DEBUG_LOG(" %dx%d @ (%d,%d).\n",
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y);
+
+ return frame;
+}
+
+/*
+ * xprAddPseudoramiXScreens
+ * Add a single virtual screen encompassing all the physical screens
+ * with PseudoramiX.
+ */
+static void
+xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
+{
+ CGDisplayCount i, displayCount;
+ CGDirectDisplayID *displayList = NULL;
+ CGRect unionRect = CGRectNull, frame;
+
+ // Find all the CoreGraphics displays
+ CGGetActiveDisplayList(0, NULL, &displayCount);
+ DEBUG_LOG("displayCount: %d\n", (int)displayCount);
+
+ if(!displayCount) {
+ ErrorF("CoreGraphics has reported no connected displays. Creating a stub 800x600 display.\n");
+ *x = *y = 0;
+ *width = 800;
+ *height = 600;
+ PseudoramiXAddScreen(*x, *y, *width, *height);
+ return;
+ }
+
+ displayList = xalloc(displayCount * sizeof(CGDirectDisplayID));
+ if(!displayList)
+ FatalError("Unable to allocate memory for list of displays.\n");
+ CGGetActiveDisplayList(displayCount, displayList, &displayCount);
+
+ /* Get the union of all screens */
+ for (i = 0; i < displayCount; i++) {
+ CGDirectDisplayID dpy = displayList[i];
+ frame = displayScreenBounds(dpy);
+ unionRect = CGRectUnion(unionRect, frame);
+ }
+
+ /* Use unionRect as the screen size for the X server. */
+ *x = unionRect.origin.x;
+ *y = unionRect.origin.y;
+ *width = unionRect.size.width;
+ *height = unionRect.size.height;
+
+ DEBUG_LOG(" screen union origin: (%d,%d) size: (%d,%d).\n",
+ *x, *y, *width, *height);
+
+ /* Tell PseudoramiX about the real screens. */
+ for (i = 0; i < displayCount; i++)
+ {
+ CGDirectDisplayID dpy = displayList[i];
+
+ frame = displayScreenBounds(dpy);
+ frame.origin.x -= unionRect.origin.x;
+ frame.origin.y -= unionRect.origin.y;
+
+ DEBUG_LOG(" placed at X11 coordinate (%d,%d).\n",
+ (int)frame.origin.x, (int)frame.origin.y);
+
+ PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
+ frame.size.width, frame.size.height);
+ }
+
+ xfree(displayList);
+}
+
+/*
+ * xprDisplayInit
+ * Find number of CoreGraphics displays and initialize Xplugin.
+ */
+static void
+xprDisplayInit(void)
+{
+ CGDisplayCount displayCount;
+
+ DEBUG_LOG("");
+
+ CGGetActiveDisplayList(0, NULL, &displayCount);
+
+ /* With PseudoramiX, the X server only sees one screen; only PseudoramiX
+ itself knows about all of the screens. */
+
+ if (noPseudoramiXExtension)
+ darwinScreensFound = displayCount;
+ else
+ darwinScreensFound = 1;
+
+ if (xp_init(XP_BACKGROUND_EVENTS | XP_NO_DEFERRED_UPDATES) != Success)
+ FatalError("Could not initialize the Xplugin library.");
+
+ xp_select_events(XP_EVENT_DISPLAY_CHANGED
+ | XP_EVENT_WINDOW_STATE_CHANGED
+ | XP_EVENT_WINDOW_MOVED
+#ifdef XP_EVENT_SPACE_CHANGED
+ | XP_EVENT_SPACE_CHANGED
+#endif
+ | XP_EVENT_SURFACE_CHANGED
+ | XP_EVENT_SURFACE_DESTROYED,
+ eventHandler, NULL);
+
+ AppleDRIExtensionInit();
+ xprAppleWMInit();
+
+ if (!quartzEnableRootless)
+ RootlessHideAllWindows();
+}
+
+/*
+ * xprAddScreen
+ * Init the framebuffer and record pixmap parameters for the screen.
+ */
+static Bool
+xprAddScreen(int index, ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ int depth = darwinDesiredDepth;
+
+ DEBUG_LOG("index=%d depth=%d\n", index, depth);
+
+ if(depth == -1) {
+ depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ }
+
+ switch(depth) {
+ case 8: // pseudo-working
+ dfb->visuals = PseudoColorMask;
+ dfb->preferredCVC = PseudoColor;
+ dfb->depth = 8;
+ dfb->bitsPerRGB = 8;
+ dfb->bitsPerPixel = 8;
+ dfb->redMask = 0;
+ dfb->greenMask = 0;
+ dfb->blueMask = 0;
+ break;
+ case 15:
+ dfb->visuals = TrueColorMask; //LARGE_VISUALS;
+ dfb->preferredCVC = TrueColor;
+ dfb->depth = 15;
+ dfb->bitsPerRGB = 5;
+ dfb->bitsPerPixel = 16;
+ dfb->redMask = RM_ARGB(0,5,5,5);
+ dfb->greenMask = GM_ARGB(0,5,5,5);
+ dfb->blueMask = BM_ARGB(0,5,5,5);
+ break;
+// case 24:
+ default:
+ if(depth != 24)
+ ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n", darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay));
+ dfb->visuals = TrueColorMask; //LARGE_VISUALS;
+ dfb->preferredCVC = TrueColor;
+ dfb->depth = 24;
+ dfb->bitsPerRGB = 8;
+ dfb->bitsPerPixel = 32;
+ dfb->redMask = RM_ARGB(0,8,8,8);
+ dfb->greenMask = GM_ARGB(0,8,8,8);
+ dfb->blueMask = BM_ARGB(0,8,8,8);
+ break;
+ }
+
+ if (noPseudoramiXExtension)
+ {
+ CGDirectDisplayID dpy;
+ CGRect frame;
+
+ ErrorF("Warning: noPseudoramiXExtension!\n");
+
+ dpy = displayAtIndex(index);
+
+ frame = displayScreenBounds(dpy);
+
+ dfb->x = frame.origin.x;
+ dfb->y = frame.origin.y;
+ dfb->width = frame.size.width;
+ dfb->height = frame.size.height;
+ }
+ else
+ {
+ xprAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
+ }
+
+ /* Passing zero width (pitch) makes miCreateScreenResources set the
+ screen pixmap to the framebuffer pointer, i.e. NULL. The generic
+ rootless code takes care of making this work. */
+ dfb->pitch = 0;
+ dfb->framebuffer = NULL;
+
+ DRIScreenInit(pScreen);
+
+ return TRUE;
+}
+
+/*
+ * xprSetupScreen
+ * Setup the screen for rootless access.
+ */
+static Bool
+xprSetupScreen(int index, ScreenPtr pScreen)
+{
+ // Initialize accelerated rootless drawing
+ // Note that this must be done before DamageSetup().
+
+ // These are crashing ugly... better to be stable and not crash for now.
+ //RootlessAccelInit(pScreen);
+
+#ifdef DAMAGE
+ // The Damage extension needs to wrap underneath the
+ // generic rootless layer, so do it now.
+ if (!DamageSetup(pScreen))
+ return FALSE;
+#endif
+
+ // Initialize generic rootless code
+ if (!xprInit(pScreen))
+ return FALSE;
+
+ return DRIFinishScreenInit(pScreen);
+}
+
+/*
+ * xprUpdateScreen
+ * Update screen after configuation change.
+ */
+static void
+xprUpdateScreen(ScreenPtr pScreen)
+{
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]);
+
+ RootlessRepositionWindows(pScreen);
+ RootlessUpdateScreenPixmap(pScreen);
+}
+
+/*
+ * xprInitInput
+ * Finalize xpr specific setup.
+ */
+static void
+xprInitInput(int argc, char **argv)
+{
+ int i;
+
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ AppleWMSetScreenOrigin(WindowTable[i]);
+}
+
+/*
+ * Quartz display mode function list.
+ */
+static QuartzModeProcsRec xprModeProcs = {
+ xprDisplayInit,
+ xprAddScreen,
+ xprSetupScreen,
+ xprInitInput,
+ QuartzInitCursor,
+ QuartzSuspendXCursor,
+ QuartzResumeXCursor,
+ xprAddPseudoramiXScreens,
+ xprUpdateScreen,
+ xprIsX11Window,
+ xprHideWindows,
+ RootlessFrameForWindow,
+ TopLevelParent,
+ DRICreateSurface,
+ DRIDestroySurface
+};
+
+/*
+ * QuartzModeBundleInit
+ * Initialize the display mode bundle after loading.
+ */
+Bool
+QuartzModeBundleInit(void)
+{
+ quartzProcs = &xprModeProcs;
+ quartzOpenGLBundle = xprOpenGLBundle;
+ return TRUE;
+}
diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in index 84c78db54..7907b0a25 100644 --- a/xorg-server/include/dix-config.h.in +++ b/xorg-server/include/dix-config.h.in @@ -1,454 +1,451 @@ -/* dix-config.h.in: not at all generated. -*- c -*- */ - -#ifndef _DIX_CONFIG_H_ -#define _DIX_CONFIG_H_ - -/* Support BigRequests extension */ -#undef BIGREQS - -/* Builder address */ -#undef BUILDERADDR - -/* Operating System Name */ -#undef OSNAME - -/* Operating System Vendor */ -#undef OSVENDOR - -/* Builder string */ -#undef BUILDERSTRING - -/* Default font path */ -#undef COMPILEDDEFAULTFONTPATH - -/* Miscellaneous server configuration files path */ -#undef SERVER_MISC_CONFIG_PATH - -/* Support Composite Extension */ -#undef COMPOSITE - -/* Support Damage extension */ -#undef DAMAGE - -/* Build for darwin with Quartz support */ -#undef DARWIN_WITH_QUARTZ - -/* Use OsVendorVErrorF */ -#undef DDXOSVERRORF - -/* Use ddxBeforeReset */ -#undef DDXBEFORERESET - -/* Build DPMS extension */ -#undef DPMSExtension - -/* Build GLX extension */ -#undef GLXEXT - -/* Build GLX DRI loader */ -#undef GLX_DRI - -/* Path to DRI drivers */ -#undef DRI_DRIVER_PATH - -/* Support XDM-AUTH*-1 */ -#undef HASXDMAUTH - -/* Define to 1 if you have the `getdtablesize' function. */ -#undef HAS_GETDTABLESIZE - -/* Define to 1 if you have the `getifaddrs' function. */ -#undef HAS_GETIFADDRS - -/* Define to 1 if you have the `getpeereid' function. */ -#undef HAS_GETPEEREID - -/* Define to 1 if you have the `getpeerucred' function. */ -#undef HAS_GETPEERUCRED - -/* Define to 1 if you have the `mmap' function. */ -#undef HAS_MMAP - -/* Support SHM */ -#undef HAS_SHM - -/* Have the 'strlcpy' function */ -#undef HAS_STRLCPY - -/* Define to 1 if you have the <asm/mtrr.h> header file. */ -#undef HAVE_ASM_MTRR_H - -/* Has backtrace support */ -#undef HAVE_BACKTRACE - -/* Define to 1 if you have the <byteswap.h> header file. */ -#undef HAVE_BYTESWAP_H - -/* Define to 1 if you have cbrt */ -#undef HAVE_CBRT - -/* Define to 1 if you have the <dbm.h> header file. */ -#undef HAVE_DBM_H - -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Have execinfo.h */ -#undef HAVE_EXECINFO_H - -/* Define to 1 if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define to 1 if you have the `getisax' function. */ -#undef HAVE_GETISAX - -/* Define to 1 if you have the `getuid' function. */ -#undef HAVE_GETUID - -/* Define to 1 if you have the `getzoneid' function. */ -#undef HAVE_GETZONEID - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Have Quartz */ -#undef XQUARTZ - -/* Support application updating through sparkle. */ -#undef XQUARTZ_SPARKLE - -/* Prefix to use for launchd identifiers */ -#undef LAUNCHD_ID_PREFIX - -/* Build a standalone xpbproxy */ -#undef STANDALONE_XPBPROXY - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `link' function. */ -#undef HAVE_LINK - -/* Define to 1 if you have the <linux/agpgart.h> header file. */ -#undef HAVE_LINUX_AGPGART_H - -/* Define to 1 if you have the <linux/apm_bios.h> header file. */ -#undef HAVE_LINUX_APM_BIOS_H - -/* Define to 1 if you have the <linux/fb.h> header file. */ -#undef HAVE_LINUX_FB_H - -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP - -/* Define to 1 if you have the <ndbm.h> header file. */ -#undef HAVE_NDBM_H - -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */ -#undef HAVE_RPCSVC_DBM_H - -/* Define to use libc SHA1 functions */ -#undef HAVE_SHA1_IN_LIBC - -/* Define to use CommonCrypto SHA1 functions */ -#undef HAVE_SHA1_IN_COMMONCRYPTO - -/* Define to use libmd SHA1 functions */ -#undef HAVE_SHA1_IN_LIBMD - -/* Define to use libgcrypt SHA1 functions */ -#undef HAVE_SHA1_IN_LIBGCRYPT - -/* Define to use libsha1 for SHA1 */ -#undef HAVE_SHA1_IN_LIBSHA1 - -/* Define to 1 if you have the `shmctl64' function. */ -#undef HAVE_SHMCTL64 - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if SYSV IPC is available */ -#undef HAVE_SYSV_IPC - -/* Define to 1 if you have the <sys/agpio.h> header file. */ -#undef HAVE_SYS_AGPIO_H - -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the <sys/io.h> header file. */ -#undef HAVE_SYS_IO_H - -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <sys/vm86.h> header file. */ -#undef HAVE_SYS_VM86_H - -/* Define to 1 if you have the <tslib.h> header file. */ -#undef HAVE_TSLIB_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the <fnmatch.h> header file. */ -#undef HAVE_FNMATCH_H - -/* Have /dev/urandom */ -#undef HAVE_URANDOM - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Support IPv6 for TCP connections */ -#undef IPv6 - -/* Support os-specific local connections */ -#undef LOCALCONN - -/* Support MIT-SHM Extension */ -#undef MITSHM - -/* Enable some debugging code */ -#undef DEBUG - -/* Name of package */ -#undef PACKAGE - -/* Internal define for Xinerama */ -#undef PANORAMIX - -/* Overall prefix */ -#undef PROJECTROOT - -/* Support RANDR extension */ -#undef RANDR - -/* Support Record extension */ -#undef XRECORD - -/* Support RENDER extension */ -#undef RENDER - -/* Support X resource extension */ -#undef RES - -/* Support MIT-SCREEN-SAVER extension */ -#undef SCREENSAVER - -/* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */ -#undef SECURE_RPC - -/* Support SHAPE extension */ -#undef SHAPE - -/* Define to 1 on systems derived from System V Release 4 */ -#undef SVR4 - -/* Support TCP socket connections */ -#undef TCPCONN - -/* Enable touchscreen support */ -#undef TOUCHSCREEN - -/* Support tslib touchscreen abstraction library */ -#undef TSLIB - -/* Support UNIX socket connections */ -#undef UNIXCONN - -/* Define to use byteswap macros from <sys/endian.h> */ -#undef USE_SYS_ENDIAN_H - -/* unaligned word accesses behave as expected */ -#undef WORKING_UNALIGNED_INT - -/* Build X string registry */ -#undef XREGISTRY - -/* Build X-ACE extension */ -#undef XACE - -/* Build SELinux extension */ -#undef XSELINUX - -/* Support XCMisc extension */ -#undef XCMISC - -/* Build Security extension */ -#undef XCSECURITY - -/* Support Xdmcp */ -#undef XDMCP - -/* Build XFree86 BigFont extension */ -#undef XF86BIGFONT - -/* Support XFree86 Video Mode extension */ -#undef XF86VIDMODE - -/* Support XFixes extension */ -#undef XFIXES - -/* Build XDGA support */ -#undef XFreeXDGA - -/* Support Xinerama extension */ -#undef XINERAMA - -/* Vendor release */ -#undef XORG_RELEASE - -/* Current Xorg version */ -#undef XORG_VERSION_CURRENT - -/* Xorg release date */ -#undef XORG_DATE - -/* Build Xv Extension */ -#undef XvExtension - -/* Build XvMC Extension */ -#undef XvMCExtension - -/* Support XSync extension */ -#undef XSYNC - -/* Support XTest extension */ -#undef XTEST - -/* Support Xv extension */ -#undef XV - -/* Build Multibuffer extension */ -#undef MULTIBUFFER - -/* Support DRI extension */ -#undef XF86DRI - -/* Build DRI2 extension */ -#undef DRI2 - -/* Build DBE support */ -#undef DBE - -/* Vendor name */ -#undef XVENDORNAME - -/* Enable GNU and other extensions to the C environment for GLIBC */ -#undef _GNU_SOURCE - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `int' if <sys/types.h> does not define. */ -#undef pid_t - -/* Build Rootless code */ -#undef ROOTLESS - -/* Define to 1 if unsigned long is 64 bits. */ -#undef _XSERVER64 - -/* System is BSD-like */ -#undef CSRG_BASED - -/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */ -#undef BSD44SOCKETS - -/* Support D-Bus */ -#undef HAVE_DBUS - -/* Use libudev for input hotplug */ -#undef CONFIG_UDEV - -/* Use D-Bus for input hotplug */ -#undef CONFIG_NEED_DBUS - -/* Support the D-Bus hotplug API */ -#undef CONFIG_DBUS_API - -/* Support HAL for hotplug */ -#undef CONFIG_HAL - -/* Use only built-in fonts */ -#undef BUILTIN_FONTS - -/* Use an empty root cursor */ -#undef NULL_ROOT_CURSOR - -/* Have a monotonic clock from clock_gettime() */ -#undef MONOTONIC_CLOCK - -/* Define to 1 if the DTrace Xserver provider probes should be built in */ -#undef XSERVER_DTRACE - -/* Define to 16-bit byteswap macro */ -#undef bswap_16 - -/* Define to 32-bit byteswap macro */ -#undef bswap_32 - -/* Define to 64-bit byteswap macro */ -#undef bswap_64 - -/* Need the strcasecmp function. */ -#undef NEED_STRCASECMP - -/* Need the strncasecmp function. */ -#undef NEED_STRNCASECMP - -/* Need the strcasestr function. */ -#undef NEED_STRCASESTR - -/* Define to 1 if you have the `ffs' function. */ -#undef HAVE_FFS - -/* Correctly set _XSERVER64 for OSX fat binaries */ -#ifdef __APPLE__ -#include "dix-config-apple-verbatim.h" -#endif - -#undef HAVE_AVC_NETLINK_ACQUIRE_FD - -#endif /* _DIX_CONFIG_H_ */ +/* dix-config.h.in: not at all generated. -*- c -*- */
+
+#ifndef _DIX_CONFIG_H_
+#define _DIX_CONFIG_H_
+
+/* Support BigRequests extension */
+#undef BIGREQS
+
+/* Builder address */
+#undef BUILDERADDR
+
+/* Operating System Name */
+#undef OSNAME
+
+/* Operating System Vendor */
+#undef OSVENDOR
+
+/* Builder string */
+#undef BUILDERSTRING
+
+/* Default font path */
+#undef COMPILEDDEFAULTFONTPATH
+
+/* Miscellaneous server configuration files path */
+#undef SERVER_MISC_CONFIG_PATH
+
+/* Support Composite Extension */
+#undef COMPOSITE
+
+/* Support Damage extension */
+#undef DAMAGE
+
+/* Build for darwin with Quartz support */
+#undef DARWIN_WITH_QUARTZ
+
+/* Use OsVendorVErrorF */
+#undef DDXOSVERRORF
+
+/* Use ddxBeforeReset */
+#undef DDXBEFORERESET
+
+/* Build DPMS extension */
+#undef DPMSExtension
+
+/* Build GLX extension */
+#undef GLXEXT
+
+/* Build GLX DRI loader */
+#undef GLX_DRI
+
+/* Path to DRI drivers */
+#undef DRI_DRIVER_PATH
+
+/* Support XDM-AUTH*-1 */
+#undef HASXDMAUTH
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAS_GETDTABLESIZE
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAS_GETIFADDRS
+
+/* Define to 1 if you have the `getpeereid' function. */
+#undef HAS_GETPEEREID
+
+/* Define to 1 if you have the `getpeerucred' function. */
+#undef HAS_GETPEERUCRED
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAS_MMAP
+
+/* Support SHM */
+#undef HAS_SHM
+
+/* Have the 'strlcpy' function */
+#undef HAS_STRLCPY
+
+/* Define to 1 if you have the <asm/mtrr.h> header file. */
+#undef HAVE_ASM_MTRR_H
+
+/* Has backtrace support */
+#undef HAVE_BACKTRACE
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+#undef HAVE_BYTESWAP_H
+
+/* Define to 1 if you have cbrt */
+#undef HAVE_CBRT
+
+/* Define to 1 if you have the <dbm.h> header file. */
+#undef HAVE_DBM_H
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Have execinfo.h */
+#undef HAVE_EXECINFO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define to 1 if you have the `getisax' function. */
+#undef HAVE_GETISAX
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define to 1 if you have the `getzoneid' function. */
+#undef HAVE_GETZONEID
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Have Quartz */
+#undef XQUARTZ
+
+/* Support application updating through sparkle. */
+#undef XQUARTZ_SPARKLE
+
+/* Prefix to use for launchd identifiers */
+#undef LAUNCHD_ID_PREFIX
+
+/* Build a standalone xpbproxy */
+#undef STANDALONE_XPBPROXY
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the `link' function. */
+#undef HAVE_LINK
+
+/* Define to 1 if you have the <linux/agpgart.h> header file. */
+#undef HAVE_LINUX_AGPGART_H
+
+/* Define to 1 if you have the <linux/apm_bios.h> header file. */
+#undef HAVE_LINUX_APM_BIOS_H
+
+/* Define to 1 if you have the <linux/fb.h> header file. */
+#undef HAVE_LINUX_FB_H
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the <ndbm.h> header file. */
+#undef HAVE_NDBM_H
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
+#undef HAVE_RPCSVC_DBM_H
+
+/* Define to use libc SHA1 functions */
+#undef HAVE_SHA1_IN_LIBC
+
+/* Define to use CommonCrypto SHA1 functions */
+#undef HAVE_SHA1_IN_COMMONCRYPTO
+
+/* Define to use libmd SHA1 functions */
+#undef HAVE_SHA1_IN_LIBMD
+
+/* Define to use libgcrypt SHA1 functions */
+#undef HAVE_SHA1_IN_LIBGCRYPT
+
+/* Define to use libsha1 for SHA1 */
+#undef HAVE_SHA1_IN_LIBSHA1
+
+/* Define to 1 if you have the `shmctl64' function. */
+#undef HAVE_SHMCTL64
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if SYSV IPC is available */
+#undef HAVE_SYSV_IPC
+
+/* Define to 1 if you have the <sys/agpio.h> header file. */
+#undef HAVE_SYS_AGPIO_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/io.h> header file. */
+#undef HAVE_SYS_IO_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/vm86.h> header file. */
+#undef HAVE_SYS_VM86_H
+
+/* Define to 1 if you have the <tslib.h> header file. */
+#undef HAVE_TSLIB_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <fnmatch.h> header file. */
+#undef HAVE_FNMATCH_H
+
+/* Have /dev/urandom */
+#undef HAVE_URANDOM
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Support IPv6 for TCP connections */
+#undef IPv6
+
+/* Support os-specific local connections */
+#undef LOCALCONN
+
+/* Support MIT-SHM Extension */
+#undef MITSHM
+
+/* Enable some debugging code */
+#undef DEBUG
+
+/* Name of package */
+#undef PACKAGE
+
+/* Internal define for Xinerama */
+#undef PANORAMIX
+
+/* Overall prefix */
+#undef PROJECTROOT
+
+/* Support RANDR extension */
+#undef RANDR
+
+/* Support Record extension */
+#undef XRECORD
+
+/* Support RENDER extension */
+#undef RENDER
+
+/* Support X resource extension */
+#undef RES
+
+/* Support MIT-SCREEN-SAVER extension */
+#undef SCREENSAVER
+
+/* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */
+#undef SECURE_RPC
+
+/* Support SHAPE extension */
+#undef SHAPE
+
+/* Define to 1 on systems derived from System V Release 4 */
+#undef SVR4
+
+/* Support TCP socket connections */
+#undef TCPCONN
+
+/* Enable touchscreen support */
+#undef TOUCHSCREEN
+
+/* Support tslib touchscreen abstraction library */
+#undef TSLIB
+
+/* Support UNIX socket connections */
+#undef UNIXCONN
+
+/* Define to use byteswap macros from <sys/endian.h> */
+#undef USE_SYS_ENDIAN_H
+
+/* unaligned word accesses behave as expected */
+#undef WORKING_UNALIGNED_INT
+
+/* Build X string registry */
+#undef XREGISTRY
+
+/* Build X-ACE extension */
+#undef XACE
+
+/* Build SELinux extension */
+#undef XSELINUX
+
+/* Support XCMisc extension */
+#undef XCMISC
+
+/* Build Security extension */
+#undef XCSECURITY
+
+/* Support Xdmcp */
+#undef XDMCP
+
+/* Build XFree86 BigFont extension */
+#undef XF86BIGFONT
+
+/* Support XFree86 Video Mode extension */
+#undef XF86VIDMODE
+
+/* Support XFixes extension */
+#undef XFIXES
+
+/* Build XDGA support */
+#undef XFreeXDGA
+
+/* Support Xinerama extension */
+#undef XINERAMA
+
+/* Vendor release */
+#undef XORG_RELEASE
+
+/* Current Xorg version */
+#undef XORG_VERSION_CURRENT
+
+/* Xorg release date */
+#undef XORG_DATE
+
+/* Build Xv Extension */
+#undef XvExtension
+
+/* Build XvMC Extension */
+#undef XvMCExtension
+
+/* Support XSync extension */
+#undef XSYNC
+
+/* Support XTest extension */
+#undef XTEST
+
+/* Support Xv extension */
+#undef XV
+
+/* Build Multibuffer extension */
+#undef MULTIBUFFER
+
+/* Support DRI extension */
+#undef XF86DRI
+
+/* Build DRI2 extension */
+#undef DRI2
+
+/* Build DBE support */
+#undef DBE
+
+/* Vendor name */
+#undef XVENDORNAME
+
+/* Enable GNU and other extensions to the C environment for GLIBC */
+#undef _GNU_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Build Rootless code */
+#undef ROOTLESS
+
+/* Define to 1 if unsigned long is 64 bits. */
+#undef _XSERVER64
+
+/* System is BSD-like */
+#undef CSRG_BASED
+
+/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */
+#undef BSD44SOCKETS
+
+/* Support D-Bus */
+#undef HAVE_DBUS
+
+/* Use libudev for input hotplug */
+#undef CONFIG_UDEV
+
+/* Use D-Bus for input hotplug */
+#undef CONFIG_NEED_DBUS
+
+/* Support the D-Bus hotplug API */
+#undef CONFIG_DBUS_API
+
+/* Support HAL for hotplug */
+#undef CONFIG_HAL
+
+/* Use only built-in fonts */
+#undef BUILTIN_FONTS
+
+/* Have a monotonic clock from clock_gettime() */
+#undef MONOTONIC_CLOCK
+
+/* Define to 1 if the DTrace Xserver provider probes should be built in */
+#undef XSERVER_DTRACE
+
+/* Define to 16-bit byteswap macro */
+#undef bswap_16
+
+/* Define to 32-bit byteswap macro */
+#undef bswap_32
+
+/* Define to 64-bit byteswap macro */
+#undef bswap_64
+
+/* Need the strcasecmp function. */
+#undef NEED_STRCASECMP
+
+/* Need the strncasecmp function. */
+#undef NEED_STRNCASECMP
+
+/* Need the strcasestr function. */
+#undef NEED_STRCASESTR
+
+/* Define to 1 if you have the `ffs' function. */
+#undef HAVE_FFS
+
+/* Correctly set _XSERVER64 for OSX fat binaries */
+#ifdef __APPLE__
+#include "dix-config-apple-verbatim.h"
+#endif
+
+#undef HAVE_AVC_NETLINK_ACQUIRE_FD
+
+#endif /* _DIX_CONFIG_H_ */
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index e3a184721..02267638f 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -193,7 +193,7 @@ LogInit(const char *fname, const char *backup) sprintf(oldLog, "%s%s", logFileName, suffix);
free(suffix);
if (rename(logFileName, oldLog) == -1) {
- FatalError("Cannot move old log file (\"%s\" to \"%s\"\n",
+ FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
logFileName, oldLog);
}
free(oldLog);
@@ -264,6 +264,14 @@ LogVWrite(int verb, const char *f, va_list args) {
char tmpBuffer[1024];
int len = 0;
+ static Bool newline = TRUE;
+
+ if (newline) {
+ sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
+ }
/*
* Since a va_list can only be processed once, write the string to a
@@ -275,6 +283,7 @@ LogVWrite(int verb, const char *f, va_list args) tmpBuffer[sizeof(tmpBuffer)-1]=0;
len = strlen(tmpBuffer);
}
+ newline = (tmpBuffer[len-1] == '\n');
if ((verb < 0 || logVerbosity >= verb) && len > 0)
fwrite(tmpBuffer, len, 1, stderr);
if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {
diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c index 77e5e0396..7f3c10a93 100644 --- a/xorg-server/render/render.c +++ b/xorg-server/render/render.c @@ -1,3277 +1,3414 @@ -/* - * - * Copyright © 2000 SuSE, Inc. - * - * 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 name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * 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. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <X11/X.h> -#include <X11/Xproto.h> -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "colormapst.h" -#include "extnsionst.h" -#include "servermd.h" -#include <X11/extensions/render.h> -#include <X11/extensions/renderproto.h> -#include "picturestr.h" -#include "glyphstr.h" -#include <X11/Xfuncproto.h> -#include "cursorstr.h" -#include "xace.h" -#include "protocol-versions.h" - -#if HAVE_STDINT_H -#include <stdint.h> -#elif !defined(UINT32_MAX) -#define UINT32_MAX 0xffffffffU -#endif - -static int ProcRenderQueryVersion (ClientPtr pClient); -static int ProcRenderQueryPictFormats (ClientPtr pClient); -static int ProcRenderQueryPictIndexValues (ClientPtr pClient); -static int ProcRenderQueryDithers (ClientPtr pClient); -static int ProcRenderCreatePicture (ClientPtr pClient); -static int ProcRenderChangePicture (ClientPtr pClient); -static int ProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int ProcRenderFreePicture (ClientPtr pClient); -static int ProcRenderComposite (ClientPtr pClient); -static int ProcRenderScale (ClientPtr pClient); -static int ProcRenderTrapezoids (ClientPtr pClient); -static int ProcRenderTriangles (ClientPtr pClient); -static int ProcRenderTriStrip (ClientPtr pClient); -static int ProcRenderTriFan (ClientPtr pClient); -static int ProcRenderColorTrapezoids (ClientPtr pClient); -static int ProcRenderColorTriangles (ClientPtr pClient); -static int ProcRenderTransform (ClientPtr pClient); -static int ProcRenderCreateGlyphSet (ClientPtr pClient); -static int ProcRenderReferenceGlyphSet (ClientPtr pClient); -static int ProcRenderFreeGlyphSet (ClientPtr pClient); -static int ProcRenderAddGlyphs (ClientPtr pClient); -static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int ProcRenderFreeGlyphs (ClientPtr pClient); -static int ProcRenderCompositeGlyphs (ClientPtr pClient); -static int ProcRenderFillRectangles (ClientPtr pClient); -static int ProcRenderCreateCursor (ClientPtr pClient); -static int ProcRenderSetPictureTransform (ClientPtr pClient); -static int ProcRenderQueryFilters (ClientPtr pClient); -static int ProcRenderSetPictureFilter (ClientPtr pClient); -static int ProcRenderCreateAnimCursor (ClientPtr pClient); -static int ProcRenderAddTraps (ClientPtr pClient); -static int ProcRenderCreateSolidFill (ClientPtr pClient); -static int ProcRenderCreateLinearGradient (ClientPtr pClient); -static int ProcRenderCreateRadialGradient (ClientPtr pClient); -static int ProcRenderCreateConicalGradient (ClientPtr pClient); - -static int ProcRenderDispatch (ClientPtr pClient); - -static int SProcRenderQueryVersion (ClientPtr pClient); -static int SProcRenderQueryPictFormats (ClientPtr pClient); -static int SProcRenderQueryPictIndexValues (ClientPtr pClient); -static int SProcRenderQueryDithers (ClientPtr pClient); -static int SProcRenderCreatePicture (ClientPtr pClient); -static int SProcRenderChangePicture (ClientPtr pClient); -static int SProcRenderSetPictureClipRectangles (ClientPtr pClient); -static int SProcRenderFreePicture (ClientPtr pClient); -static int SProcRenderComposite (ClientPtr pClient); -static int SProcRenderScale (ClientPtr pClient); -static int SProcRenderTrapezoids (ClientPtr pClient); -static int SProcRenderTriangles (ClientPtr pClient); -static int SProcRenderTriStrip (ClientPtr pClient); -static int SProcRenderTriFan (ClientPtr pClient); -static int SProcRenderColorTrapezoids (ClientPtr pClient); -static int SProcRenderColorTriangles (ClientPtr pClient); -static int SProcRenderTransform (ClientPtr pClient); -static int SProcRenderCreateGlyphSet (ClientPtr pClient); -static int SProcRenderReferenceGlyphSet (ClientPtr pClient); -static int SProcRenderFreeGlyphSet (ClientPtr pClient); -static int SProcRenderAddGlyphs (ClientPtr pClient); -static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient); -static int SProcRenderFreeGlyphs (ClientPtr pClient); -static int SProcRenderCompositeGlyphs (ClientPtr pClient); -static int SProcRenderFillRectangles (ClientPtr pClient); -static int SProcRenderCreateCursor (ClientPtr pClient); -static int SProcRenderSetPictureTransform (ClientPtr pClient); -static int SProcRenderQueryFilters (ClientPtr pClient); -static int SProcRenderSetPictureFilter (ClientPtr pClient); -static int SProcRenderCreateAnimCursor (ClientPtr pClient); -static int SProcRenderAddTraps (ClientPtr pClient); -static int SProcRenderCreateSolidFill (ClientPtr pClient); -static int SProcRenderCreateLinearGradient (ClientPtr pClient); -static int SProcRenderCreateRadialGradient (ClientPtr pClient); -static int SProcRenderCreateConicalGradient (ClientPtr pClient); - -static int SProcRenderDispatch (ClientPtr pClient); - -int (*ProcRenderVector[RenderNumberRequests])(ClientPtr) = { - ProcRenderQueryVersion, - ProcRenderQueryPictFormats, - ProcRenderQueryPictIndexValues, - ProcRenderQueryDithers, - ProcRenderCreatePicture, - ProcRenderChangePicture, - ProcRenderSetPictureClipRectangles, - ProcRenderFreePicture, - ProcRenderComposite, - ProcRenderScale, - ProcRenderTrapezoids, - ProcRenderTriangles, - ProcRenderTriStrip, - ProcRenderTriFan, - ProcRenderColorTrapezoids, - ProcRenderColorTriangles, - ProcRenderTransform, - ProcRenderCreateGlyphSet, - ProcRenderReferenceGlyphSet, - ProcRenderFreeGlyphSet, - ProcRenderAddGlyphs, - ProcRenderAddGlyphsFromPicture, - ProcRenderFreeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderCompositeGlyphs, - ProcRenderFillRectangles, - ProcRenderCreateCursor, - ProcRenderSetPictureTransform, - ProcRenderQueryFilters, - ProcRenderSetPictureFilter, - ProcRenderCreateAnimCursor, - ProcRenderAddTraps, - ProcRenderCreateSolidFill, - ProcRenderCreateLinearGradient, - ProcRenderCreateRadialGradient, - ProcRenderCreateConicalGradient -}; - -int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = { - SProcRenderQueryVersion, - SProcRenderQueryPictFormats, - SProcRenderQueryPictIndexValues, - SProcRenderQueryDithers, - SProcRenderCreatePicture, - SProcRenderChangePicture, - SProcRenderSetPictureClipRectangles, - SProcRenderFreePicture, - SProcRenderComposite, - SProcRenderScale, - SProcRenderTrapezoids, - SProcRenderTriangles, - SProcRenderTriStrip, - SProcRenderTriFan, - SProcRenderColorTrapezoids, - SProcRenderColorTriangles, - SProcRenderTransform, - SProcRenderCreateGlyphSet, - SProcRenderReferenceGlyphSet, - SProcRenderFreeGlyphSet, - SProcRenderAddGlyphs, - SProcRenderAddGlyphsFromPicture, - SProcRenderFreeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderCompositeGlyphs, - SProcRenderFillRectangles, - SProcRenderCreateCursor, - SProcRenderSetPictureTransform, - SProcRenderQueryFilters, - SProcRenderSetPictureFilter, - SProcRenderCreateAnimCursor, - SProcRenderAddTraps, - SProcRenderCreateSolidFill, - SProcRenderCreateLinearGradient, - SProcRenderCreateRadialGradient, - SProcRenderCreateConicalGradient -}; - -int RenderErrBase; -static int RenderClientPrivateKeyIndex; -DevPrivateKey RenderClientPrivateKey = &RenderClientPrivateKeyIndex; - -typedef struct _RenderClient { - int major_version; - int minor_version; -} RenderClientRec, *RenderClientPtr; - -#define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey)) - -static void -RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - RenderClientPtr pRenderClient = GetRenderClient (pClient); - - pRenderClient->major_version = 0; - pRenderClient->minor_version = 0; -} - -void -RenderExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (!PictureType) - return; - if (!PictureFinishInit ()) - return; - if (!dixRequestPrivate(RenderClientPrivateKey, sizeof(RenderClientRec))) - return; - if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0)) - return; - - extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors, - ProcRenderDispatch, SProcRenderDispatch, - NULL, StandardMinorOpcode); - if (!extEntry) - return; - RenderErrBase = extEntry->errorBase; -} - -static int -ProcRenderQueryVersion (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; - register int n; - REQUEST(xRenderQueryVersionReq); - - pRenderClient->major_version = stuff->majorVersion; - pRenderClient->minor_version = stuff->minorVersion; - - REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - memset(&rep, 0, sizeof(xRenderQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if ((stuff->majorVersion * 1000 + stuff->minorVersion) < - (SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) - { - rep.majorVersion = stuff->majorVersion; - rep.minorVersion = stuff->minorVersion; - } else - { - rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; - rep.minorVersion = SERVER_RENDER_MINOR_VERSION; - } - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -static VisualPtr -findVisual (ScreenPtr pScreen, VisualID vid) -{ - VisualPtr pVisual; - int v; - - for (v = 0; v < pScreen->numVisuals; v++) - { - pVisual = pScreen->visuals + v; - if (pVisual->vid == vid) - return pVisual; - } - return 0; -} - -static int -ProcRenderQueryPictFormats (ClientPtr client) -{ - RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryPictFormatsReply *reply; - xPictScreen *pictScreen; - xPictDepth *pictDepth; - xPictVisual *pictVisual; - xPictFormInfo *pictForm; - CARD32 *pictSubpixel; - ScreenPtr pScreen; - VisualPtr pVisual; - DepthPtr pDepth; - int v, d; - PictureScreenPtr ps; - PictFormatPtr pFormat; - int nformat; - int ndepth; - int nvisual; - int rlength; - int s; - int n; - int numScreens; - int numSubpixel; -/* REQUEST(xRenderQueryPictFormatsReq); */ - - REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - -#ifdef PANORAMIX - if (noPanoramiXExtension) - numScreens = screenInfo.numScreens; - else - numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; -#else - numScreens = screenInfo.numScreens; -#endif - ndepth = nformat = nvisual = 0; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - for (d = 0; d < pScreen->numDepths; d++) - { - pDepth = pScreen->allowedDepths + d; - ++ndepth; - - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && PictureMatchVisual (pScreen, pDepth->depth, pVisual)) - ++nvisual; - } - } - ps = GetPictureScreenIfSet(pScreen); - if (ps) - nformat += ps->nformats; - } - if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6) - numSubpixel = 0; - else - numSubpixel = numScreens; - - rlength = (sizeof (xRenderQueryPictFormatsReply) + - nformat * sizeof (xPictFormInfo) + - numScreens * sizeof (xPictScreen) + - ndepth * sizeof (xPictDepth) + - nvisual * sizeof (xPictVisual) + - numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xcalloc (1, rlength); - if (!reply) - return BadAlloc; - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = bytes_to_int32(rlength - sizeof(xGenericReply)); - reply->numFormats = nformat; - reply->numScreens = numScreens; - reply->numDepths = ndepth; - reply->numVisuals = nvisual; - reply->numSubpixel = numSubpixel; - - pictForm = (xPictFormInfo *) (reply + 1); - - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (nformat = 0, pFormat = ps->formats; - nformat < ps->nformats; - nformat++, pFormat++) - { - pictForm->id = pFormat->id; - pictForm->type = pFormat->type; - pictForm->depth = pFormat->depth; - pictForm->direct.red = pFormat->direct.red; - pictForm->direct.redMask = pFormat->direct.redMask; - pictForm->direct.green = pFormat->direct.green; - pictForm->direct.greenMask = pFormat->direct.greenMask; - pictForm->direct.blue = pFormat->direct.blue; - pictForm->direct.blueMask = pFormat->direct.blueMask; - pictForm->direct.alpha = pFormat->direct.alpha; - pictForm->direct.alphaMask = pFormat->direct.alphaMask; - if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap) - pictForm->colormap = pFormat->index.pColormap->mid; - else - pictForm->colormap = None; - if (client->swapped) - { - swapl (&pictForm->id, n); - swaps (&pictForm->direct.red, n); - swaps (&pictForm->direct.redMask, n); - swaps (&pictForm->direct.green, n); - swaps (&pictForm->direct.greenMask, n); - swaps (&pictForm->direct.blue, n); - swaps (&pictForm->direct.blueMask, n); - swaps (&pictForm->direct.alpha, n); - swaps (&pictForm->direct.alphaMask, n); - swapl (&pictForm->colormap, n); - } - pictForm++; - } - } - } - - pictScreen = (xPictScreen *) pictForm; - for (s = 0; s < numScreens; s++) - { - pScreen = screenInfo.screens[s]; - pictDepth = (xPictDepth *) (pictScreen + 1); - ndepth = 0; - for (d = 0; d < pScreen->numDepths; d++) - { - pictVisual = (xPictVisual *) (pictDepth + 1); - pDepth = pScreen->allowedDepths + d; - - nvisual = 0; - for (v = 0; v < pDepth->numVids; v++) - { - pVisual = findVisual (pScreen, pDepth->vids[v]); - if (pVisual && (pFormat = PictureMatchVisual (pScreen, - pDepth->depth, - pVisual))) - { - pictVisual->visual = pVisual->vid; - pictVisual->format = pFormat->id; - if (client->swapped) - { - swapl (&pictVisual->visual, n); - swapl (&pictVisual->format, n); - } - pictVisual++; - nvisual++; - } - } - pictDepth->depth = pDepth->depth; - pictDepth->nPictVisuals = nvisual; - if (client->swapped) - { - swaps (&pictDepth->nPictVisuals, n); - } - ndepth++; - pictDepth = (xPictDepth *) pictVisual; - } - pictScreen->nDepth = ndepth; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - pictScreen->fallback = ps->fallback->id; - else - pictScreen->fallback = 0; - if (client->swapped) - { - swapl (&pictScreen->nDepth, n); - swapl (&pictScreen->fallback, n); - } - pictScreen = (xPictScreen *) pictDepth; - } - pictSubpixel = (CARD32 *) pictScreen; - - for (s = 0; s < numSubpixel; s++) - { - pScreen = screenInfo.screens[s]; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - *pictSubpixel = ps->subpixel; - else - *pictSubpixel = SubPixelUnknown; - if (client->swapped) - { - swapl (pictSubpixel, n); - } - ++pictSubpixel; - } - - if (client->swapped) - { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numFormats, n); - swapl (&reply->numScreens, n); - swapl (&reply->numDepths, n); - swapl (&reply->numVisuals, n); - swapl (&reply->numSubpixel, n); - } - WriteToClient(client, rlength, (char *) reply); - xfree (reply); - return client->noClientException; -} - -static int -ProcRenderQueryPictIndexValues (ClientPtr client) -{ - PictFormatPtr pFormat; - int rc, num; - int rlength; - int i, n; - REQUEST(xRenderQueryPictIndexValuesReq); - xRenderQueryPictIndexValuesReply *reply; - xIndexValue *values; - - REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - - rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - - if (pFormat->type != PictTypeIndexed) - { - client->errorValue = stuff->format; - return BadMatch; - } - num = pFormat->index.nvalues; - rlength = (sizeof (xRenderQueryPictIndexValuesReply) + - num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength); - if (!reply) - return BadAlloc; - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = bytes_to_int32(rlength - sizeof(xGenericReply)); - reply->numIndexValues = num; - - values = (xIndexValue *) (reply + 1); - - memcpy (reply + 1, pFormat->index.pValues, num * sizeof (xIndexValue)); - - if (client->swapped) - { - for (i = 0; i < num; i++) - { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); - } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); - } - - WriteToClient(client, rlength, (char *) reply); - xfree(reply); - return (client->noClientException); -} - -static int -ProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreatePicture (ClientPtr client) -{ - PicturePtr pPicture; - DrawablePtr pDrawable; - PictFormatPtr pFormat; - int len, error, rc; - REQUEST(xRenderCreatePictureReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, - DixReadAccess|DixAddAccess); - if (rc != Success) - return rc; - - rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - - if (pFormat->depth != pDrawable->depth) - return BadMatch; - len = client->req_len - bytes_to_int32(sizeof(xRenderCreatePictureReq)); - if (Ones(stuff->mask) != len) - return BadLength; - - pPicture = CreatePicture (stuff->pid, - pDrawable, - pFormat, - stuff->mask, - (XID *) (stuff + 1), - client, - &error); - if (!pPicture) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int -ProcRenderChangePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderChangePictureReq); - int len; - - REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess, - RenderErrBase + BadPicture); - - len = client->req_len - bytes_to_int32(sizeof(xRenderChangePictureReq)); - if (Ones(stuff->mask) != len) - return BadLength; - - return ChangePicture (pPicture, stuff->mask, (XID *) (stuff + 1), - (DevUnion *) 0, client); -} - -static int -ProcRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - PicturePtr pPicture; - int nr; - int result; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess, - RenderErrBase + BadPicture); - if (!pPicture->pDrawable) - return BadDrawable; - - nr = (client->req_len << 2) - sizeof(xRenderChangePictureReq); - if (nr & 4) - return BadLength; - nr >>= 3; - result = SetPictureClipRects (pPicture, - stuff->xOrigin, stuff->yOrigin, - nr, (xRectangle *) &stuff[1]); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderFreePicture (ClientPtr client) -{ - PicturePtr pPicture; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess, - RenderErrBase + BadPicture); - FreeResource (stuff->picture, RT_NONE); - return(client->noClientException); -} - -static Bool -PictOpValid (CARD8 op) -{ - if (/*PictOpMinimum <= op && */ op <= PictOpMaximum) - return TRUE; - if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum) - return TRUE; - if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum) - return TRUE; - if (PictOpBlendMinimum <= op && op <= PictOpBlendMaximum) - return TRUE; - return FALSE; -} - -static int -ProcRenderComposite (ClientPtr client) -{ - PicturePtr pSrc, pMask, pDst; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess, - RenderErrBase + BadPicture); - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || - (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; - CompositePicture (stuff->op, - pSrc, - pMask, - pDst, - stuff->xSrc, - stuff->ySrc, - stuff->xMask, - stuff->yMask, - stuff->xDst, - stuff->yDst, - stuff->width, - stuff->height); - return Success; -} - -static int -ProcRenderScale (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTrapezoids (ClientPtr client) -{ - int rc, ntraps; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - } - else - pFormat = 0; - ntraps = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - if (ntraps % sizeof (xTrapezoid)) - return BadLength; - ntraps /= sizeof (xTrapezoid); - if (ntraps) - CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntraps, (xTrapezoid *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriangles (ClientPtr client) -{ - int rc, ntris; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - } - else - pFormat = 0; - ntris = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - if (ntris % sizeof (xTriangle)) - return BadLength; - ntris /= sizeof (xTriangle); - if (ntris) - CompositeTriangles (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - ntris, (xTriangle *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriStrip (ClientPtr client) -{ - int rc, npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriStrip (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderTriFan (ClientPtr client) -{ - int rc, npoints; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - } - else - pFormat = 0; - npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq)); - if (npoints & 4) - return(BadLength); - npoints >>= 3; - if (npoints >= 3) - CompositeTriFan (stuff->op, pSrc, pDst, pFormat, - stuff->xSrc, stuff->ySrc, - npoints, (xPointFixed *) &stuff[1]); - return client->noClientException; -} - -static int -ProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderCreateGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - PictFormatPtr format; - int rc, f; - REQUEST(xRenderCreateGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - rc = dixLookupResourceByType((pointer *)&format, stuff->format, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - - switch (format->depth) { - case 1: - f = GlyphFormat1; - break; - case 4: - f = GlyphFormat4; - break; - case 8: - f = GlyphFormat8; - break; - case 16: - f = GlyphFormat16; - break; - case 32: - f = GlyphFormat32; - break; - default: - return BadMatch; - } - if (format->type != PictTypeDirect) - return BadMatch; - glyphSet = AllocateGlyphSet (f, format); - if (!glyphSet) - return BadAlloc; - /* security creation/labeling check */ - rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->gsid, GlyphSetType, - glyphSet, RT_NONE, NULL, DixCreateAccess); - if (rc != Success) - return rc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return Success; -} - -static int -ProcRenderReferenceGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - int rc; - REQUEST(xRenderReferenceGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - - LEGAL_NEW_RESOURCE(stuff->gsid, client); - - rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->existing, GlyphSetType, - client, DixGetAttrAccess); - if (rc != Success) - { - client->errorValue = stuff->existing; - return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; - } - glyphSet->refcnt++; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) - return BadAlloc; - return client->noClientException; -} - -#define NLOCALDELTA 64 -#define NLOCALGLYPH 256 - -static int -ProcRenderFreeGlyphSet (ClientPtr client) -{ - GlyphSetPtr glyphSet; - int rc; - REQUEST(xRenderFreeGlyphSetReq); - - REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, GlyphSetType, - client, DixDestroyAccess); - if (rc != Success) - { - client->errorValue = stuff->glyphset; - return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; - } - FreeResource (stuff->glyphset, RT_NONE); - return client->noClientException; -} - -typedef struct _GlyphNew { - Glyph id; - GlyphPtr glyph; - Bool found; - unsigned char sha1[20]; -} GlyphNewRec, *GlyphNewPtr; - -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - -static int -ProcRenderAddGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - REQUEST(xRenderAddGlyphsReq); - GlyphNewRec glyphsLocal[NLOCALGLYPH]; - GlyphNewPtr glyphsBase, glyphs, glyph_new; - int remain, nglyphs; - CARD32 *gids; - xGlyphInfo *gi; - CARD8 *bits; - unsigned int size; - int err; - int i, screen; - PicturePtr pSrc = NULL, pDst = NULL; - PixmapPtr pSrcPix = NULL, pDstPix = NULL; - CARD32 component_alpha; - - REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - err = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, GlyphSetType, - client, DixAddAccess); - if (err != Success) - { - client->errorValue = stuff->glyphset; - return (err == BadValue) ? RenderErrBase + BadGlyphSet : err; - } - - err = BadAlloc; - nglyphs = stuff->nglyphs; - if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec)) - return BadAlloc; - - component_alpha = NeedsComponent (glyphSet->format->format); - - if (nglyphs <= NLOCALGLYPH) { - memset (glyphsLocal, 0, sizeof (glyphsLocal)); - glyphsBase = glyphsLocal; - } - else - { - glyphsBase = (GlyphNewPtr) Xcalloc (nglyphs * sizeof (GlyphNewRec)); - if (!glyphsBase) - return BadAlloc; - } - - remain = (client->req_len << 2) - sizeof (xRenderAddGlyphsReq); - - glyphs = glyphsBase; - - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + nglyphs); - bits = (CARD8 *) (gi + nglyphs); - remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs; - for (i = 0; i < nglyphs; i++) - { - size_t padded_width; - glyph_new = &glyphs[i]; - - padded_width = PixmapBytePad (gi[i].width, - glyphSet->format->depth); - - if (gi[i].height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi[i].height) - break; - - size = gi[i].height * padded_width; - if (remain < size) - break; - - err = HashGlyph (&gi[i], bits, size, glyph_new->sha1); - if (err) - goto bail; - - glyph_new->glyph = FindGlyphByHash (glyph_new->sha1, - glyphSet->fdepth); - - if (glyph_new->glyph && glyph_new->glyph != DeletedGlyph) - { - glyph_new->found = TRUE; - } - else - { - GlyphPtr glyph; - - glyph_new->found = FALSE; - glyph_new->glyph = glyph = AllocateGlyph (&gi[i], glyphSet->fdepth); - if (! glyph) - { - err = BadAlloc; - goto bail; - } - - for (screen = 0; screen < screenInfo.numScreens; screen++) - { - int width = gi[i].width; - int height = gi[i].height; - int depth = glyphSet->format->depth; - ScreenPtr pScreen; - int error; - - /* Skip work if it's invisibly small anyway */ - if (!width || !height) - break; - - pScreen = screenInfo.screens[screen]; - pSrcPix = GetScratchPixmapHeader (pScreen, - width, height, - depth, depth, - -1, bits); - if (! pSrcPix) - { - err = BadAlloc; - goto bail; - } - - pSrc = CreatePicture (0, &pSrcPix->drawable, - glyphSet->format, 0, NULL, - serverClient, &error); - if (! pSrc) - { - err = BadAlloc; - goto bail; - } - - pDstPix = (pScreen->CreatePixmap) (pScreen, - width, height, depth, - CREATE_PIXMAP_USAGE_GLYPH_PICTURE); - - GlyphPicture (glyph)[screen] = pDst = - CreatePicture (0, &pDstPix->drawable, - glyphSet->format, - CPComponentAlpha, &component_alpha, - serverClient, &error); - - /* The picture takes a reference to the pixmap, so we - drop ours. */ - (pScreen->DestroyPixmap) (pDstPix); - - if (! pDst) - { - err = BadAlloc; - goto bail; - } - - CompositePicture (PictOpSrc, - pSrc, - None, - pDst, - 0, 0, - 0, 0, - 0, 0, - width, height); - - FreePicture ((pointer) pSrc, 0); - pSrc = NULL; - FreeScratchPixmapHeader (pSrcPix); - pSrcPix = NULL; - } - - memcpy (glyph_new->glyph->sha1, glyph_new->sha1, 20); - } - - glyph_new->id = gids[i]; - - if (size & 3) - size += 4 - (size & 3); - bits += size; - remain -= size; - } - if (remain || i < nglyphs) - { - err = BadLength; - goto bail; - } - if (!ResizeGlyphSet (glyphSet, nglyphs)) - { - err = BadAlloc; - goto bail; - } - for (i = 0; i < nglyphs; i++) - AddGlyph (glyphSet, glyphs[i].glyph, glyphs[i].id); - - if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); - return client->noClientException; -bail: - if (pSrc) - FreePicture ((pointer) pSrc, 0); - if (pSrcPix) - FreeScratchPixmapHeader (pSrcPix); - for (i = 0; i < nglyphs; i++) - if (glyphs[i].glyph && ! glyphs[i].found) - xfree (glyphs[i].glyph); - if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); - return err; -} - -static int -ProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -ProcRenderFreeGlyphs (ClientPtr client) -{ - REQUEST(xRenderFreeGlyphsReq); - GlyphSetPtr glyphSet; - int rc, nglyph; - CARD32 *gids; - CARD32 glyph; - - REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, GlyphSetType, - client, DixRemoveAccess); - if (rc != Success) - { - client->errorValue = stuff->glyphset; - return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; - } - nglyph = bytes_to_int32((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)); - gids = (CARD32 *) (stuff + 1); - while (nglyph-- > 0) - { - glyph = *gids++; - if (!DeleteGlyph (glyphSet, glyph)) - { - client->errorValue = glyph; - return RenderErrBase + BadGlyph; - } - } - return client->noClientException; -} - -static int -ProcRenderCompositeGlyphs (ClientPtr client) -{ - GlyphSetPtr glyphSet; - GlyphSet gs; - PicturePtr pSrc, pDst; - PictFormatPtr pFormat; - GlyphListRec listsLocal[NLOCALDELTA]; - GlyphListPtr lists, listsBase; - GlyphPtr glyphsLocal[NLOCALGLYPH]; - Glyph glyph; - GlyphPtr *glyphs, *glyphsBase; - xGlyphElt *elt; - CARD8 *buffer, *end; - int nglyph; - int nlist; - int space; - int size; - int rc, n; - - REQUEST(xRenderCompositeGlyphsReq); - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) - return BadMatch; - if (stuff->maskFormat) - { - rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, - PictFormatType, client, DixReadAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; - } - else - pFormat = 0; - - rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, - GlyphSetType, client, DixUseAccess); - if (rc != Success) - return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; - - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - nglyph = 0; - nlist = 0; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - buffer += 4; - } - else - { - nlist++; - nglyph += elt->len; - space = size * elt->len; - if (space & 3) - space += 4 - (space & 3); - buffer += space; - } - } - if (nglyph <= NLOCALGLYPH) - glyphsBase = glyphsLocal; - else - { - glyphsBase = (GlyphPtr *) xalloc (nglyph * sizeof (GlyphPtr)); - if (!glyphsBase) - return BadAlloc; - } - if (nlist <= NLOCALDELTA) - listsBase = listsLocal; - else - { - listsBase = (GlyphListPtr) xalloc (nlist * sizeof (GlyphListRec)); - if (!listsBase) - return BadAlloc; - } - buffer = (CARD8 *) (stuff + 1); - glyphs = glyphsBase; - lists = listsBase; - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - if (elt->len == 0xff) - { - if (buffer + sizeof (GlyphSet) < end) - { - memcpy(&gs, buffer, sizeof(GlyphSet)); - rc = dixLookupResourceByType((pointer *)&glyphSet, gs, - GlyphSetType, client, - DixUseAccess); - if (rc != Success) - { - if (glyphsBase != glyphsLocal) - xfree (glyphsBase); - if (listsBase != listsLocal) - xfree (listsBase); - return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; - } - } - buffer += 4; - } - else - { - lists->xOff = elt->deltax; - lists->yOff = elt->deltay; - lists->format = glyphSet->format; - lists->len = 0; - n = elt->len; - while (n--) - { - if (buffer + size <= end) - { - switch (size) { - case 1: - glyph = *((CARD8 *)buffer); break; - case 2: - glyph = *((CARD16 *)buffer); break; - case 4: - default: - glyph = *((CARD32 *)buffer); break; - } - if ((*glyphs = FindGlyph (glyphSet, glyph))) - { - lists->len++; - glyphs++; - } - } - buffer += size; - } - space = size * elt->len; - if (space & 3) - buffer += 4 - (space & 3); - lists++; - } - } - if (buffer > end) - return BadLength; - - CompositeGlyphs (stuff->op, - pSrc, - pDst, - pFormat, - stuff->xSrc, - stuff->ySrc, - nlist, - listsBase, - glyphsBase); - - if (glyphsBase != glyphsLocal) - xfree (glyphsBase); - if (listsBase != listsLocal) - xfree (listsBase); - - return client->noClientException; -} - -static int -ProcRenderFillRectangles (ClientPtr client) -{ - PicturePtr pDst; - int things; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - if (!PictOpValid (stuff->op)) - { - client->errorValue = stuff->op; - return BadValue; - } - VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pDst->pDrawable) - return BadDrawable; - - things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq); - if (things & 4) - return(BadLength); - things >>= 3; - - CompositeRects (stuff->op, - pDst, - &stuff->color, - things, - (xRectangle *) &stuff[1]); - - return client->noClientException; -} - -static void -RenderSetBit (unsigned char *line, int x, int bit) -{ - unsigned char mask; - - if (screenInfo.bitmapBitOrder == LSBFirst) - mask = (1 << (x & 7)); - else - mask = (0x80 >> (x & 7)); - /* XXX assumes byte order is host byte order */ - line += (x >> 3); - if (bit) - *line |= mask; - else - *line &= ~mask; -} - -#define DITHER_DIM 2 - -static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = { - { 1, 3, }, - { 4, 2, }, -}; - -#define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1) - -static int -ProcRenderCreateCursor (ClientPtr client) -{ - REQUEST(xRenderCreateCursorReq); - PicturePtr pSrc; - ScreenPtr pScreen; - unsigned short width, height; - CARD32 *argbbits, *argb; - unsigned char *srcbits, *srcline; - unsigned char *mskbits, *mskline; - int stride; - int x, y; - int nbytes_mono; - CursorMetricRec cm; - CursorPtr pCursor; - CARD32 twocolor[3]; - int rc, ncolor; - - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - - VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - if (!pSrc->pDrawable) - return BadDrawable; - pScreen = pSrc->pDrawable->pScreen; - width = pSrc->pDrawable->width; - height = pSrc->pDrawable->height; - if (height && width > UINT32_MAX/(height*sizeof(CARD32))) - return BadAlloc; - if ( stuff->x > width - || stuff->y > height ) - return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); - if (!argbbits) - return (BadAlloc); - - stride = BitmapBytePad(width); - nbytes_mono = stride*height; - srcbits = xcalloc(1, nbytes_mono); - if (!srcbits) - { - xfree (argbbits); - return (BadAlloc); - } - mskbits = xcalloc(1, nbytes_mono); - if (!mskbits) - { - xfree(argbbits); - xfree(srcbits); - return (BadAlloc); - } - - if (pSrc->format == PICT_a8r8g8b8) - { - (*pScreen->GetImage) (pSrc->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - } - else - { - PixmapPtr pPixmap; - PicturePtr pPicture; - PictFormatPtr pFormat; - int error; - - pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); - if (!pFormat) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadImplementation); - } - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32, - CREATE_PIXMAP_USAGE_SCRATCH); - if (!pPixmap) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return (BadAlloc); - } - pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, - client, &error); - if (!pPicture) - { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); - return error; - } - (*pScreen->DestroyPixmap) (pPixmap); - CompositePicture (PictOpSrc, - pSrc, 0, pPicture, - 0, 0, 0, 0, 0, 0, width, height); - (*pScreen->GetImage) (pPicture->pDrawable, - 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); - FreePicture (pPicture, 0); - } - /* - * Check whether the cursor can be directly supported by - * the core cursor code - */ - ncolor = 0; - argb = argbbits; - for (y = 0; ncolor <= 2 && y < height; y++) - { - for (x = 0; ncolor <= 2 && x < width; x++) - { - CARD32 p = *argb++; - CARD32 a = (p >> 24); - - if (a == 0) /* transparent */ - continue; - if (a == 0xff) /* opaque */ - { - int n; - for (n = 0; n < ncolor; n++) - if (p == twocolor[n]) - break; - if (n == ncolor) - twocolor[ncolor++] = p; - } - else - ncolor = 3; - } - } - - /* - * Convert argb image to two plane cursor - */ - srcline = srcbits; - mskline = mskbits; - argb = argbbits; - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - CARD32 p = *argb++; - - if (ncolor <= 2) - { - CARD32 a = ((p >> 24)); - - RenderSetBit (mskline, x, a != 0); - RenderSetBit (srcline, x, a != 0 && p == twocolor[0]); - } - else - { - CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255; - CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255; - CARD32 d = orderedDither[y&(DITHER_DIM-1)][x&(DITHER_DIM-1)]; - /* Set mask from dithered alpha value */ - RenderSetBit(mskline, x, a > d); - /* Set src from dithered intensity value */ - RenderSetBit(srcline, x, a > d && i <= d); - } - } - srcline += stride; - mskline += stride; - } - /* - * Dither to white and black if the cursor has more than two colors - */ - if (ncolor > 2) - { - twocolor[0] = 0xff000000; - twocolor[1] = 0xffffffff; - } - else - { - xfree (argbbits); - argbbits = 0; - } - -#define GetByte(p,s) (((p) >> (s)) & 0xff) -#define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8)) - - cm.width = width; - cm.height = height; - cm.xhot = stuff->x; - cm.yhot = stuff->y; - rc = AllocARGBCursor(srcbits, mskbits, argbbits, &cm, - GetColor(twocolor[0], 16), - GetColor(twocolor[0], 8), - GetColor(twocolor[0], 0), - GetColor(twocolor[1], 16), - GetColor(twocolor[1], 8), - GetColor(twocolor[1], 0), - &pCursor, client, stuff->cid); - if (rc != Success) - return rc; - if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return BadAlloc; - - return client->noClientException; -} - -static int -ProcRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - PicturePtr pPicture; - int result; - - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess, - RenderErrBase + BadPicture); - result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); -} - -static int -ProcRenderQueryFilters (ClientPtr client) -{ - REQUEST (xRenderQueryFiltersReq); - DrawablePtr pDrawable; - xRenderQueryFiltersReply *reply; - int nbytesName; - int nnames; - ScreenPtr pScreen; - PictureScreenPtr ps; - int i, j, len, total_bytes, rc; - INT16 *aliases; - char *names; - - REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, - DixGetAttrAccess); - if (rc != Success) - return rc; - - pScreen = pDrawable->pScreen; - nbytesName = 0; - nnames = 0; - ps = GetPictureScreenIfSet(pScreen); - if (ps) - { - for (i = 0; i < ps->nfilters; i++) - nbytesName += 1 + strlen (ps->filters[i].name); - for (i = 0; i < ps->nfilterAliases; i++) - nbytesName += 1 + strlen (ps->filterAliases[i].alias); - nnames = ps->nfilters + ps->nfilterAliases; - } - len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName); - total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); - if (!reply) - return BadAlloc; - aliases = (INT16 *) (reply + 1); - names = (char *) (aliases + ((nnames + 1) & ~1)); - - reply->type = X_Reply; - reply->sequenceNumber = client->sequence; - reply->length = len; - reply->numAliases = nnames; - reply->numFilters = nnames; - if (ps) - { - - /* fill in alias values */ - for (i = 0; i < ps->nfilters; i++) - aliases[i] = FilterAliasNone; - for (i = 0; i < ps->nfilterAliases; i++) - { - for (j = 0; j < ps->nfilters; j++) - if (ps->filterAliases[i].filter_id == ps->filters[j].id) - break; - if (j == ps->nfilters) - { - for (j = 0; j < ps->nfilterAliases; j++) - if (ps->filterAliases[i].filter_id == - ps->filterAliases[j].alias_id) - { - break; - } - if (j == ps->nfilterAliases) - j = FilterAliasNone; - else - j = j + ps->nfilters; - } - aliases[i + ps->nfilters] = j; - } - - /* fill in filter names */ - for (i = 0; i < ps->nfilters; i++) - { - j = strlen (ps->filters[i].name); - *names++ = j; - strncpy (names, ps->filters[i].name, j); - names += j; - } - - /* fill in filter alias names */ - for (i = 0; i < ps->nfilterAliases; i++) - { - j = strlen (ps->filterAliases[i].alias); - *names++ = j; - strncpy (names, ps->filterAliases[i].alias, j); - names += j; - } - } - - if (client->swapped) - { - register int n; - - for (i = 0; i < reply->numAliases; i++) - { - swaps (&aliases[i], n); - } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); - } - WriteToClient(client, total_bytes, (char *) reply); - xfree (reply); - - return(client->noClientException); -} - -static int -ProcRenderSetPictureFilter (ClientPtr client) -{ - REQUEST (xRenderSetPictureFilterReq); - PicturePtr pPicture; - int result; - xFixed *params; - int nparams; - char *name; - - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess, - RenderErrBase + BadPicture); - name = (char *) (stuff + 1); - params = (xFixed *) (name + pad_to_int32(stuff->nbytes)); - nparams = ((xFixed *) stuff + client->req_len) - params; - result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams); - return result; -} - -static int -ProcRenderCreateAnimCursor (ClientPtr client) -{ - REQUEST(xRenderCreateAnimCursorReq); - CursorPtr *cursors; - CARD32 *deltas; - CursorPtr pCursor; - int ncursor; - xAnimCursorElt *elt; - int i; - int ret; - - REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq); - LEGAL_NEW_RESOURCE(stuff->cid, client); - if (client->req_len & 1) - return BadLength; - ncursor = (client->req_len - (bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); - if (!cursors) - return BadAlloc; - deltas = (CARD32 *) (cursors + ncursor); - elt = (xAnimCursorElt *) (stuff + 1); - for (i = 0; i < ncursor; i++) - { - ret = dixLookupResourceByType((pointer *)(cursors + i), elt->cursor, - RT_CURSOR, client, DixReadAccess); - if (ret != Success) - { - xfree (cursors); - return (ret == BadValue) ? BadCursor : ret; - } - deltas[i] = elt->delay; - elt++; - } - ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor, client, - stuff->cid); - xfree (cursors); - if (ret != Success) - return ret; - - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) - return client->noClientException; - return BadAlloc; -} - -static int -ProcRenderAddTraps (ClientPtr client) -{ - int ntraps; - PicturePtr pPicture; - REQUEST(xRenderAddTrapsReq); - - REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, - RenderErrBase + BadPicture); - if (!pPicture->pDrawable) - return BadDrawable; - ntraps = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); - if (ntraps % sizeof (xTrap)) - return BadLength; - ntraps /= sizeof (xTrap); - if (ntraps) - AddTraps (pPicture, - stuff->xOff, stuff->yOff, - ntraps, (xTrap *) &stuff[1]); - return client->noClientException; -} - -static int ProcRenderCreateSolidFill(ClientPtr client) -{ - PicturePtr pPicture; - int error = 0; - REQUEST(xRenderCreateSolidFillReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); - if (!pPicture) - return error; - /* security creation/labeling check */ - error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, - pPicture, RT_NONE, NULL, DixCreateAccess); - if (error != Success) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateLinearGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateLinearGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateLinearGradientPicture (stuff->pid, &stuff->p1, &stuff->p2, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - /* security creation/labeling check */ - error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, - pPicture, RT_NONE, NULL, DixCreateAccess); - if (error != Success) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateRadialGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateRadialGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateRadialGradientPicture (stuff->pid, &stuff->inner, &stuff->outer, - stuff->inner_radius, stuff->outer_radius, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - /* security creation/labeling check */ - error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, - pPicture, RT_NONE, NULL, DixCreateAccess); - if (error != Success) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - -static int ProcRenderCreateConicalGradient (ClientPtr client) -{ - PicturePtr pPicture; - int len; - int error = 0; - xFixed *stops; - xRenderColor *colors; - REQUEST(xRenderCreateConicalGradientReq); - - REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq); - - LEGAL_NEW_RESOURCE(stuff->pid, client); - - len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - stops = (xFixed *)(stuff + 1); - colors = (xRenderColor *)(stops + stuff->nStops); - - pPicture = CreateConicalGradientPicture (stuff->pid, &stuff->center, stuff->angle, - stuff->nStops, stops, colors, &error); - if (!pPicture) - return error; - /* security creation/labeling check */ - error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType, - pPicture, RT_NONE, NULL, DixCreateAccess); - if (error != Success) - return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) - return BadAlloc; - return Success; -} - - -static int -ProcRenderDispatch (ClientPtr client) -{ - REQUEST(xReq); - - if (stuff->data < RenderNumberRequests) - return (*ProcRenderVector[stuff->data]) (client); - else - return BadRequest; -} - -static int -SProcRenderQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return (*ProcRenderVector[stuff->renderReqType])(client); -} - -static int -SProcRenderQueryPictFormats (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryPictIndexValues (ClientPtr client) -{ - register int n; - REQUEST(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryDithers (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreatePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderChangePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureClipRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOrigin, n); - swaps(&stuff->yOrigin, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreePicture (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderComposite (ClientPtr client) -{ - register int n; - REQUEST(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderScale (ClientPtr client) -{ - register int n; - REQUEST(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTrapezoids (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrapezoidsReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderTrianglesReq); - - REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriStrip (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriStripReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderTriFan (ClientPtr client) -{ - register int n; - REQUEST(xRenderTriFanReq); - - REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderColorTrapezoids (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderColorTriangles (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderTransform (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderCreateGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderReferenceGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFreeGlyphSet (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphs (ClientPtr client) -{ - register int n; - register int i; - CARD32 *gids; - void *end; - xGlyphInfo *gi; - REQUEST(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); - if (stuff->nglyphs & 0xe0000000) - return BadLength; - end = (CARD8 *) stuff + (client->req_len << 2); - gids = (CARD32 *) (stuff + 1); - gi = (xGlyphInfo *) (gids + stuff->nglyphs); - if ((char *) end - (char *) (gids + stuff->nglyphs) < 0) - return BadLength; - if ((char *) end - (char *) (gi + stuff->nglyphs) < 0) - return BadLength; - for (i = 0; i < stuff->nglyphs; i++) - { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddGlyphsFromPicture (ClientPtr client) -{ - return BadImplementation; -} - -static int -SProcRenderFreeGlyphs (ClientPtr client) -{ - register int n; - REQUEST(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCompositeGlyphs (ClientPtr client) -{ - register int n; - xGlyphElt *elt; - CARD8 *buffer; - CARD8 *end; - int space; - int i; - int size; - - REQUEST(xRenderCompositeGlyphsReq); - - switch (stuff->renderReqType) { - default: size = 1; break; - case X_RenderCompositeGlyphs16: size = 2; break; - case X_RenderCompositeGlyphs32: size = 4; break; - } - - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - buffer = (CARD8 *) (stuff + 1); - end = (CARD8 *) stuff + (client->req_len << 2); - while (buffer + sizeof (xGlyphElt) < end) - { - elt = (xGlyphElt *) buffer; - buffer += sizeof (xGlyphElt); - - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); - - i = elt->len; - if (i == 0xff) - { - swapl (buffer, n); - buffer += 4; - } - else - { - space = size * i; - switch (size) { - case 1: - buffer += i; - break; - case 2: - while (i--) - { - swaps (buffer, n); - buffer += 2; - } - break; - case 4: - while (i--) - { - swapl (buffer, n); - buffer += 4; - } - break; - } - if (space & 3) - buffer += 4 - (space & 3); - } - } - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderFillRectangles (ClientPtr client) -{ - register int n; - REQUEST(xRenderFillRectanglesReq); - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); - SwapRestS(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateCursor (ClientPtr client) -{ - register int n; - REQUEST(xRenderCreateCursorReq); - REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureTransform (ClientPtr client) -{ - register int n; - REQUEST(xRenderSetPictureTransformReq); - REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderQueryFilters (ClientPtr client) -{ - register int n; - REQUEST (xRenderQueryFiltersReq); - REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderSetPictureFilter (ClientPtr client) -{ - register int n; - REQUEST (xRenderSetPictureFilterReq); - REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateAnimCursor (ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateAnimCursorReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderAddTraps (ClientPtr client) -{ - register int n; - REQUEST (xRenderAddTrapsReq); - REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOff, n); - swaps(&stuff->yOff, n); - SwapRestL(stuff); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateSolidFill(ClientPtr client) -{ - register int n; - REQUEST (xRenderCreateSolidFillReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swaps(&stuff->color.alpha, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static void swapStops(void *stuff, int num) -{ - int i, n; - CARD32 *stops; - CARD16 *colors; - stops = (CARD32 *)(stuff); - for (i = 0; i < num; ++i) { - swapl(stops, n); - ++stops; - } - colors = (CARD16 *)(stops); - for (i = 0; i < 4*num; ++i) { - swaps(stops, n); - ++stops; - } -} - -static int -SProcRenderCreateLinearGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateLinearGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->p1.x, n); - swapl(&stuff->p1.y, n); - swapl(&stuff->p2.x, n); - swapl(&stuff->p2.y, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateRadialGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateRadialGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->inner.x, n); - swapl(&stuff->inner.y, n); - swapl(&stuff->outer.x, n); - swapl(&stuff->outer.y, n); - swapl(&stuff->inner_radius, n); - swapl(&stuff->outer_radius, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderCreateConicalGradient (ClientPtr client) -{ - register int n; - int len; - REQUEST (xRenderCreateConicalGradientReq); - REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq); - - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->center.x, n); - swapl(&stuff->center.y, n); - swapl(&stuff->angle, n); - swapl(&stuff->nStops, n); - - len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); - if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor))) - return BadLength; - - swapStops(stuff+1, stuff->nStops); - - return (*ProcRenderVector[stuff->renderReqType]) (client); -} - -static int -SProcRenderDispatch (ClientPtr client) -{ - REQUEST(xReq); - - if (stuff->data < RenderNumberRequests) - return (*SProcRenderVector[stuff->data]) (client); - else - return BadRequest; -} - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - -#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\ - int rc = dixLookupResourceByType((pointer *)&(pPicture), pid,\ - XRT_PICTURE, client, mode);\ - if (rc != Success)\ - return (rc == BadValue) ? err : rc;\ -} - -#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\ - if (pid == None) \ - pPicture = 0; \ - else { \ - VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \ - } \ -} \ - -int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr); - -unsigned long XRT_PICTURE; - -static int -PanoramiXRenderCreatePicture (ClientPtr client) -{ - REQUEST(xRenderCreatePictureReq); - PanoramiXRes *refDraw, *newPict; - int result, j; - - REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - result = dixLookupResourceByClass((pointer *)&refDraw, stuff->drawable, - XRC_DRAWABLE, client, DixWriteAccess); - if (result != Success) - return (result == BadValue) ? BadDrawable : result; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) - return BadAlloc; - newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; - - if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) - { - newPict->u.pict.root = TRUE; - } - else - newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - - FOR_NSCREENS_BACKWARD(j) { - stuff->pid = newPict->info[j].id; - stuff->drawable = refDraw->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client); - if(result != Success) break; - } - - if (result == Success) - AddResource(newPict->info[0].id, XRT_PICTURE, newPict); - else - xfree(newPict); - - return (result); -} - -static int -PanoramiXRenderChangePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderChangePictureReq); - - REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureClipRectangles (ClientPtr client) -{ - REQUEST(xRenderSetPictureClipRectanglesReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureTransform (ClientPtr client) -{ - REQUEST(xRenderSetPictureTransformReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureTransform]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderSetPictureFilter (ClientPtr client) -{ - REQUEST(xRenderSetPictureFilterReq); - int result = Success, j; - PanoramiXRes *pict; - - REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, - RenderErrBase + BadPicture); - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderSetPictureFilter]) (client); - if(result != Success) break; - } - - return (result); -} - -static int -PanoramiXRenderFreePicture (ClientPtr client) -{ - PanoramiXRes *pict; - int result = Success, j; - REQUEST(xRenderFreePictureReq); - - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - - client->errorValue = stuff->picture; - - VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess, - RenderErrBase + BadPicture); - - - FOR_NSCREENS_BACKWARD(j) { - stuff->picture = pict->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client); - if(result != Success) break; - } - - /* Since ProcRenderFreePicture is using FreeResource, it will free - our resource for us on the last pass through the loop above */ - - return (result); -} - -static int -PanoramiXRenderComposite (ClientPtr client) -{ - PanoramiXRes *src, *msk, *dst; - int result = Success, j; - xRenderCompositeReq orig; - REQUEST(xRenderCompositeReq); - - REQUEST_SIZE_MATCH(xRenderCompositeReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - - orig = *stuff; - - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - stuff->xDst = orig.xDst - panoramiXdataPtr[j].x; - stuff->yDst = orig.yDst - panoramiXdataPtr[j].y; - } - if (msk) - { - stuff->mask = msk->info[j].id; - if (msk->u.pict.root) - { - stuff->xMask = orig.xMask - panoramiXdataPtr[j].x; - stuff->yMask = orig.yMask - panoramiXdataPtr[j].y; - } - } - result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client); - if(result != Success) break; - } - - return result; -} - -static int -PanoramiXRenderCompositeGlyphs (ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderCompositeGlyphsReq); - xGlyphElt origElt, *elt; - INT16 xSrc, ySrc; - - REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - - if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + - sizeof (xGlyphElt))) - { - elt = (xGlyphElt *) (stuff + 1); - origElt = *elt; - xSrc = stuff->xSrc; - ySrc = stuff->ySrc; - FOR_NSCREENS_FORWARD(j) { - stuff->src = src->info[j].id; - if (src->u.pict.root) - { - stuff->xSrc = xSrc - panoramiXdataPtr[j].x; - stuff->ySrc = ySrc - panoramiXdataPtr[j].y; - } - stuff->dst = dst->info[j].id; - if (dst->u.pict.root) - { - elt->deltax = origElt.deltax - panoramiXdataPtr[j].x; - elt->deltay = origElt.deltay - panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client); - if(result != Success) break; - } - } - - return result; -} - -static int -PanoramiXRenderFillRectangles (ClientPtr client) -{ - PanoramiXRes *dst; - int result = Success, j; - REQUEST(xRenderFillRectanglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); - if (extra_len && - (extra = (char *) xalloc (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) - { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xRectangle *rects = (xRectangle *) (stuff + 1); - int i = extra_len / sizeof (xRectangle); - - while (i--) - { - rects->x -= x_off; - rects->y -= y_off; - rects++; - } - } - } - stuff->dst = dst->info[j].id; - result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); - if(result != Success) break; - } - xfree(extra); - } - - return result; -} - -static int -PanoramiXRenderTrapezoids(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTrapezoidsReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); - - if (extra_len && - (extra = (char *) xalloc (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xTrapezoid *trap = (xTrapezoid *) (stuff + 1); - int i = extra_len / sizeof (xTrapezoid); - - while (i--) { - trap->top -= y_off; - trap->bottom -= y_off; - trap->left.p1.x -= x_off; - trap->left.p1.y -= y_off; - trap->left.p2.x -= x_off; - trap->left.p2.y -= y_off; - trap->right.p1.x -= x_off; - trap->right.p1.y -= y_off; - trap->right.p2.x -= x_off; - trap->right.p2.y -= y_off; - trap++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTrapezoids]) (client); - - if(result != Success) break; - } - - xfree(extra); - } - - return result; -} - -static int -PanoramiXRenderTriangles(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTrianglesReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); - - if (extra_len && - (extra = (char *) xalloc (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xTriangle *tri = (xTriangle *) (stuff + 1); - int i = extra_len / sizeof (xTriangle); - - while (i--) { - tri->p1.x -= x_off; - tri->p1.y -= y_off; - tri->p2.x -= x_off; - tri->p2.y -= y_off; - tri->p3.x -= x_off; - tri->p3.y -= y_off; - tri++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriangles]) (client); - - if(result != Success) break; - } - - xfree(extra); - } - - return result; -} - -static int -PanoramiXRenderTriStrip(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTriStripReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTriStripReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); - - if (extra_len && - (extra = (char *) xalloc (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xPointFixed *fixed = (xPointFixed *) (stuff + 1); - int i = extra_len / sizeof (xPointFixed); - - while (i--) { - fixed->x -= x_off; - fixed->y -= y_off; - fixed++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriStrip]) (client); - - if(result != Success) break; - } - - xfree(extra); - } - - return result; -} - -static int -PanoramiXRenderTriFan(ClientPtr client) -{ - PanoramiXRes *src, *dst; - int result = Success, j; - REQUEST(xRenderTriFanReq); - char *extra; - int extra_len; - - REQUEST_AT_LEAST_SIZE (xRenderTriFanReq); - - VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, - RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, - RenderErrBase + BadPicture); - - extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); - - if (extra_len && - (extra = (char *) xalloc (extra_len))) { - memcpy (extra, stuff + 1, extra_len); - - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - if (dst->u.pict.root) { - int x_off = panoramiXdataPtr[j].x; - int y_off = panoramiXdataPtr[j].y; - - if(x_off || y_off) { - xPointFixed *fixed = (xPointFixed *) (stuff + 1); - int i = extra_len / sizeof (xPointFixed); - - while (i--) { - fixed->x -= x_off; - fixed->y -= y_off; - fixed++; - } - } - } - - stuff->src = src->info[j].id; - stuff->dst = dst->info[j].id; - result = - (*PanoramiXSaveRenderVector[X_RenderTriFan]) (client); - - if(result != Success) break; - } - - xfree(extra); - } - - return result; -} - -static int -PanoramiXRenderAddTraps (ClientPtr client) -{ - PanoramiXRes *picture; - int result = Success, j; - REQUEST(xRenderAddTrapsReq); - char *extra; - int extra_len; - INT16 x_off, y_off; - - REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess, - RenderErrBase + BadPicture); - extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); - if (extra_len && - (extra = (char *) xalloc (extra_len))) - { - memcpy (extra, stuff + 1, extra_len); - x_off = stuff->xOff; - y_off = stuff->yOff; - FOR_NSCREENS_FORWARD(j) { - if (j) memcpy (stuff + 1, extra, extra_len); - stuff->picture = picture->info[j].id; - - if (picture->u.pict.root) - { - stuff->xOff = x_off + panoramiXdataPtr[j].x; - stuff->yOff = y_off + panoramiXdataPtr[j].y; - } - result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); - if(result != Success) break; - } - xfree(extra); - } - - return result; -} - -void -PanoramiXRenderInit (void) -{ - int i; - - XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource, - "XineramaPicture"); - for (i = 0; i < RenderNumberRequests; i++) - PanoramiXSaveRenderVector[i] = ProcRenderVector[i]; - /* - * Stuff in Xinerama aware request processing hooks - */ - ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture; - ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture; - ProcRenderVector[X_RenderSetPictureTransform] = PanoramiXRenderSetPictureTransform; - ProcRenderVector[X_RenderSetPictureFilter] = PanoramiXRenderSetPictureFilter; - ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles; - ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture; - ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite; - ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs; - ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles; - - ProcRenderVector[X_RenderTrapezoids] = PanoramiXRenderTrapezoids; - ProcRenderVector[X_RenderTriangles] = PanoramiXRenderTriangles; - ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip; - ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan; - ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps; -} - -void -PanoramiXRenderReset (void) -{ - int i; - for (i = 0; i < RenderNumberRequests; i++) - ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; -} - -#endif /* PANORAMIX */ +/*
+ *
+ * Copyright © 2000 SuSE, Inc.
+ *
+ * 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 name of SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
+ * 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.
+ *
+ * Author: Keith Packard, SuSE, Inc.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#include "resource.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "colormapst.h"
+#include "extnsionst.h"
+#include "servermd.h"
+#include <X11/extensions/render.h>
+#include <X11/extensions/renderproto.h>
+#include "picturestr.h"
+#include "glyphstr.h"
+#include <X11/Xfuncproto.h>
+#include "cursorstr.h"
+#include "xace.h"
+#include "protocol-versions.h"
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#elif !defined(UINT32_MAX)
+#define UINT32_MAX 0xffffffffU
+#endif
+
+static int ProcRenderQueryVersion (ClientPtr pClient);
+static int ProcRenderQueryPictFormats (ClientPtr pClient);
+static int ProcRenderQueryPictIndexValues (ClientPtr pClient);
+static int ProcRenderQueryDithers (ClientPtr pClient);
+static int ProcRenderCreatePicture (ClientPtr pClient);
+static int ProcRenderChangePicture (ClientPtr pClient);
+static int ProcRenderSetPictureClipRectangles (ClientPtr pClient);
+static int ProcRenderFreePicture (ClientPtr pClient);
+static int ProcRenderComposite (ClientPtr pClient);
+static int ProcRenderScale (ClientPtr pClient);
+static int ProcRenderTrapezoids (ClientPtr pClient);
+static int ProcRenderTriangles (ClientPtr pClient);
+static int ProcRenderTriStrip (ClientPtr pClient);
+static int ProcRenderTriFan (ClientPtr pClient);
+static int ProcRenderColorTrapezoids (ClientPtr pClient);
+static int ProcRenderColorTriangles (ClientPtr pClient);
+static int ProcRenderTransform (ClientPtr pClient);
+static int ProcRenderCreateGlyphSet (ClientPtr pClient);
+static int ProcRenderReferenceGlyphSet (ClientPtr pClient);
+static int ProcRenderFreeGlyphSet (ClientPtr pClient);
+static int ProcRenderAddGlyphs (ClientPtr pClient);
+static int ProcRenderAddGlyphsFromPicture (ClientPtr pClient);
+static int ProcRenderFreeGlyphs (ClientPtr pClient);
+static int ProcRenderCompositeGlyphs (ClientPtr pClient);
+static int ProcRenderFillRectangles (ClientPtr pClient);
+static int ProcRenderCreateCursor (ClientPtr pClient);
+static int ProcRenderSetPictureTransform (ClientPtr pClient);
+static int ProcRenderQueryFilters (ClientPtr pClient);
+static int ProcRenderSetPictureFilter (ClientPtr pClient);
+static int ProcRenderCreateAnimCursor (ClientPtr pClient);
+static int ProcRenderAddTraps (ClientPtr pClient);
+static int ProcRenderCreateSolidFill (ClientPtr pClient);
+static int ProcRenderCreateLinearGradient (ClientPtr pClient);
+static int ProcRenderCreateRadialGradient (ClientPtr pClient);
+static int ProcRenderCreateConicalGradient (ClientPtr pClient);
+
+static int ProcRenderDispatch (ClientPtr pClient);
+
+static int SProcRenderQueryVersion (ClientPtr pClient);
+static int SProcRenderQueryPictFormats (ClientPtr pClient);
+static int SProcRenderQueryPictIndexValues (ClientPtr pClient);
+static int SProcRenderQueryDithers (ClientPtr pClient);
+static int SProcRenderCreatePicture (ClientPtr pClient);
+static int SProcRenderChangePicture (ClientPtr pClient);
+static int SProcRenderSetPictureClipRectangles (ClientPtr pClient);
+static int SProcRenderFreePicture (ClientPtr pClient);
+static int SProcRenderComposite (ClientPtr pClient);
+static int SProcRenderScale (ClientPtr pClient);
+static int SProcRenderTrapezoids (ClientPtr pClient);
+static int SProcRenderTriangles (ClientPtr pClient);
+static int SProcRenderTriStrip (ClientPtr pClient);
+static int SProcRenderTriFan (ClientPtr pClient);
+static int SProcRenderColorTrapezoids (ClientPtr pClient);
+static int SProcRenderColorTriangles (ClientPtr pClient);
+static int SProcRenderTransform (ClientPtr pClient);
+static int SProcRenderCreateGlyphSet (ClientPtr pClient);
+static int SProcRenderReferenceGlyphSet (ClientPtr pClient);
+static int SProcRenderFreeGlyphSet (ClientPtr pClient);
+static int SProcRenderAddGlyphs (ClientPtr pClient);
+static int SProcRenderAddGlyphsFromPicture (ClientPtr pClient);
+static int SProcRenderFreeGlyphs (ClientPtr pClient);
+static int SProcRenderCompositeGlyphs (ClientPtr pClient);
+static int SProcRenderFillRectangles (ClientPtr pClient);
+static int SProcRenderCreateCursor (ClientPtr pClient);
+static int SProcRenderSetPictureTransform (ClientPtr pClient);
+static int SProcRenderQueryFilters (ClientPtr pClient);
+static int SProcRenderSetPictureFilter (ClientPtr pClient);
+static int SProcRenderCreateAnimCursor (ClientPtr pClient);
+static int SProcRenderAddTraps (ClientPtr pClient);
+static int SProcRenderCreateSolidFill (ClientPtr pClient);
+static int SProcRenderCreateLinearGradient (ClientPtr pClient);
+static int SProcRenderCreateRadialGradient (ClientPtr pClient);
+static int SProcRenderCreateConicalGradient (ClientPtr pClient);
+
+static int SProcRenderDispatch (ClientPtr pClient);
+
+int (*ProcRenderVector[RenderNumberRequests])(ClientPtr) = {
+ ProcRenderQueryVersion,
+ ProcRenderQueryPictFormats,
+ ProcRenderQueryPictIndexValues,
+ ProcRenderQueryDithers,
+ ProcRenderCreatePicture,
+ ProcRenderChangePicture,
+ ProcRenderSetPictureClipRectangles,
+ ProcRenderFreePicture,
+ ProcRenderComposite,
+ ProcRenderScale,
+ ProcRenderTrapezoids,
+ ProcRenderTriangles,
+ ProcRenderTriStrip,
+ ProcRenderTriFan,
+ ProcRenderColorTrapezoids,
+ ProcRenderColorTriangles,
+ ProcRenderTransform,
+ ProcRenderCreateGlyphSet,
+ ProcRenderReferenceGlyphSet,
+ ProcRenderFreeGlyphSet,
+ ProcRenderAddGlyphs,
+ ProcRenderAddGlyphsFromPicture,
+ ProcRenderFreeGlyphs,
+ ProcRenderCompositeGlyphs,
+ ProcRenderCompositeGlyphs,
+ ProcRenderCompositeGlyphs,
+ ProcRenderFillRectangles,
+ ProcRenderCreateCursor,
+ ProcRenderSetPictureTransform,
+ ProcRenderQueryFilters,
+ ProcRenderSetPictureFilter,
+ ProcRenderCreateAnimCursor,
+ ProcRenderAddTraps,
+ ProcRenderCreateSolidFill,
+ ProcRenderCreateLinearGradient,
+ ProcRenderCreateRadialGradient,
+ ProcRenderCreateConicalGradient
+};
+
+int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = {
+ SProcRenderQueryVersion,
+ SProcRenderQueryPictFormats,
+ SProcRenderQueryPictIndexValues,
+ SProcRenderQueryDithers,
+ SProcRenderCreatePicture,
+ SProcRenderChangePicture,
+ SProcRenderSetPictureClipRectangles,
+ SProcRenderFreePicture,
+ SProcRenderComposite,
+ SProcRenderScale,
+ SProcRenderTrapezoids,
+ SProcRenderTriangles,
+ SProcRenderTriStrip,
+ SProcRenderTriFan,
+ SProcRenderColorTrapezoids,
+ SProcRenderColorTriangles,
+ SProcRenderTransform,
+ SProcRenderCreateGlyphSet,
+ SProcRenderReferenceGlyphSet,
+ SProcRenderFreeGlyphSet,
+ SProcRenderAddGlyphs,
+ SProcRenderAddGlyphsFromPicture,
+ SProcRenderFreeGlyphs,
+ SProcRenderCompositeGlyphs,
+ SProcRenderCompositeGlyphs,
+ SProcRenderCompositeGlyphs,
+ SProcRenderFillRectangles,
+ SProcRenderCreateCursor,
+ SProcRenderSetPictureTransform,
+ SProcRenderQueryFilters,
+ SProcRenderSetPictureFilter,
+ SProcRenderCreateAnimCursor,
+ SProcRenderAddTraps,
+ SProcRenderCreateSolidFill,
+ SProcRenderCreateLinearGradient,
+ SProcRenderCreateRadialGradient,
+ SProcRenderCreateConicalGradient
+};
+
+int RenderErrBase;
+static int RenderClientPrivateKeyIndex;
+DevPrivateKey RenderClientPrivateKey = &RenderClientPrivateKeyIndex;
+
+typedef struct _RenderClient {
+ int major_version;
+ int minor_version;
+} RenderClientRec, *RenderClientPtr;
+
+#define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey))
+
+static void
+RenderClientCallback (CallbackListPtr *list,
+ pointer closure,
+ pointer data)
+{
+ NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
+ ClientPtr pClient = clientinfo->client;
+ RenderClientPtr pRenderClient = GetRenderClient (pClient);
+
+ pRenderClient->major_version = 0;
+ pRenderClient->minor_version = 0;
+}
+
+void
+RenderExtensionInit (void)
+{
+ ExtensionEntry *extEntry;
+
+ if (!PictureType)
+ return;
+ if (!PictureFinishInit ())
+ return;
+ if (!dixRequestPrivate(RenderClientPrivateKey, sizeof(RenderClientRec)))
+ return;
+ if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0))
+ return;
+
+ extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors,
+ ProcRenderDispatch, SProcRenderDispatch,
+ NULL, StandardMinorOpcode);
+ if (!extEntry)
+ return;
+ RenderErrBase = extEntry->errorBase;
+}
+
+static int
+ProcRenderQueryVersion (ClientPtr client)
+{
+ RenderClientPtr pRenderClient = GetRenderClient (client);
+ xRenderQueryVersionReply rep;
+ register int n;
+ REQUEST(xRenderQueryVersionReq);
+
+ pRenderClient->major_version = stuff->majorVersion;
+ pRenderClient->minor_version = stuff->minorVersion;
+
+ REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
+ memset(&rep, 0, sizeof(xRenderQueryVersionReply));
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
+ (SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION))
+ {
+ rep.majorVersion = stuff->majorVersion;
+ rep.minorVersion = stuff->minorVersion;
+ } else
+ {
+ rep.majorVersion = SERVER_RENDER_MAJOR_VERSION;
+ rep.minorVersion = SERVER_RENDER_MINOR_VERSION;
+ }
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.majorVersion, n);
+ swapl(&rep.minorVersion, n);
+ }
+ WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static VisualPtr
+findVisual (ScreenPtr pScreen, VisualID vid)
+{
+ VisualPtr pVisual;
+ int v;
+
+ for (v = 0; v < pScreen->numVisuals; v++)
+ {
+ pVisual = pScreen->visuals + v;
+ if (pVisual->vid == vid)
+ return pVisual;
+ }
+ return 0;
+}
+
+static int
+ProcRenderQueryPictFormats (ClientPtr client)
+{
+ RenderClientPtr pRenderClient = GetRenderClient (client);
+ xRenderQueryPictFormatsReply *reply;
+ xPictScreen *pictScreen;
+ xPictDepth *pictDepth;
+ xPictVisual *pictVisual;
+ xPictFormInfo *pictForm;
+ CARD32 *pictSubpixel;
+ ScreenPtr pScreen;
+ VisualPtr pVisual;
+ DepthPtr pDepth;
+ int v, d;
+ PictureScreenPtr ps;
+ PictFormatPtr pFormat;
+ int nformat;
+ int ndepth;
+ int nvisual;
+ int rlength;
+ int s;
+ int n;
+ int numScreens;
+ int numSubpixel;
+/* REQUEST(xRenderQueryPictFormatsReq); */
+
+ REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
+
+#ifdef PANORAMIX
+ if (noPanoramiXExtension)
+ numScreens = screenInfo.numScreens;
+ else
+ numScreens = ((xConnSetup *)ConnectionInfo)->numRoots;
+#else
+ numScreens = screenInfo.numScreens;
+#endif
+ ndepth = nformat = nvisual = 0;
+ for (s = 0; s < numScreens; s++)
+ {
+ pScreen = screenInfo.screens[s];
+ for (d = 0; d < pScreen->numDepths; d++)
+ {
+ pDepth = pScreen->allowedDepths + d;
+ ++ndepth;
+
+ for (v = 0; v < pDepth->numVids; v++)
+ {
+ pVisual = findVisual (pScreen, pDepth->vids[v]);
+ if (pVisual && PictureMatchVisual (pScreen, pDepth->depth, pVisual))
+ ++nvisual;
+ }
+ }
+ ps = GetPictureScreenIfSet(pScreen);
+ if (ps)
+ nformat += ps->nformats;
+ }
+ if (pRenderClient->major_version == 0 && pRenderClient->minor_version < 6)
+ numSubpixel = 0;
+ else
+ numSubpixel = numScreens;
+
+ rlength = (sizeof (xRenderQueryPictFormatsReply) +
+ nformat * sizeof (xPictFormInfo) +
+ numScreens * sizeof (xPictScreen) +
+ ndepth * sizeof (xPictDepth) +
+ nvisual * sizeof (xPictVisual) +
+ numSubpixel * sizeof (CARD32));
+ reply = (xRenderQueryPictFormatsReply *) xcalloc (1, rlength);
+ if (!reply)
+ return BadAlloc;
+ reply->type = X_Reply;
+ reply->sequenceNumber = client->sequence;
+ reply->length = bytes_to_int32(rlength - sizeof(xGenericReply));
+ reply->numFormats = nformat;
+ reply->numScreens = numScreens;
+ reply->numDepths = ndepth;
+ reply->numVisuals = nvisual;
+ reply->numSubpixel = numSubpixel;
+
+ pictForm = (xPictFormInfo *) (reply + 1);
+
+ for (s = 0; s < numScreens; s++)
+ {
+ pScreen = screenInfo.screens[s];
+ ps = GetPictureScreenIfSet(pScreen);
+ if (ps)
+ {
+ for (nformat = 0, pFormat = ps->formats;
+ nformat < ps->nformats;
+ nformat++, pFormat++)
+ {
+ pictForm->id = pFormat->id;
+ pictForm->type = pFormat->type;
+ pictForm->depth = pFormat->depth;
+ pictForm->direct.red = pFormat->direct.red;
+ pictForm->direct.redMask = pFormat->direct.redMask;
+ pictForm->direct.green = pFormat->direct.green;
+ pictForm->direct.greenMask = pFormat->direct.greenMask;
+ pictForm->direct.blue = pFormat->direct.blue;
+ pictForm->direct.blueMask = pFormat->direct.blueMask;
+ pictForm->direct.alpha = pFormat->direct.alpha;
+ pictForm->direct.alphaMask = pFormat->direct.alphaMask;
+ if (pFormat->type == PictTypeIndexed && pFormat->index.pColormap)
+ pictForm->colormap = pFormat->index.pColormap->mid;
+ else
+ pictForm->colormap = None;
+ if (client->swapped)
+ {
+ swapl (&pictForm->id, n);
+ swaps (&pictForm->direct.red, n);
+ swaps (&pictForm->direct.redMask, n);
+ swaps (&pictForm->direct.green, n);
+ swaps (&pictForm->direct.greenMask, n);
+ swaps (&pictForm->direct.blue, n);
+ swaps (&pictForm->direct.blueMask, n);
+ swaps (&pictForm->direct.alpha, n);
+ swaps (&pictForm->direct.alphaMask, n);
+ swapl (&pictForm->colormap, n);
+ }
+ pictForm++;
+ }
+ }
+ }
+
+ pictScreen = (xPictScreen *) pictForm;
+ for (s = 0; s < numScreens; s++)
+ {
+ pScreen = screenInfo.screens[s];
+ pictDepth = (xPictDepth *) (pictScreen + 1);
+ ndepth = 0;
+ for (d = 0; d < pScreen->numDepths; d++)
+ {
+ pictVisual = (xPictVisual *) (pictDepth + 1);
+ pDepth = pScreen->allowedDepths + d;
+
+ nvisual = 0;
+ for (v = 0; v < pDepth->numVids; v++)
+ {
+ pVisual = findVisual (pScreen, pDepth->vids[v]);
+ if (pVisual && (pFormat = PictureMatchVisual (pScreen,
+ pDepth->depth,
+ pVisual)))
+ {
+ pictVisual->visual = pVisual->vid;
+ pictVisual->format = pFormat->id;
+ if (client->swapped)
+ {
+ swapl (&pictVisual->visual, n);
+ swapl (&pictVisual->format, n);
+ }
+ pictVisual++;
+ nvisual++;
+ }
+ }
+ pictDepth->depth = pDepth->depth;
+ pictDepth->nPictVisuals = nvisual;
+ if (client->swapped)
+ {
+ swaps (&pictDepth->nPictVisuals, n);
+ }
+ ndepth++;
+ pictDepth = (xPictDepth *) pictVisual;
+ }
+ pictScreen->nDepth = ndepth;
+ ps = GetPictureScreenIfSet(pScreen);
+ if (ps)
+ pictScreen->fallback = ps->fallback->id;
+ else
+ pictScreen->fallback = 0;
+ if (client->swapped)
+ {
+ swapl (&pictScreen->nDepth, n);
+ swapl (&pictScreen->fallback, n);
+ }
+ pictScreen = (xPictScreen *) pictDepth;
+ }
+ pictSubpixel = (CARD32 *) pictScreen;
+
+ for (s = 0; s < numSubpixel; s++)
+ {
+ pScreen = screenInfo.screens[s];
+ ps = GetPictureScreenIfSet(pScreen);
+ if (ps)
+ *pictSubpixel = ps->subpixel;
+ else
+ *pictSubpixel = SubPixelUnknown;
+ if (client->swapped)
+ {
+ swapl (pictSubpixel, n);
+ }
+ ++pictSubpixel;
+ }
+
+ if (client->swapped)
+ {
+ swaps (&reply->sequenceNumber, n);
+ swapl (&reply->length, n);
+ swapl (&reply->numFormats, n);
+ swapl (&reply->numScreens, n);
+ swapl (&reply->numDepths, n);
+ swapl (&reply->numVisuals, n);
+ swapl (&reply->numSubpixel, n);
+ }
+ WriteToClient(client, rlength, (char *) reply);
+ xfree (reply);
+ return client->noClientException;
+}
+
+static int
+ProcRenderQueryPictIndexValues (ClientPtr client)
+{
+ PictFormatPtr pFormat;
+ int rc, num;
+ int rlength;
+ int i, n;
+ REQUEST(xRenderQueryPictIndexValuesReq);
+ xRenderQueryPictIndexValuesReply *reply;
+ xIndexValue *values;
+
+ REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq);
+
+ rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+
+ if (pFormat->type != PictTypeIndexed)
+ {
+ client->errorValue = stuff->format;
+ return BadMatch;
+ }
+ num = pFormat->index.nvalues;
+ rlength = (sizeof (xRenderQueryPictIndexValuesReply) +
+ num * sizeof(xIndexValue));
+ reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength);
+ if (!reply)
+ return BadAlloc;
+
+ reply->type = X_Reply;
+ reply->sequenceNumber = client->sequence;
+ reply->length = bytes_to_int32(rlength - sizeof(xGenericReply));
+ reply->numIndexValues = num;
+
+ values = (xIndexValue *) (reply + 1);
+
+ memcpy (reply + 1, pFormat->index.pValues, num * sizeof (xIndexValue));
+
+ if (client->swapped)
+ {
+ for (i = 0; i < num; i++)
+ {
+ swapl (&values[i].pixel, n);
+ swaps (&values[i].red, n);
+ swaps (&values[i].green, n);
+ swaps (&values[i].blue, n);
+ swaps (&values[i].alpha, n);
+ }
+ swaps (&reply->sequenceNumber, n);
+ swapl (&reply->length, n);
+ swapl (&reply->numIndexValues, n);
+ }
+
+ WriteToClient(client, rlength, (char *) reply);
+ xfree(reply);
+ return (client->noClientException);
+}
+
+static int
+ProcRenderQueryDithers (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+ProcRenderCreatePicture (ClientPtr client)
+{
+ PicturePtr pPicture;
+ DrawablePtr pDrawable;
+ PictFormatPtr pFormat;
+ int len, error, rc;
+ REQUEST(xRenderCreatePictureReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
+
+ LEGAL_NEW_RESOURCE(stuff->pid, client);
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixReadAccess|DixAddAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+
+ if (pFormat->depth != pDrawable->depth)
+ return BadMatch;
+ len = client->req_len - bytes_to_int32(sizeof(xRenderCreatePictureReq));
+ if (Ones(stuff->mask) != len)
+ return BadLength;
+
+ pPicture = CreatePicture (stuff->pid,
+ pDrawable,
+ pFormat,
+ stuff->mask,
+ (XID *) (stuff + 1),
+ client,
+ &error);
+ if (!pPicture)
+ return error;
+ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
+ return BadAlloc;
+ return Success;
+}
+
+static int
+ProcRenderChangePicture (ClientPtr client)
+{
+ PicturePtr pPicture;
+ REQUEST(xRenderChangePictureReq);
+ int len;
+
+ REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
+ VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
+ RenderErrBase + BadPicture);
+
+ len = client->req_len - bytes_to_int32(sizeof(xRenderChangePictureReq));
+ if (Ones(stuff->mask) != len)
+ return BadLength;
+
+ return ChangePicture (pPicture, stuff->mask, (XID *) (stuff + 1),
+ (DevUnion *) 0, client);
+}
+
+static int
+ProcRenderSetPictureClipRectangles (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureClipRectanglesReq);
+ PicturePtr pPicture;
+ int nr;
+ int result;
+
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
+ VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
+ RenderErrBase + BadPicture);
+ if (!pPicture->pDrawable)
+ return BadDrawable;
+
+ nr = (client->req_len << 2) - sizeof(xRenderSetPictureClipRectanglesReq);
+ if (nr & 4)
+ return BadLength;
+ nr >>= 3;
+ result = SetPictureClipRects (pPicture,
+ stuff->xOrigin, stuff->yOrigin,
+ nr, (xRectangle *) &stuff[1]);
+ if (client->noClientException != Success)
+ return(client->noClientException);
+ else
+ return(result);
+}
+
+static int
+ProcRenderFreePicture (ClientPtr client)
+{
+ PicturePtr pPicture;
+ REQUEST(xRenderFreePictureReq);
+
+ REQUEST_SIZE_MATCH(xRenderFreePictureReq);
+
+ VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess,
+ RenderErrBase + BadPicture);
+ FreeResource (stuff->picture, RT_NONE);
+ return(client->noClientException);
+}
+
+static Bool
+PictOpValid (CARD8 op)
+{
+ if (/*PictOpMinimum <= op && */ op <= PictOpMaximum)
+ return TRUE;
+ if (PictOpDisjointMinimum <= op && op <= PictOpDisjointMaximum)
+ return TRUE;
+ if (PictOpConjointMinimum <= op && op <= PictOpConjointMaximum)
+ return TRUE;
+ if (PictOpBlendMinimum <= op && op <= PictOpBlendMaximum)
+ return TRUE;
+ return FALSE;
+}
+
+static int
+ProcRenderComposite (ClientPtr client)
+{
+ PicturePtr pSrc, pMask, pDst;
+ REQUEST(xRenderCompositeReq);
+
+ REQUEST_SIZE_MATCH(xRenderCompositeReq);
+ if (!PictOpValid (stuff->op))
+ {
+ client->errorValue = stuff->op;
+ return BadValue;
+ }
+ VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pDst->pDrawable)
+ return BadDrawable;
+ VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
+ (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
+ return BadMatch;
+ CompositePicture (stuff->op,
+ pSrc,
+ pMask,
+ pDst,
+ stuff->xSrc,
+ stuff->ySrc,
+ stuff->xMask,
+ stuff->yMask,
+ stuff->xDst,
+ stuff->yDst,
+ stuff->width,
+ stuff->height);
+ return Success;
+}
+
+static int
+ProcRenderScale (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+ProcRenderTrapezoids (ClientPtr client)
+{
+ int rc, ntraps;
+ PicturePtr pSrc, pDst;
+ PictFormatPtr pFormat;
+ REQUEST(xRenderTrapezoidsReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
+ if (!PictOpValid (stuff->op))
+ {
+ client->errorValue = stuff->op;
+ return BadValue;
+ }
+ VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pDst->pDrawable)
+ return BadDrawable;
+ if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
+ return BadMatch;
+ if (stuff->maskFormat)
+ {
+ rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+ }
+ else
+ pFormat = 0;
+ ntraps = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
+ if (ntraps % sizeof (xTrapezoid))
+ return BadLength;
+ ntraps /= sizeof (xTrapezoid);
+ if (ntraps)
+ CompositeTrapezoids (stuff->op, pSrc, pDst, pFormat,
+ stuff->xSrc, stuff->ySrc,
+ ntraps, (xTrapezoid *) &stuff[1]);
+ return client->noClientException;
+}
+
+static int
+ProcRenderTriangles (ClientPtr client)
+{
+ int rc, ntris;
+ PicturePtr pSrc, pDst;
+ PictFormatPtr pFormat;
+ REQUEST(xRenderTrianglesReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
+ if (!PictOpValid (stuff->op))
+ {
+ client->errorValue = stuff->op;
+ return BadValue;
+ }
+ VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pDst->pDrawable)
+ return BadDrawable;
+ if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
+ return BadMatch;
+ if (stuff->maskFormat)
+ {
+ rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+ }
+ else
+ pFormat = 0;
+ ntris = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
+ if (ntris % sizeof (xTriangle))
+ return BadLength;
+ ntris /= sizeof (xTriangle);
+ if (ntris)
+ CompositeTriangles (stuff->op, pSrc, pDst, pFormat,
+ stuff->xSrc, stuff->ySrc,
+ ntris, (xTriangle *) &stuff[1]);
+ return client->noClientException;
+}
+
+static int
+ProcRenderTriStrip (ClientPtr client)
+{
+ int rc, npoints;
+ PicturePtr pSrc, pDst;
+ PictFormatPtr pFormat;
+ REQUEST(xRenderTrianglesReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
+ if (!PictOpValid (stuff->op))
+ {
+ client->errorValue = stuff->op;
+ return BadValue;
+ }
+ VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pDst->pDrawable)
+ return BadDrawable;
+ if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
+ return BadMatch;
+ if (stuff->maskFormat)
+ {
+ rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+ }
+ else
+ pFormat = 0;
+ npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq));
+ if (npoints & 4)
+ return(BadLength);
+ npoints >>= 3;
+ if (npoints >= 3)
+ CompositeTriStrip (stuff->op, pSrc, pDst, pFormat,
+ stuff->xSrc, stuff->ySrc,
+ npoints, (xPointFixed *) &stuff[1]);
+ return client->noClientException;
+}
+
+static int
+ProcRenderTriFan (ClientPtr client)
+{
+ int rc, npoints;
+ PicturePtr pSrc, pDst;
+ PictFormatPtr pFormat;
+ REQUEST(xRenderTrianglesReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
+ if (!PictOpValid (stuff->op))
+ {
+ client->errorValue = stuff->op;
+ return BadValue;
+ }
+ VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pDst->pDrawable)
+ return BadDrawable;
+ if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
+ return BadMatch;
+ if (stuff->maskFormat)
+ {
+ rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+ }
+ else
+ pFormat = 0;
+ npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq));
+ if (npoints & 4)
+ return(BadLength);
+ npoints >>= 3;
+ if (npoints >= 3)
+ CompositeTriFan (stuff->op, pSrc, pDst, pFormat,
+ stuff->xSrc, stuff->ySrc,
+ npoints, (xPointFixed *) &stuff[1]);
+ return client->noClientException;
+}
+
+static int
+ProcRenderColorTrapezoids (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+ProcRenderColorTriangles (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+ProcRenderTransform (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+ProcRenderCreateGlyphSet (ClientPtr client)
+{
+ GlyphSetPtr glyphSet;
+ PictFormatPtr format;
+ int rc, f;
+ REQUEST(xRenderCreateGlyphSetReq);
+
+ REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
+
+ LEGAL_NEW_RESOURCE(stuff->gsid, client);
+ rc = dixLookupResourceByType((pointer *)&format, stuff->format,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+
+ switch (format->depth) {
+ case 1:
+ f = GlyphFormat1;
+ break;
+ case 4:
+ f = GlyphFormat4;
+ break;
+ case 8:
+ f = GlyphFormat8;
+ break;
+ case 16:
+ f = GlyphFormat16;
+ break;
+ case 32:
+ f = GlyphFormat32;
+ break;
+ default:
+ return BadMatch;
+ }
+ if (format->type != PictTypeDirect)
+ return BadMatch;
+ glyphSet = AllocateGlyphSet (f, format);
+ if (!glyphSet)
+ return BadAlloc;
+ /* security creation/labeling check */
+ rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->gsid, GlyphSetType,
+ glyphSet, RT_NONE, NULL, DixCreateAccess);
+ if (rc != Success)
+ return rc;
+ if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
+ return BadAlloc;
+ return Success;
+}
+
+static int
+ProcRenderReferenceGlyphSet (ClientPtr client)
+{
+ GlyphSetPtr glyphSet;
+ int rc;
+ REQUEST(xRenderReferenceGlyphSetReq);
+
+ REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
+
+ LEGAL_NEW_RESOURCE(stuff->gsid, client);
+
+ rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->existing, GlyphSetType,
+ client, DixGetAttrAccess);
+ if (rc != Success)
+ {
+ client->errorValue = stuff->existing;
+ return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
+ }
+ glyphSet->refcnt++;
+ if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
+ return BadAlloc;
+ return client->noClientException;
+}
+
+#define NLOCALDELTA 64
+#define NLOCALGLYPH 256
+
+static int
+ProcRenderFreeGlyphSet (ClientPtr client)
+{
+ GlyphSetPtr glyphSet;
+ int rc;
+ REQUEST(xRenderFreeGlyphSetReq);
+
+ REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
+ rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, GlyphSetType,
+ client, DixDestroyAccess);
+ if (rc != Success)
+ {
+ client->errorValue = stuff->glyphset;
+ return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
+ }
+ FreeResource (stuff->glyphset, RT_NONE);
+ return client->noClientException;
+}
+
+typedef struct _GlyphNew {
+ Glyph id;
+ GlyphPtr glyph;
+ Bool found;
+ unsigned char sha1[20];
+} GlyphNewRec, *GlyphNewPtr;
+
+#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
+
+static int
+ProcRenderAddGlyphs (ClientPtr client)
+{
+ GlyphSetPtr glyphSet;
+ REQUEST(xRenderAddGlyphsReq);
+ GlyphNewRec glyphsLocal[NLOCALGLYPH];
+ GlyphNewPtr glyphsBase, glyphs, glyph_new;
+ int remain, nglyphs;
+ CARD32 *gids;
+ xGlyphInfo *gi;
+ CARD8 *bits;
+ unsigned int size;
+ int err;
+ int i, screen;
+ PicturePtr pSrc = NULL, pDst = NULL;
+ PixmapPtr pSrcPix = NULL, pDstPix = NULL;
+ CARD32 component_alpha;
+
+ REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
+ err = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, GlyphSetType,
+ client, DixAddAccess);
+ if (err != Success)
+ {
+ client->errorValue = stuff->glyphset;
+ return (err == BadValue) ? RenderErrBase + BadGlyphSet : err;
+ }
+
+ err = BadAlloc;
+ nglyphs = stuff->nglyphs;
+ if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec))
+ return BadAlloc;
+
+ component_alpha = NeedsComponent (glyphSet->format->format);
+
+ if (nglyphs <= NLOCALGLYPH) {
+ memset (glyphsLocal, 0, sizeof (glyphsLocal));
+ glyphsBase = glyphsLocal;
+ }
+ else
+ {
+ glyphsBase = (GlyphNewPtr) Xcalloc (nglyphs * sizeof (GlyphNewRec));
+ if (!glyphsBase)
+ return BadAlloc;
+ }
+
+ remain = (client->req_len << 2) - sizeof (xRenderAddGlyphsReq);
+
+ glyphs = glyphsBase;
+
+ gids = (CARD32 *) (stuff + 1);
+ gi = (xGlyphInfo *) (gids + nglyphs);
+ bits = (CARD8 *) (gi + nglyphs);
+ remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
+ for (i = 0; i < nglyphs; i++)
+ {
+ size_t padded_width;
+ glyph_new = &glyphs[i];
+
+ padded_width = PixmapBytePad (gi[i].width,
+ glyphSet->format->depth);
+
+ if (gi[i].height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi[i].height)
+ break;
+
+ size = gi[i].height * padded_width;
+ if (remain < size)
+ break;
+
+ err = HashGlyph (&gi[i], bits, size, glyph_new->sha1);
+ if (err)
+ goto bail;
+
+ glyph_new->glyph = FindGlyphByHash (glyph_new->sha1,
+ glyphSet->fdepth);
+
+ if (glyph_new->glyph && glyph_new->glyph != DeletedGlyph)
+ {
+ glyph_new->found = TRUE;
+ }
+ else
+ {
+ GlyphPtr glyph;
+
+ glyph_new->found = FALSE;
+ glyph_new->glyph = glyph = AllocateGlyph (&gi[i], glyphSet->fdepth);
+ if (! glyph)
+ {
+ err = BadAlloc;
+ goto bail;
+ }
+
+ for (screen = 0; screen < screenInfo.numScreens; screen++)
+ {
+ int width = gi[i].width;
+ int height = gi[i].height;
+ int depth = glyphSet->format->depth;
+ ScreenPtr pScreen;
+ int error;
+
+ /* Skip work if it's invisibly small anyway */
+ if (!width || !height)
+ break;
+
+ pScreen = screenInfo.screens[screen];
+ pSrcPix = GetScratchPixmapHeader (pScreen,
+ width, height,
+ depth, depth,
+ -1, bits);
+ if (! pSrcPix)
+ {
+ err = BadAlloc;
+ goto bail;
+ }
+
+ pSrc = CreatePicture (0, &pSrcPix->drawable,
+ glyphSet->format, 0, NULL,
+ serverClient, &error);
+ if (! pSrc)
+ {
+ err = BadAlloc;
+ goto bail;
+ }
+
+ pDstPix = (pScreen->CreatePixmap) (pScreen,
+ width, height, depth,
+ CREATE_PIXMAP_USAGE_GLYPH_PICTURE);
+
+ GlyphPicture (glyph)[screen] = pDst =
+ CreatePicture (0, &pDstPix->drawable,
+ glyphSet->format,
+ CPComponentAlpha, &component_alpha,
+ serverClient, &error);
+
+ /* The picture takes a reference to the pixmap, so we
+ drop ours. */
+ (pScreen->DestroyPixmap) (pDstPix);
+
+ if (! pDst)
+ {
+ err = BadAlloc;
+ goto bail;
+ }
+
+ CompositePicture (PictOpSrc,
+ pSrc,
+ None,
+ pDst,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ width, height);
+
+ FreePicture ((pointer) pSrc, 0);
+ pSrc = NULL;
+ FreeScratchPixmapHeader (pSrcPix);
+ pSrcPix = NULL;
+ }
+
+ memcpy (glyph_new->glyph->sha1, glyph_new->sha1, 20);
+ }
+
+ glyph_new->id = gids[i];
+
+ if (size & 3)
+ size += 4 - (size & 3);
+ bits += size;
+ remain -= size;
+ }
+ if (remain || i < nglyphs)
+ {
+ err = BadLength;
+ goto bail;
+ }
+ if (!ResizeGlyphSet (glyphSet, nglyphs))
+ {
+ err = BadAlloc;
+ goto bail;
+ }
+ for (i = 0; i < nglyphs; i++)
+ AddGlyph (glyphSet, glyphs[i].glyph, glyphs[i].id);
+
+ if (glyphsBase != glyphsLocal)
+ Xfree (glyphsBase);
+ return client->noClientException;
+bail:
+ if (pSrc)
+ FreePicture ((pointer) pSrc, 0);
+ if (pSrcPix)
+ FreeScratchPixmapHeader (pSrcPix);
+ for (i = 0; i < nglyphs; i++)
+ if (glyphs[i].glyph && ! glyphs[i].found)
+ xfree (glyphs[i].glyph);
+ if (glyphsBase != glyphsLocal)
+ Xfree (glyphsBase);
+ return err;
+}
+
+static int
+ProcRenderAddGlyphsFromPicture (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+ProcRenderFreeGlyphs (ClientPtr client)
+{
+ REQUEST(xRenderFreeGlyphsReq);
+ GlyphSetPtr glyphSet;
+ int rc, nglyph;
+ CARD32 *gids;
+ CARD32 glyph;
+
+ REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
+ rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, GlyphSetType,
+ client, DixRemoveAccess);
+ if (rc != Success)
+ {
+ client->errorValue = stuff->glyphset;
+ return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
+ }
+ nglyph = bytes_to_int32((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq));
+ gids = (CARD32 *) (stuff + 1);
+ while (nglyph-- > 0)
+ {
+ glyph = *gids++;
+ if (!DeleteGlyph (glyphSet, glyph))
+ {
+ client->errorValue = glyph;
+ return RenderErrBase + BadGlyph;
+ }
+ }
+ return client->noClientException;
+}
+
+static int
+ProcRenderCompositeGlyphs (ClientPtr client)
+{
+ GlyphSetPtr glyphSet;
+ GlyphSet gs;
+ PicturePtr pSrc, pDst;
+ PictFormatPtr pFormat;
+ GlyphListRec listsLocal[NLOCALDELTA];
+ GlyphListPtr lists, listsBase;
+ GlyphPtr glyphsLocal[NLOCALGLYPH];
+ Glyph glyph;
+ GlyphPtr *glyphs, *glyphsBase;
+ xGlyphElt *elt;
+ CARD8 *buffer, *end;
+ int nglyph;
+ int nlist;
+ int space;
+ int size;
+ int rc, n;
+
+ REQUEST(xRenderCompositeGlyphsReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
+
+ switch (stuff->renderReqType) {
+ default: size = 1; break;
+ case X_RenderCompositeGlyphs16: size = 2; break;
+ case X_RenderCompositeGlyphs32: size = 4; break;
+ }
+
+ if (!PictOpValid (stuff->op))
+ {
+ client->errorValue = stuff->op;
+ return BadValue;
+ }
+ VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pDst->pDrawable)
+ return BadDrawable;
+ if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen)
+ return BadMatch;
+ if (stuff->maskFormat)
+ {
+ rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
+ PictFormatType, client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc;
+ }
+ else
+ pFormat = 0;
+
+ rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset,
+ GlyphSetType, client, DixUseAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
+
+ buffer = (CARD8 *) (stuff + 1);
+ end = (CARD8 *) stuff + (client->req_len << 2);
+ nglyph = 0;
+ nlist = 0;
+ while (buffer + sizeof (xGlyphElt) < end)
+ {
+ elt = (xGlyphElt *) buffer;
+ buffer += sizeof (xGlyphElt);
+
+ if (elt->len == 0xff)
+ {
+ buffer += 4;
+ }
+ else
+ {
+ nlist++;
+ nglyph += elt->len;
+ space = size * elt->len;
+ if (space & 3)
+ space += 4 - (space & 3);
+ buffer += space;
+ }
+ }
+ if (nglyph <= NLOCALGLYPH)
+ glyphsBase = glyphsLocal;
+ else
+ {
+ glyphsBase = (GlyphPtr *) xalloc (nglyph * sizeof (GlyphPtr));
+ if (!glyphsBase)
+ return BadAlloc;
+ }
+ if (nlist <= NLOCALDELTA)
+ listsBase = listsLocal;
+ else
+ {
+ listsBase = (GlyphListPtr) xalloc (nlist * sizeof (GlyphListRec));
+ if (!listsBase)
+ return BadAlloc;
+ }
+ buffer = (CARD8 *) (stuff + 1);
+ glyphs = glyphsBase;
+ lists = listsBase;
+ while (buffer + sizeof (xGlyphElt) < end)
+ {
+ elt = (xGlyphElt *) buffer;
+ buffer += sizeof (xGlyphElt);
+
+ if (elt->len == 0xff)
+ {
+ if (buffer + sizeof (GlyphSet) < end)
+ {
+ memcpy(&gs, buffer, sizeof(GlyphSet));
+ rc = dixLookupResourceByType((pointer *)&glyphSet, gs,
+ GlyphSetType, client,
+ DixUseAccess);
+ if (rc != Success)
+ {
+ if (glyphsBase != glyphsLocal)
+ xfree (glyphsBase);
+ if (listsBase != listsLocal)
+ xfree (listsBase);
+ return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
+ }
+ }
+ buffer += 4;
+ }
+ else
+ {
+ lists->xOff = elt->deltax;
+ lists->yOff = elt->deltay;
+ lists->format = glyphSet->format;
+ lists->len = 0;
+ n = elt->len;
+ while (n--)
+ {
+ if (buffer + size <= end)
+ {
+ switch (size) {
+ case 1:
+ glyph = *((CARD8 *)buffer); break;
+ case 2:
+ glyph = *((CARD16 *)buffer); break;
+ case 4:
+ default:
+ glyph = *((CARD32 *)buffer); break;
+ }
+ if ((*glyphs = FindGlyph (glyphSet, glyph)))
+ {
+ lists->len++;
+ glyphs++;
+ }
+ }
+ buffer += size;
+ }
+ space = size * elt->len;
+ if (space & 3)
+ buffer += 4 - (space & 3);
+ lists++;
+ }
+ }
+ if (buffer > end)
+ return BadLength;
+
+ CompositeGlyphs (stuff->op,
+ pSrc,
+ pDst,
+ pFormat,
+ stuff->xSrc,
+ stuff->ySrc,
+ nlist,
+ listsBase,
+ glyphsBase);
+
+ if (glyphsBase != glyphsLocal)
+ xfree (glyphsBase);
+ if (listsBase != listsLocal)
+ xfree (listsBase);
+
+ return client->noClientException;
+}
+
+static int
+ProcRenderFillRectangles (ClientPtr client)
+{
+ PicturePtr pDst;
+ int things;
+ REQUEST(xRenderFillRectanglesReq);
+
+ REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
+ if (!PictOpValid (stuff->op))
+ {
+ client->errorValue = stuff->op;
+ return BadValue;
+ }
+ VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pDst->pDrawable)
+ return BadDrawable;
+
+ things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq);
+ if (things & 4)
+ return(BadLength);
+ things >>= 3;
+
+ CompositeRects (stuff->op,
+ pDst,
+ &stuff->color,
+ things,
+ (xRectangle *) &stuff[1]);
+
+ return client->noClientException;
+}
+
+static void
+RenderSetBit (unsigned char *line, int x, int bit)
+{
+ unsigned char mask;
+
+ if (screenInfo.bitmapBitOrder == LSBFirst)
+ mask = (1 << (x & 7));
+ else
+ mask = (0x80 >> (x & 7));
+ /* XXX assumes byte order is host byte order */
+ line += (x >> 3);
+ if (bit)
+ *line |= mask;
+ else
+ *line &= ~mask;
+}
+
+#define DITHER_DIM 2
+
+static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = {
+ { 1, 3, },
+ { 4, 2, },
+};
+
+#define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1)
+
+static int
+ProcRenderCreateCursor (ClientPtr client)
+{
+ REQUEST(xRenderCreateCursorReq);
+ PicturePtr pSrc;
+ ScreenPtr pScreen;
+ unsigned short width, height;
+ CARD32 *argbbits, *argb;
+ unsigned char *srcbits, *srcline;
+ unsigned char *mskbits, *mskline;
+ int stride;
+ int x, y;
+ int nbytes_mono;
+ CursorMetricRec cm;
+ CursorPtr pCursor;
+ CARD32 twocolor[3];
+ int rc, ncolor;
+
+ REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
+ LEGAL_NEW_RESOURCE(stuff->cid, client);
+
+ VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ if (!pSrc->pDrawable)
+ return BadDrawable;
+ pScreen = pSrc->pDrawable->pScreen;
+ width = pSrc->pDrawable->width;
+ height = pSrc->pDrawable->height;
+ if (height && width > UINT32_MAX/(height*sizeof(CARD32)))
+ return BadAlloc;
+ if ( stuff->x > width
+ || stuff->y > height )
+ return (BadMatch);
+ argbbits = xalloc (width * height * sizeof (CARD32));
+ if (!argbbits)
+ return (BadAlloc);
+
+ stride = BitmapBytePad(width);
+ nbytes_mono = stride*height;
+ srcbits = xcalloc(1, nbytes_mono);
+ if (!srcbits)
+ {
+ xfree (argbbits);
+ return (BadAlloc);
+ }
+ mskbits = xcalloc(1, nbytes_mono);
+ if (!mskbits)
+ {
+ xfree(argbbits);
+ xfree(srcbits);
+ return (BadAlloc);
+ }
+
+ if (pSrc->format == PICT_a8r8g8b8)
+ {
+ (*pScreen->GetImage) (pSrc->pDrawable,
+ 0, 0, width, height, ZPixmap,
+ 0xffffffff, (pointer) argbbits);
+ }
+ else
+ {
+ PixmapPtr pPixmap;
+ PicturePtr pPicture;
+ PictFormatPtr pFormat;
+ int error;
+
+ pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
+ if (!pFormat)
+ {
+ xfree (argbbits);
+ xfree (srcbits);
+ xfree (mskbits);
+ return (BadImplementation);
+ }
+ pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32,
+ CREATE_PIXMAP_USAGE_SCRATCH);
+ if (!pPixmap)
+ {
+ xfree (argbbits);
+ xfree (srcbits);
+ xfree (mskbits);
+ return (BadAlloc);
+ }
+ pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0,
+ client, &error);
+ if (!pPicture)
+ {
+ xfree (argbbits);
+ xfree (srcbits);
+ xfree (mskbits);
+ return error;
+ }
+ (*pScreen->DestroyPixmap) (pPixmap);
+ CompositePicture (PictOpSrc,
+ pSrc, 0, pPicture,
+ 0, 0, 0, 0, 0, 0, width, height);
+ (*pScreen->GetImage) (pPicture->pDrawable,
+ 0, 0, width, height, ZPixmap,
+ 0xffffffff, (pointer) argbbits);
+ FreePicture (pPicture, 0);
+ }
+ /*
+ * Check whether the cursor can be directly supported by
+ * the core cursor code
+ */
+ ncolor = 0;
+ argb = argbbits;
+ for (y = 0; ncolor <= 2 && y < height; y++)
+ {
+ for (x = 0; ncolor <= 2 && x < width; x++)
+ {
+ CARD32 p = *argb++;
+ CARD32 a = (p >> 24);
+
+ if (a == 0) /* transparent */
+ continue;
+ if (a == 0xff) /* opaque */
+ {
+ int n;
+ for (n = 0; n < ncolor; n++)
+ if (p == twocolor[n])
+ break;
+ if (n == ncolor)
+ twocolor[ncolor++] = p;
+ }
+ else
+ ncolor = 3;
+ }
+ }
+
+ /*
+ * Convert argb image to two plane cursor
+ */
+ srcline = srcbits;
+ mskline = mskbits;
+ argb = argbbits;
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ CARD32 p = *argb++;
+
+ if (ncolor <= 2)
+ {
+ CARD32 a = ((p >> 24));
+
+ RenderSetBit (mskline, x, a != 0);
+ RenderSetBit (srcline, x, a != 0 && p == twocolor[0]);
+ }
+ else
+ {
+ CARD32 a = ((p >> 24) * DITHER_SIZE + 127) / 255;
+ CARD32 i = ((CvtR8G8B8toY15(p) >> 7) * DITHER_SIZE + 127) / 255;
+ CARD32 d = orderedDither[y&(DITHER_DIM-1)][x&(DITHER_DIM-1)];
+ /* Set mask from dithered alpha value */
+ RenderSetBit(mskline, x, a > d);
+ /* Set src from dithered intensity value */
+ RenderSetBit(srcline, x, a > d && i <= d);
+ }
+ }
+ srcline += stride;
+ mskline += stride;
+ }
+ /*
+ * Dither to white and black if the cursor has more than two colors
+ */
+ if (ncolor > 2)
+ {
+ twocolor[0] = 0xff000000;
+ twocolor[1] = 0xffffffff;
+ }
+ else
+ {
+ xfree (argbbits);
+ argbbits = 0;
+ }
+
+#define GetByte(p,s) (((p) >> (s)) & 0xff)
+#define GetColor(p,s) (GetByte(p,s) | (GetByte(p,s) << 8))
+
+ cm.width = width;
+ cm.height = height;
+ cm.xhot = stuff->x;
+ cm.yhot = stuff->y;
+ rc = AllocARGBCursor(srcbits, mskbits, argbbits, &cm,
+ GetColor(twocolor[0], 16),
+ GetColor(twocolor[0], 8),
+ GetColor(twocolor[0], 0),
+ GetColor(twocolor[1], 16),
+ GetColor(twocolor[1], 8),
+ GetColor(twocolor[1], 0),
+ &pCursor, client, stuff->cid);
+ if (rc != Success)
+ return rc;
+ if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
+ return BadAlloc;
+
+ return client->noClientException;
+}
+
+static int
+ProcRenderSetPictureTransform (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureTransformReq);
+ PicturePtr pPicture;
+ int result;
+
+ REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
+ VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
+ RenderErrBase + BadPicture);
+ result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform);
+ if (client->noClientException != Success)
+ return(client->noClientException);
+ else
+ return(result);
+}
+
+static int
+ProcRenderQueryFilters (ClientPtr client)
+{
+ REQUEST (xRenderQueryFiltersReq);
+ DrawablePtr pDrawable;
+ xRenderQueryFiltersReply *reply;
+ int nbytesName;
+ int nnames;
+ ScreenPtr pScreen;
+ PictureScreenPtr ps;
+ int i, j, len, total_bytes, rc;
+ INT16 *aliases;
+ char *names;
+
+ REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ pScreen = pDrawable->pScreen;
+ nbytesName = 0;
+ nnames = 0;
+ ps = GetPictureScreenIfSet(pScreen);
+ if (ps)
+ {
+ for (i = 0; i < ps->nfilters; i++)
+ nbytesName += 1 + strlen (ps->filters[i].name);
+ for (i = 0; i < ps->nfilterAliases; i++)
+ nbytesName += 1 + strlen (ps->filterAliases[i].alias);
+ nnames = ps->nfilters + ps->nfilterAliases;
+ }
+ len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName);
+ total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2);
+ reply = (xRenderQueryFiltersReply *) xalloc (total_bytes);
+ if (!reply)
+ return BadAlloc;
+ aliases = (INT16 *) (reply + 1);
+ names = (char *) (aliases + ((nnames + 1) & ~1));
+
+ reply->type = X_Reply;
+ reply->sequenceNumber = client->sequence;
+ reply->length = len;
+ reply->numAliases = nnames;
+ reply->numFilters = nnames;
+ if (ps)
+ {
+
+ /* fill in alias values */
+ for (i = 0; i < ps->nfilters; i++)
+ aliases[i] = FilterAliasNone;
+ for (i = 0; i < ps->nfilterAliases; i++)
+ {
+ for (j = 0; j < ps->nfilters; j++)
+ if (ps->filterAliases[i].filter_id == ps->filters[j].id)
+ break;
+ if (j == ps->nfilters)
+ {
+ for (j = 0; j < ps->nfilterAliases; j++)
+ if (ps->filterAliases[i].filter_id ==
+ ps->filterAliases[j].alias_id)
+ {
+ break;
+ }
+ if (j == ps->nfilterAliases)
+ j = FilterAliasNone;
+ else
+ j = j + ps->nfilters;
+ }
+ aliases[i + ps->nfilters] = j;
+ }
+
+ /* fill in filter names */
+ for (i = 0; i < ps->nfilters; i++)
+ {
+ j = strlen (ps->filters[i].name);
+ *names++ = j;
+ strncpy (names, ps->filters[i].name, j);
+ names += j;
+ }
+
+ /* fill in filter alias names */
+ for (i = 0; i < ps->nfilterAliases; i++)
+ {
+ j = strlen (ps->filterAliases[i].alias);
+ *names++ = j;
+ strncpy (names, ps->filterAliases[i].alias, j);
+ names += j;
+ }
+ }
+
+ if (client->swapped)
+ {
+ register int n;
+
+ for (i = 0; i < reply->numAliases; i++)
+ {
+ swaps (&aliases[i], n);
+ }
+ swaps(&reply->sequenceNumber, n);
+ swapl(&reply->length, n);
+ swapl(&reply->numAliases, n);
+ swapl(&reply->numFilters, n);
+ }
+ WriteToClient(client, total_bytes, (char *) reply);
+ xfree (reply);
+
+ return(client->noClientException);
+}
+
+static int
+ProcRenderSetPictureFilter (ClientPtr client)
+{
+ REQUEST (xRenderSetPictureFilterReq);
+ PicturePtr pPicture;
+ int result;
+ xFixed *params;
+ int nparams;
+ char *name;
+
+ REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
+ VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
+ RenderErrBase + BadPicture);
+ name = (char *) (stuff + 1);
+ params = (xFixed *) (name + pad_to_int32(stuff->nbytes));
+ nparams = ((xFixed *) stuff + client->req_len) - params;
+ result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams);
+ return result;
+}
+
+static int
+ProcRenderCreateAnimCursor (ClientPtr client)
+{
+ REQUEST(xRenderCreateAnimCursorReq);
+ CursorPtr *cursors;
+ CARD32 *deltas;
+ CursorPtr pCursor;
+ int ncursor;
+ xAnimCursorElt *elt;
+ int i;
+ int ret;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateAnimCursorReq);
+ LEGAL_NEW_RESOURCE(stuff->cid, client);
+ if (client->req_len & 1)
+ return BadLength;
+ ncursor = (client->req_len - (bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
+ cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
+ if (!cursors)
+ return BadAlloc;
+ deltas = (CARD32 *) (cursors + ncursor);
+ elt = (xAnimCursorElt *) (stuff + 1);
+ for (i = 0; i < ncursor; i++)
+ {
+ ret = dixLookupResourceByType((pointer *)(cursors + i), elt->cursor,
+ RT_CURSOR, client, DixReadAccess);
+ if (ret != Success)
+ {
+ xfree (cursors);
+ return (ret == BadValue) ? BadCursor : ret;
+ }
+ deltas[i] = elt->delay;
+ elt++;
+ }
+ ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor, client,
+ stuff->cid);
+ xfree (cursors);
+ if (ret != Success)
+ return ret;
+
+ if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor))
+ return client->noClientException;
+ return BadAlloc;
+}
+
+static int
+ProcRenderAddTraps (ClientPtr client)
+{
+ int ntraps;
+ PicturePtr pPicture;
+ REQUEST(xRenderAddTrapsReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq);
+ VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ if (!pPicture->pDrawable)
+ return BadDrawable;
+ ntraps = (client->req_len << 2) - sizeof (xRenderAddTrapsReq);
+ if (ntraps % sizeof (xTrap))
+ return BadLength;
+ ntraps /= sizeof (xTrap);
+ if (ntraps)
+ AddTraps (pPicture,
+ stuff->xOff, stuff->yOff,
+ ntraps, (xTrap *) &stuff[1]);
+ return client->noClientException;
+}
+
+static int ProcRenderCreateSolidFill(ClientPtr client)
+{
+ PicturePtr pPicture;
+ int error = 0;
+ REQUEST(xRenderCreateSolidFillReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq);
+
+ LEGAL_NEW_RESOURCE(stuff->pid, client);
+
+ pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
+ if (!pPicture)
+ return error;
+ /* security creation/labeling check */
+ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
+ pPicture, RT_NONE, NULL, DixCreateAccess);
+ if (error != Success)
+ return error;
+ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
+ return BadAlloc;
+ return Success;
+}
+
+static int ProcRenderCreateLinearGradient (ClientPtr client)
+{
+ PicturePtr pPicture;
+ int len;
+ int error = 0;
+ xFixed *stops;
+ xRenderColor *colors;
+ REQUEST(xRenderCreateLinearGradientReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq);
+
+ LEGAL_NEW_RESOURCE(stuff->pid, client);
+
+ len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
+ if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+ if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+
+ stops = (xFixed *)(stuff + 1);
+ colors = (xRenderColor *)(stops + stuff->nStops);
+
+ pPicture = CreateLinearGradientPicture (stuff->pid, &stuff->p1, &stuff->p2,
+ stuff->nStops, stops, colors, &error);
+ if (!pPicture)
+ return error;
+ /* security creation/labeling check */
+ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
+ pPicture, RT_NONE, NULL, DixCreateAccess);
+ if (error != Success)
+ return error;
+ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
+ return BadAlloc;
+ return Success;
+}
+
+static int ProcRenderCreateRadialGradient (ClientPtr client)
+{
+ PicturePtr pPicture;
+ int len;
+ int error = 0;
+ xFixed *stops;
+ xRenderColor *colors;
+ REQUEST(xRenderCreateRadialGradientReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq);
+
+ LEGAL_NEW_RESOURCE(stuff->pid, client);
+
+ len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
+ if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+
+ stops = (xFixed *)(stuff + 1);
+ colors = (xRenderColor *)(stops + stuff->nStops);
+
+ pPicture = CreateRadialGradientPicture (stuff->pid, &stuff->inner, &stuff->outer,
+ stuff->inner_radius, stuff->outer_radius,
+ stuff->nStops, stops, colors, &error);
+ if (!pPicture)
+ return error;
+ /* security creation/labeling check */
+ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
+ pPicture, RT_NONE, NULL, DixCreateAccess);
+ if (error != Success)
+ return error;
+ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
+ return BadAlloc;
+ return Success;
+}
+
+static int ProcRenderCreateConicalGradient (ClientPtr client)
+{
+ PicturePtr pPicture;
+ int len;
+ int error = 0;
+ xFixed *stops;
+ xRenderColor *colors;
+ REQUEST(xRenderCreateConicalGradientReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq);
+
+ LEGAL_NEW_RESOURCE(stuff->pid, client);
+
+ len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
+ if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+
+ stops = (xFixed *)(stuff + 1);
+ colors = (xRenderColor *)(stops + stuff->nStops);
+
+ pPicture = CreateConicalGradientPicture (stuff->pid, &stuff->center, stuff->angle,
+ stuff->nStops, stops, colors, &error);
+ if (!pPicture)
+ return error;
+ /* security creation/labeling check */
+ error = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, PictureType,
+ pPicture, RT_NONE, NULL, DixCreateAccess);
+ if (error != Success)
+ return error;
+ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
+ return BadAlloc;
+ return Success;
+}
+
+
+static int
+ProcRenderDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ if (stuff->data < RenderNumberRequests)
+ return (*ProcRenderVector[stuff->data]) (client);
+ else
+ return BadRequest;
+}
+
+static int
+SProcRenderQueryVersion (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderQueryVersionReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->majorVersion, n);
+ swapl(&stuff->minorVersion, n);
+ return (*ProcRenderVector[stuff->renderReqType])(client);
+}
+
+static int
+SProcRenderQueryPictFormats (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderQueryPictFormatsReq);
+ swaps(&stuff->length, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderQueryPictIndexValues (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderQueryPictIndexValuesReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->format, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderQueryDithers (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+SProcRenderCreatePicture (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderCreatePictureReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->pid, n);
+ swapl(&stuff->drawable, n);
+ swapl(&stuff->format, n);
+ swapl(&stuff->mask, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderChangePicture (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderChangePictureReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->picture, n);
+ swapl(&stuff->mask, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderSetPictureClipRectangles (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderSetPictureClipRectanglesReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->picture, n);
+ swaps(&stuff->xOrigin, n);
+ swaps(&stuff->yOrigin, n);
+ SwapRestS(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderFreePicture (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderFreePictureReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->picture, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderComposite (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderCompositeReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->src, n);
+ swapl(&stuff->mask, n);
+ swapl(&stuff->dst, n);
+ swaps(&stuff->xSrc, n);
+ swaps(&stuff->ySrc, n);
+ swaps(&stuff->xMask, n);
+ swaps(&stuff->yMask, n);
+ swaps(&stuff->xDst, n);
+ swaps(&stuff->yDst, n);
+ swaps(&stuff->width, n);
+ swaps(&stuff->height, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderScale (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderScaleReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->src, n);
+ swapl(&stuff->dst, n);
+ swapl(&stuff->colorScale, n);
+ swapl(&stuff->alphaScale, n);
+ swaps(&stuff->xSrc, n);
+ swaps(&stuff->ySrc, n);
+ swaps(&stuff->xDst, n);
+ swaps(&stuff->yDst, n);
+ swaps(&stuff->width, n);
+ swaps(&stuff->height, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderTrapezoids (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderTrapezoidsReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
+ swaps (&stuff->length, n);
+ swapl (&stuff->src, n);
+ swapl (&stuff->dst, n);
+ swapl (&stuff->maskFormat, n);
+ swaps (&stuff->xSrc, n);
+ swaps (&stuff->ySrc, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderTriangles (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderTrianglesReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
+ swaps (&stuff->length, n);
+ swapl (&stuff->src, n);
+ swapl (&stuff->dst, n);
+ swapl (&stuff->maskFormat, n);
+ swaps (&stuff->xSrc, n);
+ swaps (&stuff->ySrc, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderTriStrip (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderTriStripReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
+ swaps (&stuff->length, n);
+ swapl (&stuff->src, n);
+ swapl (&stuff->dst, n);
+ swapl (&stuff->maskFormat, n);
+ swaps (&stuff->xSrc, n);
+ swaps (&stuff->ySrc, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderTriFan (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderTriFanReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderTriFanReq);
+ swaps (&stuff->length, n);
+ swapl (&stuff->src, n);
+ swapl (&stuff->dst, n);
+ swapl (&stuff->maskFormat, n);
+ swaps (&stuff->xSrc, n);
+ swaps (&stuff->ySrc, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderColorTrapezoids (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+SProcRenderColorTriangles (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+SProcRenderTransform (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+SProcRenderCreateGlyphSet (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderCreateGlyphSetReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->gsid, n);
+ swapl(&stuff->format, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderReferenceGlyphSet (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderReferenceGlyphSetReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->gsid, n);
+ swapl(&stuff->existing, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderFreeGlyphSet (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderFreeGlyphSetReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->glyphset, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderAddGlyphs (ClientPtr client)
+{
+ register int n;
+ register int i;
+ CARD32 *gids;
+ void *end;
+ xGlyphInfo *gi;
+ REQUEST(xRenderAddGlyphsReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->glyphset, n);
+ swapl(&stuff->nglyphs, n);
+ if (stuff->nglyphs & 0xe0000000)
+ return BadLength;
+ end = (CARD8 *) stuff + (client->req_len << 2);
+ gids = (CARD32 *) (stuff + 1);
+ gi = (xGlyphInfo *) (gids + stuff->nglyphs);
+ if ((char *) end - (char *) (gids + stuff->nglyphs) < 0)
+ return BadLength;
+ if ((char *) end - (char *) (gi + stuff->nglyphs) < 0)
+ return BadLength;
+ for (i = 0; i < stuff->nglyphs; i++)
+ {
+ swapl (&gids[i], n);
+ swaps (&gi[i].width, n);
+ swaps (&gi[i].height, n);
+ swaps (&gi[i].x, n);
+ swaps (&gi[i].y, n);
+ swaps (&gi[i].xOff, n);
+ swaps (&gi[i].yOff, n);
+ }
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderAddGlyphsFromPicture (ClientPtr client)
+{
+ return BadImplementation;
+}
+
+static int
+SProcRenderFreeGlyphs (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderFreeGlyphsReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->glyphset, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderCompositeGlyphs (ClientPtr client)
+{
+ register int n;
+ xGlyphElt *elt;
+ CARD8 *buffer;
+ CARD8 *end;
+ int space;
+ int i;
+ int size;
+
+ REQUEST(xRenderCompositeGlyphsReq);
+
+ switch (stuff->renderReqType) {
+ default: size = 1; break;
+ case X_RenderCompositeGlyphs16: size = 2; break;
+ case X_RenderCompositeGlyphs32: size = 4; break;
+ }
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->src, n);
+ swapl(&stuff->dst, n);
+ swapl(&stuff->maskFormat, n);
+ swapl(&stuff->glyphset, n);
+ swaps(&stuff->xSrc, n);
+ swaps(&stuff->ySrc, n);
+ buffer = (CARD8 *) (stuff + 1);
+ end = (CARD8 *) stuff + (client->req_len << 2);
+ while (buffer + sizeof (xGlyphElt) < end)
+ {
+ elt = (xGlyphElt *) buffer;
+ buffer += sizeof (xGlyphElt);
+
+ swaps (&elt->deltax, n);
+ swaps (&elt->deltay, n);
+
+ i = elt->len;
+ if (i == 0xff)
+ {
+ swapl (buffer, n);
+ buffer += 4;
+ }
+ else
+ {
+ space = size * i;
+ switch (size) {
+ case 1:
+ buffer += i;
+ break;
+ case 2:
+ while (i--)
+ {
+ swaps (buffer, n);
+ buffer += 2;
+ }
+ break;
+ case 4:
+ while (i--)
+ {
+ swapl (buffer, n);
+ buffer += 4;
+ }
+ break;
+ }
+ if (space & 3)
+ buffer += 4 - (space & 3);
+ }
+ }
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderFillRectangles (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderFillRectanglesReq);
+
+ REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->dst, n);
+ swaps(&stuff->color.red, n);
+ swaps(&stuff->color.green, n);
+ swaps(&stuff->color.blue, n);
+ swaps(&stuff->color.alpha, n);
+ SwapRestS(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderCreateCursor (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderCreateCursorReq);
+ REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->cid, n);
+ swapl(&stuff->src, n);
+ swaps(&stuff->x, n);
+ swaps(&stuff->y, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderSetPictureTransform (ClientPtr client)
+{
+ register int n;
+ REQUEST(xRenderSetPictureTransformReq);
+ REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->picture, n);
+ swapl(&stuff->transform.matrix11, n);
+ swapl(&stuff->transform.matrix12, n);
+ swapl(&stuff->transform.matrix13, n);
+ swapl(&stuff->transform.matrix21, n);
+ swapl(&stuff->transform.matrix22, n);
+ swapl(&stuff->transform.matrix23, n);
+ swapl(&stuff->transform.matrix31, n);
+ swapl(&stuff->transform.matrix32, n);
+ swapl(&stuff->transform.matrix33, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderQueryFilters (ClientPtr client)
+{
+ register int n;
+ REQUEST (xRenderQueryFiltersReq);
+ REQUEST_SIZE_MATCH (xRenderQueryFiltersReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->drawable, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderSetPictureFilter (ClientPtr client)
+{
+ register int n;
+ REQUEST (xRenderSetPictureFilterReq);
+ REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->picture, n);
+ swaps(&stuff->nbytes, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderCreateAnimCursor (ClientPtr client)
+{
+ register int n;
+ REQUEST (xRenderCreateAnimCursorReq);
+ REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->cid, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderAddTraps (ClientPtr client)
+{
+ register int n;
+ REQUEST (xRenderAddTrapsReq);
+ REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->picture, n);
+ swaps(&stuff->xOff, n);
+ swaps(&stuff->yOff, n);
+ SwapRestL(stuff);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderCreateSolidFill(ClientPtr client)
+{
+ register int n;
+ REQUEST (xRenderCreateSolidFillReq);
+ REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->pid, n);
+ swaps(&stuff->color.alpha, n);
+ swaps(&stuff->color.red, n);
+ swaps(&stuff->color.green, n);
+ swaps(&stuff->color.blue, n);
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static void swapStops(void *stuff, int num)
+{
+ int i, n;
+ CARD32 *stops;
+ CARD16 *colors;
+ stops = (CARD32 *)(stuff);
+ for (i = 0; i < num; ++i) {
+ swapl(stops, n);
+ ++stops;
+ }
+ colors = (CARD16 *)(stops);
+ for (i = 0; i < 4*num; ++i) {
+ swaps(stops, n);
+ ++stops;
+ }
+}
+
+static int
+SProcRenderCreateLinearGradient (ClientPtr client)
+{
+ register int n;
+ int len;
+ REQUEST (xRenderCreateLinearGradientReq);
+ REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->pid, n);
+ swapl(&stuff->p1.x, n);
+ swapl(&stuff->p1.y, n);
+ swapl(&stuff->p2.x, n);
+ swapl(&stuff->p2.y, n);
+ swapl(&stuff->nStops, n);
+
+ len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
+ if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+ if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+
+ swapStops(stuff+1, stuff->nStops);
+
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderCreateRadialGradient (ClientPtr client)
+{
+ register int n;
+ int len;
+ REQUEST (xRenderCreateRadialGradientReq);
+ REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->pid, n);
+ swapl(&stuff->inner.x, n);
+ swapl(&stuff->inner.y, n);
+ swapl(&stuff->outer.x, n);
+ swapl(&stuff->outer.y, n);
+ swapl(&stuff->inner_radius, n);
+ swapl(&stuff->outer_radius, n);
+ swapl(&stuff->nStops, n);
+
+ len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
+ if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+ if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+
+ swapStops(stuff+1, stuff->nStops);
+
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderCreateConicalGradient (ClientPtr client)
+{
+ register int n;
+ int len;
+ REQUEST (xRenderCreateConicalGradientReq);
+ REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq);
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->pid, n);
+ swapl(&stuff->center.x, n);
+ swapl(&stuff->center.y, n);
+ swapl(&stuff->angle, n);
+ swapl(&stuff->nStops, n);
+
+ len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
+ if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+ if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
+ return BadLength;
+
+ swapStops(stuff+1, stuff->nStops);
+
+ return (*ProcRenderVector[stuff->renderReqType]) (client);
+}
+
+static int
+SProcRenderDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ if (stuff->data < RenderNumberRequests)
+ return (*SProcRenderVector[stuff->data]) (client);
+ else
+ return BadRequest;
+}
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+
+#define VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err) {\
+ int rc = dixLookupResourceByType((pointer *)&(pPicture), pid,\
+ XRT_PICTURE, client, mode);\
+ if (rc != Success)\
+ return (rc == BadValue) ? err : rc;\
+}
+
+#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode, err) {\
+ if (pid == None) \
+ pPicture = 0; \
+ else { \
+ VERIFY_XIN_PICTURE(pPicture, pid, client, mode, err); \
+ } \
+} \
+
+int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr);
+
+unsigned long XRT_PICTURE;
+
+static int
+PanoramiXRenderCreatePicture (ClientPtr client)
+{
+ REQUEST(xRenderCreatePictureReq);
+ PanoramiXRes *refDraw, *newPict;
+ int result, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
+ result = dixLookupResourceByClass((pointer *)&refDraw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
+ if (result != Success)
+ return (result == BadValue) ? BadDrawable : result;
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = stuff->pid;
+
+ if (refDraw->type == XRT_WINDOW &&
+ stuff->drawable == WindowTable[0]->drawable.id)
+ {
+ newPict->u.pict.root = TRUE;
+ }
+ else
+ newPict->u.pict.root = FALSE;
+
+ for(j = 1; j < PanoramiXNumScreens; j++)
+ newPict->info[j].id = FakeClientID(client->index);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->pid = newPict->info[j].id;
+ stuff->drawable = refDraw->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderCreatePicture]) (client);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return (result);
+}
+
+static int
+PanoramiXRenderChangePicture (ClientPtr client)
+{
+ PanoramiXRes *pict;
+ int result = Success, j;
+ REQUEST(xRenderChangePictureReq);
+
+ REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderChangePicture]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
+PanoramiXRenderSetPictureClipRectangles (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureClipRectanglesReq);
+ int result = Success, j;
+ PanoramiXRes *pict;
+
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderSetPictureClipRectangles]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
+PanoramiXRenderSetPictureTransform (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureTransformReq);
+ int result = Success, j;
+ PanoramiXRes *pict;
+
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderSetPictureTransform]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
+PanoramiXRenderSetPictureFilter (ClientPtr client)
+{
+ REQUEST(xRenderSetPictureFilterReq);
+ int result = Success, j;
+ PanoramiXRes *pict;
+
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderSetPictureFilter]) (client);
+ if(result != Success) break;
+ }
+
+ return (result);
+}
+
+static int
+PanoramiXRenderFreePicture (ClientPtr client)
+{
+ PanoramiXRes *pict;
+ int result = Success, j;
+ REQUEST(xRenderFreePictureReq);
+
+ REQUEST_SIZE_MATCH(xRenderFreePictureReq);
+
+ client->errorValue = stuff->picture;
+
+ VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess,
+ RenderErrBase + BadPicture);
+
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->picture = pict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderFreePicture]) (client);
+ if(result != Success) break;
+ }
+
+ /* Since ProcRenderFreePicture is using FreeResource, it will free
+ our resource for us on the last pass through the loop above */
+
+ return (result);
+}
+
+static int
+PanoramiXRenderComposite (ClientPtr client)
+{
+ PanoramiXRes *src, *msk, *dst;
+ int result = Success, j;
+ xRenderCompositeReq orig;
+ REQUEST(xRenderCompositeReq);
+
+ REQUEST_SIZE_MATCH(xRenderCompositeReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_ALPHA (msk, stuff->mask, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ orig = *stuff;
+
+ FOR_NSCREENS_FORWARD(j) {
+ stuff->src = src->info[j].id;
+ if (src->u.pict.root)
+ {
+ stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x;
+ stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y;
+ }
+ stuff->dst = dst->info[j].id;
+ if (dst->u.pict.root)
+ {
+ stuff->xDst = orig.xDst - panoramiXdataPtr[j].x;
+ stuff->yDst = orig.yDst - panoramiXdataPtr[j].y;
+ }
+ if (msk)
+ {
+ stuff->mask = msk->info[j].id;
+ if (msk->u.pict.root)
+ {
+ stuff->xMask = orig.xMask - panoramiXdataPtr[j].x;
+ stuff->yMask = orig.yMask - panoramiXdataPtr[j].y;
+ }
+ }
+ result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client);
+ if(result != Success) break;
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderCompositeGlyphs (ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderCompositeGlyphsReq);
+ xGlyphElt origElt, *elt;
+ INT16 xSrc, ySrc;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
+ VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) +
+ sizeof (xGlyphElt)))
+ {
+ elt = (xGlyphElt *) (stuff + 1);
+ origElt = *elt;
+ xSrc = stuff->xSrc;
+ ySrc = stuff->ySrc;
+ FOR_NSCREENS_FORWARD(j) {
+ stuff->src = src->info[j].id;
+ if (src->u.pict.root)
+ {
+ stuff->xSrc = xSrc - panoramiXdataPtr[j].x;
+ stuff->ySrc = ySrc - panoramiXdataPtr[j].y;
+ }
+ stuff->dst = dst->info[j].id;
+ if (dst->u.pict.root)
+ {
+ elt->deltax = origElt.deltax - panoramiXdataPtr[j].x;
+ elt->deltay = origElt.deltay - panoramiXdataPtr[j].y;
+ }
+ result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client);
+ if(result != Success) break;
+ }
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderFillRectangles (ClientPtr client)
+{
+ PanoramiXRes *dst;
+ int result = Success, j;
+ REQUEST(xRenderFillRectanglesReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq);
+ if (extra_len &&
+ (extra = (char *) xalloc (extra_len)))
+ {
+ memcpy (extra, stuff + 1, extra_len);
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root)
+ {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xRectangle *rects = (xRectangle *) (stuff + 1);
+ int i = extra_len / sizeof (xRectangle);
+
+ while (i--)
+ {
+ rects->x -= x_off;
+ rects->y -= y_off;
+ rects++;
+ }
+ }
+ }
+ stuff->dst = dst->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client);
+ if(result != Success) break;
+ }
+ xfree(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderTrapezoids(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTrapezoidsReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
+
+ if (extra_len &&
+ (extra = (char *) xalloc (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xTrapezoid *trap = (xTrapezoid *) (stuff + 1);
+ int i = extra_len / sizeof (xTrapezoid);
+
+ while (i--) {
+ trap->top -= y_off;
+ trap->bottom -= y_off;
+ trap->left.p1.x -= x_off;
+ trap->left.p1.y -= y_off;
+ trap->left.p2.x -= x_off;
+ trap->left.p2.y -= y_off;
+ trap->right.p1.x -= x_off;
+ trap->right.p1.y -= y_off;
+ trap->right.p2.x -= x_off;
+ trap->right.p2.y -= y_off;
+ trap++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTrapezoids]) (client);
+
+ if(result != Success) break;
+ }
+
+ xfree(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderTriangles(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTrianglesReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
+
+ if (extra_len &&
+ (extra = (char *) xalloc (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xTriangle *tri = (xTriangle *) (stuff + 1);
+ int i = extra_len / sizeof (xTriangle);
+
+ while (i--) {
+ tri->p1.x -= x_off;
+ tri->p1.y -= y_off;
+ tri->p2.x -= x_off;
+ tri->p2.y -= y_off;
+ tri->p3.x -= x_off;
+ tri->p3.y -= y_off;
+ tri++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTriangles]) (client);
+
+ if(result != Success) break;
+ }
+
+ xfree(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderTriStrip(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTriStripReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTriStripReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq);
+
+ if (extra_len &&
+ (extra = (char *) xalloc (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xPointFixed *fixed = (xPointFixed *) (stuff + 1);
+ int i = extra_len / sizeof (xPointFixed);
+
+ while (i--) {
+ fixed->x -= x_off;
+ fixed->y -= y_off;
+ fixed++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTriStrip]) (client);
+
+ if(result != Success) break;
+ }
+
+ xfree(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderTriFan(ClientPtr client)
+{
+ PanoramiXRes *src, *dst;
+ int result = Success, j;
+ REQUEST(xRenderTriFanReq);
+ char *extra;
+ int extra_len;
+
+ REQUEST_AT_LEAST_SIZE (xRenderTriFanReq);
+
+ VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess,
+ RenderErrBase + BadPicture);
+ VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+
+ extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq);
+
+ if (extra_len &&
+ (extra = (char *) xalloc (extra_len))) {
+ memcpy (extra, stuff + 1, extra_len);
+
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ if (dst->u.pict.root) {
+ int x_off = panoramiXdataPtr[j].x;
+ int y_off = panoramiXdataPtr[j].y;
+
+ if(x_off || y_off) {
+ xPointFixed *fixed = (xPointFixed *) (stuff + 1);
+ int i = extra_len / sizeof (xPointFixed);
+
+ while (i--) {
+ fixed->x -= x_off;
+ fixed->y -= y_off;
+ fixed++;
+ }
+ }
+ }
+
+ stuff->src = src->info[j].id;
+ stuff->dst = dst->info[j].id;
+ result =
+ (*PanoramiXSaveRenderVector[X_RenderTriFan]) (client);
+
+ if(result != Success) break;
+ }
+
+ xfree(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderAddTraps (ClientPtr client)
+{
+ PanoramiXRes *picture;
+ int result = Success, j;
+ REQUEST(xRenderAddTrapsReq);
+ char *extra;
+ int extra_len;
+ INT16 x_off, y_off;
+
+ REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
+ VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess,
+ RenderErrBase + BadPicture);
+ extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq);
+ if (extra_len &&
+ (extra = (char *) xalloc (extra_len)))
+ {
+ memcpy (extra, stuff + 1, extra_len);
+ x_off = stuff->xOff;
+ y_off = stuff->yOff;
+ FOR_NSCREENS_FORWARD(j) {
+ if (j) memcpy (stuff + 1, extra, extra_len);
+ stuff->picture = picture->info[j].id;
+
+ if (picture->u.pict.root)
+ {
+ stuff->xOff = x_off + panoramiXdataPtr[j].x;
+ stuff->yOff = y_off + panoramiXdataPtr[j].y;
+ }
+ result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client);
+ if(result != Success) break;
+ }
+ xfree(extra);
+ }
+
+ return result;
+}
+
+static int
+PanoramiXRenderCreateSolidFill (ClientPtr client)
+{
+ REQUEST(xRenderCreateSolidFillReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = stuff->pid;
+ newPict->u.pict.root = FALSE;
+
+ for(j = 1; j < PanoramiXNumScreens; j++)
+ newPict->info[j].id = FakeClientID(client->index);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->pid = newPict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderCreateSolidFill]) (client);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
+static int
+PanoramiXRenderCreateLinearGradient (ClientPtr client)
+{
+ REQUEST(xRenderCreateLinearGradientReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = stuff->pid;
+ newPict->u.pict.root = FALSE;
+
+ for(j = 1; j < PanoramiXNumScreens; j++)
+ newPict->info[j].id = FakeClientID(client->index);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->pid = newPict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderCreateLinearGradient]) (client);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
+static int
+PanoramiXRenderCreateRadialGradient (ClientPtr client)
+{
+ REQUEST(xRenderCreateRadialGradientReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = stuff->pid;
+ newPict->u.pict.root = FALSE;
+
+ for(j = 1; j < PanoramiXNumScreens; j++)
+ newPict->info[j].id = FakeClientID(client->index);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->pid = newPict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderCreateRadialGradient]) (client);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
+static int
+PanoramiXRenderCreateConicalGradient (ClientPtr client)
+{
+ REQUEST(xRenderCreateConicalGradientReq);
+ PanoramiXRes *newPict;
+ int result = Success, j;
+
+ REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq);
+
+ if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
+
+ newPict->type = XRT_PICTURE;
+ newPict->info[0].id = stuff->pid;
+ newPict->u.pict.root = FALSE;
+
+ for(j = 1; j < PanoramiXNumScreens; j++)
+ newPict->info[j].id = FakeClientID(client->index);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->pid = newPict->info[j].id;
+ result = (*PanoramiXSaveRenderVector[X_RenderCreateConicalGradient]) (client);
+ if(result != Success) break;
+ }
+
+ if (result == Success)
+ AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+ else
+ xfree(newPict);
+
+ return result;
+}
+
+void
+PanoramiXRenderInit (void)
+{
+ int i;
+
+ XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource,
+ "XineramaPicture");
+ for (i = 0; i < RenderNumberRequests; i++)
+ PanoramiXSaveRenderVector[i] = ProcRenderVector[i];
+ /*
+ * Stuff in Xinerama aware request processing hooks
+ */
+ ProcRenderVector[X_RenderCreatePicture] = PanoramiXRenderCreatePicture;
+ ProcRenderVector[X_RenderChangePicture] = PanoramiXRenderChangePicture;
+ ProcRenderVector[X_RenderSetPictureTransform] = PanoramiXRenderSetPictureTransform;
+ ProcRenderVector[X_RenderSetPictureFilter] = PanoramiXRenderSetPictureFilter;
+ ProcRenderVector[X_RenderSetPictureClipRectangles] = PanoramiXRenderSetPictureClipRectangles;
+ ProcRenderVector[X_RenderFreePicture] = PanoramiXRenderFreePicture;
+ ProcRenderVector[X_RenderComposite] = PanoramiXRenderComposite;
+ ProcRenderVector[X_RenderCompositeGlyphs8] = PanoramiXRenderCompositeGlyphs;
+ ProcRenderVector[X_RenderCompositeGlyphs16] = PanoramiXRenderCompositeGlyphs;
+ ProcRenderVector[X_RenderCompositeGlyphs32] = PanoramiXRenderCompositeGlyphs;
+ ProcRenderVector[X_RenderFillRectangles] = PanoramiXRenderFillRectangles;
+
+ ProcRenderVector[X_RenderTrapezoids] = PanoramiXRenderTrapezoids;
+ ProcRenderVector[X_RenderTriangles] = PanoramiXRenderTriangles;
+ ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip;
+ ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan;
+ ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps;
+
+ ProcRenderVector[X_RenderCreateSolidFill] = PanoramiXRenderCreateSolidFill;
+ ProcRenderVector[X_RenderCreateLinearGradient] = PanoramiXRenderCreateLinearGradient;
+ ProcRenderVector[X_RenderCreateRadialGradient] = PanoramiXRenderCreateRadialGradient;
+ ProcRenderVector[X_RenderCreateConicalGradient] = PanoramiXRenderCreateConicalGradient;
+}
+
+void
+PanoramiXRenderReset (void)
+{
+ int i;
+ for (i = 0; i < RenderNumberRequests; i++)
+ ProcRenderVector[i] = PanoramiXSaveRenderVector[i];
+}
+
+#endif /* PANORAMIX */
|