< prev index next >

src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp

Print this page
rev 12283 : 8169373: Work around linux NPTL stack guard error.
Summary: Also streamline OS guard page handling on linuxs390, linuxppc, aixppc.


 518   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 519 
 520   VMError::report_and_die(t, sig, pc, info, ucVoid);
 521 
 522   ShouldNotReachHere();
 523   return 0;
 524 }
 525 
 526 void os::Aix::init_thread_fpu_state(void) {
 527 #if !defined(USE_XLC_BUILTINS)
 528   // Disable FP exceptions.
 529   __asm__ __volatile__ ("mtfsfi 6,0");
 530 #else
 531   __mtfsfi(6, 0);
 532 #endif
 533 }
 534 
 535 ////////////////////////////////////////////////////////////////////////////////
 536 // thread stack
 537 
 538 size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;


 539 size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
 540 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
 541 
 542 // return default stack size for thr_type
 543 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 544   // default stack size (compiler thread needs larger stack)
 545   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 546   return s;






 547 }
 548 
 549 /////////////////////////////////////////////////////////////////////////////
 550 // helper functions for fatal error handler
 551 
 552 void os::print_context(outputStream *st, const void *context) {
 553   if (context == NULL) return;
 554 
 555   const ucontext_t* uc = (const ucontext_t*)context;
 556 
 557   st->print_cr("Registers:");
 558   st->print("pc =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.iar);
 559   st->print("lr =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.lr);
 560   st->print("ctr=" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.ctr);
 561   st->cr();
 562   for (int i = 0; i < 32; i++) {
 563     st->print("r%-2d=" INTPTR_FORMAT "  ", i, uc->uc_mcontext.jmp_context.gpr[i]);
 564     if (i % 3 == 2) st->cr();
 565   }
 566   st->cr();




 518   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 519 
 520   VMError::report_and_die(t, sig, pc, info, ucVoid);
 521 
 522   ShouldNotReachHere();
 523   return 0;
 524 }
 525 
 526 void os::Aix::init_thread_fpu_state(void) {
 527 #if !defined(USE_XLC_BUILTINS)
 528   // Disable FP exceptions.
 529   __asm__ __volatile__ ("mtfsfi 6,0");
 530 #else
 531   __mtfsfi(6, 0);
 532 #endif
 533 }
 534 
 535 ////////////////////////////////////////////////////////////////////////////////
 536 // thread stack
 537 
 538 // These sizes exclude OS stack guard pages, but include
 539 // the VM guard pages.
 540 size_t os::Posix::_compiler_thread_min_stack_allowed = 320 * K;
 541 size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
 542 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
 543 
 544 // Return default stack size for thr_type.
 545 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 546   // Default stack size (compiler thread needs larger stack).
 547   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 548   return s;
 549 }
 550 
 551 size_t os::Aix::default_guard_size(os::ThreadType thr_type) {
 552   // Creating guard pages is very expensive. Java thread has HotSpot
 553   // guard pages, so only enable libc guard pages for non-Java threads.
 554   return (thr_type == java_thread ? 0 : page_size());
 555 }
 556 
 557 /////////////////////////////////////////////////////////////////////////////
 558 // helper functions for fatal error handler
 559 
 560 void os::print_context(outputStream *st, const void *context) {
 561   if (context == NULL) return;
 562 
 563   const ucontext_t* uc = (const ucontext_t*)context;
 564 
 565   st->print_cr("Registers:");
 566   st->print("pc =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.iar);
 567   st->print("lr =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.lr);
 568   st->print("ctr=" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.ctr);
 569   st->cr();
 570   for (int i = 0; i < 32; i++) {
 571     st->print("r%-2d=" INTPTR_FORMAT "  ", i, uc->uc_mcontext.jmp_context.gpr[i]);
 572     if (i % 3 == 2) st->cr();
 573   }
 574   st->cr();


< prev index next >