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
;
79 typedef struct clock_frequency_info_t clock_frequency_info_t
;
81 extern clock_frequency_info_t gPEClockFrequencyInfo
;
83 struct timebase_freq_t
{
84 unsigned long timebase_num
;
85 unsigned long timebase_den
;
88 typedef void (*timebase_callback_func
)(struct timebase_freq_t
*timebase_freq
);
90 void PE_register_timebase_callback(timebase_callback_func callback
);
92 void PE_call_timebase_callback(void);
94 void PE_install_interrupt_handler(
95 void *nub
, int source
,
96 void *target
, IOInterruptHandler handler
, void *refCon
);
99 const char *fmt
, ...);
101 void init_display_putc(unsigned char *baseaddr
, int rowbytes
, int height
);
102 void display_putc(char c
);
104 boolean_t
PE_init_ethernet_debugger( void );
110 extern int (*PE_read_write_time_of_day
)(
111 unsigned int options
,
115 kPEWaitForInput
= 0x00000001,
116 kPERawInput
= 0x00000002
118 extern int (*PE_poll_input
)(
119 unsigned int options
,
122 extern int (*PE_write_IIC
)(
127 /* Private Stuff - eventually put in pexpertprivate.h */
130 kDebugTypeDisplay
= 1,
135 unsigned long v_baseAddr
; /* Base address of video memory */
136 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
137 unsigned long v_width
; /* Width */
138 unsigned long v_height
; /* Height */
139 unsigned long v_depth
; /* Pixel Depth */
140 unsigned long v_display
; /* Text or Graphics */
141 char v_pixelFormat
[64];
145 typedef struct PE_Video PE_Video
;
147 extern int PE_current_console(
150 extern void PE_create_console(
153 extern int PE_initialize_console(
157 #define kPEGraphicsMode 1
158 #define kPETextMode 2
159 #define kPETextScreen 3
160 #define kPEAcquireScreen 4
161 #define kPEReleaseScreen 5
162 #define kPEEnableScreen 6
163 #define kPEDisableScreen 7
165 extern void PE_display_icon( unsigned int flags
,
168 typedef struct PE_state
{
169 boolean_t initialized
;
171 void *deviceTreeHead
;
174 void *fakePPCBootArgs
;
178 extern PE_state_t PE_state
;
180 extern char * PE_boot_args(
183 extern boolean_t
PE_parse_boot_arg(
189 kPECommandKey
= 0x37,
190 kPEControlKey
= 0x36,
194 extern boolean_t
PE_get_hotkey(
197 extern kern_return_t
PE_cpu_start(
199 vm_offset_t start_paddr
,
200 vm_offset_t arg_paddr
);
202 extern void PE_cpu_halt(
205 extern void PE_cpu_signal(
209 extern void PE_cpu_machine_init(
213 extern void PE_cpu_machine_quiesce(
216 extern void pe_init_debug(void);
220 #endif /* _PEXPERT_PEXPERT_H_ */