]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
593a1d5f | 2 | * Copyright (c) 2000-2008 Apple Inc. All rights reserved. |
1c79356b | 3 | * |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
2d21ac55 A |
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 License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
8f6c56a5 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
8f6c56a5 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* | |
29 | * @OSF_COPYRIGHT@ | |
30 | */ | |
31 | ||
32 | #ifndef _KERN_MACHINE_H_ | |
33 | #define _KERN_MACHINE_H_ | |
34 | ||
1c79356b A |
35 | #include <mach/kern_return.h> |
36 | #include <mach/processor_info.h> | |
37 | #include <kern/kern_types.h> | |
38 | ||
39 | /* | |
40 | * Machine support declarations. | |
41 | */ | |
42 | ||
91447636 A |
43 | extern void processor_up( |
44 | processor_t processor); | |
1c79356b | 45 | |
55e303ae A |
46 | extern void processor_offline( |
47 | processor_t processor); | |
48 | ||
593a1d5f | 49 | extern void processor_start_thread(void *machine_param); |
91447636 | 50 | |
1c79356b A |
51 | /* |
52 | * Must be implemented in machine dependent code. | |
53 | */ | |
54 | ||
55 | /* Initialize machine dependent ast code */ | |
91447636 A |
56 | extern void init_ast_check( |
57 | processor_t processor); | |
1c79356b A |
58 | |
59 | /* Cause check for ast */ | |
91447636 A |
60 | extern void cause_ast_check( |
61 | processor_t processor); | |
1c79356b | 62 | |
91447636 A |
63 | extern kern_return_t cpu_control( |
64 | int slot_num, | |
65 | processor_info_t info, | |
66 | unsigned int count); | |
1c79356b | 67 | |
91447636 | 68 | extern void cpu_sleep(void); |
1c79356b | 69 | |
91447636 A |
70 | extern kern_return_t cpu_start( |
71 | int slot_num); | |
72 | ||
73 | extern void cpu_exit_wait( | |
74 | int slot_num); | |
75 | ||
76 | extern kern_return_t cpu_info( | |
77 | processor_flavor_t flavor, | |
78 | int slot_num, | |
79 | processor_info_t info, | |
80 | unsigned int *count); | |
81 | ||
82 | extern kern_return_t cpu_info_count( | |
83 | processor_flavor_t flavor, | |
84 | unsigned int *count); | |
85 | ||
86 | extern thread_t machine_processor_shutdown( | |
87 | thread_t thread, | |
88 | void (*doshutdown)(processor_t), | |
89 | processor_t processor); | |
90 | ||
91 | extern void machine_idle(void); | |
92 | ||
4b17d6b6 A |
93 | extern void machine_track_platform_idle(boolean_t); |
94 | ||
3e170ce0 | 95 | /* Signals a processor to bring it out of idle */ |
91447636 A |
96 | extern void machine_signal_idle( |
97 | processor_t processor); | |
98 | ||
3e170ce0 A |
99 | /* Signals a processor to bring it out of idle unless canceled */ |
100 | extern void machine_signal_idle_deferred( | |
101 | processor_t processor); | |
102 | ||
103 | /* Cancels an outstanding machine_signal_idle_deferred, if this is supported */ | |
104 | extern void machine_signal_idle_cancel( | |
105 | processor_t processor); | |
106 | ||
91447636 A |
107 | extern void halt_cpu(void); |
108 | ||
109 | extern void halt_all_cpus( | |
110 | boolean_t reboot); | |
111 | ||
112 | extern char *machine_boot_info( | |
113 | char *buf, | |
114 | vm_size_t buf_len); | |
115 | ||
116 | /* | |
117 | * Machine-dependent routine to fill in an array with up to callstack_max | |
118 | * levels of return pc information. | |
119 | */ | |
120 | extern void machine_callstack( | |
39236c6e | 121 | uintptr_t *buf, |
91447636 | 122 | vm_size_t callstack_max); |
1c79356b | 123 | |
91447636 | 124 | extern void consider_machine_collect(void); |
1c79356b | 125 | |
3e170ce0 A |
126 | /* |
127 | * Machine-dependent routine to inform platform layer and external | |
128 | * CPU power management about context switches | |
129 | */ | |
130 | ||
131 | extern void machine_thread_going_on_core(thread_t new_thread, | |
132 | int urgency, | |
d190cdc3 A |
133 | uint64_t sched_latency, |
134 | uint64_t dispatch_time); | |
3e170ce0 | 135 | |
d190cdc3 | 136 | extern void machine_thread_going_off_core(thread_t old_thread, boolean_t thread_terminating, uint64_t last_dispatch); |
3e170ce0 A |
137 | |
138 | extern void machine_max_runnable_latency(uint64_t bg_max_latency, | |
139 | uint64_t default_max_latency, | |
140 | uint64_t realtime_max_latency); | |
141 | ||
142 | extern void machine_work_interval_notify(thread_t thread, | |
143 | uint64_t work_id, | |
144 | uint64_t start_abstime, | |
145 | uint64_t finish_abstime, | |
146 | uint64_t deadline_abstime, | |
147 | uint64_t next_start_abstime, | |
148 | uint16_t urgency, | |
149 | uint32_t flags); | |
150 | ||
1c79356b | 151 | #endif /* _KERN_MACHINE_H_ */ |