2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
32 * Revision 1.1.1.1 1998/09/22 21:05:34 wsanchez
33 * Import of Mac OS X kernel (~semeria)
35 * Revision 1.1.1.1 1998/03/07 02:25:54 wsanchez
36 * Import of OSF Mach kernel (~mburg)
38 * Revision 1.1.2.4 1995/10/09 17:13:55 devrcs
39 * Merged RT3_SHARED version into `mainline.'
40 * [1995/09/13 16:17:31 joe]
42 * Revision 1.1.2.3 1995/09/18 19:13:40 devrcs
43 * Merged RT3_SHARED version into `mainline.'
44 * [1995/09/13 16:17:31 joe]
46 * Revision 1.1.2.2 1995/01/10 05:11:19 devrcs
47 * mk6 CR801 - new file for mk6_shared from cnmk_shared.
48 * [1994/12/01 21:11:51 dwm]
50 * Revision 1.1.2.1 1994/10/21 18:28:53 joe
51 * Initial ETAP submission
52 * [1994/10/20 19:31:35 joe]
59 * The start_data_node structure is primarily needed to hold
60 * start information for read locks (since multiple readers
61 * can acquire a read lock). For consistency, however, the
62 * structure is used for write locks as well. Each complex
63 * lock will maintain a linked list of these structures.
66 #ifndef _KERN_ETAP_POOL_H_
67 #define _KERN_ETAP_POOL_H_
69 #include <kern/etap_options.h>
70 #include <mach/etap.h>
71 #include <mach/boolean.h>
76 #include <mach/clock_types.h>
77 #include <mach/kern_return.h>
78 #include <kern/misc_protos.h>
80 struct start_data_node
{
81 unsigned int thread_id
; /* thread id */
82 etap_time_t start_hold_time
; /* time of last acquisition */
83 etap_time_t start_wait_time
; /* time of first miss */
84 unsigned int start_pc
; /* pc of acquiring function */
85 unsigned int end_pc
; /* pc of relinquishing function */
86 struct start_data_node
*next
; /* pointer to next list entry */
89 typedef struct start_data_node
* start_data_node_t
;
92 * The start_data_node pool is statically
93 * allocated and privatly maintained
96 #define SD_POOL_ENTRIES (NCPUS * 256)
98 extern void init_start_data_pool(void);
99 extern start_data_node_t
get_start_data_node(void);
100 extern void free_start_data_node(start_data_node_t
);
102 #else /* ETAP_LOCK_TRACE */
103 typedef boolean_t start_data_node_t
;
104 #define get_start_data_node()
105 #define free_start_start_data_node(node)
106 #endif /* ETAP_LOCK_TRACE */
108 #define SD_ENTRY_NULL ((start_data_node_t) 0)
110 #endif /* _KERN_ETAP_POOL_H_ */