Deleted Added
full compact
profile.h (129444) profile.h (134287)
1/* $FreeBSD: head/sys/ia64/include/profile.h 129444 2004-05-19 15:41:26Z bde $ */
2/* From: NetBSD: profile.h,v 1.9 1997/04/06 08:47:37 cgd Exp */
3
4/*
1/*
5 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
2 * Copyright (c) 2004 Marcel Moolenaar
6 * All rights reserved.
7 *
3 * All rights reserved.
4 *
8 * Author: Chris G. Demetriou
9 *
10 * Permission to use, copy, modify and distribute this software and
11 * its documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation.
15 *
16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 *
20 * Carnegie Mellon requests users of this software to return to
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
21 *
8 *
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
26 *
14 *
27 * any improvements or extensions that they make and grant Carnegie the
28 * rights to redistribute these changes.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/ia64/include/profile.h 134287 2004-08-25 07:42:34Z marcel $
29 */
30
27 */
28
31#define _MCOUNT_DECL void mcount
29#define _MCOUNT_DECL void __mcount
30#define MCOUNT
32
31
33#define FUNCTION_ALIGNMENT 32
32#define FUNCTION_ALIGNMENT 32
34
33
35typedef u_long fptrdiff_t;
34typedef unsigned long fptrdiff_t;
36
35
37#define MCOUNT __asm (" \n\
38 .globl _mcount \n\
39 .proc _mcount \n\
40_mcount: \n\
41 alloc loc0=ar.pfs,8,7,2,0 // space to save r8-r11,rp,b7 \n\
42 add sp=-8*16,sp // space to save f8-f15 \n\
43 mov loc1=rp // caller's return address \n\
44 mov loc2=b7 // our return back to caller \n\
45 ;; \n\
46 add r17=16,sp // leave 16 bytes for mcount \n\
47 add r18=32,sp \n\
48 ;; \n\
49 mov loc3=r8 // structure return address \n\
50 mov loc4=r9 // language specific \n\
51 mov loc5=r10 // language specific \n\
52 mov loc6=r11 // language specific \n\
53 ;; \n\
54 stf.spill [r17]=f8,32 // save float arguments \n\
55 stf.spill [r18]=f9,32 \n\
56 mov out0=rp // frompc \n\
57 ;; \n\
58 stf.spill [r17]=f10,32 \n\
59 stf.spill [r18]=f11,32 \n\
60 mov out1=b7 // selfpc \n\
61 ;; \n\
62 stf.spill [r17]=f12,32 \n\
63 stf.spill [r18]=f13,32 \n\
64 ;; \n\
65 stf.spill [r17]=f14,32 \n\
66 stf.spill [r18]=f15,32 \n\
67 ;; \n\
68 br.call.sptk.many rp=mcount \n\
69 ;; \n\
70 add r17=16,sp \n\
71 add r18=32,sp \n\
72 ;; \n\
73 ldf.fill f8=[r17],32 \n\
74 ldf.fill f9=[r18],32 \n\
75 mov r8=loc3 // restore structure pointer \n\
76 ;; \n\
77 ldf.fill f10=[r17],32 // restore float arguments \n\
78 ldf.fill f11=[r18],32 \n\
79 mov r9=loc4 \n\
80 ;; \n\
81 ldf.fill f12=[r17],32 // etc. \n\
82 ldf.fill f13=[r18],32 \n\
83 mov r10=loc5 \n\
84 ;; \n\
85 ldf.fill f14=[r17],32 \n\
86 ldf.fill f15=[r18],32 \n\
87 mov r11=loc6 \n\
88 ;; \n\
89 mov b7=loc2 // clean up \n\
90 mov rp=loc1 \n\
91 mov ar.pfs=loc0 \n\
92 ;; \n\
93 alloc r14=ar.pfs,0,0,8,0 // drop our register frame \n\
94 br.sptk.many b7 // back to caller \n\
95 \n\
96 .end _mcount");
97
98#ifdef _KERNEL
99/*
100 * The following two macros do splhigh and splx respectively.
101 */
102#define MCOUNT_ENTER(s) \n\
103 _c = intr_disable()
104#define MCOUNT_EXIT(s) \n\
105 intr_restore(_c)
106#define MCOUNT_DECL(s) register_t c;
36#ifdef _KERNEL
37/*
38 * The following two macros do splhigh and splx respectively.
39 */
40#define MCOUNT_ENTER(s) \n\
41 _c = intr_disable()
42#define MCOUNT_EXIT(s) \n\
43 intr_restore(_c)
44#define MCOUNT_DECL(s) register_t c;
45
107#else /* !_KERNEL */
46#else /* !_KERNEL */
108typedef u_long uintfptr_t;
47
48typedef unsigned long uintfptr_t;
49
109#endif
50#endif