]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/processor_data.h
xnu-792.10.96.tar.gz
[apple/xnu.git] / osfmk / kern / processor_data.h
1 /*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * Machine independent per processor data.
24 */
25
26 #ifndef _KERN_PROCESSOR_DATA_H_
27 #define _KERN_PROCESSOR_DATA_H_
28
29 /*
30 * #include kern/processor.h instead of this file.
31 */
32
33 #ifdef MACH_KERNEL_PRIVATE
34
35 #include <ipc/ipc_kmsg.h>
36 #include <kern/timer.h>
37
38 struct processor_data {
39 /* Processor state statistics */
40 integer_t cpu_ticks[CPU_STATE_MAX];
41
42 #if !STAT_TIME
43 /* Current execution timer */
44 timer_t current_timer;
45 timer_data_t offline_timer;
46 #endif /* STAT_TIME */
47
48 /* Kernel stack cache */
49 struct stack_cache {
50 vm_offset_t free;
51 unsigned int count;
52 } stack_cache;
53
54 /* Pending timer callouts */
55 queue_head_t timer_call_queue;
56
57 /* VM event counters */
58 vm_statistics_data_t vm_stat;
59
60 /* IPC free message cache */
61 struct ikm_cache {
62 #define IKM_STASH 16
63 ipc_kmsg_t entries[IKM_STASH];
64 unsigned int avail;
65 } ikm_cache;
66
67 int slot_num;
68 };
69
70 typedef struct processor_data processor_data_t;
71
72 #define PROCESSOR_DATA(processor, member) \
73 (processor)->processor_data.member
74
75 extern void processor_data_init(
76 processor_t processor);
77
78 #endif /* MACH_KERNEL_PRIVATE */
79
80 #endif /* _KERN_PROCESSOR_DATA_H_ */