/*-1* SPDX-License-Identifier: MIT-CMU2*3* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.4* All rights reserved.5*6* Author: Chris G. Demetriou7*8* Permission to use, copy, modify and distribute this software and9* its documentation is hereby granted, provided that both the copyright10* notice and this permission notice appear in all copies of the11* software, derivative works or modified versions, and any portions12* thereof, and that both notices appear in supporting documentation.13*14* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"15* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND16* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.17*18* Carnegie Mellon requests users of this software to return to19*20* Software Distribution Coordinator or [email protected]21* School of Computer Science22* Carnegie Mellon University23* Pittsburgh PA 15213-389024*25* any improvements or extensions that they make and grant Carnegie the26* rights to redistribute these changes.27*28* from: NetBSD: profile.h,v 1.9 1997/04/06 08:47:37 cgd Exp29* from: FreeBSD: src/sys/alpha/include/profile.h,v 1.4 1999/12/2930*/3132#ifndef _MACHINE_PROFILE_H_33#define _MACHINE_PROFILE_H_3435#define FUNCTION_ALIGNMENT 323637typedef u_long fptrdiff_t;3839#ifdef _KERNEL4041#include <machine/cpufunc.h>4243#define _MCOUNT_DECL void mcount44#define MCOUNT4546#define MCOUNT_DECL(s) register_t s;47#define MCOUNT_ENTER(s) {s = intr_disable(); }48#define MCOUNT_EXIT(s) {intr_restore(s); }4950void bintr(void);51void btrap(void);52void eintr(void);53void user(void);5455#define MCOUNT_FROMPC_USER(pc) \56((pc < (uintfptr_t)VM_MAXUSER_ADDRESS) ? (uintfptr_t)user : pc)5758#define MCOUNT_FROMPC_INTR(pc) \59((pc >= (uintfptr_t)btrap && pc < (uintfptr_t)eintr) ? \60((pc >= (uintfptr_t)bintr) ? (uintfptr_t)bintr : \61(uintfptr_t)btrap) : ~0UL)6263void mcount(uintfptr_t frompc, uintfptr_t selfpc);6465#else /* !_KERNEL */6667typedef __uintfptr_t uintfptr_t;6869#define _MCOUNT_DECL void mcount70#define MCOUNT7172#endif /* _KERNEL */7374#endif /* !_MACHINE_PROFILE_H_ */757677