/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef OS_WINDOWS_VM_OS_WINDOWS_HPP
#define OS_WINDOWS_VM_OS_WINDOWS_HPP
// Win32_OS defines the interface to windows operating systems
class win32 {
friend class os;
protected:
static int _vm_page_size;
static int _vm_allocation_granularity;
static int _processor_type;
static int _processor_level;
static bool _is_nt;
static bool _is_windows_2003;
static bool _is_windows_server;
public:
// Windows-specific interface:
static void initialize_system_info();
static void setmode_streams();
// Processor info as provided by NT
// Processor level may not be accurate on non-NT systems
static int processor_level() {
return _processor_level;
}
static julong available_memory();
// load dll from Windows system directory or Windows directory
public:
// Generic interface:
// Trace number of created threads
// Tells whether the platform is NT or Windown95
// Tells whether this is a server version of Windows
// Tells whether the platform is Windows 2003
// Returns the byte size of a virtual memory page
// Returns the size in bytes of memory blocks which can be allocated.
// Read the headers for the executable that started the current process into
// the structure passed in (see winnt.h).
static void read_executable_headers(PIMAGE_NT_HEADERS);
// Default stack size for the current process.
#ifndef _WIN64
// A wrapper to install a structured exception handler for fast JNI accesors.
#endif
// filter function to ignore faults on serializations page
};
private:
volatile int _Event ;
public: // TODO-FIXME: make dtor private
public:
PlatformEvent() {
_Event = 0 ;
}
// Exercise caution using reset() and fired() - they may require MEMBARs
void park () ;
void unpark () ;
} ;
protected:
public:
PlatformParker () {
}
} ;
// JDK7 requires VS2010
#if _MSC_VER < 1600
#endif
public:
static BOOL WinSock2Available();
#ifdef JDK6_OR_EARLIER
private:
static void initialize();
#endif
};
public:
static BOOL SwitchToThread();
static SIZE_T GetLargePageMinimum();
static BOOL SwitchToThreadAvailable();
static BOOL GetLargePageMinimumAvailable();
// Help tools
static BOOL HelpToolsAvailable();
static BOOL GetNativeSystemInfoAvailable();
static void GetNativeSystemInfo(LPSYSTEM_INFO);
// NUMA calls
static BOOL NumaCallsAvailable();
// Stack walking
private:
// and later
static void initialize();
static void initializeCommon();
#ifdef JDK6_OR_EARLIER
private:
#endif
};
public:
static BOOL AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
static BOOL AdvapiAvailable();
#ifdef JDK6_OR_EARLIER
private:
static BOOL (WINAPI *_AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
static void initialize();
#endif
};
public:
static BOOL PSApiAvailable();
#ifdef JDK6_OR_EARLIER
private:
static void initialize();
#endif
};
#endif // OS_WINDOWS_VM_OS_WINDOWS_HPP