mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-15 09:30:06 +00:00
92b27c7470
2002-07-29 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/powerpc/__longjmp.S: Moved to... * sysdeps/powerpc/powerpc32/__longjmp.S: ...here. * sysdeps/powerpc/add_n.S: Moved to... * sysdeps/powerpc/powerpc32/add_n.S: ...here. * sysdeps/powerpc/addmul_1.S: Moved to... * sysdeps/powerpc/powerpc32/addmul_1.S: ...here. * sysdeps/powerpc/atomicity.h: Moved to... * sysdeps/powerpc/powerpc32/atomicity.h: ...here. * sysdeps/powerpc/backtrace.c: Moved to... * sysdeps/powerpc/powerpc32/backtrace.c: ...here. * sysdeps/powerpc/bp-asm.h: Moved to... * sysdeps/powerpc/powerpc32/bp-asm.h: ...here. * sysdeps/powerpc/bsd-_setjmp.S: Moved to... * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: ...here. * sysdeps/powerpc/bsd-setjmp.S: Moved to... * sysdeps/powerpc/powerpc32/bsd-setjmp.S: ...here. * sysdeps/powerpc/dl-machine.c: Moved to... * sysdeps/powerpc/powerpc32/dl-machine.c: ...here. * sysdeps/powerpc/dl-machine.h: Moved to... * sysdeps/powerpc/powerpc32/dl-machine.h: ...here. * sysdeps/powerpc/dl-start.S: Moved to... * sysdeps/powerpc/powerpc32/dl-start.S: ...here. * sysdeps/powerpc/gprrest0.S: Moved to... * sysdeps/powerpc/powerpc32/gprrest0.S: ...here. * sysdeps/powerpc/gprrest1.S: Moved to... * sysdeps/powerpc/powerpc32/gprrest1.S: ...here. * sysdeps/powerpc/gprsave0.S: Moved to... * sysdeps/powerpc/powerpc32/gprsave0.S: ...here. * sysdeps/powerpc/gprsave1.S: Moved to... * sysdeps/powerpc/powerpc32/gprsave1.S: ...here. * sysdeps/powerpc/lshift.S: Moved to... * sysdeps/powerpc/powerpc32/lshift.S: ...here. * sysdeps/powerpc/memset.S: Moved to... * sysdeps/powerpc/powerpc32/memset.S: ...here. * sysdeps/powerpc/mul_1.S: Moved to... * sysdeps/powerpc/powerpc32/mul_1.S: ...here. * sysdeps/powerpc/ppc-mcount.S: Moved to... * sysdeps/powerpc/powerpc32/ppc-mcount.S: ...here. * sysdeps/powerpc/register-dump.h: Moved to... * sysdeps/powerpc/powerpc32/register-dump.h: ...here. * sysdeps/powerpc/rshift.S: Moved to... * sysdeps/powerpc/powerpc32/rshift.S: ...here. * sysdeps/powerpc/setjmp.S: Moved to... * sysdeps/powerpc/powerpc32/setjmp.S: ...here. * sysdeps/powerpc/stpcpy.S: Moved to... * sysdeps/powerpc/powerpc32/stpcpy.S: ...here. * sysdeps/powerpc/strchr.S: Moved to... * sysdeps/powerpc/powerpc32/strchr.S: ...here. * sysdeps/powerpc/strcmp.S: Moved to... * sysdeps/powerpc/powerpc32/strcmp.S: ...here. * sysdeps/powerpc/strcpy.S: Moved to... * sysdeps/powerpc/powerpc32/strcpy.S: ...here. * sysdeps/powerpc/strlen.S: Moved to... * sysdeps/powerpc/powerpc32/strlen.S: ...here. * sysdeps/powerpc/sub_n.S: Moved to... * sysdeps/powerpc/powerpc32/sub_n.S: ...here. * sysdeps/powerpc/submul_1.S: Moved to... * sysdeps/powerpc/powerpc32/submul_1.S: ...here. * sysdeps/powerpc/elf/bzero.S: Moved to... * sysdeps/powerpc/powerpc32/elf/bzero.S: ...here. * sysdeps/powerpc/elf/start.S: Moved to... * sysdeps/powerpc/powerpc32/elf/start.S: ...here. * sysdeps/powerpc/fpu/__longjmp.S: Moved to... * sysdeps/powerpc/powerpc32/fpu/__longjmp.S: ...here. * sysdeps/powerpc/fpu/fprrest.S: Moved to... * sysdeps/powerpc/powerpc32/fpu/fprrest.S: ...here. * sysdeps/powerpc/fpu/fprsave.S: Moved to... * sysdeps/powerpc/powerpc32/fpu/fprsave.S: ...here. * sysdeps/powerpc/fpu/setjmp.S: Moved to... * sysdeps/powerpc/powerpc32/fpu/setjmp.S: ...here. * sysdeps/powerpc/fpu/s_copysign.S: Moved to... * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: ...here. * sysdeps/powerpc/fpu/s_copysignf.S: Moved to... * sysdeps/powerpc/powerpc32/fpu/s_copysignf.S: ...here. * sysdeps/unix/sysv/linux/powerpc/brk.S: Moved to... * sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S: ...here. * sysdeps/unix/sysv/linux/powerpc/clone.S: Moved to... * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: ...here. * sysdeps/unix/sysv/linux/powerpc/glob64.c: Moved to... * sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c: ...here. * sysdeps/unix/sysv/linux/powerpc/kernel_stat.h: Moved to... * sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h: ...here. * sysdeps/unix/sysv/linux/powerpc/socket.S: Moved to... * sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S: ...here. * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Moved to... * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: ...here. * sysdeps/unix/sysv/linux/powerpc/syscalls.list: Moved to... * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: ...here. Support PowerPC64. Separate powerpc into powerpc/powerpc32 and powerpc/powerpc64. 2002-07-29 Steven Munroe <sjmunroe@us.ibm.com> * FAQ.in: Add powerpc64 to supported targets list. Also state the minimum gcc version is 3.2 * README: Add powerpc64 to supported targets list. * configure.in: Change machine=powerpc to machine=powerpc/powerpc32. Add powerpc64 and machine=powerpc/powerpc64. (HAVE_ASM_GLOBAL_DOT_NAME): Define if linux*powerpc/powerpc64*. * shlib-versions: Set DEFAULT version to 2.2.5 for powerpc64. * sysdeps/powerpc/Dist: Remove dl-machine.c, dl-start.S, ppc-mcount.S, gprsave1.S, gprsave0.S, gprrest1.S, and gprrest0.S. * sysdeps/powerpc/powerpc32/Dist: New file. * sysdeps/powerpc/Implies: Remove wordsize-32 and powerpc/soft-fp. * sysdeps/powerpc/powerpc32/Implies: New file. * sysdeps/powerpc/Makefile(cflags): Remove powerpc32 specific cflags. ($(with-fp) = no): Move test to powerpc32/Makefile. ($(subdir) = misc): Move to powerpc32/Makefile. ($(build-shared) = yes): Move to powerpc32/Makefile. ($(subdir) = csu): Move to powerpc32/Makefile. (sysdep-rtld-routines): Remove dl-start. Moved these bits to ... * sysdeps/powerpc/powerpc32/Makefile: New file. * sysdeps/powerpc/Versions: Remove libgcc functions. * sysdeps/powerpc/powerpc32/Versions: New file. * sysdeps/powerpc/fpu/Makefile: Remove fprsave and fprrest. * sysdeps/powerpc/powerpc32/fpu/Makefile: New file. * sysdeps/unix/sysv/linux/configure.in (powerpc*): Set arch_minimum_kernel=2.4.19 for powerpc/powerpc64. Also set libc_cv_gcc_unwind_find_fde=yes only if !powerpc/powerpc64. ($machine): Add powerpc/powerpc64 to if ... | for libc_cv_slibdir=/libc64. (powerpc*): Set ldd_rewrite_script. * sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed: New file. * sysdeps/unix/sysv/linux/powerpc/Dist: Remove clone.S. * sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist: New file. Add clone.S. * sysdeps/unix/sysv/linux/powerpc/Makefile: Remove oldgetrlimit64. * sysdeps/unix/sysv/linux/powerpc/Versions: Remove GLIBC_2.0 functions. Remove GLIBC_2.2 functions except getrlimit and setrlimit. Moved them to ... * sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions: New file. 2002-09-04 Ulrich Drepper <drepper@redhat.com> * libio/tst-atime.c: Include <errno.h>. (do_test): Only perform fstatvfs check if ST_NOATIME is defined. 2002-09-03 Isamu Hasegawa <isamu@yamato.ibm.com> * posix/regcomp.c (regcomp): Append "__restrict" modifier to avoid warnings of some compilers. (build_collating_symbol): Change the type of characters from "unsigned char" to "char", and append a cast to "char*" pointer in array subscript. (build_collating_symbol): Likewise. (build_equiv_class): Likewise. (build_charclass): Likewise. (re_compile_pattern): Remove incorrect cast. (re_compile_fastmap_iter): Change the type of characters from "unsigned char" to "char", and append a cast to "char*" pointer in array subscript. (parse_bracket_exp): Likewise. * posix/regex_internal.c (re_string_construct_common): Likewise. (re_string_allocate): Likewise. (re_string_construct): Likewise. (re_string_realloc_buffers): Likewise. (build_wcs_buffer): Likewise. (re_string_reconstruct): Likewise. * posix/regex_internal.h: Change the type of characters in re_string_t and bracket_elem_t from "unsigned char" to "char". * posix/regexec.c (regexec): Append "__restrict" modifier to avoid warnings of some compilers. (transit_state_bkref_loop): Change the type of characters from "unsigned char" to "char", and append a cast to "char*" pointer in array subscript. (check_node_accept_bytes): Likewise. (find_collation_sequence_value): Likewise.
122 lines
5.2 KiB
C
122 lines
5.2 KiB
C
/* Dump registers.
|
|
Copyright (C) 1998 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
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library; if not, write to the Free
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
02111-1307 USA. */
|
|
|
|
#include <sys/uio.h>
|
|
#include <stdio-common/_itoa.h>
|
|
|
|
/* This prints out the information in the following form: */
|
|
static const char dumpform[] = "\
|
|
Register dump:\n\
|
|
fp0-3: 0000030%0000031% 0000032%0000033% 0000034%0000035% 0000036%0000037%\n\
|
|
fp4-7: 0000038%0000039% 000003a%000003b% 000003c%000003d% 000003e%000003f%\n\
|
|
fp8-11: 0000040%0000041% 0000042%0000043% 0000044%0000045% 0000046%0000047%\n\
|
|
fp12-15: 0000048%0000049% 000004a%000004b% 000004c%000004d% 000004e%000004f%\n\
|
|
fp16-19: 0000050%0000051% 0000052%0000053% 0000054%0000055% 0000056%0000057%\n\
|
|
fp20-23: 0000058%0000059% 000005a%000005b% 000005c%000005d% 000005e%000005f%\n\
|
|
fp24-27: 0000060%0000061% 0000062%0000063% 0000064%0000065% 0000066%0000067%\n\
|
|
fp28-31: 0000068%0000069% 000006a%000006b% 000006c%000006d% 000006e%000006f%\n\
|
|
r0 =0000000% sp =0000001% r2 =0000002% r3 =0000003% trap=0000028%\n\
|
|
r4 =0000004% r5 =0000005% r6 =0000006% r7 =0000007% sr0=0000020% sr1=0000021%\n\
|
|
r8 =0000008% r9 =0000009% r10=000000a% r11=000000b% dar=0000029% dsi=000002a%\n\
|
|
r12=000000c% r13=000000d% r14=000000e% r15=000000f% r3*=0000022%\n\
|
|
r16=0000010% r17=0000011% r18=0000012% r19=0000013%\n\
|
|
r20=0000014% r21=0000015% r22=0000016% r23=0000017% lr=0000024% xer=0000025%\n\
|
|
r24=0000018% r25=0000019% r26=000001a% r27=000001b% mq=0000027% ctr=0000023%\n\
|
|
r28=000001c% r29=000001d% r30=000001e% r31=000001f% fscr=0000071% ccr=0000026%\n\
|
|
";
|
|
|
|
/* Most of the fields are self-explanatory. 'sr0' is the next
|
|
instruction to execute, from SRR0, which may have some relationship
|
|
with the instruction that caused the exception. 'r3*' is the value
|
|
that will be returned in register 3 when the current system call
|
|
returns. 'sr1' is SRR1, bits 16-31 of which are copied from the MSR:
|
|
|
|
16 - External interrupt enable
|
|
17 - Privilege level (1=user, 0=supervisor)
|
|
18 - FP available
|
|
19 - Machine check enable (if clear, processor locks up on machine check)
|
|
20 - FP exception mode bit 0 (FP exceptions recoverable)
|
|
21 - Single-step trace enable
|
|
22 - Branch trace enable
|
|
23 - FP exception mode bit 1
|
|
25 - exception prefix (if set, exceptions are taken from 0xFFFnnnnn,
|
|
otherwise from 0x000nnnnn).
|
|
26 - Instruction address translation enabled.
|
|
27 - Data address translation enabled.
|
|
30 - Exception is recoverable (otherwise, don't try to return).
|
|
31 - Little-endian mode enable.
|
|
|
|
'Trap' is the address of the exception:
|
|
|
|
00200 - Machine check exception (memory parity error, for instance)
|
|
00300 - Data access exception (memory not mapped, see dsisr for why)
|
|
00400 - Instruction access exception (memory not mapped)
|
|
00500 - External interrupt
|
|
00600 - Alignment exception (see dsisr for more information)
|
|
00700 - Program exception (illegal/trap instruction, FP exception)
|
|
00800 - FP unavailable (should not be seen by user code)
|
|
00900 - Decrementer exception (for instance, SIGALRM)
|
|
00A00 - I/O controller interface exception
|
|
00C00 - System call exception (for instance, kill(3)).
|
|
00E00 - FP assist exception (optional FP instructions, etc.)
|
|
|
|
'dar' is the memory location, for traps 00300, 00400, 00600, 00A00.
|
|
'dsisr' has the following bits under trap 00300:
|
|
0 - direct-store error exception
|
|
1 - no page table entry for page
|
|
4 - memory access not permitted
|
|
5 - trying to access I/O controller space or using lwarx/stwcx on
|
|
non-write-cached memory
|
|
6 - access was store
|
|
9 - data access breakpoint hit
|
|
10 - segment table search failed to find translation (64-bit ppcs only)
|
|
11 - I/O controller instruction not permitted
|
|
For trap 00400, the same bits are set in SRR1 instead.
|
|
For trap 00600, bits 12-31 of the DSISR set to allow emulation of
|
|
the instruction without actually having to read it from memory.
|
|
*/
|
|
|
|
#define xtoi(x) (x >= 'a' ? x + 10 - 'a' : x - '0')
|
|
|
|
static void
|
|
register_dump (int fd, struct sigcontext *ctx)
|
|
{
|
|
char buffer[sizeof(dumpform)];
|
|
char *bufferpos;
|
|
unsigned regno;
|
|
unsigned *regs = (unsigned *)(ctx->regs);
|
|
|
|
memcpy(buffer, dumpform, sizeof(dumpform));
|
|
|
|
/* Generate the output. */
|
|
while ((bufferpos = memchr (buffer, '%', sizeof(dumpform))))
|
|
{
|
|
regno = xtoi (bufferpos[-1]) | xtoi (bufferpos[-2]) << 4;
|
|
memset (bufferpos-2, '0', 3);
|
|
_itoa_word (regs[regno], bufferpos+1, 16, 0);
|
|
}
|
|
|
|
/* Write the output. */
|
|
write (fd, buffer, sizeof(buffer));
|
|
}
|
|
|
|
|
|
#define REGISTER_DUMP \
|
|
register_dump (fd, ctx)
|