From 95b37fc1a6a2a2c4306c12a2f4f182f9a9b31703 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 2 Dec 2022 09:24:23 +0000 Subject: [PATCH] Aenderungen von Helge diff --git a/libgo/go/runtime/mgc.go b/libgo/go/runtime/mgc.go index 65cbcdb5522..28eb7ff671f 100644 --- a/libgo/go/runtime/mgc.go +++ b/libgo/go/runtime/mgc.go @@ -1695,7 +1695,7 @@ func gcTestPointerClass(p unsafe.Pointer) string { return "heap" } bss := getBSS() - if p2 >= getText() && p2 < bss { + if p2 >= getText() && p2 < bss { // Text, data, bss ... return "data" } if p2 >= bss && p2 < getEnd() { diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c index aa1b6305ad0..79b50447e9f 100644 --- a/libgo/runtime/go-signal.c +++ b/libgo/runtime/go-signal.c @@ -260,6 +260,8 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused))) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; #elif defined(__aarch64__) && defined(__linux__) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.pc; +#elif defined(__hppa__) && defined(__linux__) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_iaoq[0]; #elif defined(__NetBSD__) ret.sigpc = _UC_MACHINE_PC(((ucontext_t*)(context))); #endif @@ -423,5 +425,12 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u runtime_printf("pc %X\n", m->pc); runtime_printf("pstate %X\n", m->pstate); } +#elif defined(__hppa__) && defined(__linux__) + { + int i; +// #warning "TODO !!!" + for (i = 0; i < 31; i++) + runtime_printf("x%d %X\n", i, i); + } #endif } diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c index 3a30748d329..810327c2d5a 100644 --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -44,7 +44,7 @@ extern void __splitstack_block_signals_context (void *context[10], int *, #endif #ifndef PTHREAD_STACK_MIN -# define PTHREAD_STACK_MIN 8192 +# define PTHREAD_STACK_MIN (4*8192) #endif #if defined(USING_SPLIT_STACK) && defined(LINKER_SUPPORTS_SPLIT_STACK) @@ -326,7 +326,7 @@ runtime_mcall(FuncVal *fv) #else // We have to point to an address on the stack that is // below the saved registers. - gp->gcnextsp = (uintptr)(&afterregs); + gp->gcnextsp = (uintptr)(&afterregs); // XXXXXX gp->gcnextsp2 = (uintptr)(secondary_stack_pointer()); #endif gp->fromgogo = false; @@ -567,7 +567,7 @@ runtime_mstart(void *arg) // Setting gcstacksize to 0 is a marker meaning that gcinitialsp // is the top of the stack, not the bottom. gp->gcstacksize = 0; - gp->gcnextsp = (uintptr)(&arg); + gp->gcnextsp = (uintptr)(&arg); // XXX gp->gcinitialsp2 = secondary_stack_pointer(); gp->gcnextsp2 = (uintptr)(gp->gcinitialsp2); #endif @@ -648,7 +648,7 @@ setGContext(void) gp->gcinitialsp = &val; gp->gcstack = 0; gp->gcstacksize = 0; - gp->gcnextsp = (uintptr)(&val); + gp->gcnextsp = (uintptr)(&val); // XXX gp->gcinitialsp2 = secondary_stack_pointer(); gp->gcnextsp2 = (uintptr)(gp->gcinitialsp2); #endif @@ -727,7 +727,7 @@ doentersyscall(uintptr pc, uintptr sp) { void *v; - g->gcnextsp = (uintptr)(&v); + g->gcnextsp = (uintptr)(&v); // XXX g->gcnextsp2 = (uintptr)(secondary_stack_pointer()); } #endif @@ -769,7 +769,7 @@ doentersyscallblock(uintptr pc, uintptr sp) { void *v; - g->gcnextsp = (uintptr)(&v); + g->gcnextsp = (uintptr)(&v); // XXXX g->gcnextsp2 = (uintptr)(secondary_stack_pointer()); } #endif @@ -884,7 +884,7 @@ resetNewG(G *newg, void **sp, uintptr *spsize) *spsize = newg->gcstacksize; if(*spsize == 0) runtime_throw("bad spsize in resetNewG"); - newg->gcnextsp = (uintptr)(*sp); + newg->gcnextsp = (uintptr)(*sp); // XXX newg->gcnextsp2 = (uintptr)(newg->gcinitialsp2); #endif } diff --git a/libgo/runtime/stack.c b/libgo/runtime/stack.c index 65e8fa30077..0d31699256e 100644 --- a/libgo/runtime/stack.c +++ b/libgo/runtime/stack.c @@ -112,9 +112,9 @@ static bool doscanstack1(G *gp, void *gcw) { } top = (byte*)(void*)(gp->gcinitialsp) + gp->gcstacksize; if(top > bottom) - scanstackblock((uintptr)(bottom), (uintptr)(top - bottom), gcw); + scanstackblock((uintptr)(bottom), (uintptr)(top - bottom), gcw); // // FIXME low-> high else - scanstackblock((uintptr)(top), (uintptr)(bottom - top), gcw); + scanstackblock((uintptr)(top), (uintptr)(bottom - top), gcw);// FIXME low-> high if (nextsp2 != nil) { initialsp2 = (byte*)(void*)(gp->gcinitialsp2); if(initialsp2 > nextsp2)