1139790Simp/*- 2134287Smarcel * Copyright (c) 2004 Marcel Moolenaar 366458Sdfr * All rights reserved. 466458Sdfr * 5134287Smarcel * Redistribution and use in source and binary forms, with or without 6134287Smarcel * modification, are permitted provided that the following conditions 7134287Smarcel * are met: 866458Sdfr * 9134287Smarcel * 1. Redistributions of source code must retain the above copyright 10134287Smarcel * notice, this list of conditions and the following disclaimer. 11134287Smarcel * 2. Redistributions in binary form must reproduce the above copyright 12134287Smarcel * notice, this list of conditions and the following disclaimer in the 13134287Smarcel * documentation and/or other materials provided with the distribution. 1466458Sdfr * 15134287Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16134287Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17134287Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18134287Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19134287Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20134287Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21134287Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22134287Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23134287Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24134287Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25134287Smarcel * 26134287Smarcel * $FreeBSD: releng/10.3/sys/ia64/include/profile.h 209617 2010-06-30 22:29:02Z marcel $ 2766458Sdfr */ 2866458Sdfr 29134398Smarcel#ifndef _MACHINE_PROFILE_H_ 30134398Smarcel#define _MACHINE_PROFILE_H_ 31134398Smarcel 32134287Smarcel#define _MCOUNT_DECL void __mcount 33134287Smarcel#define MCOUNT 3466458Sdfr 35209617Smarcel#define FUNCTION_ALIGNMENT 16 3666458Sdfr 37134287Smarceltypedef unsigned long fptrdiff_t; 3866458Sdfr 3966458Sdfr#ifdef _KERNEL 4066458Sdfr/* 4166458Sdfr * The following two macros do splhigh and splx respectively. 4266458Sdfr */ 43134289Smarcel#define MCOUNT_ENTER(s) s = intr_disable() 44134289Smarcel#define MCOUNT_EXIT(s) intr_restore(s) 45134289Smarcel#define MCOUNT_DECL(s) register_t s; 46134287Smarcel 47134398Smarcelvoid bintr(void); 48134398Smarcelvoid btrap(void); 49134398Smarcelvoid eintr(void); 50134398Smarcelvoid user(void); 51134398Smarcel 52134398Smarcel#define MCOUNT_FROMPC_USER(pc) \ 53134398Smarcel ((pc < (uintfptr_t)VM_MAXUSER_ADDRESS) ? ~0UL : pc) 54134398Smarcel 55134398Smarcel#define MCOUNT_FROMPC_INTR(pc) (~0UL) 56134398Smarcel 57134289Smarcel_MCOUNT_DECL(uintfptr_t, uintfptr_t); 58134289Smarcel 5966458Sdfr#else /* !_KERNEL */ 60134287Smarcel 61134287Smarceltypedef unsigned long uintfptr_t; 62134287Smarcel 6366458Sdfr#endif 64134398Smarcel 65134398Smarcel#endif /* _MACHINE_PROFILE_H_ */ 66