BSD 4_4_Lite2 development
[unix-history] / usr / src / contrib / mprof / md.s
CommitLineData
7d1948c3
C
1/*
2 * mprof
3 * md.s 1.2 8/17/90 16:22:14
4 * Copyright (c) 1988, Benjamin G. Zorn
5 *
6 * Machine dependent part.
7 */
8
9#ifdef sun4
10#include <sun4/trap.h>
11
12/*
13 * This is severly misnamed, since we're really getting the sp, not
14 * the fp. But we don't want to contort the logic of the rest of the
15 * program, so here we are.
16 */
17.global _get_current_fp
18_get_current_fp:
19 ta ST_FLUSH_WINDOWS /* we're going to walk the stack */
20 retl
21 mov %sp,%o0
22
23#endif sun4
24
25#ifdef mips
26 # 3 extern int intloc;
27 # 4
28 .extern intloc 4
29 .text
30 .align 2
31 .file 2 "md.s"
32 # 1 /* place register 31 in location intloc */
33 # 2
34 .globl get31
35 .ent get31
36get31:
37 .frame $sp, 0, $31
38 sw $31, intloc
39 j $31
40 .end get31
41
42 .text
43 .align 2
44 # 1 /* get the sp of the caller */
45 # 2
46 .globl getsp
47 .ent getsp
48getsp:
49 .frame $sp, 0, $31
50 sw $sp, intloc
51 j $31
52 .end getsp
53#endif