Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/os/windows/vm/os_windows.inline.hpp
32284 views
/*1* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP25#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP2627#include "runtime/atomic.inline.hpp"28#include "runtime/orderAccess.inline.hpp"29#include "runtime/os.hpp"3031inline const char* os::file_separator() { return "\\"; }32inline const char* os::line_separator() { return "\r\n"; }33inline const char* os::path_separator() { return ";"; }34inline const char* os::dll_file_extension() { return ".dll"; }3536inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;}3738// File names are case-insensitive on windows only39inline int os::file_name_strcmp(const char* s, const char* t) {40return _stricmp(s, t);41}4243inline void os::dll_unload(void *lib) {44::FreeLibrary((HMODULE)lib);45}4647inline void* os::dll_lookup(void *lib, const char *name) {48return (void*)::GetProcAddress((HMODULE)lib, name);49}5051// Used to improve time-sharing on some systems52inline void os::loop_breaker(int attempts) {}5354inline bool os::obsolete_option(const JavaVMOption *option) {55return false;56}5758inline bool os::uses_stack_guard_pages() {59return os::win32::is_nt();60}6162inline bool os::allocate_stack_guard_pages() {63assert(uses_stack_guard_pages(), "sanity check");64return true;65}6667// Bang the shadow pages if they need to be touched to be mapped.68inline void os::bang_stack_shadow_pages() {69// Write to each page of our new frame to force OS mapping.70// If we decrement stack pointer more than one page71// the OS may not map an intervening page into our space72// and may fault on a memory access to interior of our frame.73address sp = current_stack_pointer();74for (int pages = 1; pages <= StackShadowPages; pages++) {75*((int *)(sp - (pages * vm_page_size()))) = 0;76}77}7879inline bool os::numa_has_static_binding() { return true; }80inline bool os::numa_has_group_homing() { return false; }8182inline size_t os::read(int fd, void *buf, unsigned int nBytes) {83return ::read(fd, buf, nBytes);84}8586inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {87return ::read(fd, buf, nBytes);88}8990inline size_t os::write(int fd, const void *buf, unsigned int nBytes) {91return ::write(fd, buf, nBytes);92}9394inline int os::close(int fd) {95return ::close(fd);96}9798#define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) \99os::win32::call_test_func_with_wrapper(f)100101#endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP102103104