< prev index next >

src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp

Print this page




 447   // signal-chaining
 448   if (os::Linux::chained_handler(sig, info, ucVoid)) {
 449      return true;
 450   }
 451 
 452   if (!abort_if_unrecognized) {
 453     // caller wants another chance, so give it to him
 454     return false;
 455   }
 456 
 457   if (pc == NULL && uc != NULL) {
 458     pc = os::Linux::ucontext_get_pc(uc);
 459   }
 460 
 461   // unmask current signal
 462   sigset_t newset;
 463   sigemptyset(&newset);
 464   sigaddset(&newset, sig);
 465   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 466 
 467   VMError err(t, sig, pc, info, ucVoid);
 468   err.report_and_die();
 469 
 470   ShouldNotReachHere();
 471   return true; // Mute compiler
 472 }
 473 
 474 void os::Linux::init_thread_fpu_state(void) {
 475 }
 476 
 477 int os::Linux::get_fpu_control_word(void) {
 478   return 0;
 479 }
 480 
 481 void os::Linux::set_fpu_control_word(int fpu_control) {
 482 }
 483 
 484 // Check that the linux kernel version is 2.4 or higher since earlier
 485 // versions do not support SSE without patches.
 486 bool os::supports_sse() {
 487   return true;
 488 }


 541 //
 542 // ** P1 (aka bottom) and size ( P2 = P1 - size) are the address and stack size returned from
 543 //    pthread_attr_getstack()
 544 
 545 static void current_stack_region(address * bottom, size_t * size) {
 546   if (os::Linux::is_initial_thread()) {
 547      // initial thread needs special handling because pthread_getattr_np()
 548      // may return bogus value.
 549      *bottom = os::Linux::initial_thread_stack_bottom();
 550      *size   = os::Linux::initial_thread_stack_size();
 551   } else {
 552      pthread_attr_t attr;
 553 
 554      int rslt = pthread_getattr_np(pthread_self(), &attr);
 555 
 556      // JVM needs to know exact stack location, abort if it fails
 557      if (rslt != 0) {
 558        if (rslt == ENOMEM) {
 559          vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
 560        } else {
 561          fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt));
 562        }
 563      }
 564 
 565      if (pthread_attr_getstack(&attr, (void **)bottom, size) != 0) {
 566          fatal("Can not locate current stack attributes!");
 567      }
 568 
 569      pthread_attr_destroy(&attr);
 570 
 571   }
 572   assert(os::current_stack_pointer() >= *bottom &&
 573          os::current_stack_pointer() < *bottom + *size, "just checking");
 574 }
 575 
 576 address os::current_stack_base() {
 577   address bottom;
 578   size_t size;
 579   current_stack_region(&bottom, &size);
 580   return (bottom + size);
 581 }




 447   // signal-chaining
 448   if (os::Linux::chained_handler(sig, info, ucVoid)) {
 449      return true;
 450   }
 451 
 452   if (!abort_if_unrecognized) {
 453     // caller wants another chance, so give it to him
 454     return false;
 455   }
 456 
 457   if (pc == NULL && uc != NULL) {
 458     pc = os::Linux::ucontext_get_pc(uc);
 459   }
 460 
 461   // unmask current signal
 462   sigset_t newset;
 463   sigemptyset(&newset);
 464   sigaddset(&newset, sig);
 465   sigprocmask(SIG_UNBLOCK, &newset, NULL);
 466 
 467   VMError::report_and_die(t, sig, pc, info, ucVoid);

 468 
 469   ShouldNotReachHere();
 470   return true; // Mute compiler
 471 }
 472 
 473 void os::Linux::init_thread_fpu_state(void) {
 474 }
 475 
 476 int os::Linux::get_fpu_control_word(void) {
 477   return 0;
 478 }
 479 
 480 void os::Linux::set_fpu_control_word(int fpu_control) {
 481 }
 482 
 483 // Check that the linux kernel version is 2.4 or higher since earlier
 484 // versions do not support SSE without patches.
 485 bool os::supports_sse() {
 486   return true;
 487 }


 540 //
 541 // ** P1 (aka bottom) and size ( P2 = P1 - size) are the address and stack size returned from
 542 //    pthread_attr_getstack()
 543 
 544 static void current_stack_region(address * bottom, size_t * size) {
 545   if (os::Linux::is_initial_thread()) {
 546      // initial thread needs special handling because pthread_getattr_np()
 547      // may return bogus value.
 548      *bottom = os::Linux::initial_thread_stack_bottom();
 549      *size   = os::Linux::initial_thread_stack_size();
 550   } else {
 551      pthread_attr_t attr;
 552 
 553      int rslt = pthread_getattr_np(pthread_self(), &attr);
 554 
 555      // JVM needs to know exact stack location, abort if it fails
 556      if (rslt != 0) {
 557        if (rslt == ENOMEM) {
 558          vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
 559        } else {
 560          fatal("pthread_getattr_np failed with errno = %d", rslt);
 561        }
 562      }
 563 
 564      if (pthread_attr_getstack(&attr, (void **)bottom, size) != 0) {
 565          fatal("Can not locate current stack attributes!");
 566      }
 567 
 568      pthread_attr_destroy(&attr);
 569 
 570   }
 571   assert(os::current_stack_pointer() >= *bottom &&
 572          os::current_stack_pointer() < *bottom + *size, "just checking");
 573 }
 574 
 575 address os::current_stack_base() {
 576   address bottom;
 577   size_t size;
 578   current_stack_region(&bottom, &size);
 579   return (bottom + size);
 580 }


< prev index next >