2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
22 #ifndef _PEXPERT_PEXPERT_H_
23 #define _PEXPERT_PEXPERT_H_
25 #include <sys/cdefs.h>
27 #include <IOKit/IOInterrupts.h>
28 #include <kern/kern_types.h>
31 #include <mach/boolean.h>
32 #include <mach/kern_return.h>
33 #include <mach/machine/vm_types.h>
35 #ifdef PEXPERT_KERNEL_PRIVATE
36 #include <pexpert/protos.h>
38 #include <pexpert/boot.h>
40 #if defined(PEXPERT_KERNEL_PRIVATE) || defined(IOKIT_KERNEL_PRIVATE)
41 typedef void *cpu_id_t
;
43 typedef void *cpu_id_t
;
47 void PE_enter_debugger(
50 void PE_init_platform(
51 boolean_t vm_initialized
,
55 boolean_t vm_initialized
);
57 extern int32_t gPESerialBaud
;
59 unsigned int PE_init_taproot(vm_offset_t
*taddr
);
61 extern void (*PE_kputc
)(char c
);
64 boolean_t vm_initialized
);
66 extern void (*PE_putc
)(char c
);
71 struct clock_frequency_info_t
{
72 unsigned long bus_clock_rate_hz
;
73 unsigned long cpu_clock_rate_hz
;
74 unsigned long dec_clock_rate_hz
;
75 unsigned long bus_clock_rate_num
;
76 unsigned long bus_clock_rate_den
;
77 unsigned long bus_to_cpu_rate_num
;
78 unsigned long bus_to_cpu_rate_den
;
79 unsigned long bus_to_dec_rate_num
;
80 unsigned long bus_to_dec_rate_den
;
81 unsigned long timebase_frequency_hz
;
82 unsigned long timebase_frequency_num
;
83 unsigned long timebase_frequency_den
;
84 unsigned long long bus_frequency_hz
;
85 unsigned long long bus_frequency_min_hz
;
86 unsigned long long bus_frequency_max_hz
;
87 unsigned long long cpu_frequency_hz
;
88 unsigned long long cpu_frequency_min_hz
;
89 unsigned long long cpu_frequency_max_hz
;
92 typedef struct clock_frequency_info_t clock_frequency_info_t
;
94 extern clock_frequency_info_t gPEClockFrequencyInfo
;
96 struct timebase_freq_t
{
97 unsigned long timebase_num
;
98 unsigned long timebase_den
;
101 typedef void (*timebase_callback_func
)(struct timebase_freq_t
*timebase_freq
);
103 void PE_register_timebase_callback(timebase_callback_func callback
);
105 void PE_call_timebase_callback(void);
107 void PE_install_interrupt_handler(
108 void *nub
, int source
,
109 void *target
, IOInterruptHandler handler
, void *refCon
);
113 void kprintf(const char *fmt
, ...);
116 void init_display_putc(unsigned char *baseaddr
, int rowbytes
, int height
);
117 void display_putc(char c
);
123 extern int (*PE_read_write_time_of_day
)(
124 unsigned int options
,
128 kPEWaitForInput
= 0x00000001,
129 kPERawInput
= 0x00000002
131 extern int (*PE_poll_input
)(
132 unsigned int options
,
135 extern int (*PE_write_IIC
)(
140 /* Private Stuff - eventually put in pexpertprivate.h */
143 kDebugTypeDisplay
= 1,
148 unsigned long v_baseAddr
; /* Base address of video memory */
149 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
150 unsigned long v_width
; /* Width */
151 unsigned long v_height
; /* Height */
152 unsigned long v_depth
; /* Pixel Depth */
153 unsigned long v_display
; /* Text or Graphics */
154 char v_pixelFormat
[64];
158 typedef struct PE_Video PE_Video
;
160 extern int PE_current_console(
163 extern void PE_create_console(
166 extern int PE_initialize_console(
170 #define kPEGraphicsMode 1
171 #define kPETextMode 2
172 #define kPETextScreen 3
173 #define kPEAcquireScreen 4
174 #define kPEReleaseScreen 5
175 #define kPEEnableScreen 6
176 #define kPEDisableScreen 7
178 extern void PE_display_icon( unsigned int flags
,
181 typedef struct PE_state
{
182 boolean_t initialized
;
184 void *deviceTreeHead
;
187 void *fakePPCBootArgs
;
191 extern PE_state_t PE_state
;
193 extern char * PE_boot_args(
196 extern boolean_t
PE_parse_boot_arg(
197 const char *arg_string
,
200 extern boolean_t
PE_parse_boot_argn(
201 const char *arg_string
,
207 kPECommandKey
= 0x37,
208 kPEControlKey
= 0x36,
212 extern boolean_t
PE_get_hotkey(
215 extern kern_return_t
PE_cpu_start(
217 vm_offset_t start_paddr
,
218 vm_offset_t arg_paddr
);
220 extern void PE_cpu_halt(
223 extern void PE_cpu_signal(
227 extern void PE_cpu_machine_init(
231 extern void PE_cpu_machine_quiesce(
234 extern void pe_init_debug(void);
238 #endif /* _PEXPERT_PEXPERT_H_ */