2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
37 * Revision 1.1.1.1 1998/09/22 21:05:49 wsanchez
38 * Import of Mac OS X kernel (~semeria)
40 * Revision 1.1.1.1 1998/03/07 02:26:08 wsanchez
41 * Import of OSF Mach kernel (~mburg)
43 * Revision 1.1.8.1 1996/12/09 16:57:22 stephen
44 * nmklinux_1.0b3_shared into pmk1.1
45 * [1996/12/09 11:13:16 stephen]
47 * Revision 1.1.6.1 1996/04/11 11:20:35 emcmanus
48 * Copied from mainline.ppc.
49 * [1996/04/11 08:26:36 emcmanus]
52 * [1995/03/15 09:47:27 bruel]
54 * Revision 1.1.4.1 1995/11/23 17:37:28 stephen
55 * first powerpc checkin to mainline.ppc
56 * [1995/11/23 16:46:29 stephen]
58 * Revision 1.1.2.1 1995/08/25 06:50:17 stephen
59 * Initial checkin of files for PowerPC port
60 * [1995/08/23 15:05:31 stephen]
62 * Revision 1.1.2.1 1995/02/14 14:25:16 bruel
73 * Define the interfaces between the assembly language profiling support
74 * that is common between the kernel, mach servers, and user space library.
81 typedef long prof_ptrint_t
; /* hold either pointer or signed int */
82 typedef unsigned long prof_uptrint_t
; /* hold either pointer or unsigned int */
83 typedef long prof_lock_t
; /* lock word type */
84 typedef unsigned char prof_flag_t
; /* type for boolean flags */
87 * Double precision counter.
90 typedef struct prof_cnt_t
{
91 prof_uptrint_t low
; /* low 32 bits of counter */
92 prof_uptrint_t high
; /* high 32 bits of counter */
95 #define PROF_CNT_INC(cnt) ((++((cnt).low) == 0) ? ++((cnt).high) : 0)
96 #define PROF_CNT_ADD(cnt,val) (((((cnt).low + (val)) < (val)) ? ((cnt).high++) : 0), ((cnt).low += (val)))
97 #define PROF_CNT_LADD(cnt,val) (PROF_CNT_ADD(cnt,(val).low), (cnt).high += (val).high)
98 #define PROF_CNT_SUB(cnt,val) (((((cnt).low - (val)) > (cnt).low) ? ((cnt).high--) : 0), ((cnt).low -= (val)))
99 #define PROF_CNT_LSUB(cnt,val) (PROF_CNT_SUB(cnt,(val).low), (cnt).high -= (val).high)
101 #define LPROF_ULONG_TO_CNT(cnt,val) PROF_ULONG_TO_CNT(cnt,val)
102 #define LPROF_CNT_INC(lp) PROF_CNT_INC(lp)
103 #define LPROF_CNT_ADD(lp,val) PROF_CNT_ADD(lp,val)
104 #define LPROF_CNT_LADD(lp,val) PROF_CNT_LADD(lp,val)
105 #define LPROF_CNT_SUB(lp,val) PROF_CNT_SUB(lp,val)
106 #define LPROF_CNT_LSUB(lp,val) PROF_CNT_LSUB(lp,val)
107 #define LPROF_CNT_OVERFLOW(lp,high,low) PROF_CNT_OVERFLOW(lp,high,low)
108 #define LPROF_CNT_TO_ULONG(lp) PROF_CNT_TO_ULONG(lp)
109 #define LPROF_CNT_TO_LDOUBLE(lp) PROF_CNT_TO_LDOUBLE(lp)
110 #define LPROF_CNT_TO_DECIMAL(buf,cnt) PROF_CNT_TO_DECIMAL(buf,cnt)
111 #define LPROF_CNT_EQ_0(cnt) PROF_CNT_EQ_0(cnt)
112 #define LPROF_CNT_NE_0(cnt) PROF_CNT_NE_0(cnt)
113 #define LPROF_CNT_EQ(cnt1,cnt2) PROF_CNT_EQ(cnt1,cnt2)
114 #define LPROF_CNT_NE(cnt1,cnt2) PROF_CNT_NE(cnt1,cnt2)
115 #define LPROF_CNT_GT(cnt1,cnt2) PROF_CNT_GT(cnt1,cnt2)
116 #define LPROF_CNT_LT(cnt1,cnt2) PROF_CNT_LT(cnt1,cnt2)
117 #define LPROF_CNT_DIGITS PROF_CNT_DIGITS
121 * Types of the profil counter.
124 typedef unsigned short HISTCOUNTER
; /* profil */
125 typedef prof_cnt_t LHISTCOUNTER
; /* lprofil */
127 struct profile_stats
{ /* Debugging counters */
128 prof_uptrint_t major_version
; /* major version number */
129 prof_uptrint_t minor_version
; /* minor version number */
133 int major_version
; /* major version number */
134 int minor_version
; /* minor version number */
137 #define PROFILE_MAJOR_VERSION 1
138 #define PROFILE_MINOR_VERSION 1
140 #endif /* _PROFILE_MD_H */