1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2012, 2014 SAP AG. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 // no precompiled headers
  27 #include "assembler_ppc.inline.hpp"
  28 #include "classfile/classLoader.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "classfile/vmSymbols.hpp"
  31 #include "code/codeCache.hpp"
  32 #include "code/icBuffer.hpp"
  33 #include "code/vtableStubs.hpp"
  34 #include "interpreter/interpreter.hpp"
  35 #include "jvm_aix.h"
  36 #include "memory/allocation.inline.hpp"
  37 #include "mutex_aix.inline.hpp"
  38 #include "nativeInst_ppc.hpp"
  39 #include "os_share_aix.hpp"
  40 #include "prims/jniFastGetField.hpp"
  41 #include "prims/jvm.h"
  42 #include "prims/jvm_misc.hpp"
  43 #include "runtime/arguments.hpp"
  44 #include "runtime/extendedPC.hpp"
  45 #include "runtime/frame.inline.hpp"
  46 #include "runtime/interfaceSupport.hpp"
  47 #include "runtime/java.hpp"
  48 #include "runtime/javaCalls.hpp"
  49 #include "runtime/mutexLocker.hpp"
  50 #include "runtime/osThread.hpp"
  51 #include "runtime/sharedRuntime.hpp"
  52 #include "runtime/stubRoutines.hpp"
  53 #include "runtime/thread.inline.hpp"
  54 #include "runtime/timer.hpp"
  55 #include "utilities/events.hpp"
  56 #include "utilities/vmError.hpp"
  57 #ifdef COMPILER1
  58 #include "c1/c1_Runtime1.hpp"
  59 #endif
  60 #ifdef COMPILER2
  61 #include "opto/runtime.hpp"
  62 #endif
  63 
  64 // put OS-includes here
  65 # include <ucontext.h>
  66 
  67 address os::current_stack_pointer() {
  68   address csp;
  69 
  70 #if !defined(USE_XLC_BUILTINS)
  71   // inline assembly for `mr regno(csp), R1_SP':
  72   __asm__ __volatile__ ("mr %0, 1":"=r"(csp):);
  73 #else
  74   csp = (address) __builtin_frame_address(0);
  75 #endif
  76 
  77   return csp;
  78 }
  79 
  80 char* os::non_memory_address_word() {
  81   // Must never look like an address returned by reserve_memory,
  82   // even in its subfields (as defined by the CPU immediate fields,
  83   // if the CPU splits constants across multiple instructions).
  84 
  85   return (char*) -1;
  86 }
  87 
  88 // OS specific thread initialization
  89 //
  90 // Calculate and store the limits of the memory stack.
  91 void os::initialize_thread(Thread *thread) { }
  92 
  93 // Frame information (pc, sp, fp) retrieved via ucontext
  94 // always looks like a C-frame according to the frame
  95 // conventions in frame_ppc.hpp.
  96 
  97 address os::Aix::ucontext_get_pc(const ucontext_t * uc) {
  98   return (address)uc->uc_mcontext.jmp_context.iar;
  99 }
 100 
 101 intptr_t* os::Aix::ucontext_get_sp(const ucontext_t * uc) {
 102   // gpr1 holds the stack pointer on aix
 103   return (intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/];
 104 }
 105 
 106 intptr_t* os::Aix::ucontext_get_fp(const ucontext_t * uc) {
 107   return NULL;
 108 }
 109 
 110 void os::Aix::ucontext_set_pc(ucontext_t* uc, address new_pc) {
 111   uc->uc_mcontext.jmp_context.iar = (uint64_t) new_pc;
 112 }
 113 
 114 ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
 115                                         intptr_t** ret_sp, intptr_t** ret_fp) {
 116 
 117   ExtendedPC  epc;
 118   const ucontext_t* uc = (const ucontext_t*)ucVoid;
 119 
 120   if (uc != NULL) {
 121     epc = ExtendedPC(os::Aix::ucontext_get_pc(uc));
 122     if (ret_sp) *ret_sp = os::Aix::ucontext_get_sp(uc);
 123     if (ret_fp) *ret_fp = os::Aix::ucontext_get_fp(uc);
 124   } else {
 125     // construct empty ExtendedPC for return value checking
 126     epc = ExtendedPC(NULL);
 127     if (ret_sp) *ret_sp = (intptr_t *)NULL;
 128     if (ret_fp) *ret_fp = (intptr_t *)NULL;
 129   }
 130 
 131   return epc;
 132 }
 133 
 134 frame os::fetch_frame_from_context(const void* ucVoid) {
 135   intptr_t* sp;
 136   intptr_t* fp;
 137   ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp);
 138   // Avoid crash during crash if pc broken.
 139   if (epc.pc()) {
 140     frame fr(sp, epc.pc());
 141     return fr;
 142   }
 143   frame fr(sp);
 144   return fr;
 145 }
 146 
 147 frame os::get_sender_for_C_frame(frame* fr) {
 148   if (*fr->sp() == NULL) {
 149     // fr is the last C frame
 150     return frame(NULL, NULL);
 151   }
 152   return frame(fr->sender_sp(), fr->sender_pc());
 153 }
 154 
 155 
 156 frame os::current_frame() {
 157   intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer());
 158   // hack.
 159   frame topframe(csp, (address)0x8);
 160   // return sender of current topframe which hopefully has pc != NULL.
 161   return os::get_sender_for_C_frame(&topframe);
 162 }
 163 
 164 // Utility functions
 165 
 166 extern "C" JNIEXPORT int
 167 JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) {
 168 
 169   ucontext_t* uc = (ucontext_t*) ucVoid;
 170 
 171   Thread* t = Thread::current_or_null_safe();
 172 
 173   SignalHandlerMark shm(t);
 174 
 175   // Note: it's not uncommon that JNI code uses signal/sigset to install
 176   // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
 177   // or have a SIGILL handler when detecting CPU type). When that happens,
 178   // JVM_handle_aix_signal() might be invoked with junk info/ucVoid. To
 179   // avoid unnecessary crash when libjsig is not preloaded, try handle signals
 180   // that do not require siginfo/ucontext first.
 181 
 182   if (sig == SIGPIPE) {
 183     if (os::Aix::chained_handler(sig, info, ucVoid)) {
 184       return 1;
 185     } else {
 186       if (PrintMiscellaneous && (WizardMode || Verbose)) {
 187         warning("Ignoring SIGPIPE - see bug 4229104");
 188       }
 189       return 1;
 190     }
 191   }
 192 
 193   JavaThread* thread = NULL;
 194   VMThread* vmthread = NULL;
 195   if (os::Aix::signal_handlers_are_installed) {
 196     if (t != NULL) {
 197       if(t->is_Java_thread()) {
 198         thread = (JavaThread*)t;
 199       }
 200       else if(t->is_VM_thread()) {
 201         vmthread = (VMThread *)t;
 202       }
 203     }
 204   }
 205 
 206   // Decide if this trap can be handled by a stub.
 207   address stub = NULL;
 208 
 209   // retrieve program counter
 210   address const pc = uc ? os::Aix::ucontext_get_pc(uc) : NULL;
 211 
 212   // retrieve crash address
 213   address const addr = info ? (const address) info->si_addr : NULL;
 214 
 215   // SafeFetch 32 handling:
 216   // - make it work if _thread is null
 217   // - make it use the standard os::...::ucontext_get/set_pc APIs
 218   if (uc) {
 219     address const pc = os::Aix::ucontext_get_pc(uc);
 220     if (pc && StubRoutines::is_safefetch_fault(pc)) {
 221       os::Aix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
 222       return true;
 223     }
 224   }
 225 
 226   // Handle SIGDANGER right away. AIX would raise SIGDANGER whenever available swap
 227   // space falls below 30%. This is only a chance for the process to gracefully abort.
 228   // We can't hope to proceed after SIGDANGER since SIGKILL tailgates.
 229   if (sig == SIGDANGER) {
 230     goto report_and_die;
 231   }
 232 
 233   if (info == NULL || uc == NULL || thread == NULL && vmthread == NULL) {
 234     goto run_chained_handler;
 235   }
 236 
 237   // If we are a java thread...
 238   if (thread != NULL) {
 239 
 240     // Handle ALL stack overflow variations here
 241     if (sig == SIGSEGV && thread->on_local_stack(addr)) {
 242       // stack overflow
 243       //
 244       // If we are in a yellow zone and we are inside java, we disable the yellow zone and
 245       // throw a stack overflow exception.
 246       // If we are in native code or VM C code, we report-and-die. The original coding tried
 247       // to continue with yellow zone disabled, but that doesn't buy us much and prevents
 248       // hs_err_pid files.
 249       if (thread->in_stack_yellow_reserved_zone(addr)) {
 250         thread->disable_stack_yellow_reserved_zone();
 251         if (thread->thread_state() == _thread_in_Java) {
 252           // Throw a stack overflow exception.
 253           // Guard pages will be reenabled while unwinding the stack.
 254           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
 255           goto run_stub;
 256         } else {
 257           // Thread was in the vm or native code. Return and try to finish.
 258           return 1;
 259         }
 260       } else if (thread->in_stack_red_zone(addr)) {
 261         // Fatal red zone violation. Disable the guard pages and fall through
 262         // to handle_unexpected_exception way down below.
 263         thread->disable_stack_red_zone();
 264         tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
 265         goto report_and_die;
 266       } else {
 267         // This means a segv happened inside our stack, but not in
 268         // the guarded zone. I'd like to know when this happens,
 269         tty->print_raw_cr("SIGSEGV happened inside stack but outside yellow and red zone.");
 270         goto report_and_die;
 271       }
 272 
 273     } // end handle SIGSEGV inside stack boundaries
 274 
 275     if (thread->thread_state() == _thread_in_Java) {
 276       // Java thread running in Java code
 277 
 278       // The following signals are used for communicating VM events:
 279       //
 280       // SIGILL: the compiler generates illegal opcodes
 281       //   at places where it wishes to interrupt the VM:
 282       //   Safepoints, Unreachable Code, Entry points of Zombie methods,
 283       //    This results in a SIGILL with (*pc) == inserted illegal instruction.
 284       //
 285       //   (so, SIGILLs with a pc inside the zero page are real errors)
 286       //
 287       // SIGTRAP:
 288       //   The ppc trap instruction raises a SIGTRAP and is very efficient if it
 289       //   does not trap. It is used for conditional branches that are expected
 290       //   to be never taken. These are:
 291       //     - zombie methods
 292       //     - IC (inline cache) misses.
 293       //     - null checks leading to UncommonTraps.
 294       //     - range checks leading to Uncommon Traps.
 295       //   On Aix, these are especially null checks, as the ImplicitNullCheck
 296       //   optimization works only in rare cases, as the page at address 0 is only
 297       //   write protected.      //
 298       //   Note: !UseSIGTRAP is used to prevent SIGTRAPS altogether, to facilitate debugging.
 299       //
 300       // SIGSEGV:
 301       //   used for safe point polling:
 302       //     To notify all threads that they have to reach a safe point, safe point polling is used:
 303       //     All threads poll a certain mapped memory page. Normally, this page has read access.
 304       //     If the VM wants to inform the threads about impending safe points, it puts this
 305       //     page to read only ("poisens" the page), and the threads then reach a safe point.
 306       //   used for null checks:
 307       //     If the compiler finds a store it uses it for a null check. Unfortunately this
 308       //     happens rarely.  In heap based and disjoint base compressd oop modes also loads
 309       //     are used for null checks.
 310 
 311       // A VM-related SIGILL may only occur if we are not in the zero page.
 312       // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else
 313       // in the zero page, because it is filled with 0x0. We ignore
 314       // explicit SIGILLs in the zero page.
 315       if (sig == SIGILL && (pc < (address) 0x200)) {
 316         if (TraceTraps) {
 317           tty->print_raw_cr("SIGILL happened inside zero page.");
 318         }
 319         goto report_and_die;
 320       }
 321 
 322       // Handle signal from NativeJump::patch_verified_entry().
 323       if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
 324           (!TrapBasedNotEntrantChecks && sig == SIGILL  && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
 325         if (TraceTraps) {
 326           tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
 327         }
 328         stub = SharedRuntime::get_handle_wrong_method_stub();
 329         goto run_stub;
 330       }
 331 
 332       else if (sig == SIGSEGV && os::is_poll_address(addr)) {
 333         if (TraceTraps) {
 334           tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
 335         }
 336         stub = SharedRuntime::get_poll_stub(pc);
 337         goto run_stub;
 338       }
 339 
 340       // SIGTRAP-based ic miss check in compiled code.
 341       else if (sig == SIGTRAP && TrapBasedICMissChecks &&
 342                nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
 343         if (TraceTraps) {
 344           tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
 345         }
 346         stub = SharedRuntime::get_ic_miss_stub();
 347         goto run_stub;
 348       }
 349 
 350       // SIGTRAP-based implicit null check in compiled code.
 351       else if (sig == SIGTRAP && TrapBasedNullChecks &&
 352                nativeInstruction_at(pc)->is_sigtrap_null_check()) {
 353         if (TraceTraps) {
 354           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
 355         }
 356         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
 357         goto run_stub;
 358       }
 359 
 360       // SIGSEGV-based implicit null check in compiled code.
 361       else if (sig == SIGSEGV && ImplicitNullChecks &&
 362                CodeCache::contains((void*) pc) &&
 363                !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
 364         if (TraceTraps) {
 365           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc);
 366         }
 367         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
 368       }
 369 
 370 #ifdef COMPILER2
 371       // SIGTRAP-based implicit range check in compiled code.
 372       else if (sig == SIGTRAP && TrapBasedRangeChecks &&
 373                nativeInstruction_at(pc)->is_sigtrap_range_check()) {
 374         if (TraceTraps) {
 375           tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
 376         }
 377         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
 378         goto run_stub;
 379       }
 380 #endif
 381 
 382       else if (sig == SIGFPE /* && info->si_code == FPE_INTDIV */) {
 383         if (TraceTraps) {
 384           tty->print_raw_cr("Fix SIGFPE handler, trying divide by zero handler.");
 385         }
 386         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
 387         goto run_stub;
 388       }
 389 
 390       else if (sig == SIGBUS) {
 391         // BugId 4454115: A read from a MappedByteBuffer can fault here if the
 392         // underlying file has been truncated. Do not crash the VM in such a case.
 393         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
 394         nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL;
 395         if (nm != NULL && nm->has_unsafe_access()) {
 396           // We don't really need a stub here! Just set the pending exeption and
 397           // continue at the next instruction after the faulting read. Returning
 398           // garbage from this read is ok.
 399           thread->set_pending_unsafe_access_error();
 400           os::Aix::ucontext_set_pc(uc, pc + 4);
 401           return 1;
 402         }
 403       }
 404     }
 405 
 406     else { // thread->thread_state() != _thread_in_Java
 407       // Detect CPU features. This is only done at the very start of the VM. Later, the
 408       // VM_Version::is_determine_features_test_running() flag should be false.
 409 
 410       if (sig == SIGILL && VM_Version::is_determine_features_test_running()) {
 411         // SIGILL must be caused by VM_Version::determine_features().
 412         *(int *)pc = 0; // patch instruction to 0 to indicate that it causes a SIGILL,
 413                         // flushing of icache is not necessary.
 414         stub = pc + 4;  // continue with next instruction.
 415         goto run_stub;
 416       }
 417       else if (thread->thread_state() == _thread_in_vm &&
 418                sig == SIGBUS && thread->doing_unsafe_access()) {
 419         // We don't really need a stub here! Just set the pending exeption and
 420         // continue at the next instruction after the faulting read. Returning
 421         // garbage from this read is ok.
 422         thread->set_pending_unsafe_access_error();
 423         os::Aix::ucontext_set_pc(uc, pc + 4);
 424         return 1;
 425       }
 426     }
 427 
 428     // Check to see if we caught the safepoint code in the
 429     // process of write protecting the memory serialization page.
 430     // It write enables the page immediately after protecting it
 431     // so we can just return to retry the write.
 432     if ((sig == SIGSEGV) &&
 433         os::is_memory_serialize_page(thread, addr)) {
 434       // Synchronization problem in the pseudo memory barrier code (bug id 6546278)
 435       // Block current thread until the memory serialize page permission restored.
 436       os::block_on_serialize_page_trap();
 437       return true;
 438     }
 439   }
 440 
 441 run_stub:
 442 
 443   // One of the above code blocks ininitalized the stub, so we want to
 444   // delegate control to that stub.
 445   if (stub != NULL) {
 446     // Save all thread context in case we need to restore it.
 447     if (thread != NULL) thread->set_saved_exception_pc(pc);
 448     os::Aix::ucontext_set_pc(uc, stub);
 449     return 1;
 450   }
 451 
 452 run_chained_handler:
 453 
 454   // signal-chaining
 455   if (os::Aix::chained_handler(sig, info, ucVoid)) {
 456     return 1;
 457   }
 458   if (!abort_if_unrecognized) {
 459     // caller wants another chance, so give it to him
 460     return 0;
 461   }
 462 
 463 report_and_die:
 464 
 465   // Use sigthreadmask instead of sigprocmask on AIX and unmask current signal.
 466   sigset_t newset;
 467   sigemptyset(&newset);
 468   sigaddset(&newset, sig);
 469   sigthreadmask(SIG_UNBLOCK, &newset, NULL);
 470 
 471   VMError::report_and_die(t, sig, pc, info, ucVoid);
 472 
 473   ShouldNotReachHere();
 474   return 0;
 475 }
 476 
 477 void os::Aix::init_thread_fpu_state(void) {
 478 #if !defined(USE_XLC_BUILTINS)
 479   // Disable FP exceptions.
 480   __asm__ __volatile__ ("mtfsfi 6,0");
 481 #else
 482   __mtfsfi(6, 0);
 483 #endif
 484 }
 485 
 486 ////////////////////////////////////////////////////////////////////////////////
 487 // thread stack
 488 
 489 size_t os::Aix::min_stack_allowed = 128*K;
 490 
 491 // return default stack size for thr_type
 492 size_t os::Aix::default_stack_size(os::ThreadType thr_type) {
 493   // default stack size (compiler thread needs larger stack)
 494   // Notice that the setting for compiler threads here have no impact
 495   // because of the strange 'fallback logic' in os::create_thread().
 496   // Better set CompilerThreadStackSize in globals_<os_cpu>.hpp if you want to
 497   // specify a different stack size for compiler threads!
 498   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 499   return s;
 500 }
 501 
 502 size_t os::Aix::default_guard_size(os::ThreadType thr_type) {
 503   return 2 * page_size();
 504 }
 505 
 506 /////////////////////////////////////////////////////////////////////////////
 507 // helper functions for fatal error handler
 508 
 509 void os::print_context(outputStream *st, const void *context) {
 510   if (context == NULL) return;
 511 
 512   const ucontext_t* uc = (const ucontext_t*)context;
 513 
 514   st->print_cr("Registers:");
 515   st->print("pc =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.iar);
 516   st->print("lr =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.lr);
 517   st->print("ctr=" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.ctr);
 518   st->cr();
 519   for (int i = 0; i < 32; i++) {
 520     st->print("r%-2d=" INTPTR_FORMAT "  ", i, uc->uc_mcontext.jmp_context.gpr[i]);
 521     if (i % 3 == 2) st->cr();
 522   }
 523   st->cr();
 524   st->cr();
 525 
 526   intptr_t *sp = (intptr_t *)os::Aix::ucontext_get_sp(uc);
 527   st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
 528   print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
 529   st->cr();
 530 
 531   // Note: it may be unsafe to inspect memory near pc. For example, pc may
 532   // point to garbage if entry point in an nmethod is corrupted. Leave
 533   // this at the end, and hope for the best.
 534   address pc = os::Aix::ucontext_get_pc(uc);
 535   st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
 536   print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
 537   st->cr();
 538 
 539   // Try to decode the instructions.
 540   st->print_cr("Decoded instructions: (pc=" PTR_FORMAT ")", pc);
 541   st->print("<TODO: PPC port - print_context>");
 542   // TODO: PPC port Disassembler::decode(pc, 16, 16, st);
 543   st->cr();
 544 }
 545 
 546 void os::print_register_info(outputStream *st, const void *context) {
 547   if (context == NULL) return;
 548 
 549   ucontext_t *uc = (ucontext_t*)context;
 550 
 551   st->print_cr("Register to memory mapping:");
 552   st->cr();
 553 
 554   st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.iar);
 555   st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.lr);
 556   st->print("sp ="); print_location(st, (intptr_t)os::Aix::ucontext_get_sp(uc));
 557   for (int i = 0; i < 32; i++) {
 558     st->print("r%-2d=", i);
 559     print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.gpr[i]);
 560   }
 561 
 562   st->cr();
 563 }
 564 
 565 extern "C" {
 566   int SpinPause() {
 567     return 0;
 568   }
 569 }
 570 
 571 #ifndef PRODUCT
 572 void os::verify_stack_alignment() {
 573   assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
 574 }
 575 #endif
 576 
 577 int os::extra_bang_size_in_bytes() {
 578   // PPC does not require the additional stack bang.
 579   return 0;
 580 }
 581