aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/alpha
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-04-08 02:16:43 +0000
committerRoland McGrath <roland@gnu.org>2002-04-08 02:16:43 +0000
commit7ce93726fb9f02c45e45df15d923faabaa8951d3 (patch)
tree8a3c8ca67f54134b2de37cf6d135042e717288db /sysdeps/mach/hurd/alpha
parent14906e37fed856d51451b5bc2ac3c68d1e29e1a6 (diff)
downloadglibc-7ce93726fb9f02c45e45df15d923faabaa8951d3.tar
glibc-7ce93726fb9f02c45e45df15d923faabaa8951d3.tar.gz
glibc-7ce93726fb9f02c45e45df15d923faabaa8951d3.tar.bz2
glibc-7ce93726fb9f02c45e45df15d923faabaa8951d3.zip
* mach/setup-thread.c (__mach_setup_thread): int -> natural_t
* sysdeps/mach/hurd/dl-sysdep.c: Use ElfW(TYPE) in place of Elf32_TYPE. (__mmap): Use MAP_FAILED instead of widening __hurd_fail value. * sysdeps/mach/hurd/bind.c: Use prototype definition. * sysdeps/mach/hurd/connect.c: Likewise. * sysdeps/mach/hurd/getsockopt.c: Likewise. * sysdeps/mach/hurd/setsockopt.c: Likewise. * sysdeps/mach/hurd/alpha/sigreturn.c: Pass missing argument to __msg_sig_post RPC. * hurd/catch-exc.c: Use integer_t instead of int. * hurd/hurdfault.c: Likewise. * sysdeps/mach/hurd/alpha/exc2signal.c (_hurd_exception2signal): Rewritten. * sysdeps/mach/hurd/alpha/longjmp-ts.c (_hurd_longjmp_thread_state): Rewritten.
Diffstat (limited to 'sysdeps/mach/hurd/alpha')
-rw-r--r--sysdeps/mach/hurd/alpha/exc2signal.c27
-rw-r--r--sysdeps/mach/hurd/alpha/longjmp-ts.c29
-rw-r--r--sysdeps/mach/hurd/alpha/sigreturn.c9
3 files changed, 35 insertions, 30 deletions
diff --git a/sysdeps/mach/hurd/alpha/exc2signal.c b/sysdeps/mach/hurd/alpha/exc2signal.c
index 3bceb64b22..5f3fbbbbb1 100644
--- a/sysdeps/mach/hurd/alpha/exc2signal.c
+++ b/sysdeps/mach/hurd/alpha/exc2signal.c
@@ -1,5 +1,5 @@
/* Translate Mach exception codes into signal numbers. Alpha version.
- Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994,97,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,52 +25,51 @@
into a signal number and signal subcode. */
void
-_hurd_exception2signal (int exception, int code, int subcode,
- int *signo, long int *sigcode, int *error)
+_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
{
- *error = 0;
+ detail->error = 0;
- switch (exception)
+ switch (detail->exc)
{
default:
*signo = SIGIOT;
- *sigcode = exception;
+ detail->code = detail->exc;
break;
case EXC_BAD_ACCESS:
- if (code == KERN_PROTECTION_FAILURE)
+ if (detail->exc_code == KERN_PROTECTION_FAILURE)
*signo = SIGSEGV;
else
*signo = SIGBUS;
- *sigcode = subcode;
- *error = code;
+ detail->code = detail->exc_subcode;
+ detail->error = detail->exc_code;
break;
case EXC_BAD_INSTRUCTION:
*signo = SIGILL;
- *sigcode = code;
+ detail->code = detail->exc_code;
break;
case EXC_ARITHMETIC:
*signo = SIGFPE;
- *sigcode = code;
+ detail->code = detail->exc_code;
break;
break;
case EXC_EMULATION:
/* 3.0 doesn't give this one, why, I don't know. */
*signo = SIGEMT;
- *sigcode = code;
+ detail->code = detail->exc_code;
break;
case EXC_SOFTWARE:
*signo = SIGEMT;
- *sigcode = code;
+ detail->code = detail->exc_code;
break;
case EXC_BREAKPOINT:
*signo = SIGTRAP;
- *sigcode = code;
+ detail->code = detail->exc_code;
break;
}
}
diff --git a/sysdeps/mach/hurd/alpha/longjmp-ts.c b/sysdeps/mach/hurd/alpha/longjmp-ts.c
index eb2764977c..b271d6d2a9 100644
--- a/sysdeps/mach/hurd/alpha/longjmp-ts.c
+++ b/sysdeps/mach/hurd/alpha/longjmp-ts.c
@@ -1,5 +1,5 @@
/* Perform a `longjmp' on a Mach thread_state. Alpha version.
- Copyright (C) 1991, 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,15 +27,22 @@
void
_hurd_longjmp_thread_state (void *state, jmp_buf env, int val)
{
- struct alpha_thread_state *ts = state;
-
- ts->r9 = env[0].__jmpbuf[0].__9;
- ts->r11 = env[0].__jmpbuf[0].__11;
- ts->r12 = env[0].__jmpbuf[0].__12;
- ts->r13 = env[0].__jmpbuf[0].__13;
- ts->r14 = env[0].__jmpbuf[0].__14;
- ts->r15 = (long int) env[0].__jmpbuf[0].__fp;
- ts->r30 = (long int) env[0].__jmpbuf[0].__sp;
- ts->pc = (long int) env[0].__jmpbuf[0].__pc;
+ struct alpha_thread_state *const ts = state;
+
+ ts->r9 = env[0].__jmpbuf[JB_S0];
+ ts->r10 = env[0].__jmpbuf[JB_S1];
+ ts->r11 = env[0].__jmpbuf[JB_S2];
+ ts->r12 = env[0].__jmpbuf[JB_S3];
+ ts->r13 = env[0].__jmpbuf[JB_S4];
+ ts->r13 = env[0].__jmpbuf[JB_S5];
+ ts->pc = env[0].__jmpbuf[JB_PC];
+ ts->r15 = env[0].__jmpbuf[JB_FP];
+ ts->r30 = env[0].__jmpbuf[JB_SP];
ts->r0 = val ?: 1;
+
+ /* XXX
+ To mimic longjmp we ought to restore some fp registers too.
+ But those registers are in struct alpha_float_state.
+ The only use of this is in fork, and it probably won't matter.
+ */
}
diff --git a/sysdeps/mach/hurd/alpha/sigreturn.c b/sysdeps/mach/hurd/alpha/sigreturn.c
index e520b35e73..182d4cbd84 100644
--- a/sysdeps/mach/hurd/alpha/sigreturn.c
+++ b/sysdeps/mach/hurd/alpha/sigreturn.c
@@ -1,5 +1,5 @@
/* Return from signal handler in GNU C library for Hurd. Alpha version.
- Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1994,95,97,98,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,6 @@
#include <hurd/msg.h>
#include <stdlib.h>
#include <string.h>
-#include <mach/machine/alpha_instruction.h>
int
__sigreturn (struct sigcontext *scp)
@@ -58,7 +57,7 @@ __sigreturn (struct sigcontext *scp)
thread will examine us while we are blocked in the sig_post RPC. */
ss->intr_port = MACH_PORT_NULL;
__spin_unlock (&ss->lock);
- __msg_sig_post (_hurd_msgport, 0, __mach_task_self ());
+ __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ());
/* If a pending signal was handled, sig_post never returned. */
__spin_lock (&ss->lock);
}
@@ -200,9 +199,9 @@ __sigreturn (struct sigcontext *scp)
the user stack and do the magical `rei' PAL call. */
asm volatile ("mov %0, $30\n"
"call_pal %1"
- : : "r" (rei_frame), "i" (op_rei));
+ : : "r" (rei_frame), "i" (63)); /* PAL_rti */
/* Firewall. */
- asm volatile ("call_pal %0" : : "i" (op_halt));
+ asm volatile ("halt");
}
/* NOTREACHED */