author | sspitsyn |
Mon, 27 Apr 2015 19:51:00 -0700 | |
changeset 30289 | 10b7b61d759a |
parent 30143 | 7e99f2b4bae5 |
child 35201 | 996db89f378e |
permissions | -rw-r--r-- |
1 | 1 |
/* |
30143
7e99f2b4bae5
8074860: Structured Exception Catcher missing around CreateJavaVM on Windows
stuefe
parents:
26682
diff
changeset
|
2 |
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP |
26 |
#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP |
|
27 |
||
28 |
#include "runtime/os.hpp" |
|
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7405
diff
changeset
|
29 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
30 |
inline const char* os::dll_file_extension() { return ".dll"; } |
1 | 31 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
32 |
inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
33 |
|
1 | 34 |
// File names are case-insensitive on windows only |
35 |
inline int os::file_name_strcmp(const char* s, const char* t) { |
|
36 |
return _stricmp(s, t); |
|
37 |
} |
|
38 |
||
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
39 |
inline void os::dll_unload(void *lib) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
40 |
::FreeLibrary((HMODULE)lib); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
41 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
42 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
43 |
inline void* os::dll_lookup(void *lib, const char *name) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
44 |
return (void*)::GetProcAddress((HMODULE)lib, name); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
45 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
46 |
|
1 | 47 |
inline bool os::obsolete_option(const JavaVMOption *option) { |
48 |
return false; |
|
49 |
} |
|
50 |
||
51 |
inline bool os::uses_stack_guard_pages() { |
|
52 |
return os::win32::is_nt(); |
|
53 |
} |
|
54 |
||
55 |
inline bool os::allocate_stack_guard_pages() { |
|
56 |
assert(uses_stack_guard_pages(), "sanity check"); |
|
57 |
return true; |
|
58 |
} |
|
59 |
||
60 |
inline int os::readdir_buf_size(const char *path) |
|
61 |
{ |
|
62 |
/* As Windows doesn't use the directory entry buffer passed to |
|
63 |
os::readdir() this can be as short as possible */ |
|
64 |
||
65 |
return 1; |
|
66 |
} |
|
67 |
||
68 |
// Bang the shadow pages if they need to be touched to be mapped. |
|
69 |
inline void os::bang_stack_shadow_pages() { |
|
70 |
// Write to each page of our new frame to force OS mapping. |
|
71 |
// If we decrement stack pointer more than one page |
|
72 |
// the OS may not map an intervening page into our space |
|
73 |
// and may fault on a memory access to interior of our frame. |
|
74 |
address sp = current_stack_pointer(); |
|
75 |
for (int pages = 1; pages <= StackShadowPages; pages++) { |
|
76 |
*((int *)(sp - (pages * vm_page_size()))) = 0; |
|
77 |
} |
|
78 |
} |
|
388 | 79 |
|
80 |
inline bool os::numa_has_static_binding() { return true; } |
|
81 |
inline bool os::numa_has_group_homing() { return false; } |
|
7397 | 82 |
|
7405
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
83 |
inline size_t os::read(int fd, void *buf, unsigned int nBytes) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
84 |
return ::read(fd, buf, nBytes); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
85 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
86 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
87 |
inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
88 |
return ::read(fd, buf, nBytes); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
89 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
90 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
91 |
inline size_t os::write(int fd, const void *buf, unsigned int nBytes) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
92 |
return ::write(fd, buf, nBytes); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
93 |
} |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
94 |
|
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
95 |
inline int os::close(int fd) { |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
96 |
return ::close(fd); |
e6fc8d3926f8
6348631: remove the use of the HPI library from Hotspot
ikrylov
parents:
7397
diff
changeset
|
97 |
} |
18683
a6418e038255
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
15855
diff
changeset
|
98 |
|
22891
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18683
diff
changeset
|
99 |
inline bool os::supports_monotonic_clock() { |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18683
diff
changeset
|
100 |
return win32::_has_performance_count; |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18683
diff
changeset
|
101 |
} |
1f5d1fff23fa
6546236: Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler
fparain
parents:
18683
diff
changeset
|
102 |
|
26682
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
103 |
inline void os::exit(int num) { |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
104 |
win32::exit_process_or_thread(win32::EPT_PROCESS, num); |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
105 |
} |
f339669ba825
8057744: (process) Synchronize exiting of threads and process [win]
igerasim
parents:
25468
diff
changeset
|
106 |
|
7397 | 107 |
#endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP |