OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [tn_m001/] [newlib/] [newlib/] [libc/] [machine/] [hppa/] [DEFS.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/*
2
 * Copyright (c) 1990 The Regents of the University of California.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms are permitted
6
 * provided that the above copyright notice and this paragraph are
7
 * duplicated in all such forms and that any documentation,
8
 * advertising materials, and other materials related to such
9
 * distribution and use acknowledge that the software was developed
10
 * by the University of California, Berkeley.  The name of the
11
 * University may not be used to endorse or promote products derived
12
 * from this software without specific prior written permission.
13
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16
 */
17
 
18
#include "pcc_prefix.s"
19
 
20
#define BLANK
21
#define BANNER(str)     BLANK   .VERSION str
22
#define ENTRY(Name)     BLANK   M_ENTRY (Name,PROF_/**/Name)
23
#define ENTRYC(Name)    BLANK   M_ENTRYC(Name,PROF_/**/Name)
24
#define EXIT(Name)      BLANK   M_EXIT  (Name,PROF_/**/Name)
25
#define EXITC(Name)     BLANK   M_EXITC (Name,PROF_/**/Name)
26
 
27
#ifdef PROF
28
 
29
;
30
; All four argument registers are saved into caller save registers
31
; and restored after the call to _mcount.  This is possible because
32
; the mcount routine does not modify them, so we can.  Mcount takes
33
; 3 arguments; the first argument is the incoming 'rp', the second
34
; is the starting address of the profiled routine, and the third is
35
; the address of the PROF label (which is where mcount stores the
36
; profile data).
37
;
38
#define M_ENTRY(name,prof)      \
39
        .SPACE  $TEXT$          !\
40
        .SUBSPA $CODE$          !\
41
        .label name             !\
42
        .PROC                   !\
43
        .CALLINFO CALLER,SAVE_RP !\
44
        .ENTRY                  !\
45
        stw     rp,-20(sp)      !\
46
        ldo     48(sp),sp       !\
47
        or      arg0,r0,r19     !\
48
        or      arg1,r0,r20     !\
49
        or      arg2,r0,r21     !\
50
        or      arg3,r0,r22     !\
51
        or      rp,r0,arg0      !\
52
        ldil    L%name,r1       !\
53
        ldo     R%name(r1),arg1 !\
54
        addil   L%prof-$global$,dp      !\
55
        bl      _mcount,rp      !\
56
        ldo     R%prof-$global$(r1),arg2        !\
57
        ldw     -68(sp),rp      !\
58
        ldo     -48(sp),sp      !\
59
        or      r19,r0,arg0     !\
60
        or      r20,r0,arg1     !\
61
        or      r21,r0,arg2     !\
62
        or      r22,r0,arg3     !\
63
 
64
 
65
#define M_ENTRYC(name,prof)     \
66
        .SPACE  $TEXT$          !\
67
        .SUBSPA $CODE$          !\
68
        .label name             !\
69
        .PROC                   !\
70
        .CALLINFO CALLER,SAVE_RP !\
71
        .ENTRY                  !\
72
        stw     rp,-20(sp)      !\
73
        ldo     128(sp),sp      !\
74
        or      arg0,r0,r19     !\
75
        or      arg1,r0,r20     !\
76
        or      arg2,r0,r21     !\
77
        or      arg3,r0,r22     !\
78
        or      rp,r0,arg0      !\
79
        ldil    L%name,r1       !\
80
        ldo     R%name(r1),arg1 !\
81
        addil   L%prof-$global$,dp      !\
82
        bl      _mcount,rp      !\
83
        ldo     R%prof-$global$(r1),arg2        !\
84
        ldw     -148(sp),rp     !\
85
        or      r19,r0,arg0     !\
86
        or      r20,r0,arg1     !\
87
        or      r21,r0,arg2     !\
88
        or      r22,r0,arg3     !\
89
 
90
;
91
; The HPUX profiler uses a word for each entrypoint to store the profiling
92
; information.  The setup code passes the address to the _mcount routine.
93
; The EXIT macro defines a label (PROF_foo), and a word of storage.
94
;
95
#define M_EXIT(name,prof)       \
96
        bv,n    r0(rp)          !\
97
        .EXIT                   !\
98
        .PROCEND                !\
99
        .EXPORT name,ENTRY      !\
100
        .SPACE  $PRIVATE$       !\
101
        .SUBSPA $DATA$          !\
102
        .label prof             !\
103
        .WORD   0                !\
104
        .IMPORT $global$,DATA   !\
105
        .IMPORT _mcount,CODE
106
 
107
#define M_EXITC(name,prof)      \
108
        bv      r0(rp)          !\
109
        ldo     -128(sp),sp     !\
110
        .EXIT                   !\
111
        .PROCEND                !\
112
        .EXPORT name,ENTRY      !\
113
        .SPACE  $PRIVATE$       !\
114
        .SUBSPA $DATA$          !\
115
        .label prof             !\
116
        .WORD   0                !\
117
        .IMPORT $global$,DATA   !\
118
        .IMPORT _mcount,CODE
119
 
120
#else   /* NOT profiling */
121
 
122
#define M_ENTRY(name,prof)      \
123
        .SPACE $TEXT$   !\
124
        .SUBSPA $CODE$  !\
125
        .label name     !\
126
        .PROC           !\
127
        .CALLINFO       !\
128
        .ENTRY
129
 
130
#define M_ENTRYC(name,prof)     \
131
        .SPACE  $TEXT$  !\
132
        .SUBSPA $CODE$  !\
133
        .label name     !\
134
        .PROC           !\
135
        .CALLINFO CALLER,SAVE_RP        !\
136
        .ENTRY          !\
137
        stw     rp,-20(sp)      !\
138
        ldo     128(sp),sp
139
 
140
#define M_EXIT(name,prof)       \
141
        bv,n    r0(rp)  !\
142
        .EXIT           !\
143
        .PROCEND        !\
144
        .EXPORT name,ENTRY
145
 
146
#define M_EXITC(name,prof)      \
147
        ldw     -148(sp),rp     !\
148
        bv      r0(rp)  !\
149
        ldo     -128(sp),sp     !\
150
        .EXIT           !\
151
        .PROCEND        !\
152
        .EXPORT name,ENTRY
153
 
154
#define ENTRY(Name)     BLANK   M_ENTRY (Name,PROF_/**/Name)
155
#define ENTRYC(Name)    BLANK   M_ENTRYC(Name,PROF_/**/Name)
156
#define EXIT(Name)      BLANK   M_EXIT  (Name,PROF_/**/Name)
157
#define EXITC(Name)     BLANK   M_EXITC (Name,PROF_/**/Name)
158
 
159
 
160
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.