diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-09-16 17:54:34 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-09-16 17:54:34 +0000 |
commit | 9c4c002459bd2665ac1ad544e56952ec7797e8dd (patch) | |
tree | 9d2faf3588e279b3b99748cdf7ccdceefe6a7092 /sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c | |
parent | a8125d855218832508af812df585c5fac5093bc3 (diff) | |
download | glibc-9c4c002459bd2665ac1ad544e56952ec7797e8dd.tar glibc-9c4c002459bd2665ac1ad544e56952ec7797e8dd.tar.gz glibc-9c4c002459bd2665ac1ad544e56952ec7797e8dd.tar.bz2 glibc-9c4c002459bd2665ac1ad544e56952ec7797e8dd.zip |
Update.
1998-09-14 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/mach/hurd/dl-cache.c (_dl_unload_cache): New dummy
function. Reported by okuji@kuicr.kyoto-u.ac.jp [PR libc/789].
1998-09-15 David S. Miller <davem@pierdol.cobaltmicro.com>
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_runtime_setup):
Add profiling support.
(TRAMPOLINE_TEMPLATE): New macro.
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Define in terms of that.
(RTLD_START): Prettify, and set __libc_stack_end properly.
(elf_machine_rela) [R_SPARC_COPY]: Remove RTLD_BOOTSTRAP ifndef
and check for sym being NULL instead.
* sysdeps/sparc/sparc64/addmul_1.S: Adjust to allocate 192 bytes
of stack space.
* sysdeps/sparc/sparc64/lshift.S: Likewise.
* sysdeps/sparc/sparc64/mul_1.S: Likewise.
* sysdeps/sparc/sparc64/rshift.S: Likewise.
* sysdeps/sparc/sparc64/submul_1.S: Likewise.
* sysdeps/sparc/sparc64/elf/crtbegin.S: Likewise and remove old
MEDANY code model %g4 usage.
* sysdeps/sparc/sparc64/elf/crtend.S: Likewise and remove old
MEDANY code model %g4 usage.
* sysdeps/sparc/sparc64/elf/start.S: Rework to not use old FULLANY
code model address formation.
* sysdeps/sparc/sparc64/dl-machine.h: Don't include link.h, do
include elf/ldsodefs.h
(DT_SPARC): Remove.
(elf_machine_matches_host): It is now EM_SPARCV9.
(elf_machine_dynamic): Clean up to remove ugly cast.
(elf_machine_fixup_plt): Rework for new V9 ABI, add support for
new PLT formats.
(elf_machine_rela): Don't do anything at all for R_SPARC_NONE.
Prettify rest of function.
[R_SPARC_COPY]: Check for sym being NULL.
[R_SPARC_32]: Handle it.
[R_SPARC_H44, R_SPARC_M44, R_SPARC_L44]: Handle them for the
MEDMID code model.
[R_SPARC_HH22, R_SPARC_HM10, R_SPARC_LM22]: Handle them for the
MEDANY code model.
[R_SPARC_NONE]: Remove this case, as it is now checked earlier.
(elf_machine_runtime_setup): Rewrite for new V9 ABI plt formats.
Add profiling support.
(TRAMPOLINE_TEMPLATE): New macro.
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Define in terms of that.
(RTLD_START): Prettify and set __libc_stack_end.
* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h (SA_SIGINFO):
Define.
* sysdeps/unix/sysv/linux/sparc/bits/signum.h (_NSIG): Set to 64.
(SIGRTMIN, SIGRTMAX, __SIGRTMIN, __SIGRTMAX): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/brk.c (__brk): Remove
unused variable scratch.
* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
(__syscall_rt_sigaction, __rt_sigreturn_stub, __sigreturn_stub):
Declare.
(__sigaction): Rewrite rt_sigaction case to pass correct sigreturn
stub to rt_sigaction syscalls. Rewrite non-rt case to use correct
old format kernel sigaction structures.
* sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h: Move...
* sysdeps/unix/sysv/linux/sparc/sparc64/sys/ucontext.h: to here.
* sysdeps/unix/sysv/linux/sparc/sparc64/Dist: Remove ucontext.h
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h: Fix
ucontext include.
(_JMPBUF_UNWINDS): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: Declare
statfs64 structure, which is exactly the same as the normal one.
* sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Allocate 192 bytes
of stack. Use correct syscall trap number. Add branch prediction
settings to branch instructions. Remove old MEDANY code model %g4
referneces for non-PIC.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add
__libc_longjmp and __libc_siglongjmp strong aliases.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c (__readdir64):
Also define to __no__readdir64_decl around readdir.c inclusion.
(__readdir64): Add strong alias.
* sysdeps/unix/sysv/linux/sparc/sparc64/socket.S: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (getrlimit):
Set strong and weak names properly.
1998-09-16 11:25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/Makefile (AWK): Default to gawk if standalone.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (distribute): Undo last change.
* Make-dist (+tsrc) [not subdir]: Also include indirection headers
for sysdep headers.
(+subdir-headers): Removed, unused.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdio-common/Makefile ($(inst_includedir)/bits/stdio_lim.h): Use
$(do-install).
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules ($(+sysdir_pfx)sysd-Makefile): Don't check for
absolute name in $(config-sysdirs), can never happen.
($(+sysdir_pfx)sysd-rules): Likewise.
* Makeconfig (full-config-sysdirs): Likewise.
(all-Subdirs-files): Prepend $(..).
* configure.in: Don't check for absolute name in $add_ons_pfx, can
not happen. Let --enable-add-ons=yes work if no add-ons actually
exist.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Rules ($(common-objpfx)bits/stdio_%.h): Remove extra
continuations in command.
1998-09-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libio/oldstdfiles.c (_IO_stdin_used): Update declaration.
Diffstat (limited to 'sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c | 92 |
1 files changed, 78 insertions, 14 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c index 742ac5583c..ae44328fad 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c @@ -23,6 +23,13 @@ #include <errno.h> #include <kernel_sigaction.h> +extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *, + struct kernel_sigaction *, unsigned long, + size_t); + +static void __rt_sigreturn_stub (void); +static void __sigreturn_stub (void); + /* The variable is shared between all wrappers around signal handling functions which have RT equivalents. */ int __libc_missing_rt_sigs; @@ -30,8 +37,49 @@ int __libc_missing_rt_sigs; int __sigaction (int sig, __const struct sigaction *act, struct sigaction *oact) { + struct old_kernel_sigaction k_sigact, k_osigact; int ret; - struct kernel_sigaction k_sigact, k_osigact; + + /* First try the RT signals. */ + if (!__libc_missing_rt_sigs) + { + struct kernel_sigaction kact, koact; + unsigned long stub = 0; + int saved_errno = errno; + + if (act) + { + kact.k_sa_handler = act->sa_handler; + memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + if (((kact.sa_flags = act->sa_flags) & SA_SIGINFO) != 0) + stub = (unsigned long) &__rt_sigreturn_stub; + else + stub = (unsigned long) &__sigreturn_stub; + stub -= 8; + kact.sa_restorer = NULL; + } + + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + ret = __syscall_rt_sigaction (sig, act ? &kact : 0, + oact ? &koact : 0, + stub, _NSIG / 8); + + if (ret >= 0 || errno != ENOSYS) + { + if (oact && ret >= 0) + { + oact->sa_handler = koact.k_sa_handler; + memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); + oact->sa_flags = koact.sa_flags; + oact->sa_restorer = koact.sa_restorer; + } + return ret; + } + + __set_errno (saved_errno); + __libc_missing_rt_sigs = 1; + } /* Magic to tell the kernel we are using "new-style" signals, in that the signal table is not kept in userspace. Not the same as the @@ -41,15 +89,16 @@ __sigaction (int sig, __const struct sigaction *act, struct sigaction *oact) if (act) { k_sigact.k_sa_handler = act->sa_handler; - memcpy (&k_sigact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + k_sigact.sa_mask = act->sa_mask.__val[0]; k_sigact.sa_flags = act->sa_flags; + k_sigact.sa_restorer = NULL; } { register int r_syscallnr __asm__("%g1") = __NR_sigaction; register int r_sig __asm__("%o0") = sig; - register struct kernel_sigaction *r_act __asm__("%o1"); - register struct kernel_sigaction *r_oact __asm__("%o2"); + register struct old_kernel_sigaction *r_act __asm__("%o1"); + register struct old_kernel_sigaction *r_oact __asm__("%o2"); r_act = act ? &k_sigact : NULL; r_oact = oact ? &k_osigact : NULL; @@ -57,7 +106,7 @@ __sigaction (int sig, __const struct sigaction *act, struct sigaction *oact) __asm__ __volatile__("t 0x10\n\t" "bcc 1f\n\t" " nop\n\t" - " sub %%g0,%%o0,%%o0\n" + "sub %%g0,%%o0,%%o0\n" "1:" : "=r"(r_sig) : "r"(r_syscallnr), "r"(r_act), "r"(r_oact), @@ -66,16 +115,13 @@ __sigaction (int sig, __const struct sigaction *act, struct sigaction *oact) ret = r_sig; } - if (ret >= 0) + if (oact && ret >= 0) { - if (oact) - { - oact->sa_handler = k_osigact.k_sa_handler; - memcpy (&oact->sa_mask, &k_osigact.sa_mask, sizeof (sigset_t)); - oact->sa_flags = k_osigact.sa_flags; - oact->sa_restorer = NULL; - } - return 0; + oact->sa_handler = k_osigact.k_sa_handler; + oact->sa_mask.__val[0] = k_osigact.sa_mask; + oact->sa_flags = k_osigact.sa_flags; + oact->sa_restorer = NULL; + return ret; } __set_errno (-ret); @@ -83,3 +129,21 @@ __sigaction (int sig, __const struct sigaction *act, struct sigaction *oact) } weak_alias (__sigaction, sigaction); + +static void +__rt_sigreturn_stub (void) +{ + __asm__ ("mov %0, %%g1\n\t" + "ta 0x10\n\t" + : /* no outputs */ + : "i" (__NR_rt_sigreturn)); +} + +static void +__sigreturn_stub (void) +{ + __asm__ ("mov %0, %%g1\n\t" + "ta 0x10\n\t" + : /* no outputs */ + : "i" (__NR_sigreturn)); +} |