profile.h (1817) | profile.h (2166) |
---|---|
1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)profile.h 8.1 (Berkeley) 6/11/93 | 1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)profile.h 8.1 (Berkeley) 6/11/93 |
34 * $Id$ | 34 * $Id: profile.h,v 1.2 1994/08/02 07:38:56 davidg Exp $ |
35 */ 36 | 35 */ 36 |
37#ifndef _I386_MACHINE_PROFILE_H_ 38#define _I386_MACHINE_PROFILE_H_ 39 |
|
37#define _MCOUNT_DECL static inline void _mcount 38 39#define MCOUNT \ 40extern void mcount() asm("mcount"); void mcount() { \ 41 int selfpc, frompcindex; \ 42 /* \ 43 * find the return address for mcount, \ 44 * and the return address for mcount's caller. \ --- 5 unchanged lines hidden (view full) --- 50 * frompcindex = pc pushed by jsr into self. \ 51 * In GCC the caller's stack frame has already been built so we \ 52 * have to chase a6 to find caller's raddr. \ 53 */ \ 54 asm("movl (%%ebp),%0" : "=r" (frompcindex)); \ 55 frompcindex = ((int *)frompcindex)[1]; \ 56 _mcount(frompcindex, selfpc); \ 57} | 40#define _MCOUNT_DECL static inline void _mcount 41 42#define MCOUNT \ 43extern void mcount() asm("mcount"); void mcount() { \ 44 int selfpc, frompcindex; \ 45 /* \ 46 * find the return address for mcount, \ 47 * and the return address for mcount's caller. \ --- 5 unchanged lines hidden (view full) --- 53 * frompcindex = pc pushed by jsr into self. \ 54 * In GCC the caller's stack frame has already been built so we \ 55 * have to chase a6 to find caller's raddr. \ 56 */ \ 57 asm("movl (%%ebp),%0" : "=r" (frompcindex)); \ 58 frompcindex = ((int *)frompcindex)[1]; \ 59 _mcount(frompcindex, selfpc); \ 60} |
61 62#endif |
|