/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the
- * License may not be used to create, or enable the creation or
- * redistribution of, unlawful or unlicensed copies of an Apple operating
- * system, or to circumvent, violate, or enable the circumvention or
- * violation of, any terms of an Apple operating system software license
- * agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
* limitations under the License.
- *
- * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* file: pe_init.c
#include <kern/sched_prim.h>
#include <kern/debug.h>
-#include "fakePPCStructs.h"
-#include "fakePPCDeviceTree.h"
#include "boot_images.h"
/* extern references */
extern void pe_identify_machine(void * args);
-extern void initialize_screen(void *, unsigned int);
/* private globals */
PE_state_t PE_state;
-dt_data gMemoryMapNode;
-dt_data gDriversProp;
-dt_data gRootpathProp;
-dt_data gCompatibleProp;
/* Clock Frequency Info */
clock_frequency_info_t gPEClockFrequencyInfo;
-void *gPEEFISystemTable = 0;
-void *gPEEFIRuntimeServices = 0;
+void *gPEEFISystemTable;
+void *gPEEFIRuntimeServices;
int PE_initialize_console( PE_Video * info, int op )
{
static int last_console = -1;
- Boot_Video bootInfo;
- Boot_Video * bInfo;
- /*
- * Refuse changes from outside pexpert.
- * The video mode setup by the booter cannot be changed.
- */
- if ( info )
- {
- bootInfo.v_baseAddr = info->v_baseAddr;
- bootInfo.v_rowBytes = info->v_rowBytes;
- bootInfo.v_width = info->v_width;
- bootInfo.v_height = info->v_height;
- bootInfo.v_depth = info->v_depth;
- bInfo = &bootInfo;
- if (info == &PE_state.video) {
- bootInfo.v_display = info->v_display;
- } else {
- bootInfo.v_display = GRAPHICS_MODE;
- }
+ if (info) {
+ info->v_offset = 0;
+ info->v_length = 0;
+ info->v_display = GRAPHICS_MODE;
}
- else
- bInfo = 0;
switch ( op ) {
case kPEDisableScreen:
- initialize_screen((void *) bInfo, op);
+ initialize_screen(info, op);
kprintf("kPEDisableScreen %d\n", last_console);
if (!console_is_serial())
last_console = switch_to_serial_console();
break;
case kPEEnableScreen:
- initialize_screen((void *) bInfo, op);
+ initialize_screen(info, op);
kprintf("kPEEnableScreen %d\n", last_console);
if( last_console != -1)
switch_to_old_console( last_console);
break;
default:
- initialize_screen((void *) bInfo, op);
+ initialize_screen(info, op);
break;
}
boolean_t bootClutInitialized = FALSE;
boolean_t norootInitialized = FALSE;
DTEntry entry;
- int size;
+ unsigned int size;
void ** map;
+ boot_progress_element *bootPict;
PE_init_kprintf(TRUE);
PE_init_printf(TRUE);
/*
* Fetch the CLUT and the noroot image.
*/
- boot_progress_element * bootPict;
- if( kSuccess == DTLookupEntry(0, "/chosen/memory-map", &entry)) {
+ if( kSuccess == DTLookupEntry(NULL, "/chosen/memory-map", &entry)) {
if( kSuccess == DTGetProperty(entry, "BootCLUT", (void **) &map, &size)) {
bcopy( map[0], appleClut8, sizeof(appleClut8) );
bootClutInitialized = TRUE;
vc_progress_initialize( &default_progress, default_progress_data,
(unsigned char *) appleClut8 );
- (void) StartIOKit( PE_state.deviceTreeHead, PE_state.bootArgs, gPEEFIRuntimeServices, 0);
+ (void) StartIOKit( PE_state.deviceTreeHead, PE_state.bootArgs, gPEEFIRuntimeServices, NULL);
}
void PE_init_platform(boolean_t vm_initialized, void * _args)
// New EFI-style
PE_state.bootArgs = _args;
- PE_state.deviceTreeHead = args->deviceTreeP;
+ PE_state.deviceTreeHead = (void *) args->deviceTreeP;
PE_state.video.v_baseAddr = args->Video.v_baseAddr;
PE_state.video.v_rowBytes = args->Video.v_rowBytes;
PE_state.video.v_width = args->Video.v_width;
PE_state.video.v_height = args->Video.v_height;
PE_state.video.v_depth = args->Video.v_depth;
PE_state.video.v_display = args->Video.v_display;
- strcpy( PE_state.video.v_pixelFormat, "PPPPPPPP");
+ strlcpy(PE_state.video.v_pixelFormat, "PPPPPPPP",
+ sizeof(PE_state.video.v_pixelFormat));
}
if (!vm_initialized) {
pe_identify_machine(args);
} else {
- DTEntry entry;
- void *ptr;
- uint32_t size;
-
pe_init_debug();
}
}
vc_display_icon( &default_noroot, default_noroot_data );
}
-extern boolean_t PE_get_hotkey( __unused unsigned char key )
+boolean_t
+PE_get_hotkey(__unused unsigned char key)
{
return (FALSE);
}