< prev index next >

src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp

Print this page
rev 7970 : 8074552:  SafeFetch32 and SafeFetchN do not work in error handling
Summary: handle SafeFetch faults in secondary signal handlers
Reviewed-by: dholmes
Contributed-by: Thomas Stuefe


  90   // if the CPU splits constants across multiple instructions).
  91 #ifdef SPARC
  92   // On SPARC, 0 != %hi(any real address), because there is no
  93   // allocation in the first 1Kb of the virtual address space.
  94   return (char *) 0;
  95 #else
  96   // This is the value for x86; works pretty well for PPC too.
  97   return (char *) -1;
  98 #endif // SPARC
  99 }
 100 
 101 void os::initialize_thread(Thread* thr) {
 102   // Nothing to do.
 103 }
 104 
 105 address os::Bsd::ucontext_get_pc(ucontext_t* uc) {
 106   ShouldNotCallThis();
 107   return NULL;
 108 }
 109 




 110 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
 111                                         intptr_t** ret_sp,
 112                                         intptr_t** ret_fp) {
 113   ShouldNotCallThis();
 114   return ExtendedPC();
 115 }
 116 
 117 frame os::fetch_frame_from_context(void* ucVoid) {
 118   ShouldNotCallThis();
 119   return frame();
 120 }
 121 
 122 extern "C" JNIEXPORT int
 123 JVM_handle_bsd_signal(int sig,
 124                         siginfo_t* info,
 125                         void* ucVoid,
 126                         int abort_if_unrecognized) {
 127   ucontext_t* uc = (ucontext_t*) ucVoid;
 128 
 129   Thread* t = ThreadLocalStorage::get_thread_slow();




  90   // if the CPU splits constants across multiple instructions).
  91 #ifdef SPARC
  92   // On SPARC, 0 != %hi(any real address), because there is no
  93   // allocation in the first 1Kb of the virtual address space.
  94   return (char *) 0;
  95 #else
  96   // This is the value for x86; works pretty well for PPC too.
  97   return (char *) -1;
  98 #endif // SPARC
  99 }
 100 
 101 void os::initialize_thread(Thread* thr) {
 102   // Nothing to do.
 103 }
 104 
 105 address os::Bsd::ucontext_get_pc(ucontext_t* uc) {
 106   ShouldNotCallThis();
 107   return NULL;
 108 }
 109 
 110 void os::Bsd::ucontext_set_pc(ucontext_t * uc, address pc) {
 111   ShouldNotCallThis();
 112 }
 113 
 114 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
 115                                         intptr_t** ret_sp,
 116                                         intptr_t** ret_fp) {
 117   ShouldNotCallThis();
 118   return ExtendedPC();
 119 }
 120 
 121 frame os::fetch_frame_from_context(void* ucVoid) {
 122   ShouldNotCallThis();
 123   return frame();
 124 }
 125 
 126 extern "C" JNIEXPORT int
 127 JVM_handle_bsd_signal(int sig,
 128                         siginfo_t* info,
 129                         void* ucVoid,
 130                         int abort_if_unrecognized) {
 131   ucontext_t* uc = (ucontext_t*) ucVoid;
 132 
 133   Thread* t = ThreadLocalStorage::get_thread_slow();


< prev index next >