239 address os::current_stack_pointer() { 240 return (address)_get_current_sp(); 241 } 242 243 extern "C" intptr_t *_get_current_fp(); // in .il file 244 245 frame os::current_frame() { 246 intptr_t* fp = _get_current_fp(); // it's inlined so want current fp 247 frame myframe((intptr_t*)os::current_stack_pointer(), 248 (intptr_t*)fp, 249 CAST_FROM_FN_PTR(address, os::current_frame)); 250 if (os::is_first_C_frame(&myframe)) { 251 // stack is not walkable 252 frame ret; // This will be a null useless frame 253 return ret; 254 } else { 255 return os::get_sender_for_C_frame(&myframe); 256 } 257 } 258 259 static int threadgetstate(thread_t tid, int *flags, lwpid_t *lwp, stack_t *ss, gregset_t rs, lwpstatus_t *lwpstatus) { 260 char lwpstatusfile[PROCFILE_LENGTH]; 261 int lwpfd, err; 262 263 if (err = os::Solaris::thr_getstate(tid, flags, lwp, ss, rs)) 264 return (err); 265 if (*flags == TRS_LWPID) { 266 sprintf(lwpstatusfile, "/proc/%d/lwp/%d/lwpstatus", getpid(), 267 *lwp); 268 if ((lwpfd = open(lwpstatusfile, O_RDONLY)) < 0) { 269 perror("thr_mutator_status: open lwpstatus"); 270 return (EINVAL); 271 } 272 if (pread(lwpfd, lwpstatus, sizeof (lwpstatus_t), (off_t)0) != 273 sizeof (lwpstatus_t)) { 274 perror("thr_mutator_status: read lwpstatus"); 275 (void) close(lwpfd); 276 return (EINVAL); 277 } 278 (void) close(lwpfd); 279 } 280 return (0); 281 } 282 283 #ifndef AMD64 284 285 // Detecting SSE support by OS 286 // From solaris_i486.s 287 extern "C" bool sse_check(); 288 extern "C" bool sse_unavailable(); 289 290 enum { SSE_UNKNOWN, SSE_NOT_SUPPORTED, SSE_SUPPORTED}; 291 static int sse_status = SSE_UNKNOWN; 292 293 294 static void check_for_sse_support() { 295 if (!VM_Version::supports_sse()) { 296 sse_status = SSE_NOT_SUPPORTED; 297 return; 298 } 299 // looking for _sse_hw in libc.so, if it does not exist or 300 // the value (int) is 0, OS has no support for SSE 301 int *sse_hwp; 302 void *h; | 239 address os::current_stack_pointer() { 240 return (address)_get_current_sp(); 241 } 242 243 extern "C" intptr_t *_get_current_fp(); // in .il file 244 245 frame os::current_frame() { 246 intptr_t* fp = _get_current_fp(); // it's inlined so want current fp 247 frame myframe((intptr_t*)os::current_stack_pointer(), 248 (intptr_t*)fp, 249 CAST_FROM_FN_PTR(address, os::current_frame)); 250 if (os::is_first_C_frame(&myframe)) { 251 // stack is not walkable 252 frame ret; // This will be a null useless frame 253 return ret; 254 } else { 255 return os::get_sender_for_C_frame(&myframe); 256 } 257 } 258 259 #ifndef AMD64 260 261 // Detecting SSE support by OS 262 // From solaris_i486.s 263 extern "C" bool sse_check(); 264 extern "C" bool sse_unavailable(); 265 266 enum { SSE_UNKNOWN, SSE_NOT_SUPPORTED, SSE_SUPPORTED}; 267 static int sse_status = SSE_UNKNOWN; 268 269 270 static void check_for_sse_support() { 271 if (!VM_Version::supports_sse()) { 272 sse_status = SSE_NOT_SUPPORTED; 273 return; 274 } 275 // looking for _sse_hw in libc.so, if it does not exist or 276 // the value (int) is 0, OS has no support for SSE 277 int *sse_hwp; 278 void *h; |