summaryrefslogtreecommitdiff
path: root/storage/xtradb/include/univ.i
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2009-11-13 22:26:08 +0100
committerunknown <knielsen@knielsen-hq.org>2009-11-13 22:26:08 +0100
commit898f6f48b79d1f2c334fb559225b2b0fade5ea93 (patch)
tree84df8eecd942b650f172cbd67050ee8984c0d52b /storage/xtradb/include/univ.i
parent275c0a7f96502b33f763fb9388dcc1c289e4792b (diff)
parent2bde0c5e6d31583e5197e3b513f572a693161f62 (diff)
downloadmariadb-git-898f6f48b79d1f2c334fb559225b2b0fade5ea93.tar.gz
Merge XtraDB 8 into MariaDB.
Diffstat (limited to 'storage/xtradb/include/univ.i')
-rw-r--r--storage/xtradb/include/univ.i82
1 files changed, 58 insertions, 24 deletions
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index 3fc12503031..5ccb7c39551 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -2,6 +2,7 @@
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 2008, Google Inc.
+Copyright (c) 2009, Sun Microsystems, Inc.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -9,6 +10,12 @@ briefly in the InnoDB documentation. The contributions by Google are
incorporated with their permission, and subject to the conditions contained in
the file COPYING.Google.
+Portions of this file contain modifications contributed and copyrighted by
+Sun Microsystems, Inc. Those modifications are gratefully acknowledged and
+are described briefly in the InnoDB documentation. The contributions by
+Sun Microsystems are incorporated with their permission, and subject to the
+conditions contained in the file COPYING.Sun_Microsystems.
+
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
@@ -23,7 +30,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
-/***************************************************************************
+/***********************************************************************//**
+@file include/univ.i
Version control for database, common definitions, and include files
Created 1/20/1994 Heikki Tuuri
@@ -32,10 +40,14 @@ Created 1/20/1994 Heikki Tuuri
#ifndef univ_i
#define univ_i
+#ifdef UNIV_HOTBACKUP
+#include "hb_univ.i"
+#endif /* UNIV_HOTBACKUP */
+
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 0
-#define INNODB_VERSION_BUGFIX 3
-#define PERCONA_INNODB_VERSION 6a
+#define INNODB_VERSION_BUGFIX 4
+#define PERCONA_INNODB_VERSION 8
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
@@ -56,6 +68,8 @@ component, i.e. we show M.N.P as M.N */
INNODB_VERSION_BUGFIX, \
PERCONA_INNODB_VERSION)
+#define REFMAN "http://dev.mysql.com/doc/refman/5.1/en/"
+
#ifdef MYSQL_DYNAMIC_PLUGIN
/* In the dynamic plugin, redefine some externally visible symbols
in order not to conflict with the symbols of a builtin InnoDB. */
@@ -72,9 +86,10 @@ the virtual method table (vtable) in GCC 3. */
# include <windows.h>
-# if !defined(WIN64) && !defined(_WIN64)
-# define UNIV_CAN_USE_X86_ASSEMBLER
-# endif
+# if defined(HAVE_WINDOWS_ATOMICS)
+/* If atomics are defined we use them in InnoDB mutex implementation */
+# define HAVE_ATOMIC_BUILTINS
+# endif /* HAVE_WINDOWS_ATOMICS */
# ifdef _NT_
# define __NT__
@@ -87,8 +102,10 @@ the virtual method table (vtable) in GCC 3. */
in compiling more Posix-compatible. These headers also define __WIN__
if we are compiling on Windows. */
+#ifndef UNIV_HOTBACKUP
# include <my_global.h>
# include <my_pthread.h>
+#endif /* UNIV_HOTBACKUP */
/* Include <sys/stat.h> to get S_I... macros defined for os0file.c */
# include <sys/stat.h>
@@ -101,24 +118,26 @@ if we are compiling on Windows. */
/* Include the header file generated by GNU autoconf */
# ifndef __WIN__
-# include "config.h"
+#ifndef UNIV_HOTBACKUP
+# include "config.h"
+#endif /* UNIV_HOTBACKUP */
# endif
# ifdef HAVE_SCHED_H
# include <sched.h>
# endif
-/* When compiling for Itanium IA64, undefine the flag below to prevent use
-of the 32-bit x86 assembler in mutex operations. */
-
-# if defined(__WIN__) && !defined(WIN64) && !defined(_WIN64)
-# define UNIV_CAN_USE_X86_ASSEMBLER
-# endif
+# if defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_SOLARIS_ATOMICS) \
+ || defined(HAVE_WINDOWS_ATOMICS)
+/* If atomics are defined we use them in InnoDB mutex implementation */
+# define HAVE_ATOMIC_BUILTINS
+# endif /* (HAVE_GCC_ATOMIC_BUILTINS) || (HAVE_SOLARIS_ATOMICS)
+ || (HAVE_WINDOWS_ATOMICS) */
/* For InnoDB rw_locks to work with atomics we need the thread_id
to be no more than machine word wide. The following enables using
atomics for InnoDB rw_locks where these conditions are met. */
-#ifdef HAVE_GCC_ATOMIC_BUILTINS
+#ifdef HAVE_ATOMIC_BUILTINS
/* if HAVE_ATOMIC_PTHREAD_T is defined at this point that means that
the code from plug.in has defined it and we do not need to include
ut0auxconf.h which would either define HAVE_ATOMIC_PTHREAD_T or will
@@ -131,12 +150,12 @@ from Makefile.in->ut0auxconf.h */
# ifdef HAVE_ATOMIC_PTHREAD_T
# define INNODB_RW_LOCKS_USE_ATOMICS
# endif /* HAVE_ATOMIC_PTHREAD_T */
-#endif /* HAVE_GCC_ATOMIC_BUILTINS */
+#endif /* HAVE_ATOMIC_BUILTINS */
-/* Enable explicit inlining of functions only for compilers known to
-support it. */
+/* We only try to do explicit inlining of functions with gcc and
+Sun Studio */
-# if !defined(__GNUC__) && !defined(__SUNPRO_C)
+# if !defined(__GNUC__) && !(defined(__SUNPRO_C) || defined(__SUNPRO_CC))
# undef UNIV_MUST_NOT_INLINE /* Remove compiler warning */
# define UNIV_MUST_NOT_INLINE
# endif
@@ -234,19 +253,21 @@ by one. */
/* Linkage specifier for non-static InnoDB symbols (variables and functions)
that are only referenced from within InnoDB, not from MySQL */
-#ifdef __WIN__
-# define UNIV_INTERN
-#else
+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(UNIV_HOTBACKUP)
# define UNIV_INTERN __attribute__((visibility ("hidden")))
+#else
+# define UNIV_INTERN
#endif
#if (!defined(UNIV_DEBUG) && !defined(UNIV_MUST_NOT_INLINE))
/* Definition for inline version */
#ifdef __WIN__
-#define UNIV_INLINE __inline
+# define UNIV_INLINE __inline
+#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
+# define UNIV_INLINE static inline
#else
-#define UNIV_INLINE static __inline__
+# define UNIV_INLINE static __inline__
#endif
#else
@@ -323,13 +344,15 @@ typedef long int lint;
#ifdef __WIN__
typedef __int64 ib_int64_t;
typedef unsigned __int64 ib_uint64_t;
-#else
+#elif !defined(UNIV_HOTBACKUP)
/* Note: longlong and ulonglong come from MySQL headers. */
typedef longlong ib_int64_t;
typedef ulonglong ib_uint64_t;
#endif
+#ifndef UNIV_HOTBACKUP
typedef unsigned long long int ullint;
+#endif /* UNIV_HOTBACKUP */
#ifndef __WIN__
#if SIZEOF_LONG != SIZEOF_VOIDP
@@ -387,6 +410,17 @@ it is read. */
/* Minimize cache-miss latency by moving data at addr into a cache before
it is read or written. */
# define UNIV_PREFETCH_RW(addr) __builtin_prefetch(addr, 1, 3)
+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+# include <sun_prefetch.h>
+#if __SUNPRO_C >= 0x550
+# undef UNIV_INTERN
+# define UNIV_INTERN __hidden
+#endif /* __SUNPRO_C >= 0x550 */
+/* Use sun_prefetch when compile with Sun Studio */
+# define UNIV_EXPECT(expr,value) (expr)
+# define UNIV_LIKELY_NULL(expr) (expr)
+# define UNIV_PREFETCH_R(addr) sun_prefetch_read_many(addr)
+# define UNIV_PREFETCH_RW(addr) sun_prefetch_write_many(addr)
#else
/* Dummy versions of the macros */
# define UNIV_EXPECT(expr,value) (expr)