207 // From IA32 System Programming Guide |
207 // From IA32 System Programming Guide |
208 enum { |
208 enum { |
209 trap_page_fault = 0xE |
209 trap_page_fault = 0xE |
210 }; |
210 }; |
211 |
211 |
212 extern "C" void Fetch32PFI () ; |
|
213 extern "C" void Fetch32Resume () ; |
|
214 #ifdef AMD64 |
|
215 extern "C" void FetchNPFI () ; |
|
216 extern "C" void FetchNResume () ; |
|
217 #endif // AMD64 |
|
218 |
|
219 extern "C" JNIEXPORT int |
212 extern "C" JNIEXPORT int |
220 JVM_handle_linux_signal(int sig, |
213 JVM_handle_linux_signal(int sig, |
221 siginfo_t* info, |
214 siginfo_t* info, |
222 void* ucVoid, |
215 void* ucVoid, |
223 int abort_if_unrecognized) { |
216 int abort_if_unrecognized) { |
276 |
269 |
277 //%note os_trap_1 |
270 //%note os_trap_1 |
278 if (info != NULL && uc != NULL && thread != NULL) { |
271 if (info != NULL && uc != NULL && thread != NULL) { |
279 pc = (address) os::Linux::ucontext_get_pc(uc); |
272 pc = (address) os::Linux::ucontext_get_pc(uc); |
280 |
273 |
281 if (pc == (address) Fetch32PFI) { |
274 if (StubRoutines::is_safefetch_fault(pc)) { |
282 uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ; |
275 uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc)); |
283 return 1 ; |
276 return 1; |
284 } |
277 } |
285 #ifdef AMD64 |
|
286 if (pc == (address) FetchNPFI) { |
|
287 uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ; |
|
288 return 1 ; |
|
289 } |
|
290 #endif // AMD64 |
|
291 |
278 |
292 #ifndef AMD64 |
279 #ifndef AMD64 |
293 // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs |
280 // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs |
294 // This can happen in any running code (currently more frequently in |
281 // This can happen in any running code (currently more frequently in |
295 // interpreter code but has been seen in compiled code) |
282 // interpreter code but has been seen in compiled code) |