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