From 64e69d03eec9fc60e0a75d6ef3a9c4cfa3f77d93 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Sun, 1 May 2005 19:29:57 +0000 Subject: since &func is aplt workaround the switch_trampoline and deref plt for the func aswell --- sys/arch/hppa64/hppa64/locore.S | 26 +++++++++++++------------- sys/arch/hppa64/hppa64/vm_machdep.c | 6 ++++-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/sys/arch/hppa64/hppa64/locore.S b/sys/arch/hppa64/hppa64/locore.S index bc10a2f80bd..75cb492b38b 100644 --- a/sys/arch/hppa64/hppa64/locore.S +++ b/sys/arch/hppa64/hppa64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.2 2005/04/21 04:39:35 mickey Exp $ */ +/* $OpenBSD: locore.S,v 1.3 2005/05/01 19:29:56 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -1751,11 +1751,18 @@ switch_return ldd,mb -(HPPA_FRAME_SIZE+20*8)(%sp), %r3 EXIT(cpu_switch) + .align 8 + .export switch_tramp_p, code +switch_tramp_p + .dword switch_trampoline + ENTRY(switch_trampoline,0) + /* ldd 0x18(%arg3), %r19 but we know we are in kernel! */ + ldd 0x10(%arg3), %arg3 .call - blr %r0, %rp - bv,n %r0(%arg3) - nop + ble 0(%sr0, %arg3) + copy %r31, %rp + mfctl %cr24, %arg1 ldd CI_CURPROC(%arg1), %r1 b $syscall_return @@ -1766,11 +1773,8 @@ EXIT(switch_trampoline) * Signal "trampoline" code. Invoked from RTE setup by sendsig(). */ ENTRY(sigcode,0) - bb,>=,n %arg3, 30, sigcode_call - dep %r0, 31, 2, %arg3 - ldd 4(%arg3), %r19 - ldd 0(%arg3), %arg3 -sigcode_call + ldd 0x18(%arg3), %r19 + ldd 0x10(%arg3), %arg3 .call ble 0(%sr0, %arg3) copy %r31, %rp @@ -1786,10 +1790,6 @@ sigcode_call .call ble 4(%sr7, %r1) ldi SYS_exit, %r1 - - .align 256 -/* TODO syscall entry */ - ALTENTRY(esigcode) EXIT(sigcode) diff --git a/sys/arch/hppa64/hppa64/vm_machdep.c b/sys/arch/hppa64/hppa64/vm_machdep.c index 53700d03818..5dffbd59b40 100644 --- a/sys/arch/hppa64/hppa64/vm_machdep.c +++ b/sys/arch/hppa64/hppa64/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.1 2005/04/01 10:40:47 mickey Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.2 2005/05/01 19:29:56 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -145,7 +145,9 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) void *arg; { extern paddr_t fpu_curpcb; /* from locore.S */ + extern register_t switch_tramp_p; extern u_int fpu_enable; + struct pcb *pcbp; struct trapframe *tf; register_t sp, osp; @@ -208,7 +210,7 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) */ osp = sp + HPPA_FRAME_SIZE; *(register_t*)(osp - HPPA_FRAME_SIZE) = 0; - *(register_t*)(osp + HPPA_FRAME_RP) = (register_t)&switch_trampoline; + *(register_t*)(osp + HPPA_FRAME_RP) = switch_tramp_p; *(register_t*)(osp) = (osp - HPPA_FRAME_SIZE); sp = osp + HPPA_FRAME_SIZE + 20*8; /* frame + calee-save registers */ -- cgit v1.2.3