2008-04-25 18:18:48 +09:00
|
|
|
/**************************************************************************
|
|
|
|
|
*
|
s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.
This was the sed script I used:
$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#
# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g
# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/
# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g
# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 16:27:50 +00:00
|
|
|
* Copyright 2008 VMware, Inc.
|
2008-04-25 18:18:48 +09:00
|
|
|
* 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.
|
s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.
This was the sed script I used:
$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#
# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g
# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/
# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g
# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 16:27:50 +00:00
|
|
|
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
2008-04-25 18:18:48 +09:00
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @file
|
|
|
|
|
* Gallium configuration defines.
|
|
|
|
|
*
|
|
|
|
|
* This header file sets several defines based on the compiler, processor
|
|
|
|
|
* architecture, and operating system being used. These defines should be used
|
|
|
|
|
* throughout the code to facilitate porting to new platforms. It is likely that
|
|
|
|
|
* this file is auto-generated by an autoconf-like tool at some point, as some
|
2008-06-02 19:36:53 +09:00
|
|
|
* things cannot be determined by pre-defined environment alone.
|
2008-04-25 18:18:48 +09:00
|
|
|
*
|
2008-05-28 16:12:14 +09:00
|
|
|
* See also:
|
|
|
|
|
* - http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
|
|
|
|
|
* - echo | gcc -dM -E - | sort
|
|
|
|
|
* - http://msdn.microsoft.com/en-us/library/b0084kay.aspx
|
2008-06-02 19:36:53 +09:00
|
|
|
*
|
s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.
This was the sed script I used:
$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#
# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g
# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/
# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g
# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 16:27:50 +00:00
|
|
|
* @author José Fonseca <jfonseca@vmware.com>
|
2008-04-25 18:18:48 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef P_CONFIG_H_
|
|
|
|
|
#define P_CONFIG_H_
|
|
|
|
|
|
2011-05-30 20:21:16 +10:00
|
|
|
#include <limits.h>
|
2008-04-25 18:18:48 +09:00
|
|
|
/*
|
|
|
|
|
* Compiler
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if defined(__GNUC__)
|
|
|
|
|
#define PIPE_CC_GCC
|
2009-12-02 09:22:42 -07:00
|
|
|
#define PIPE_CC_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
|
2008-04-25 18:18:48 +09:00
|
|
|
#endif
|
|
|
|
|
|
2008-06-02 19:36:53 +09:00
|
|
|
/*
|
|
|
|
|
* Meaning of _MSC_VER value:
|
2013-09-10 09:20:34 -06:00
|
|
|
* - 1800: Visual Studio 2013
|
|
|
|
|
* - 1700: Visual Studio 2012
|
|
|
|
|
* - 1600: Visual Studio 2010
|
|
|
|
|
* - 1500: Visual Studio 2008
|
2008-06-02 19:36:53 +09:00
|
|
|
* - 1400: Visual C++ 2005
|
|
|
|
|
* - 1310: Visual C++ .NET 2003
|
|
|
|
|
* - 1300: Visual C++ .NET 2002
|
|
|
|
|
*
|
|
|
|
|
* __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC
|
|
|
|
|
* versions.
|
|
|
|
|
*/
|
2008-04-25 18:18:48 +09:00
|
|
|
#if defined(_MSC_VER) || defined(__MSC__)
|
|
|
|
|
#define PIPE_CC_MSVC
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(__ICL)
|
|
|
|
|
#define PIPE_CC_ICL
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-08-31 23:30:35 -07:00
|
|
|
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
|
|
|
|
#define PIPE_CC_SUNPRO
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-04-25 18:18:48 +09:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Processor architecture
|
|
|
|
|
*/
|
|
|
|
|
|
2009-03-23 20:17:57 -07:00
|
|
|
#if defined(__i386__) /* gcc */ || defined(_M_IX86) /* msvc */ || defined(_X86_) || defined(__386__) || defined(i386) || defined(__i386) /* Sun cc */
|
2008-04-25 18:18:48 +09:00
|
|
|
#define PIPE_ARCH_X86
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-03-23 20:17:57 -07:00
|
|
|
#if defined(__x86_64__) /* gcc */ || defined(_M_X64) /* msvc */ || defined(_M_AMD64) /* msvc */ || defined(__x86_64) /* Sun cc */
|
2008-04-25 18:18:48 +09:00
|
|
|
#define PIPE_ARCH_X86_64
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-10-07 14:25:09 +09:00
|
|
|
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
|
|
|
|
|
#if defined(PIPE_CC_GCC) && !defined(__SSE2__)
|
|
|
|
|
/* #warning SSE2 support requires -msse -msse2 compiler options */
|
|
|
|
|
#else
|
|
|
|
|
#define PIPE_ARCH_SSE
|
|
|
|
|
#endif
|
2010-07-14 12:23:16 +01:00
|
|
|
#if defined(PIPE_CC_GCC) && !defined(__SSSE3__)
|
|
|
|
|
/* #warning SSE3 support requires -msse3 compiler options */
|
|
|
|
|
#else
|
|
|
|
|
#define PIPE_ARCH_SSSE3
|
|
|
|
|
#endif
|
2008-10-07 14:25:09 +09:00
|
|
|
#endif
|
|
|
|
|
|
2011-07-31 09:21:56 -07:00
|
|
|
#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__)
|
2008-04-25 18:18:48 +09:00
|
|
|
#define PIPE_ARCH_PPC
|
2011-07-31 09:21:56 -07:00
|
|
|
#if defined(__ppc64__) || defined(__PPC64__)
|
2008-10-21 14:12:17 -06:00
|
|
|
#define PIPE_ARCH_PPC_64
|
|
|
|
|
#endif
|
2008-04-25 18:18:48 +09:00
|
|
|
#endif
|
|
|
|
|
|
2013-06-05 09:26:29 +01:00
|
|
|
#if defined(__s390x__)
|
|
|
|
|
#define PIPE_ARCH_S390
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-07-15 10:51:15 -04:00
|
|
|
#if defined(__arm__)
|
|
|
|
|
#define PIPE_ARCH_ARM
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(__aarch64__)
|
|
|
|
|
#define PIPE_ARCH_AARCH64
|
|
|
|
|
#endif
|
2008-04-25 18:18:48 +09:00
|
|
|
|
2009-07-08 11:26:52 -07:00
|
|
|
/*
|
|
|
|
|
* Endian detection.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-05-09 00:17:03 -04:00
|
|
|
#ifdef __GLIBC__
|
|
|
|
|
#include <endian.h>
|
|
|
|
|
|
|
|
|
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
|
|
|
# define PIPE_ARCH_LITTLE_ENDIAN
|
|
|
|
|
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
|
|
|
# define PIPE_ARCH_BIG_ENDIAN
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-07-31 09:31:48 -07:00
|
|
|
#elif defined(__APPLE__)
|
|
|
|
|
#include <machine/endian.h>
|
|
|
|
|
|
|
|
|
|
#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
|
|
|
|
|
# define PIPE_ARCH_LITTLE_ENDIAN
|
|
|
|
|
#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
|
|
|
|
|
# define PIPE_ARCH_BIG_ENDIAN
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-10-18 14:04:15 -07:00
|
|
|
#elif defined(__sun)
|
|
|
|
|
#include <sys/isa_defs.h>
|
|
|
|
|
|
|
|
|
|
#if defined(_LITTLE_ENDIAN)
|
|
|
|
|
# define PIPE_ARCH_LITTLE_ENDIAN
|
|
|
|
|
#elif defined(_BIG_ENDIAN)
|
|
|
|
|
# define PIPE_ARCH_BIG_ENDIAN
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-04-17 20:27:55 +02:00
|
|
|
#elif defined(__OpenBSD__) || defined(__NetBSD__)
|
2014-03-10 08:54:43 -06:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <machine/endian.h>
|
|
|
|
|
|
|
|
|
|
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
|
|
|
|
# define PIPE_ARCH_LITTLE_ENDIAN
|
|
|
|
|
#elif _BYTE_ORDER == _BIG_ENDIAN
|
|
|
|
|
# define PIPE_ARCH_BIG_ENDIAN
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-05-09 00:17:03 -04:00
|
|
|
#else
|
|
|
|
|
|
2013-07-15 10:51:15 -04:00
|
|
|
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
|
2009-07-08 11:26:52 -07:00
|
|
|
#define PIPE_ARCH_LITTLE_ENDIAN
|
2013-06-05 09:26:29 +01:00
|
|
|
#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
|
2009-07-08 11:26:52 -07:00
|
|
|
#define PIPE_ARCH_BIG_ENDIAN
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-05-09 00:17:03 -04:00
|
|
|
#endif
|
2009-07-08 11:26:52 -07:00
|
|
|
|
2011-05-09 12:29:47 +02:00
|
|
|
#if !defined(PIPE_ARCH_LITTLE_ENDIAN) && !defined(PIPE_ARCH_BIG_ENDIAN)
|
|
|
|
|
#error Unknown Endianness
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-04-25 18:18:48 +09:00
|
|
|
/*
|
2010-02-04 14:37:30 +00:00
|
|
|
* Auto-detect the operating system family.
|
2008-06-02 19:36:53 +09:00
|
|
|
*
|
|
|
|
|
* See subsystem below for a more fine-grained distinction.
|
2008-04-25 18:18:48 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if defined(__linux__)
|
|
|
|
|
#define PIPE_OS_LINUX
|
2009-09-29 13:17:36 +01:00
|
|
|
#define PIPE_OS_UNIX
|
2008-04-25 18:18:48 +09:00
|
|
|
#endif
|
|
|
|
|
|
2011-08-05 12:50:12 +09:00
|
|
|
/*
|
|
|
|
|
* Android defines __linux__ so PIPE_OS_LINUX and PIPE_OS_UNIX will also be
|
|
|
|
|
* defined.
|
|
|
|
|
*/
|
|
|
|
|
#if defined(ANDROID)
|
|
|
|
|
#define PIPE_OS_ANDROID
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-11-06 10:55:28 +01:00
|
|
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
2009-09-30 09:36:18 -07:00
|
|
|
#define PIPE_OS_FREEBSD
|
|
|
|
|
#define PIPE_OS_BSD
|
|
|
|
|
#define PIPE_OS_UNIX
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(__OpenBSD__)
|
|
|
|
|
#define PIPE_OS_OPENBSD
|
|
|
|
|
#define PIPE_OS_BSD
|
|
|
|
|
#define PIPE_OS_UNIX
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(__NetBSD__)
|
|
|
|
|
#define PIPE_OS_NETBSD
|
2009-02-24 20:51:10 -08:00
|
|
|
#define PIPE_OS_BSD
|
2009-09-29 13:17:36 +01:00
|
|
|
#define PIPE_OS_UNIX
|
2009-02-24 20:51:10 -08:00
|
|
|
#endif
|
|
|
|
|
|
2014-09-16 16:11:53 -07:00
|
|
|
#if defined(__DragonFly__)
|
|
|
|
|
#define PIPE_OS_DRAGONFLY
|
|
|
|
|
#define PIPE_OS_BSD
|
|
|
|
|
#define PIPE_OS_UNIX
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-06-23 21:31:28 -04:00
|
|
|
#if defined(__GNU__)
|
|
|
|
|
#define PIPE_OS_HURD
|
|
|
|
|
#define PIPE_OS_UNIX
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-03-23 20:17:57 -07:00
|
|
|
#if defined(__sun)
|
|
|
|
|
#define PIPE_OS_SOLARIS
|
2009-09-29 13:17:36 +01:00
|
|
|
#define PIPE_OS_UNIX
|
2009-03-23 20:17:57 -07:00
|
|
|
#endif
|
|
|
|
|
|
2009-06-25 09:52:50 -06:00
|
|
|
#if defined(__APPLE__)
|
|
|
|
|
#define PIPE_OS_APPLE
|
2009-09-29 13:17:36 +01:00
|
|
|
#define PIPE_OS_UNIX
|
2009-06-25 09:52:50 -06:00
|
|
|
#endif
|
|
|
|
|
|
2008-04-25 18:18:48 +09:00
|
|
|
#if defined(_WIN32) || defined(WIN32)
|
|
|
|
|
#define PIPE_OS_WINDOWS
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-09-05 23:06:53 +02:00
|
|
|
#if defined(__HAIKU__)
|
|
|
|
|
#define PIPE_OS_HAIKU
|
2009-09-29 13:17:36 +01:00
|
|
|
#define PIPE_OS_UNIX
|
2009-09-05 23:06:53 +02:00
|
|
|
#endif
|
2008-04-25 18:18:48 +09:00
|
|
|
|
2010-05-13 01:25:07 -07:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
|
#define PIPE_OS_CYGWIN
|
|
|
|
|
#define PIPE_OS_UNIX
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-04-25 18:18:48 +09:00
|
|
|
/*
|
2010-02-04 14:37:30 +00:00
|
|
|
* Try to auto-detect the subsystem.
|
2008-04-25 18:18:48 +09:00
|
|
|
*
|
2008-06-02 19:36:53 +09:00
|
|
|
* NOTE: There is no way to auto-detect most of these.
|
2008-04-25 18:18:48 +09:00
|
|
|
*/
|
|
|
|
|
|
2009-03-23 20:17:57 -07:00
|
|
|
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
|
2008-04-25 18:18:48 +09:00
|
|
|
#define PIPE_SUBSYSTEM_DRI
|
2009-03-23 20:17:57 -07:00
|
|
|
#endif /* PIPE_OS_LINUX || PIPE_OS_BSD || PIPE_OS_SOLARIS */
|
2008-04-25 18:18:48 +09:00
|
|
|
|
|
|
|
|
#if defined(PIPE_OS_WINDOWS)
|
2011-11-09 07:05:52 +00:00
|
|
|
#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
2008-06-02 19:36:53 +09:00
|
|
|
/* Windows User-space Library */
|
|
|
|
|
#else
|
2011-11-09 07:05:52 +00:00
|
|
|
#define PIPE_SUBSYSTEM_WINDOWS_USER
|
2008-06-02 19:36:53 +09:00
|
|
|
#endif
|
2008-05-01 00:59:12 +09:00
|
|
|
#endif /* PIPE_OS_WINDOWS */
|
2008-04-25 18:18:48 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* P_CONFIG_H_ */
|