From 42e36d16b391a79d6a6b204c56138f5b2294e1e4 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 10 May 2006 18:57:03 +0000 Subject: [PATCH] * sysdeps/unix/sysv/linux/mips/register-dump.h (register_dump): Don't dump sc_cause, sc_status or sc_badvaddr. * sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: Rewrite. Update structure definitions after DSP kernel changes. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h (mcontext_t): Update after the same DSP changes. --- ChangeLog.mips | 10 ++ .../unix/sysv/linux/mips/bits/sigcontext.h | 121 ++++++++---------- sysdeps/unix/sysv/linux/mips/register-dump.h | 17 +-- sysdeps/unix/sysv/linux/mips/sys/ucontext.h | 26 ++-- 4 files changed, 84 insertions(+), 90 deletions(-) diff --git a/ChangeLog.mips b/ChangeLog.mips index 7106b9da178..2122477a3b8 100644 --- a/ChangeLog.mips +++ b/ChangeLog.mips @@ -1,3 +1,13 @@ +2006-05-10 Richard Sandiford + Daniel Jacobowitz + + * sysdeps/unix/sysv/linux/mips/register-dump.h (register_dump): Don't + dump sc_cause, sc_status or sc_badvaddr. + * sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: Rewrite. Update + structure definitions after DSP kernel changes. + * sysdeps/unix/sysv/linux/mips/sys/ucontext.h (mcontext_t): Update + after the same DSP changes. + 2006-05-08 Richard Sandiford * sysdeps/unix/sysv/linux/mips/bits/stat.h (struct stat): Add diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h b/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h index 079964ed46a..99faeed397d 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h +++ b/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h @@ -1,5 +1,5 @@ -/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. +/* Copyright (C) 1996, 1997, 1998, 2003, 2004, 2006 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 modify it under the terms of the GNU Lesser General Public @@ -16,90 +16,69 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#ifndef _BITS_SIGCONTEXT_H +#define _BITS_SIGCONTEXT_H 1 + #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use directly; include instead." #endif #include -#ifndef sigcontext_struct -/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but - we need sigcontext. */ -# define sigcontext_struct sigcontext - -/* # include */ -/* Instead of including the kernel header, that will vary depending on - whether the 32- or the 64-bit kernel is installed, we paste the - contents here. In case you're wondering about the different - licenses, the fact that the file is pasted, instead of included, - doesn't really make any difference for the program that includes - this header. */ #if _MIPS_SIM == _ABIO32 -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1996, 1997, 2000 by Ralf Baechle - */ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H -/* - * Keep this struct definition in sync with the sigcontext fragment - * in arch/mips/tools/offset.c - */ -struct sigcontext { - unsigned int sc_regmask; /* Unused */ - unsigned int sc_status; - unsigned long long sc_pc; - unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; - unsigned int sc_ownedfp; /* Unused */ - unsigned int sc_fpc_csr; - unsigned int sc_fpc_eir; /* Unused */ - unsigned int sc_used_math; - unsigned int sc_ssflags; /* Unused */ - unsigned long long sc_mdhi; - unsigned long long sc_mdlo; +/* Certain unused fields were replaced with new ones in 2.6.12-rc4. + The changes were as follows: - unsigned int sc_cause; /* Unused */ - unsigned int sc_badvaddr; /* Unused */ + sc_cause -> sc_hi1 + sc_badvaddr -> sc_lo1 + sc_sigset[0] -> sc_hi2 + sc_sigset[1] -> sc_lo2 + sc_sigset[2] -> sc_hi3 + sc_sigset[3] -> sc_lo3 - unsigned long sc_sigset[4]; /* kernel's sigset_t */ + sc_regmask, sc_ownedfp and sc_fpc_eir are not used. */ +struct sigcontext { + unsigned int sc_regmask; + unsigned int sc_status; + unsigned long long sc_pc; + unsigned long long sc_regs[32]; + unsigned long long sc_fpregs[32]; + unsigned int sc_ownedfp; + unsigned int sc_fpc_csr; + unsigned int sc_fpc_eir; + unsigned int sc_used_math; + unsigned int sc_dsp; + unsigned long long sc_mdhi; + unsigned long long sc_mdlo; + unsigned long sc_hi1; + unsigned long sc_lo1; + unsigned long sc_hi2; + unsigned long sc_lo2; + unsigned long sc_hi3; + unsigned long sc_lo3; }; -#endif /* _ASM_SIGCONTEXT_H */ -#else /* _MIPS_SIM != _ABIO32 */ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1996, 1997, 1999 by Ralf Baechle - * Copyright (C) 1999 Silicon Graphics, Inc. - */ -#ifndef _ASM_SIGCONTEXT_H -#define _ASM_SIGCONTEXT_H +#else -/* - * Keep this struct definition in sync with the sigcontext fragment - * in arch/mips/tools/offset.c - */ +/* This structure changed in 2.6.12-rc4 when DSP support was added. */ struct sigcontext { - unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; - unsigned long long sc_mdhi; - unsigned long long sc_mdlo; - unsigned long long sc_pc; - unsigned int sc_status; - unsigned int sc_fpc_csr; - unsigned int sc_fpc_eir; - unsigned int sc_used_math; - unsigned int sc_cause; - unsigned int sc_badvaddr; + unsigned long long sc_regs[32]; + unsigned long long sc_fpregs[32]; + unsigned long long sc_mdhi; + unsigned long long sc_hi1; + unsigned long long sc_hi2; + unsigned long long sc_hi3; + unsigned long long sc_mdlo; + unsigned long long sc_lo1; + unsigned long long sc_lo2; + unsigned long long sc_lo3; + unsigned long long sc_pc; + unsigned int sc_fpc_csr; + unsigned int sc_used_math; + unsigned int sc_dsp; + unsigned int sc_reserved; }; -#endif /* _ASM_SIGCONTEXT_H */ #endif /* _MIPS_SIM != _ABIO32 */ #endif diff --git a/sysdeps/unix/sysv/linux/mips/register-dump.h b/sysdeps/unix/sysv/linux/mips/register-dump.h index f5bd3a2735c..8d2ec754df5 100644 --- a/sysdeps/unix/sysv/linux/mips/register-dump.h +++ b/sysdeps/unix/sysv/linux/mips/register-dump.h @@ -1,5 +1,5 @@ /* Dump registers. - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 2000. @@ -27,8 +27,8 @@ R8 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX R16 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX R24 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX - pc cause status badvaddr lo hi - XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX + pc lo hi + XXXXXXXX XXXXXXXX XXXXXXXX The FPU registers will not be printed. */ @@ -61,11 +61,8 @@ register_dump (int fd, struct sigcontext *ctx) for (i = 0; i < 32; i++) hexvalue (ctx->sc_regs[i], regs[i], 8); hexvalue (ctx->sc_pc, regs[32], 8); - hexvalue (ctx->sc_cause, regs[33], 8); - hexvalue (ctx->sc_status, regs[34], 8); - hexvalue (ctx->sc_badvaddr, regs[35], 8); - hexvalue (ctx->sc_mdhi, regs[36], 8); - hexvalue (ctx->sc_mdlo, regs[37], 8); + hexvalue (ctx->sc_mdhi, regs[33], 8); + hexvalue (ctx->sc_mdlo, regs[34], 8); /* Generate the output. */ ADD_STRING ("Register dump:\n\n R0 "); @@ -92,8 +89,8 @@ register_dump (int fd, struct sigcontext *ctx) ADD_MEM (regs[i], 8); ADD_STRING (" "); } - ADD_STRING ("\n pc cause status badvaddr lo hi\n "); - for (i = 32; i < 38; i++) + ADD_STRING ("\n pc lo hi\n "); + for (i = 32; i < 35; i++) { ADD_MEM (regs[i], 8); ADD_STRING (" "); diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h index ddb499f20cb..ac496f3d6d6 100644 --- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h +++ b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h @@ -1,5 +1,5 @@ -/* Copyright (C) 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. +/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006 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 modify it under the terms of the GNU Lesser General Public @@ -73,11 +73,15 @@ typedef struct unsigned int fpc_csr; unsigned int fpc_eir; unsigned int used_math; - unsigned int ssflags; + unsigned int dsp; greg_t mdhi; greg_t mdlo; - unsigned int cause; - unsigned int badvaddr; + unsigned long hi1; + unsigned long lo1; + unsigned long hi2; + unsigned long lo2; + unsigned long hi3; + unsigned long lo3; } mcontext_t; #else typedef struct @@ -85,14 +89,18 @@ typedef struct gregset_t gregs; fpregset_t fpregs; greg_t mdhi; + greg_t hi1; + greg_t hi2; + greg_t hi3; greg_t mdlo; + greg_t lo1; + greg_t lo2; + greg_t lo3; greg_t pc; - unsigned int status; unsigned int fpc_csr; - unsigned int fpc_eir; unsigned int used_math; - unsigned int cause; - unsigned int badvaddr; + unsigned int dsp; + unsigned int reserved; } mcontext_t; #endif -- 2.47.2