518
519 void os::Linux::init_thread_fpu_state(void) {
520 // Disable FP exceptions.
521 __asm__ __volatile__ ("mtfsfi 6,0");
522 }
523
524 int os::Linux::get_fpu_control_word(void) {
525 // x86 has problems with FPU precision after pthread_cond_timedwait().
526 // nothing to do on ppc64.
527 return 0;
528 }
529
530 void os::Linux::set_fpu_control_word(int fpu_control) {
531 // x86 has problems with FPU precision after pthread_cond_timedwait().
532 // nothing to do on ppc64.
533 }
534
535 ////////////////////////////////////////////////////////////////////////////////
536 // thread stack
537
538 // These sizes exclude libc stack guard pages, but include
539 // the HotSpot guard pages.
540 size_t os::Posix::_compiler_thread_min_stack_allowed = 384 * K;
541 size_t os::Posix::_java_thread_min_stack_allowed = 384 * 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 : 1024 * K);
548 return s;
549 }
550
551 /////////////////////////////////////////////////////////////////////////////
552 // helper functions for fatal error handler
553
554 void os::print_context(outputStream *st, const void *context) {
555 if (context == NULL) return;
556
557 const ucontext_t* uc = (const ucontext_t*)context;
558
559 st->print_cr("Registers:");
560 st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
561 st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
562 st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
563 st->cr();
564 for (int i = 0; i < 32; i++) {
565 st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
566 if (i % 3 == 2) st->cr();
|
518
519 void os::Linux::init_thread_fpu_state(void) {
520 // Disable FP exceptions.
521 __asm__ __volatile__ ("mtfsfi 6,0");
522 }
523
524 int os::Linux::get_fpu_control_word(void) {
525 // x86 has problems with FPU precision after pthread_cond_timedwait().
526 // nothing to do on ppc64.
527 return 0;
528 }
529
530 void os::Linux::set_fpu_control_word(int fpu_control) {
531 // x86 has problems with FPU precision after pthread_cond_timedwait().
532 // nothing to do on ppc64.
533 }
534
535 ////////////////////////////////////////////////////////////////////////////////
536 // thread stack
537
538 // Minimum usable stack sizes required to get to user code. Space for
539 // HotSpot guard pages is added later.
540 size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
541 size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
542 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * 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 : 1024 * K);
548 return s;
549 }
550
551 /////////////////////////////////////////////////////////////////////////////
552 // helper functions for fatal error handler
553
554 void os::print_context(outputStream *st, const void *context) {
555 if (context == NULL) return;
556
557 const ucontext_t* uc = (const ucontext_t*)context;
558
559 st->print_cr("Registers:");
560 st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
561 st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
562 st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
563 st->cr();
564 for (int i = 0; i < 32; i++) {
565 st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
566 if (i % 3 == 2) st->cr();
|