1 /*
2 * Copyright (c) 1997, 2016, 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 *
92 static lgrp_children_func_t _lgrp_children;
93 static lgrp_resources_func_t _lgrp_resources;
94 static lgrp_nlgrps_func_t _lgrp_nlgrps;
95 static lgrp_cookie_stale_func_t _lgrp_cookie_stale;
96 static lgrp_cookie_t _lgrp_cookie;
97
98 // Large Page Support
99 static bool is_valid_page_size(size_t bytes);
100 static size_t page_size_for_alignment(size_t alignment);
101 static bool setup_large_pages(caddr_t start, size_t bytes, size_t align);
102
103 static void init_thread_fpu_state(void);
104
105 static void try_enable_extended_io();
106
107 static struct sigaction *(*get_signal_action)(int);
108 static struct sigaction *get_preinstalled_handler(int);
109 static int (*get_libjsig_version)();
110 static void save_preinstalled_handler(int, struct sigaction&);
111 static void check_signal_handler(int sig);
112 // For overridable signals
113 static int _SIGasync; // user-overridable ASYNC_SIGNAL
114 static void set_SIGasync(int newsig) { _SIGasync = newsig; }
115
116 typedef int (*pthread_setname_np_func_t)(pthread_t, const char*);
117 static pthread_setname_np_func_t _pthread_setname_np;
118
119 public:
120 // Large Page Support--ISM.
121 static bool largepage_range(char* addr, size_t size);
122
123 static int SIGasync() { return _SIGasync; }
124 static address handler_start, handler_end; // start and end pc of thr_sighndlrinfo
125
126 static bool valid_stack_address(Thread* thread, address sp);
127 static bool valid_ucontext(Thread* thread, const ucontext_t* valid, const ucontext_t* suspect);
128 static const ucontext_t* get_valid_uc_in_signal_handler(Thread* thread,
129 const ucontext_t* uc);
130
131 static ExtendedPC ucontext_get_ExtendedPC(const ucontext_t* uc);
132 static intptr_t* ucontext_get_sp(const ucontext_t* uc);
133 // ucontext_get_fp() is only used by Solaris X86 (see note below)
134 static intptr_t* ucontext_get_fp(const ucontext_t* uc);
135 static address ucontext_get_pc(const ucontext_t* uc);
136 static void ucontext_set_pc(ucontext_t* uc, address pc);
137
138 // For Analyzer Forte AsyncGetCallTrace profiling support:
139 // Parameter ret_fp is only used by Solaris X86.
140 //
141 // We should have different declarations of this interface in
142 // os_solaris_i486.hpp and os_solaris_sparc.hpp, but that file
143 // provides extensions to the os class and not the Solaris class.
|
1 /*
2 * Copyright (c) 1997, 2017, 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 *
92 static lgrp_children_func_t _lgrp_children;
93 static lgrp_resources_func_t _lgrp_resources;
94 static lgrp_nlgrps_func_t _lgrp_nlgrps;
95 static lgrp_cookie_stale_func_t _lgrp_cookie_stale;
96 static lgrp_cookie_t _lgrp_cookie;
97
98 // Large Page Support
99 static bool is_valid_page_size(size_t bytes);
100 static size_t page_size_for_alignment(size_t alignment);
101 static bool setup_large_pages(caddr_t start, size_t bytes, size_t align);
102
103 static void init_thread_fpu_state(void);
104
105 static void try_enable_extended_io();
106
107 static struct sigaction *(*get_signal_action)(int);
108 static struct sigaction *get_preinstalled_handler(int);
109 static int (*get_libjsig_version)();
110 static void save_preinstalled_handler(int, struct sigaction&);
111 static void check_signal_handler(int sig);
112
113 typedef int (*pthread_setname_np_func_t)(pthread_t, const char*);
114 static pthread_setname_np_func_t _pthread_setname_np;
115
116 public:
117 // Large Page Support--ISM.
118 static bool largepage_range(char* addr, size_t size);
119
120 static address handler_start, handler_end; // start and end pc of thr_sighndlrinfo
121
122 static bool valid_stack_address(Thread* thread, address sp);
123 static bool valid_ucontext(Thread* thread, const ucontext_t* valid, const ucontext_t* suspect);
124 static const ucontext_t* get_valid_uc_in_signal_handler(Thread* thread,
125 const ucontext_t* uc);
126
127 static ExtendedPC ucontext_get_ExtendedPC(const ucontext_t* uc);
128 static intptr_t* ucontext_get_sp(const ucontext_t* uc);
129 // ucontext_get_fp() is only used by Solaris X86 (see note below)
130 static intptr_t* ucontext_get_fp(const ucontext_t* uc);
131 static address ucontext_get_pc(const ucontext_t* uc);
132 static void ucontext_set_pc(ucontext_t* uc, address pc);
133
134 // For Analyzer Forte AsyncGetCallTrace profiling support:
135 // Parameter ret_fp is only used by Solaris X86.
136 //
137 // We should have different declarations of this interface in
138 // os_solaris_i486.hpp and os_solaris_sparc.hpp, but that file
139 // provides extensions to the os class and not the Solaris class.
|