2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
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.
21 * @APPLE_LICENSE_HEADER_END@
23 #ifndef _PEXPERT_PEXPERT_H_
24 #define _PEXPERT_PEXPERT_H_
26 #include <sys/cdefs.h>
28 #include <IOKit/IOInterrupts.h>
29 #include <kern/kern_types.h>
32 #include <mach/boolean.h>
33 #include <mach/kern_return.h>
34 #include <mach/machine/vm_types.h>
36 #ifdef PEXPERT_KERNEL_PRIVATE
37 #include <pexpert/protos.h>
39 #include <pexpert/boot.h>
41 #if defined(PEXPERT_KERNEL_PRIVATE) || defined(IOKIT_KERNEL_PRIVATE)
42 typedef void *cpu_id_t
;
44 typedef void *cpu_id_t
;
48 void PE_enter_debugger(
51 void PE_init_platform(
52 boolean_t vm_initialized
,
56 boolean_t vm_initialized
);
58 extern int32_t gPESerialBaud
;
60 unsigned int PE_init_taproot(vm_offset_t
*taddr
);
62 extern void (*PE_kputc
)(char c
);
65 boolean_t vm_initialized
);
67 extern void (*PE_putc
)(char c
);
72 struct clock_frequency_info_t
{
73 unsigned long bus_clock_rate_hz
;
74 unsigned long cpu_clock_rate_hz
;
75 unsigned long dec_clock_rate_hz
;
76 unsigned long bus_clock_rate_num
;
77 unsigned long bus_clock_rate_den
;
78 unsigned long bus_to_cpu_rate_num
;
79 unsigned long bus_to_cpu_rate_den
;
80 unsigned long bus_to_dec_rate_num
;
81 unsigned long bus_to_dec_rate_den
;
82 unsigned long timebase_frequency_hz
;
83 unsigned long timebase_frequency_num
;
84 unsigned long timebase_frequency_den
;
85 unsigned long long bus_frequency_hz
;
86 unsigned long long bus_frequency_min_hz
;
87 unsigned long long bus_frequency_max_hz
;
88 unsigned long long cpu_frequency_hz
;
89 unsigned long long cpu_frequency_min_hz
;
90 unsigned long long cpu_frequency_max_hz
;
93 typedef struct clock_frequency_info_t clock_frequency_info_t
;
95 extern clock_frequency_info_t gPEClockFrequencyInfo
;
97 struct timebase_freq_t
{
98 unsigned long timebase_num
;
99 unsigned long timebase_den
;
102 typedef void (*timebase_callback_func
)(struct timebase_freq_t
*timebase_freq
);
104 void PE_register_timebase_callback(timebase_callback_func callback
);
106 void PE_call_timebase_callback(void);
108 void PE_install_interrupt_handler(
109 void *nub
, int source
,
110 void *target
, IOInterruptHandler handler
, void *refCon
);
114 void kprintf(const char *fmt
, ...);
117 void init_display_putc(unsigned char *baseaddr
, int rowbytes
, int height
);
118 void display_putc(char c
);
124 extern int (*PE_read_write_time_of_day
)(
125 unsigned int options
,
129 kPEWaitForInput
= 0x00000001,
130 kPERawInput
= 0x00000002
132 extern int (*PE_poll_input
)(
133 unsigned int options
,
136 extern int (*PE_write_IIC
)(
141 /* Private Stuff - eventually put in pexpertprivate.h */
144 kDebugTypeDisplay
= 1,
149 unsigned long v_baseAddr
; /* Base address of video memory */
150 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
151 unsigned long v_width
; /* Width */
152 unsigned long v_height
; /* Height */
153 unsigned long v_depth
; /* Pixel Depth */
154 unsigned long v_display
; /* Text or Graphics */
155 char v_pixelFormat
[64];
159 typedef struct PE_Video PE_Video
;
161 extern int PE_current_console(
164 extern void PE_create_console(
167 extern int PE_initialize_console(
171 #define kPEGraphicsMode 1
172 #define kPETextMode 2
173 #define kPETextScreen 3
174 #define kPEAcquireScreen 4
175 #define kPEReleaseScreen 5
176 #define kPEEnableScreen 6
177 #define kPEDisableScreen 7
179 extern void PE_display_icon( unsigned int flags
,
182 typedef struct PE_state
{
183 boolean_t initialized
;
185 void *deviceTreeHead
;
188 void *fakePPCBootArgs
;
192 extern PE_state_t PE_state
;
194 extern char * PE_boot_args(
197 extern boolean_t
PE_parse_boot_arg(
198 const char *arg_string
,
201 extern boolean_t
PE_parse_boot_argn(
202 const char *arg_string
,
208 kPECommandKey
= 0x37,
209 kPEControlKey
= 0x36,
213 extern boolean_t
PE_get_hotkey(
216 extern kern_return_t
PE_cpu_start(
218 vm_offset_t start_paddr
,
219 vm_offset_t arg_paddr
);
221 extern void PE_cpu_halt(
224 extern void PE_cpu_signal(
228 extern void PE_cpu_machine_init(
232 extern void PE_cpu_machine_quiesce(
235 extern void pe_init_debug(void);
239 #endif /* _PEXPERT_PEXPERT_H_ */