1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
131 static bool valid_ucontext(Thread* thread, ucontext_t* valid, ucontext_t* suspect);
132 static ucontext_t* get_valid_uc_in_signal_handler(Thread* thread,
133 ucontext_t* uc);
134
135 static ExtendedPC ucontext_get_ExtendedPC(ucontext_t* uc);
136 static intptr_t* ucontext_get_sp(ucontext_t* uc);
137 // ucontext_get_fp() is only used by Solaris X86 (see note below)
138 static intptr_t* ucontext_get_fp(ucontext_t* uc);
139 static address ucontext_get_pc(ucontext_t* uc);
140 static void ucontext_set_pc(ucontext_t* uc, address pc);
141
142 // For Analyzer Forte AsyncGetCallTrace profiling support:
143 // Parameter ret_fp is only used by Solaris X86.
144 //
145 // We should have different declarations of this interface in
146 // os_solaris_i486.hpp and os_solaris_sparc.hpp, but that file
147 // provides extensions to the os class and not the Solaris class.
148 static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
149 intptr_t** ret_sp, intptr_t** ret_fp);
150
151 static void hotspot_sigmask(Thread* thread);
152
153 // SR_handler
154 static void SR_handler(Thread* thread, ucontext_t* uc);
155 protected:
156 // Solaris-specific interface goes here
157 static julong available_memory();
158 static julong physical_memory() { return _physical_memory; }
159 static julong _physical_memory;
160 static void initialize_system_info();
161 static int _dev_zero_fd;
162 static int get_dev_zero_fd() { return _dev_zero_fd; }
163 static void set_dev_zero_fd(int fd) { _dev_zero_fd = fd; }
164 static int commit_memory_impl(char* addr, size_t bytes, bool exec);
165 static int commit_memory_impl(char* addr, size_t bytes,
166 size_t alignment_hint, bool exec);
167 static char* mmap_chunk(char *addr, size_t size, int flags, int prot);
168 static char* anon_mmap(char* requested_addr, size_t bytes, size_t alignment_hint, bool fixed);
169 static bool mpss_sanity_check(bool warn, size_t * page_size);
170
|
1 /*
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
131 static bool valid_ucontext(Thread* thread, ucontext_t* valid, ucontext_t* suspect);
132 static ucontext_t* get_valid_uc_in_signal_handler(Thread* thread,
133 ucontext_t* uc);
134
135 static ExtendedPC ucontext_get_ExtendedPC(ucontext_t* uc);
136 static intptr_t* ucontext_get_sp(ucontext_t* uc);
137 // ucontext_get_fp() is only used by Solaris X86 (see note below)
138 static intptr_t* ucontext_get_fp(ucontext_t* uc);
139 static address ucontext_get_pc(ucontext_t* uc);
140 static void ucontext_set_pc(ucontext_t* uc, address pc);
141
142 // For Analyzer Forte AsyncGetCallTrace profiling support:
143 // Parameter ret_fp is only used by Solaris X86.
144 //
145 // We should have different declarations of this interface in
146 // os_solaris_i486.hpp and os_solaris_sparc.hpp, but that file
147 // provides extensions to the os class and not the Solaris class.
148 static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
149 intptr_t** ret_sp, intptr_t** ret_fp);
150
151 static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr);
152
153 static void hotspot_sigmask(Thread* thread);
154
155 // SR_handler
156 static void SR_handler(Thread* thread, ucontext_t* uc);
157 protected:
158 // Solaris-specific interface goes here
159 static julong available_memory();
160 static julong physical_memory() { return _physical_memory; }
161 static julong _physical_memory;
162 static void initialize_system_info();
163 static int _dev_zero_fd;
164 static int get_dev_zero_fd() { return _dev_zero_fd; }
165 static void set_dev_zero_fd(int fd) { _dev_zero_fd = fd; }
166 static int commit_memory_impl(char* addr, size_t bytes, bool exec);
167 static int commit_memory_impl(char* addr, size_t bytes,
168 size_t alignment_hint, bool exec);
169 static char* mmap_chunk(char *addr, size_t size, int flags, int prot);
170 static char* anon_mmap(char* requested_addr, size_t bytes, size_t alignment_hint, bool fixed);
171 static bool mpss_sanity_check(bool warn, size_t * page_size);
172
|