2273N/A * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A#
include <
signal.h>
// needed first to avoid name collision for "std" with SC 5.0 0N/A// put OS-includes here 0N/A// Minimum stack size for the VM. It's easier to document a constant 0N/A// but it's different for x86 and sparc because the page sizes are different. 0N/A // We should detect this at run time. For now, filling 0N/A // in with a constant. 0N/A // Must never look like an address returned by reserve_memory, 0N/A // even in its subfields (as defined by the CPU immediate fields, 0N/A // if the CPU splits constants across multiple instructions). 0N/A // On SPARC, 0 != %hi(any real address), because there is no 0N/A // allocation in the first 1Kb of the virtual address space. 0N/A// Validate a ucontext retrieved from walking a uc_link of a ucontext. 0N/A// There are issues with libthread giving out uc_links for different threads 0N/A// on the same uc_link chain and bad or circular links. 0N/A// We will only follow one level of uc_link since there are libthread 0N/A// issues with ucontext linking and it is better to be safe and just 0N/A// let caller retry later. 0N/A // Sometimes the topmost register windows are not properly flushed. 0N/A // i.e., if the kernel would have needed to take a page fault 0N/A // cannot validate without uc_link so accept current ucontext 0N/A // first ucontext is valid so try the next one 0N/A // cannot validate without uc_link so accept current ucontext 0N/A // the ucontext one level down is also valid so return it 0N/A// Assumes ucontext is valid 0N/A // set npc to zero to avoid using it for safepoint, good for profiling only 0N/A// Assumes ucontext is valid 0N/A// For Forte Analyzer AsyncGetCallTrace profiling support - thread 0N/A// is currently interrupted by SIGPROF. 0N/A// ret_fp parameter is only used by Solaris X86. 0N/A// The difference between this and os::fetch_frame_from_context() is that 0N/A// here we try to skip nested signal frames. 0N/A// ret_fp parameter is only used by Solaris X86. 0N/A // construct empty ExtendedPC for return value checking 3574N/A// Returns an estimate of the current stack pointer. Result must be guaranteed to 3574N/A// point into the calling threads stack, and be no lower than the current stack 0N/A // stack is not walkable 0N/A perror(
"thr_mutator_status: open lwpstatus");
0N/A perror(
"thr_mutator_status: read lwpstatus");
0N/A // If os::Solaris::SIGasync not chained, and this is a non-vm and 0N/A // can't decode this kind of signal 0N/A // decide if this trap can be handled by a stub 0N/A // factor me: getPCfromContext 0N/A // SafeFetch() support 0N/A // Implemented with either a fixed set of addresses such 0N/A // as Fetch32*, or with Thread._OnTrap. 0N/A // Handle ALL stack overflow variations here 0N/A // Sometimes the register windows are not properly flushed. 0N/A // Throw a stack overflow exception. Guard pages will be reenabled 0N/A // while unwinding the stack. 0N/A // Thread was in the vm or native code. Return and try to finish. 0N/A // Fatal red zone violation. Disable the guard pages and fall through 0N/A // to handle_unexpected_exception way down below. 0N/A // Sometimes the register windows are not properly flushed. 0N/A // Java thread running in Java code => find exception handler if any 0N/A // a fault inside compiled code, the interpreter, or a stub 0N/A // Support Safepoint Polling 0N/A // Not needed on x86 solaris because verify_oops doesn't generate 0N/A // This is not factored because on x86 solaris the patching for 0N/A // zombies does not generate a SEGV. 0N/A // zombie method (ld [%g0],%o7 instruction) 0N/A // At the stub it needs to look like a call from the caller of this 0N/A // method (not a call from the segv site). 0N/A // BugId 4454115: A read from a MappedByteBuffer can fault 0N/A // here if the underlying file has been truncated. 0N/A // Do not crash the VM in such a case. 0N/A // integer divide by zero 0N/A // floating-point divide by zero 0N/A // Inline cache missed and user trap "Tne G0+ST_RESERVED_FOR_USER_0+2" taken. 0N/A // At the stub it needs to look like a call from the caller of this 0N/A // method (not a call from the segv site). 0N/A // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in 0N/A // and the heap gets shrunk before the field access. 0N/A // Check to see if we caught the safepoint code in the 0N/A // process of write protecting the memory serialization page. 0N/A // It write enables the page immediately after protecting it 0N/A // Block current thread until the memory serialize page permission restored. 0N/A // save all thread context in case we need to restore it 0N/A // simulate a branch to the stub (a "call" in the safepoint stub case) 0N/A // caller wants another chance, so give it to him 1827N/A // Sometimes the register windows are not properly flushed. 0N/A // unmask current signal 1983N/A // Determine which sort of error to throw. Out of swap may signal 1983N/A // on the thread stack, which could get a mapping error when touched. 0N/A // Note: it may be unsafe to inspect memory near pc. For example, pc may 0N/A // point to garbage if entry point in an nmethod is corrupted. Leave 0N/A // this at the end, and hope for the best. 1827N/A // this is only for the "general purpose" registers 0N/A // Nothing needed on Sparc. 0N/A// These routines are the initial value of atomic_xchg_entry(), 0N/A// atomic_cmpxchg_entry(), atomic_add_entry() and fence_entry() 0N/A// until initialization is complete. 0N/A// TODO - remove when the VM drops support for V8. 0N/A // try to use the stub: 0N/A // try to use the stub: 0N/A // try to use the stub: 0N/A // try to use the stub: 0N/A#
endif // !_LP64 && !COMPILER2 0N/A // For compiler1 the architecture is v8 and frps isn't present in v8 0N/A#
endif //defined(__sparc) && defined(COMPILER2)