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@
25 #ifndef _PEXPERT_PEXPERT_H_
26 #define _PEXPERT_PEXPERT_H_
28 #include <sys/cdefs.h>
30 #include <IOKit/IOInterrupts.h>
31 #include <kern/kern_types.h>
34 #include <mach/boolean.h>
35 #include <mach/kern_return.h>
36 #include <mach/machine/vm_types.h>
38 #ifdef PEXPERT_KERNEL_PRIVATE
39 #include <pexpert/protos.h>
41 #include <pexpert/boot.h>
43 #if defined(PEXPERT_KERNEL_PRIVATE) || defined(IOKIT_KERNEL_PRIVATE)
44 typedef void *cpu_id_t
;
46 typedef void *cpu_id_t
;
50 void PE_enter_debugger(
53 void PE_init_platform(
54 boolean_t vm_initialized
,
58 boolean_t vm_initialized
);
60 extern void (*PE_kputc
)(char c
);
63 boolean_t vm_initialized
);
65 extern void (*PE_putc
)(char c
);
70 struct clock_frequency_info_t
{
71 unsigned long bus_clock_rate_hz
;
72 unsigned long cpu_clock_rate_hz
;
73 unsigned long dec_clock_rate_hz
;
74 unsigned long bus_clock_rate_num
;
75 unsigned long bus_clock_rate_den
;
76 unsigned long bus_to_cpu_rate_num
;
77 unsigned long bus_to_cpu_rate_den
;
78 unsigned long bus_to_dec_rate_num
;
79 unsigned long bus_to_dec_rate_den
;
80 unsigned long timebase_frequency_hz
;
81 unsigned long timebase_frequency_num
;
82 unsigned long timebase_frequency_den
;
83 unsigned long long bus_frequency_hz
;
84 unsigned long long bus_frequency_min_hz
;
85 unsigned long long bus_frequency_max_hz
;
86 unsigned long long cpu_frequency_hz
;
87 unsigned long long cpu_frequency_min_hz
;
88 unsigned long long cpu_frequency_max_hz
;
91 typedef struct clock_frequency_info_t clock_frequency_info_t
;
93 extern clock_frequency_info_t gPEClockFrequencyInfo
;
95 struct timebase_freq_t
{
96 unsigned long timebase_num
;
97 unsigned long timebase_den
;
100 typedef void (*timebase_callback_func
)(struct timebase_freq_t
*timebase_freq
);
102 void PE_register_timebase_callback(timebase_callback_func callback
);
104 void PE_call_timebase_callback(void);
106 void PE_install_interrupt_handler(
107 void *nub
, int source
,
108 void *target
, IOInterruptHandler handler
, void *refCon
);
111 const char *fmt
, ...);
113 void init_display_putc(unsigned char *baseaddr
, int rowbytes
, int height
);
114 void display_putc(char c
);
116 boolean_t
PE_init_ethernet_debugger( void );
122 extern int (*PE_read_write_time_of_day
)(
123 unsigned int options
,
127 kPEWaitForInput
= 0x00000001,
128 kPERawInput
= 0x00000002
130 extern int (*PE_poll_input
)(
131 unsigned int options
,
134 extern int (*PE_write_IIC
)(
139 /* Private Stuff - eventually put in pexpertprivate.h */
142 kDebugTypeDisplay
= 1,
147 unsigned long v_baseAddr
; /* Base address of video memory */
148 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
149 unsigned long v_width
; /* Width */
150 unsigned long v_height
; /* Height */
151 unsigned long v_depth
; /* Pixel Depth */
152 unsigned long v_display
; /* Text or Graphics */
153 char v_pixelFormat
[64];
157 typedef struct PE_Video PE_Video
;
159 extern int PE_current_console(
162 extern void PE_create_console(
165 extern int PE_initialize_console(
169 #define kPEGraphicsMode 1
170 #define kPETextMode 2
171 #define kPETextScreen 3
172 #define kPEAcquireScreen 4
173 #define kPEReleaseScreen 5
174 #define kPEEnableScreen 6
175 #define kPEDisableScreen 7
177 extern void PE_display_icon( unsigned int flags
,
180 typedef struct PE_state
{
181 boolean_t initialized
;
183 void *deviceTreeHead
;
186 void *fakePPCBootArgs
;
190 extern PE_state_t PE_state
;
192 extern char * PE_boot_args(
195 extern boolean_t
PE_parse_boot_arg(
201 kPECommandKey
= 0x37,
202 kPEControlKey
= 0x36,
206 extern boolean_t
PE_get_hotkey(
209 extern kern_return_t
PE_cpu_start(
211 vm_offset_t start_paddr
,
212 vm_offset_t arg_paddr
);
214 extern void PE_cpu_halt(
217 extern void PE_cpu_signal(
221 extern void PE_cpu_machine_init(
225 extern void PE_cpu_machine_quiesce(
228 extern void pe_init_debug(void);
232 #endif /* _PEXPERT_PEXPERT_H_ */