Author: jgardou
Date: Thu Nov 11 15:58:18 2010
New Revision: 49565
URL: http://svn.reactos.org/svn/reactos?rev=49565&view=rev
Log:
[HEADERS]
- move stlport headers to the c++ directory
- add a specific _reactos.h configuration file for stlport
- add cerrno to c++ headers
- __declspec(nothrow) must be placed before calling convention with msvc. GCC doesn't care.
We now use our headers with both msvc and gcc.
Added:
branches/cmake-bringup/include/c++/cerrno (with props)
branches/cmake-bringup/include/c++/stlport/
- copied from r49554, branches/cmake-bringup/include/stlport/
branches/cmake-bringup/include/c++/stlport/stl/config/_reactos.h (with props)
Removed:
branches/cmake-bringup/include/stlport/
Modified:
branches/cmake-bringup/CMakeMacros.cmake
branches/cmake-bringup/include/c++/cstdio
branches/cmake-bringup/include/c++/new
branches/cmake-bringup/include/c++/stlport/stl/_limits.h
branches/cmake-bringup/include/c++/stlport/stl/config/_system.h
branches/cmake-bringup/include/crt/float.h
Modified: branches/cmake-bringup/CMakeMacros.cmake
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeMacros.cmake…
==============================================================================
--- branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -121,15 +121,11 @@
ENDMACRO(add_minicd)
macro(set_cpp)
- include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/stlport)
+ include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/c++/stlport)
set(IS_CPP 1)
add_definitions(
- -D_STLP_NATIVE_CPP_C_INCLUDE_PATH=../c++
- -D_STLP_NATIVE_C_INCLUDE_PATH=../crt
- -D_STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH=../c++
- -D_STLP_USE_NEW_C_HEADERS
- -D_STLP_NO_TYPEINFO
- )
+ -DNATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/include/c++
+ -DNATIVE_C_INCLUDE=${REACTOS_SOURCE_DIR}/include/crt)
endmacro()
MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
Added: branches/cmake-bringup/include/c++/cerrno
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/c%2B%2B/c…
==============================================================================
--- branches/cmake-bringup/include/c++/cerrno (added)
+++ branches/cmake-bringup/include/c++/cerrno [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -1,0 +1,10 @@
+// C++ forwarding C errno header.
+
+#pragma once
+
+#include <errno.h>
+
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef errno
+#define errno errno
+#endif
Propchange: branches/cmake-bringup/include/c++/cerrno
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/cmake-bringup/include/c++/cstdio
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/c%2B%2B/c…
==============================================================================
--- branches/cmake-bringup/include/c++/cstdio [iso-8859-1] (original)
+++ branches/cmake-bringup/include/c++/cstdio [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -94,4 +94,5 @@
using ::vfprintf;
using ::vprintf;
using ::vsprintf;
+ using ::vsnprintf;
}
Modified: branches/cmake-bringup/include/c++/new
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/c%2B%2B/n…
==============================================================================
--- branches/cmake-bringup/include/c++/new [iso-8859-1] (original)
+++ branches/cmake-bringup/include/c++/new [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -32,19 +32,17 @@
new_handler set_new_handler(new_handler) throw();
-void* operator new (std::size_t size) throw (std::bad_alloc);
void* operator new (std::size_t size, const std::nothrow_t& nothrow_constant) throw();
-void* operator new (std::size_t size, void* ptr) throw();
-void* operator new[] (std::size_t size) throw (std::bad_alloc);
+inline void* operator new (std::size_t size, void* ptr) throw() { return ptr; }
void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_constant) throw();
-void* operator new[] (std::size_t size, void* ptr) throw();
+inline void* operator new[] (std::size_t size, void* ptr) throw() { return ptr; }
void operator delete (void* ptr) throw ();
void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) throw();
-void operator delete (void* ptr, void* voidptr2) throw();
+inline void operator delete (void* ptr, void* voidptr2) throw() { }
void operator delete[] (void* ptr) throw ();
void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw();
-void operator delete[] (void* ptr, void* voidptr2) throw();
+inline void operator delete[] (void* ptr, void* voidptr2) throw() { }
//@}
} // extern "C++"
Modified: branches/cmake-bringup/include/c++/stlport/stl/_limits.h
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/c%2B%2B/s…
==============================================================================
--- branches/cmake-bringup/include/c++/stlport/stl/_limits.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/c++/stlport/stl/_limits.h [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -52,6 +52,13 @@
denorm_present = 1
};
+#ifdef min
+# undef min
+#endif
+#ifdef max
+# undef max
+#endif
+
_STLP_MOVE_TO_PRIV_NAMESPACE
// Base class for all specializations of numeric_limits.
@@ -59,8 +66,8 @@
class _Numeric_limits_base {
public:
- static __number (_STLP_CALL min)() _STLP_NOTHROW { return __number(); }
- static __number (_STLP_CALL max)() _STLP_NOTHROW { return __number(); }
+ static __number _STLP_CALL min() _STLP_NOTHROW { return __number(); }
+ static __number _STLP_CALL max() _STLP_NOTHROW { return __number(); }
_STLP_STATIC_CONSTANT(int, digits = 0);
_STLP_STATIC_CONSTANT(int, digits10 = 0);
@@ -118,8 +125,8 @@
class _Integer_limits : public _Numeric_limits_base<_Int> {
public:
- static _Int (_STLP_CALL min) () _STLP_NOTHROW { return (_Int)__imin; }
- static _Int (_STLP_CALL max) () _STLP_NOTHROW { return (_Int)__imax; }
+ static _Int _STLP_CALL min () _STLP_NOTHROW { return (_Int)__imin; }
+ static _Int _STLP_CALL max () _STLP_NOTHROW { return (_Int)__imax; }
_STLP_STATIC_CONSTANT(int, digits = (__idigits < 0) ? ((int)((sizeof(_Int) * (CHAR_BIT))) - ((__imin == 0) ? 0 : 1)) : (__idigits));
_STLP_STATIC_CONSTANT(int, digits10 = (digits * 301UL) / 1000);
Added: branches/cmake-bringup/include/c++/stlport/stl/config/_reactos.h
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/c%2B%2B/s…
==============================================================================
--- branches/cmake-bringup/include/c++/stlport/stl/config/_reactos.h (added)
+++ branches/cmake-bringup/include/c++/stlport/stl/config/_reactos.h [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -1,0 +1,308 @@
+/*
+ * Copyright (c) 2010
+ * Jérôme Gardou
+ *
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * This file is in public domain.
+ */
+
+/*
+ * Purpose of this file :
+ *
+ * A list of COMPILER-SPECIFIC portion of STLport settings.
+ * This file is provided to help in manual configuration
+ * of STLport. This file is being included by stlcomp.h
+ * when STLport is unable to identify your compiler.
+ * Please remove the error diagnostic below before adjusting
+ * macros.
+ *
+ */
+#ifndef _STLP_REACTOS_H
+#define _STLP_REACTOS_H
+
+#if !defined (_STLP_COMPILER)
+# ifdef _MSC_VER
+# define _STLP_COMPILER "Microsoft Visual Studio C++"
+# define _STLP_MSVC _MSC_VER
+# define _STLP_MSVC_LIB _MSC_VER
+# elif defined __MINGW32__
+# define _STLP_COMPILER "gcc"
+# else
+# error "Unrecognized compiler for reactos!"
+# endif
+#endif
+
+// We are WIN32
+#define _STLP_WIN32
+
+// We declspec
+#define _STLP_IMPORT_DECLSPEC __declspec(dllimport)
+#define _STLP_EXPORT_DECLSPEC __declspec(dllexport)
+
+//==========================================================
+
+// the values choosen here as defaults try to give
+// maximum functionality on the most conservative settings
+
+// Mostly correct guess, change it for Alpha (and other environments
+// that has 64-bit "long")
+# define _STLP_UINT32_T unsigned __int32
+
+// Disables wchar_t functionality
+// # define _STLP_NO_WCHAR_T 1
+
+// Define if wchar_t is not an intrinsic type, and is actually a typedef to unsigned short.
+// # define _STLP_WCHAR_T_IS_USHORT 1
+
+// Uncomment if long long is available
+# define _STLP_LONG_LONG __int64
+// Uncomment if long double is not available
+// # define _STLP_NO_LONG_DOUBLE 1
+
+// Uncomment this if your compiler does not support "typename" keyword
+// # define _STLP_NEED_TYPENAME 1
+
+// Uncomment this if your compiler does not support "mutable" keyword
+// # define _STLP_NEED_MUTABLE 1
+
+// Uncomment this if your compiler does not support "explicit" keyword
+// # define _STLP_NEED_EXPLICIT 1
+
+// Uncomment if new-style-casts like const_cast<> are not available
+// # define _STLP_NO_NEW_STYLE_CASTS 1
+
+// Uncomment this if your compiler does not have "bool" type
+// # define _STLP_NO_BOOL 1
+
+// Uncomment this if your compiler does not have "bool" type, but has "bool" keyword reserved
+// # define _STLP_DONT_USE_BOOL_TYPEDEF 1
+
+// Uncomment this if your compiler does not have "bool" type, but defines "bool" in <yvals.h>
+// # define _STLP_YVALS_H 1
+
+// Uncomment this if your compiler has limited or no default template arguments for classes
+// # define _STLP_LIMITED_DEFAULT_TEMPLATES 1
+
+// Uncomment this if your compiler support only complete (not dependent on other parameters)
+// types as default parameters for class templates
+// # define _STLP_DEFAULT_TYPE_PARAM 1
+
+// Uncomment this if your compiler do not support default parameters in template class methods
+// # define _STLP_DONT_SUP_DFLT_PARAM 1
+
+// Uncomment this if your compiler has problem with not-type
+// default template parameters
+// # define _STLP_NO_DEFAULT_NON_TYPE_PARAM 1
+
+// Define if compiler has
+// trouble with functions getting non-type-parameterized classes as parameters
+// # define _STLP_NON_TYPE_TMPL_PARAM_BUG 1
+
+// Uncomment this if your compiler does not support namespaces
+// # define _STLP_HAS_NO_NAMESPACES 1
+
+// Uncomment if "using" keyword does not work with template types
+// # define _STLP_BROKEN_USING_DIRECTIVE 1
+
+// Uncomment this if your compiler does not support exceptions
+// # define _STLP_HAS_NO_EXCEPTIONS 1
+
+// Uncomment this when you are able to detect that the user do not
+// want to use the exceptions feature.
+// # define _STLP_DONT_USE_EXCEPTIONS 1
+
+// Uncomment this if your compiler does not support exception specifications
+// # define _STLP_NO_EXCEPTION_SPEC
+
+// Define this if your compiler requires return statement after throw()
+// # define _STLP_THROW_RETURN_BUG 1
+
+// Define this if your compiler do not support return of void
+// # define _STLP_DONT_RETURN_VOID 1
+
+// Header <new> that comes with the compiler
+// does not define bad_alloc exception
+// # define _STLP_NO_BAD_ALLOC 1
+
+// Define this if your compiler do not throw bad_alloc from the new operator
+// # define _STLP_NEW_DONT_THROW_BAD_ALLOC 1
+
+// Define this if your compiler has no rtti support or if it has been disabled
+// # define _STLP_NO_RTTI 1
+
+// Define this if there is no native type_info definition
+# define _STLP_NO_TYPEINFO 1
+
+// Uncomment if member template methods are not available
+// # define _STLP_NO_MEMBER_TEMPLATES 1
+
+// Uncomment if member template classes are not available
+// # define _STLP_NO_MEMBER_TEMPLATE_CLASSES 1
+
+// Uncomment if your compiler do not support the std::allocator rebind technique
+// This is a special case of bad member template classes support, it is automatically
+// defined if _STLP_NO_MEMBER_TEMPLATE_CLASSES is defined.
+// # define _STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE 1
+
+// Uncomment if no "template" keyword should be used with member template classes
+// # define _STLP_NO_MEMBER_TEMPLATE_KEYWORD 1
+
+// Compiler does not accept friend declaration qualified with namespace name.
+// # define _STLP_NO_QUALIFIED_FRIENDS 1
+
+// Uncomment if partial specialization is not available
+// # define _STLP_NO_CLASS_PARTIAL_SPECIALIZATION 1
+
+// Define if class being partially specialized require full name (template parameters)
+// of itself for method declarations
+// # define _STLP_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS
+
+// Compiler has problem with qualified specializations (cont int, volatile int...)
+// # define _STLP_QUALIFIED_SPECIALIZATION_BUG
+
+// Compiler has problems specializing members of partially
+// specialized class
+// # define _STLP_MEMBER_SPECIALIZATION_BUG
+
+// Uncomment if partial order of template functions is not available
+// # define _STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
+
+// Uncomment if specialization of methods is not allowed
+// # define _STLP_NO_METHOD_SPECIALIZATION 1
+
+// Uncomment if full specialization does not use partial spec. syntax : template <> struct ....
+// # define _STLP_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
+
+// Uncomment if compiler does not support explicit template arguments for functions
+// # define _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS
+
+// Uncomment this if your compiler can't inline while(), for()
+// # define _STLP_LOOP_INLINE_PROBLEMS 1
+
+// Define if the compiler fails to match a template function argument of base
+// # define _STLP_BASE_MATCH_BUG 1
+
+// Define if the compiler fails to match a template function argument of base
+// (non-template)
+//# define _STLP_NONTEMPL_BASE_MATCH_BUG 1
+
+// Define if the compiler rejects outline method definition
+// explicitly taking nested types/typedefs
+// # define _STLP_NESTED_TYPE_PARAM_BUG 1
+
+// Compiler requires typename keyword on outline method definition
+// explicitly taking nested types/typedefs
+// #define _STLP_TYPENAME_ON_RETURN_TYPE
+
+// Define if the baseclass typedefs not visible from outside
+// # define _STLP_BASE_TYPEDEF_OUTSIDE_BUG 1
+
+// if your compiler have serious problems with typedefs, try this one
+// # define _STLP_BASE_TYPEDEF_BUG 1
+
+// Uncomment if getting errors compiling mem_fun* adaptors
+// # define _STLP_MEMBER_POINTER_PARAM_BUG 1
+
+// Uncomment if the compiler can't handle a constant-initializer in the
+// declaration of a static const data member of integer type.
+// (See section 9.4.2, paragraph 4, of the C++ standard.)
+// # define _STLP_STATIC_CONST_INIT_BUG
+
+// Uncomment to indicate that the compiler do not like static constant
+// definition.
+// Meaningfull only if _STLP_STATIC_CONST_INIT_BUG is not defined.
+// # define _STLP_NO_STATIC_CONST_DEFINITION
+
+// Define if default constructor for builtin integer type fails to initialize it to 0
+// In expression like new(&char) char():
+//# define _STLP_DEF_CONST_PLCT_NEW_BUG 1
+// In default function parameter like _M_method(_Tp __x = _Tp())
+//# define _STLP_DEF_CONST_DEF_PARAM_BUG 1
+
+// Defined if constructor
+// required to explicitly call member's default constructors for const objects
+// # define _STLP_CONST_CONSTRUCTOR_BUG 1
+
+// Defined if the compiler has trouble calling POD-types constructors/destructors
+// # define _STLP_TRIVIAL_CONSTRUCTOR_BUG 1
+// # define _STLP_TRIVIAL_DESTRUCTOR_BUG 1
+
+// Define if having problems specializing maps/sets with
+// key type being const
+// # define _STLP_MULTI_CONST_TEMPLATE_ARG_BUG
+
+// Uncomment this to disable -> operators on all iterators
+// # define _STLP_NO_ARROW_OPERATOR 1
+
+// Uncomment this to disble at() member functions for containers
+// # define _STLP_NO_AT_MEMBER_FUNCTION 1
+
+// Define this if compiler lacks <exception> header
+// # define _STLP_NO_EXCEPTION_HEADER 1
+
+// Uncomment this if your C library has lrand48() function
+// # define _STLP_RAND48 1
+
+// Uncomment if native new-style C library headers lile <cstddef>, etc are not available.
+// # define _STLP_HAS_NO_NEW_C_HEADERS 1
+
+// uncomment if new-style headers <new> is available
+// # define _STLP_HAS_NEW_NEW_HEADER 1
+
+// uncomment this if <iostream> and other STD headers put their stuff in ::namespace,
+// not std::
+// # define _STLP_VENDOR_GLOBAL_STD
+
+// uncomment this if <cstdio> and the like put stuff in ::namespace,
+// not std::
+// # define _STLP_VENDOR_GLOBAL_CSTD
+
+// uncomment this if your compiler consider as ambiguous a function imported within
+// the stlport namespace and called without scope (:: or std::)
+// # define _STLP_NO_USING_FOR_GLOBAL_FUNCTIONS 1
+
+// uncomment this if your compiler define all the C math functions C++ additional
+// overloads in ::namespace and not only in std::.
+// # define _STLP_HAS_GLOBAL_C_MATH_FUNCTIONS 1
+
+#define MKSTRING_(a) #a
+#define MKSTRING(a) MKSTRING_(a)
+#define _STLP_NATIVE_C_HEADER(header) MKSTRING(NATIVE_C_INCLUDE/header)
+#define _STLP_NATIVE_CPP_C_HEADER(header) MKSTRING(NATIVE_CPP_INCLUDE/header)
+#define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) MKSTRING(NATIVE_CPP_INCLUDE/header)
+
+
+// This macro constructs header path from directory and name.
+// You may change it if your compiler does not understand "/".
+
+// This macro constructs native include header path from include path and name.
+// You may have do define it if experimenting problems with preprocessor
+// # define _STLP_NATIVE_HEADER(header) _STLP_MAKE_HEADER(_STLP_NATIVE_INCLUDE_PATH,header)
+
+// Same for C headers
+// #define _STLP_NATIVE_C_HEADER(header)
+
+//==========================================================
+
+// We have no llabs, lldiv, etc.
+#define _STLP_NO_VENDOR_STDLIB_L
+
+// new_handler is in global namespace
+# define _STLP_GLOBAL_NEW_HANDLER
+
+// terminate function is in global namespace
+#define _STLP_VENDOR_TERMINATE_STD
+
+// We don't want stlport to use its own namespace
+#define _STLP_NO_OWN_NAMESPACE
+
+// Calling convention
+#define _STLP_CALL __cdecl
+
+// Include stlport windows specifics
+#include "_windows.h"
+
+#endif
Propchange: branches/cmake-bringup/include/c++/stlport/stl/config/_reactos.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/cmake-bringup/include/c++/stlport/stl/config/_system.h
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/c%2B%2B/s…
==============================================================================
--- branches/cmake-bringup/include/c++/stlport/stl/config/_system.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/c++/stlport/stl/config/_system.h [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -36,7 +36,9 @@
#ifndef __stl_config__system_h
#define __stl_config__system_h
-#if defined (__sun)
+#if defined (__REACTOS__)
+# include <stl/config/_reactos.h>
+#elif defined (__sun)
# include <stl/config/_solaris.h>
# if defined (__GNUC__)
# include <stl/config/_gcc.h>
Modified: branches/cmake-bringup/include/crt/float.h
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/crt/float…
==============================================================================
--- branches/cmake-bringup/include/crt/float.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/crt/float.h [iso-8859-1] Thu Nov 11 15:58:18 2010
@@ -104,12 +104,12 @@
/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
* i.e. change the bits in unMask to have the values they have in unNew,
* leaving other bits unchanged. */
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _controlfp (unsigned int unNew, unsigned int unMask);
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _control87 (unsigned int unNew, unsigned int unMask);
+__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask);
+__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _control87 (unsigned int unNew, unsigned int unMask);
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _clearfp (void); /* Clear the FPU status word */
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _statusfp (void); /* Report the FPU status word */
+__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _clearfp (void); /* Clear the FPU status word */
+__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _statusfp (void); /* Report the FPU status word */
#define _clear87 _clearfp
#define _status87 _statusfp
@@ -123,8 +123,8 @@
per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when
building your application.
*/
-void __cdecl __MINGW_NOTHROW _fpreset (void);
-void __cdecl __MINGW_NOTHROW fpreset (void);
+__MINGW_NOTHROW void __cdecl _fpreset (void);
+__MINGW_NOTHROW void __cdecl fpreset (void);
/* Global 'variable' for the current floating point error code. */
__MINGW_NOTHROW _CRTIMP int * __cdecl __fpecode(void);
@@ -135,15 +135,15 @@
* but they really belong in math.h.
*/
-_CRTIMP double __cdecl __MINGW_NOTHROW _chgsign (double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _copysign (double, double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _logb (double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _nextafter (double, double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _scalb (double, long);
+__MINGW_NOTHROW _CRTIMP double __cdecl _chgsign (double);
+__MINGW_NOTHROW _CRTIMP double __cdecl _copysign (double, double);
+__MINGW_NOTHROW _CRTIMP double __cdecl _logb (double);
+__MINGW_NOTHROW _CRTIMP double __cdecl _nextafter (double, double);
+__MINGW_NOTHROW _CRTIMP double __cdecl _scalb (double, long);
-_CRTIMP int __cdecl __MINGW_NOTHROW _finite (double);
-_CRTIMP int __cdecl __MINGW_NOTHROW _fpclass (double);
-_CRTIMP int __cdecl __MINGW_NOTHROW _isnan (double);
+__MINGW_NOTHROW _CRTIMP int __cdecl _finite (double);
+__MINGW_NOTHROW _CRTIMP int __cdecl _fpclass (double);
+__MINGW_NOTHROW _CRTIMP int __cdecl _isnan (double);
#ifdef __cplusplus
}
Author: sir_richard
Date: Thu Nov 11 13:15:40 2010
New Revision: 49559
URL: http://svn.reactos.org/svn/reactos?rev=49559&view=rev
Log:
[NTOS]: Start using colored pages. This will help performance on real systems significantly as cache is now taken into account by the memory manager. Also radically changes the way page allocations are given out and creates a less uniform physical memory layout. The fact this now works means that the PFN lists are finally now sane.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] Thu Nov 11 13:15:40 2010
@@ -356,18 +356,15 @@
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
ASSERT(MmAvailablePages != 0);
ASSERT(Color < MmSecondaryColors);
-#if 0
+
/* Check the colored free list */
PageIndex = MmFreePagesByColor[FreePageList][Color].Flink;
- DPRINT1("Found free page: %lx\n", PageIndex);
if (PageIndex == LIST_HEAD)
{
/* Check the colored zero list */
PageIndex = MmFreePagesByColor[ZeroedPageList][Color].Flink;
- DPRINT1("Found zero page: %lx\n", PageIndex);
if (PageIndex == LIST_HEAD)
{
-#endif
/* Check the free list */
ASSERT_LIST_INVARIANT(&MmFreePageListHead);
PageIndex = MmFreePageListHead.Flink;
@@ -385,10 +382,9 @@
ASSERT(MmZeroedPageListHead.Total == 0);
}
}
-#if 0
}
}
-#endif
+
/* Remove the page from its list */
PageIndex = MiRemovePageByColor(PageIndex, Color);
@@ -419,11 +415,9 @@
ASSERT(Color < MmSecondaryColors);
/* Check the colored zero list */
-#if 0
PageIndex = MmFreePagesByColor[ZeroedPageList][Color].Flink;
if (PageIndex == LIST_HEAD)
{
-#endif
/* Check the zero list */
ASSERT_LIST_INVARIANT(&MmZeroedPageListHead);
PageIndex = MmZeroedPageListHead.Flink;
@@ -433,12 +427,11 @@
/* This means there's no zero pages, we have to look for free ones */
ASSERT(MmZeroedPageListHead.Total == 0);
Zero = TRUE;
-#if 0
+
/* Check the colored free list */
PageIndex = MmFreePagesByColor[FreePageList][Color].Flink;
if (PageIndex == LIST_HEAD)
{
-#endif
/* Check the free list */
ASSERT_LIST_INVARIANT(&MmFreePageListHead);
PageIndex = MmFreePageListHead.Flink;
@@ -449,13 +442,9 @@
/* FIXME: Should check the standby list */
ASSERT(MmZeroedPageListHead.Total == 0);
}
-#if 0
}
-#endif
}
-#if 0
- }
-#endif
+ }
/* Sanity checks */
Pfn1 = MI_PFN_ELEMENT(PageIndex);
Author: sir_richard
Date: Thu Nov 11 13:13:05 2010
New Revision: 49558
URL: http://svn.reactos.org/svn/reactos?rev=49558&view=rev
Log:
[NTOS]: Use MI_PFN_ELEMENT in this code, as the extra checks done by MiGetPfnEntry are irrelevant and slow things down.
[NTOS]: Remove some old ReactOS hacks before we had MMROSPFNDATA.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] Thu Nov 11 13:13:05 2010
@@ -113,7 +113,7 @@
if (OldFlink != LIST_HEAD)
{
/* It is not, so set the backlink of the actual entry, to our backlink */
- MiGetPfnEntry(OldFlink)->u2.Blink = OldBlink;
+ MI_PFN_ELEMENT(OldFlink)->u2.Blink = OldBlink;
}
else
{
@@ -125,7 +125,7 @@
if (OldBlink != LIST_HEAD)
{
/* It is not, so set the backlink of the actual entry, to our backlink */
- MiGetPfnEntry(OldBlink)->u1.Flink = OldFlink;
+ MI_PFN_ELEMENT(OldBlink)->u1.Flink = OldFlink;
}
else
{
@@ -149,7 +149,7 @@
if (ColorTable->Flink != LIST_HEAD)
{
/* And make the previous link point to the head now */
- MiGetPfnEntry(ColorTable->Flink)->u4.PteFrame = COLORED_LIST_HEAD;
+ MI_PFN_ELEMENT(ColorTable->Flink)->u4.PteFrame = COLORED_LIST_HEAD;
}
else
{
@@ -163,14 +163,14 @@
ASSERT(Entry->u4.PteFrame != COLORED_LIST_HEAD);
/* Make the back link point to whoever the next page is */
- Pfn1 = MiGetPfnEntry(Entry->u4.PteFrame);
+ Pfn1 = MI_PFN_ELEMENT(Entry->u4.PteFrame);
Pfn1->OriginalPte.u.Long = Entry->OriginalPte.u.Long;
/* Check if this page was pointing to the head */
if (Entry->OriginalPte.u.Long != LIST_HEAD)
{
/* Make the back link point to the head */
- Pfn1 = MiGetPfnEntry(Entry->OriginalPte.u.Long);
+ Pfn1 = MI_PFN_ELEMENT(Entry->OriginalPte.u.Long);
Pfn1->u4.PteFrame = Entry->u4.PteFrame;
}
else
@@ -235,7 +235,7 @@
ASSERT(Color < MmSecondaryColors);
/* Get the PFN entry */
- Pfn1 = MiGetPfnEntry(PageIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageIndex);
ASSERT(Pfn1->u3.e1.RemovalRequested == 0);
ASSERT(Pfn1->u3.e1.Rom == 0);
@@ -260,7 +260,7 @@
if (OldFlink != LIST_HEAD)
{
/* It is not, so set the backlink of the actual entry, to our backlink */
- MiGetPfnEntry(OldFlink)->u2.Blink = OldBlink;
+ MI_PFN_ELEMENT(OldFlink)->u2.Blink = OldBlink;
}
else
{
@@ -272,7 +272,7 @@
if (OldBlink != LIST_HEAD)
{
/* It is not, so set the backlink of the actual entry, to our backlink */
- MiGetPfnEntry(OldBlink)->u1.Flink = OldFlink;
+ MI_PFN_ELEMENT(OldBlink)->u1.Flink = OldFlink;
}
else
{
@@ -306,7 +306,7 @@
else
{
/* The list is empty, so we are the first page */
- MiGetPfnEntry(ColorTable->Flink)->u4.PteFrame = COLORED_LIST_HEAD;
+ MI_PFN_ELEMENT(ColorTable->Flink)->u4.PteFrame = COLORED_LIST_HEAD;
}
/* One less page */
@@ -393,7 +393,7 @@
PageIndex = MiRemovePageByColor(PageIndex, Color);
/* Sanity checks */
- Pfn1 = MiGetPfnEntry(PageIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageIndex);
ASSERT((Pfn1->u3.e1.PageLocation == FreePageList) ||
(Pfn1->u3.e1.PageLocation == ZeroedPageList));
ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
@@ -458,13 +458,13 @@
#endif
/* Sanity checks */
- Pfn1 = MiGetPfnEntry(PageIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageIndex);
ASSERT((Pfn1->u3.e1.PageLocation == FreePageList) ||
(Pfn1->u3.e1.PageLocation == ZeroedPageList));
/* Remove the page from its list */
PageIndex = MiRemovePageByColor(PageIndex, Color);
- ASSERT(Pfn1 == MiGetPfnEntry(PageIndex));
+ ASSERT(Pfn1 == MI_PFN_ELEMENT(PageIndex));
/* Zero it, if needed */
if (Zero) MiZeroPhysicalPage(PageIndex);
@@ -497,7 +497,7 @@
(PageFrameIndex >= MmLowestPhysicalPage));
/* Get the PFN entry */
- Pfn1 = MiGetPfnEntry(PageFrameIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageFrameIndex);
/* Sanity checks that a right kind of page is being inserted here */
ASSERT(Pfn1->u4.MustBeCached == 0);
@@ -516,7 +516,7 @@
if (LastPage != LIST_HEAD)
{
/* Link us with the previous page, so we're at the end now */
- MiGetPfnEntry(LastPage)->u1.Flink = PageFrameIndex;
+ MI_PFN_ELEMENT(LastPage)->u1.Flink = PageFrameIndex;
}
else
{
@@ -571,19 +571,15 @@
/* Get the previous page */
Blink = (PMMPFN)ColorTable->Blink;
- /* Make it link to us */
+ /* Make it link to us, and link back to it */
+ Blink->OriginalPte.u.Long = PageFrameIndex;
Pfn1->u4.PteFrame = MiGetPfnEntryIndex(Blink);
-
- /* If there is an original pte, it should be an old link, NOT a ReactOS RMAP */
- ASSERT(Blink->u4.AweAllocation == FALSE);
- Blink->OriginalPte.u.Long = PageFrameIndex;
}
/* Now initialize our own list pointers */
ColorTable->Blink = Pfn1;
- /* If there is an original pte, it should be an old link, NOT a ReactOS RMAP */
- ASSERT(Pfn1->u4.AweAllocation == FALSE);
+ /* This page is now the last */
Pfn1->OriginalPte.u.Long = LIST_HEAD;
/* And increase the count in the colored list */
@@ -627,7 +623,7 @@
(PageFrameIndex >= MmLowestPhysicalPage));
/* Page should be unused */
- Pfn1 = MiGetPfnEntry(PageFrameIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageFrameIndex);
ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
ASSERT(Pfn1->u3.e1.Rom != 1);
@@ -651,7 +647,7 @@
if (Flink != LIST_HEAD)
{
/* It wasn't, so update the backlink of the previous head page */
- Pfn2 = MiGetPfnEntry(Flink);
+ Pfn2 = MI_PFN_ELEMENT(Flink);
Pfn2->u2.Blink = PageFrameIndex;
}
else
@@ -691,9 +687,6 @@
/* Get the old head */
Flink = ColorHead->Flink;
- /* If there is an original pte, it should be an old link, NOT a ReactOS RMAP */
- ASSERT(Pfn1->u4.AweAllocation == FALSE);
-
/* Make this page point back to the list, and point forwards to the old head */
Pfn1->OriginalPte.u.Long = Flink;
Pfn1->u4.PteFrame = COLORED_LIST_HEAD;
@@ -705,7 +698,7 @@
if (Flink != LIST_HEAD)
{
/* No, so make the old head point to this page */
- Pfn2 = MiGetPfnEntry(Flink);
+ Pfn2 = MI_PFN_ELEMENT(Flink);
Pfn2->u4.PteFrame = PageFrameIndex;
}
else
@@ -737,7 +730,7 @@
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
/* Setup the PTE */
- Pfn1 = MiGetPfnEntry(PageFrameIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageFrameIndex);
Pfn1->PteAddress = PointerPte;
/* Check if this PFN is part of a valid address space */
@@ -788,7 +781,7 @@
Pfn1->u4.PteFrame = PageFrameIndex;
/* Increase its share count so we don't get rid of it */
- Pfn1 = MiGetPfnEntry(PageFrameIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageFrameIndex);
Pfn1->u2.ShareCount++;
}
@@ -842,8 +835,8 @@
IN PFN_NUMBER PageFrameIndex)
{
ASSERT(PageFrameIndex > 0);
- ASSERT(MiGetPfnEntry(PageFrameIndex) != NULL);
- ASSERT(Pfn1 == MiGetPfnEntry(PageFrameIndex));
+ ASSERT(MI_PFN_ELEMENT(PageFrameIndex) != NULL);
+ ASSERT(Pfn1 == MI_PFN_ELEMENT(PageFrameIndex));
ASSERT(MI_IS_ROS_PFN(Pfn1) == FALSE);
/* Page must be in-use */
@@ -880,13 +873,7 @@
/* Clear the last reference */
Pfn1->u3.e2.ReferenceCount = 0;
-
- /*
- * OriginalPte is used by AweReferenceCount in ReactOS, but either
- * ways we shouldn't be seeing RMAP entries at this point
- */
ASSERT(Pfn1->OriginalPte.u.Soft.Prototype == 0);
- ASSERT(Pfn1->u4.AweAllocation == FALSE);
/* Mark the page temporarily as valid, we're going to make it free soon */
Pfn1->u3.e1.PageLocation = ActiveAndValid;
@@ -912,7 +899,7 @@
/* Sanity checks on the page */
ASSERT(PageFrameIndex < MmHighestPhysicalPage);
- ASSERT(Pfn1 == MiGetPfnEntry(PageFrameIndex));
+ ASSERT(Pfn1 == MI_PFN_ELEMENT(PageFrameIndex));
ASSERT(Pfn1->u3.e2.ReferenceCount != 0);
/* Dereference the page, bail out if it's still alive */
@@ -954,7 +941,7 @@
PMMPFN Pfn1;
/* Setup the PTE */
- Pfn1 = MiGetPfnEntry(PageFrameIndex);
+ Pfn1 = MI_PFN_ELEMENT(PageFrameIndex);
Pfn1->PteAddress = PointerPte;
/* Make this a software PTE */
@@ -975,7 +962,7 @@
Pfn1->u4.PteFrame = PteFrame;
/* Increase its share count so we don't get rid of it */
- Pfn1 = MiGetPfnEntry(PteFrame);
+ Pfn1 = MI_PFN_ELEMENT(PteFrame);
Pfn1->u2.ShareCount++;
}
}