1 /* Low-level statistical profiling support function. Linux/ARM version.
2 Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
21 #include <asm/ptrace.h>
27 unsigned long int trap_no;
28 unsigned long int error_code;
29 unsigned long int oldmask;
30 unsigned long int arm_r0;
31 unsigned long int arm_r1;
32 unsigned long int arm_r2;
33 unsigned long int arm_r3;
34 unsigned long int arm_r4;
35 unsigned long int arm_r5;
36 unsigned long int arm_r6;
37 unsigned long int arm_r7;
38 unsigned long int arm_r8;
39 unsigned long int arm_r9;
40 unsigned long int arm_r10;
41 unsigned long int arm_fp;
42 unsigned long int arm_ip;
43 unsigned long int arm_sp;
44 unsigned long int arm_lr;
45 unsigned long int arm_pc;
46 unsigned long int arm_cpsr;
50 unsigned long int magic;
52 unsigned long int trap_no;
53 unsigned long int error_code;
54 unsigned long int oldmask;
59 profil_counter (int signo, int _a2, int _a3, int _a4, union k_sigcontext sc)
61 /* The format of struct sigcontext changed between 2.0 and 2.1 kernels.
62 Fortunately 2.0 puts a magic number in the first word and this is not
63 a legal value for `trap_no', so we can tell them apart. */
66 if (sc.v20.magic == 0x4B534154)
67 pc = (void *) sc.v20.reg.ARM_pc;
69 pc = (void *) sc.v21.arm_pc;