aboutsummaryrefslogtreecommitdiffstats
path: root/community/openjdk8/icedtea-hotspot-musl-ppc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/openjdk8/icedtea-hotspot-musl-ppc.patch')
-rw-r--r--community/openjdk8/icedtea-hotspot-musl-ppc.patch59
1 files changed, 28 insertions, 31 deletions
diff --git a/community/openjdk8/icedtea-hotspot-musl-ppc.patch b/community/openjdk8/icedtea-hotspot-musl-ppc.patch
index dfb3150f6b6..a39bc3e9b62 100644
--- a/community/openjdk8/icedtea-hotspot-musl-ppc.patch
+++ b/community/openjdk8/icedtea-hotspot-musl-ppc.patch
@@ -7,9 +7,9 @@ running on musl libc. This patch fix this by replacing
"uc_mcontext.regs->grp" with "uc_mcontext.gp_regs"
and accessing the named fields (like "->nip") by the array index constants.
---- openjdk.orig/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
+--- openjdk/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
+++ openjdk/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
-@@ -1243,7 +1243,11 @@
+@@ -1243,7 +1243,11 @@ bool MacroAssembler::is_load_from_polling_page(int instruction, void* ucontext,
// the safepoing polling page.
ucontext_t* uc = (ucontext_t*) ucontext;
// Set polling address.
@@ -21,7 +21,7 @@ and accessing the named fields (like "->nip") by the array index constants.
if (polling_address_ptr != NULL) {
*polling_address_ptr = addr;
}
-@@ -1264,15 +1268,24 @@
+@@ -1264,15 +1268,24 @@ bool MacroAssembler::is_memory_serialization(int instruction, JavaThread* thread
int rb = inv_rb_field(instruction);
// look up content of ra and rb in ucontext
@@ -46,7 +46,7 @@ and accessing the named fields (like "->nip") by the array index constants.
return os::is_memory_serialize_page(thread, ra_val+d1);
} else {
return false;
-@@ -1335,11 +1348,20 @@
+@@ -1335,11 +1348,20 @@ address MacroAssembler::get_stack_bang_address(int instruction, void *ucontext)
|| (is_stdu(instruction) && rs == 1)) {
int ds = inv_ds_field(instruction);
// return banged address
@@ -67,21 +67,20 @@ and accessing the named fields (like "->nip") by the array index constants.
return ra != 1 || rb_val >= 0 ? NULL // not a stack bang
: sp + rb_val; // banged address
}
---- openjdk.orig/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
+--- openjdk/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
+++ openjdk/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
-@@ -75,7 +75,11 @@
+@@ -75,6 +75,10 @@
# include <poll.h>
# include <ucontext.h>
+#if ! (defined(__GLIBC__) || defined(__UCLIBC__))
+# include <asm/ptrace.h>
+#endif
-
+
+
address os::current_stack_pointer() {
intptr_t* csp;
-
-@@ -110,11 +114,19 @@
+@@ -110,11 +114,19 @@ address os::Linux::ucontext_get_pc(ucontext_t * uc) {
// it because the volatile registers are not needed to make setcontext() work.
// Hopefully it was zero'd out beforehand.
guarantee(uc->uc_mcontext.regs != NULL, "only use ucontext_get_pc in sigaction context");
@@ -101,8 +100,8 @@ and accessing the named fields (like "->nip") by the array index constants.
}
intptr_t* os::Linux::ucontext_get_fp(ucontext_t * uc) {
-@@ -213,7 +225,11 @@
- if (uc) {
+@@ -213,7 +225,11 @@ JVM_handle_linux_signal(int sig,
+ if ((sig == SIGSEGV || sig == SIGBUS) && uc) {
address const pc = os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
+#if defined(__GLIBC__) || defined(__UCLIBC__)
@@ -113,7 +112,7 @@ and accessing the named fields (like "->nip") by the array index constants.
return true;
}
}
-@@ -364,7 +380,11 @@
+@@ -364,7 +380,11 @@ JVM_handle_linux_signal(int sig,
// continue at the next instruction after the faulting read. Returning
// garbage from this read is ok.
thread->set_pending_unsafe_access_error();
@@ -125,7 +124,7 @@ and accessing the named fields (like "->nip") by the array index constants.
return true;
}
}
-@@ -383,7 +403,11 @@
+@@ -383,7 +403,11 @@ JVM_handle_linux_signal(int sig,
// continue at the next instruction after the faulting read. Returning
// garbage from this read is ok.
thread->set_pending_unsafe_access_error();
@@ -137,7 +136,7 @@ and accessing the named fields (like "->nip") by the array index constants.
return true;
}
}
-@@ -406,7 +430,11 @@
+@@ -406,7 +430,11 @@ JVM_handle_linux_signal(int sig,
if (stub != NULL) {
// Save all thread context in case we need to restore it.
if (thread != NULL) thread->set_saved_exception_pc(pc);
@@ -149,7 +148,7 @@ and accessing the named fields (like "->nip") by the array index constants.
return true;
}
-@@ -564,6 +592,7 @@
+@@ -564,6 +592,7 @@ void os::print_context(outputStream *st, void *context) {
ucontext_t* uc = (ucontext_t*)context;
st->print_cr("Registers:");
@@ -157,7 +156,7 @@ and accessing the named fields (like "->nip") by the array index constants.
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->nip);
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.regs->link);
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.regs->ctr);
-@@ -572,8 +601,18 @@
+@@ -572,6 +601,16 @@ void os::print_context(outputStream *st, void *context) {
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.regs->gpr[i]);
if (i % 3 == 2) st->cr();
}
@@ -165,18 +164,16 @@ and accessing the named fields (like "->nip") by the array index constants.
+ st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_NIP]);
+ st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_LNK]);
+ st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.gp_regs[PT_CTR]);
- st->cr();
++ st->cr();
+ for (int i = 0; i < 32; i++) {
+ st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.gp_regs[i]);
+ if (i % 3 == 2) st->cr();
+ }
+#endif
st->cr();
-+ st->cr();
+ st->cr();
- intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
- st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
-@@ -600,7 +639,11 @@
+@@ -600,7 +639,11 @@ void os::print_register_info(outputStream *st, void *context) {
// this is only for the "general purpose" registers
for (int i = 0; i < 32; i++) {
st->print("r%-2d=", i);
@@ -188,7 +185,7 @@ and accessing the named fields (like "->nip") by the array index constants.
}
st->cr();
}
---- openjdk.orig/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp
+--- openjdk/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp
+++ openjdk/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp
@@ -27,6 +27,10 @@
#include "runtime/frame.inline.hpp"
@@ -201,7 +198,7 @@ and accessing the named fields (like "->nip") by the array index constants.
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
assert(this->is_Java_thread(), "must be JavaThread");
-@@ -42,8 +46,13 @@
+@@ -42,8 +46,13 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
// if we were running Java code when SIGPROF came in.
if (isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
@@ -215,15 +212,15 @@ and accessing the named fields (like "->nip") by the array index constants.
if (ret_frame.pc() == NULL) {
// ucontext wasn't useful
-@@ -55,7 +64,11 @@
- if (!((Method*)(istate->method))->is_metaspace_object()) {
- return false;
- }
+@@ -56,7 +65,11 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
+ if (m == NULL || !m->is_valid_method()) return false;
+ if (!Metaspace::contains((const void*)m)) return false;
+
+#if defined(__GLIBC__) || defined(__UCLIBC__)
- uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+ uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+#else // Musl
+ uint64_t reg_bcp = uc->uc_mcontext.gp_regs[14/*R14_bcp*/];
+#endif
- uint64_t istate_bcp = istate->bcp;
- uint64_t code_start = (uint64_t)(((Method*)(istate->method))->code_base());
- uint64_t code_end = (uint64_t)(((Method*)istate->method)->code_base() + ((Method*)istate->method)->code_size());
+ uint64_t istate_bcp = istate->bcp;
+ uint64_t code_start = (uint64_t)(m->code_base());
+ uint64_t code_end = (uint64_t)(m->code_base() + m->code_size());