2 * Copyright (c) 2000 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 void (*PE_kputc
)(char c
);
60 boolean_t vm_initialized
);
62 extern void (*PE_putc
)(char c
);
67 struct clock_frequency_info_t
{
68 unsigned long bus_clock_rate_hz
;
69 unsigned long cpu_clock_rate_hz
;
70 unsigned long dec_clock_rate_hz
;
71 unsigned long bus_clock_rate_num
;
72 unsigned long bus_clock_rate_den
;
73 unsigned long bus_to_cpu_rate_num
;
74 unsigned long bus_to_cpu_rate_den
;
75 unsigned long bus_to_dec_rate_num
;
76 unsigned long bus_to_dec_rate_den
;
77 unsigned long timebase_frequency_hz
;
78 unsigned long timebase_frequency_num
;
79 unsigned long timebase_frequency_den
;
82 typedef struct clock_frequency_info_t clock_frequency_info_t
;
84 extern clock_frequency_info_t gPEClockFrequencyInfo
;
86 struct timebase_freq_t
{
87 unsigned long timebase_num
;
88 unsigned long timebase_den
;
91 typedef void (*timebase_callback_func
)(struct timebase_freq_t
*timebase_freq
);
93 void PE_register_timebase_callback(timebase_callback_func callback
);
95 void PE_call_timebase_callback(void);
97 void PE_install_interrupt_handler(
98 void *nub
, int source
,
99 void *target
, IOInterruptHandler handler
, void *refCon
);
102 const char *fmt
, ...);
104 void init_display_putc(unsigned char *baseaddr
, int rowbytes
, int height
);
105 void display_putc(char c
);
107 boolean_t
PE_init_ethernet_debugger( void );
113 extern int (*PE_read_write_time_of_day
)(
114 unsigned int options
,
118 kPEWaitForInput
= 0x00000001,
119 kPERawInput
= 0x00000002
121 extern int (*PE_poll_input
)(
122 unsigned int options
,
125 extern int (*PE_write_IIC
)(
130 /* Private Stuff - eventually put in pexpertprivate.h */
133 kDebugTypeDisplay
= 1,
138 unsigned long v_baseAddr
; /* Base address of video memory */
139 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
140 unsigned long v_width
; /* Width */
141 unsigned long v_height
; /* Height */
142 unsigned long v_depth
; /* Pixel Depth */
143 unsigned long v_display
; /* Text or Graphics */
144 char v_pixelFormat
[64];
148 typedef struct PE_Video PE_Video
;
150 extern int PE_current_console(
153 extern void PE_create_console(
156 extern int PE_initialize_console(
160 #define kPEGraphicsMode 1
161 #define kPETextMode 2
162 #define kPETextScreen 3
163 #define kPEAcquireScreen 4
164 #define kPEReleaseScreen 5
165 #define kPEEnableScreen 6
166 #define kPEDisableScreen 7
168 extern void PE_display_icon( unsigned int flags
,
171 typedef struct PE_state
{
172 boolean_t initialized
;
174 void *deviceTreeHead
;
177 void *fakePPCBootArgs
;
181 extern PE_state_t PE_state
;
183 extern char * PE_boot_args(
186 extern boolean_t
PE_parse_boot_arg(
192 kPECommandKey
= 0x37,
193 kPEControlKey
= 0x36,
197 extern boolean_t
PE_get_hotkey(
200 extern kern_return_t
PE_cpu_start(
202 vm_offset_t start_paddr
,
203 vm_offset_t arg_paddr
);
205 extern void PE_cpu_halt(
208 extern void PE_cpu_signal(
212 extern void PE_cpu_machine_init(
216 extern void PE_cpu_machine_quiesce(
219 extern void pe_init_debug(void);
223 #endif /* _PEXPERT_PEXPERT_H_ */