*
* @APPLE_LICENSE_HEADER_START@
*
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License"). You may not use this file except in compliance with the
+ * License. Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
*
- * 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. 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
+ * This 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.
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
* Basic initialization for I386 - ISA bus machines.
*/
-#include <cpus.h>
#include <platforms.h>
#include <mach_kdb.h>
#include <himem.h>
-#include <fast_idle.h>
#include <mach/i386/vm_param.h>
#include <kern/misc_protos.h>
#include <kern/startup.h>
#include <kern/clock.h>
-#include <kern/time_out.h>
#include <kern/cpu_data.h>
+#include <kern/machine.h>
#include <i386/fpu.h>
#include <i386/ipl.h>
#include <i386/pio.h>
#include <i386/misc_protos.h>
-#include <i386/rtclock_entries.h>
#include <i386/mp.h>
+#include <i386/mtrr.h>
+#include <i386/postcode.h>
#include <pexpert/i386/boot.h>
#if MACH_KDB
#include <ddb/db_aout.h>
#endif /* MACH_KDB */
-#if NCPUS > 1
#include <i386/mp_desc.h>
-#endif /* NCPUS */
-
-#if NCPUS > 1
#include <i386/mp.h>
-#endif /* NCPUS > 1 */
#include <IOKit/IOPlatformExpert.h>
+void enable_bluebox(void);
+void disable_bluebox(void);
+
static void machine_conf(void);
#include <i386/cpuid.h>
+extern int default_preemption_rate;
+extern int max_unsafe_quanta;
+extern int max_poll_quanta;
+extern int idlehalt;
+extern unsigned int panic_is_inited;
+
void
machine_startup()
{
#endif /* MACH_KDB */
if (PE_parse_boot_arg("preempt", &boot_arg)) {
- extern int default_preemption_rate;
-
default_preemption_rate = boot_arg;
}
if (PE_parse_boot_arg("unsafe", &boot_arg)) {
- extern int max_unsafe_quanta;
-
max_unsafe_quanta = boot_arg;
}
if (PE_parse_boot_arg("poll", &boot_arg)) {
- extern int max_poll_quanta;
-
max_poll_quanta = boot_arg;
}
if (PE_parse_boot_arg("yield", &boot_arg)) {
- extern int sched_poll_yield_shift;
-
sched_poll_yield_shift = boot_arg;
}
+ if (PE_parse_boot_arg("idlehalt", &boot_arg)) {
+ idlehalt = boot_arg;
+ }
machine_conf();
/*
* Start the system.
*/
- setup_main();
-
- /* Should never return */
+ kernel_bootstrap();
+ /*NOTREACHED*/
}
static void
machine_conf(void)
{
- machine_info.max_cpus = NCPUS;
- machine_info.avail_cpus = 1;
machine_info.memory_size = mem_size;
}
void
machine_init(void)
{
- int unit;
- const char *p;
- int n;
-
/*
* Display CPU identification
*/
cpuid_feature_display("CPU features", 0);
-#if NCPUS > 1
smp_init();
-#endif
/*
* Set up to use floating point.
* Configure clock devices.
*/
clock_config();
+
+ /*
+ * Initialize MTRR from boot processor.
+ */
+ mtrr_init();
+
+ /*
+ * Set up PAT for boot processor.
+ */
+ pat_init();
+
+ /*
+ * Free lowmem pages
+ */
+ x86_lowmem_free();
}
/*
/*
* Tell the BIOS not to clear and test memory.
*/
+#if 0 /* XXX fixme */
if (!reset_mem_on_reboot)
*(unsigned short *)phystokv(0x472) = 0x1234;
+#endif
printf("MACH Reboot\n");
PEHaltRestart( kPERestartCPU );
/*XXX*/
void fc_get(mach_timespec_t *ts);
#include <kern/clock.h>
-#include <i386/rtclock_entries.h>
extern kern_return_t sysclk_gettime(
mach_timespec_t *cur_time);
void fc_get(mach_timespec_t *ts) {
Debugger(
const char *message)
{
+
+ if (!panic_is_inited) {
+ postcode(PANIC_HLT);
+ asm("hlt");
+ }
+
printf("Debugger called: <%s>\n", message);
+ kprintf("Debugger called: <%s>\n", message);
draw_panic_dialog();
}
void
-display_syscall(int syscall)
+enable_bluebox(void)
{
- printf("System call happened %d\n", syscall);
}
-
-#if XPR_DEBUG && (NCPUS == 1)
-
-extern kern_return_t sysclk_gettime_interrupts_disabled(
- mach_timespec_t *cur_time);
-
-int xpr_time(void)
-{
- mach_timespec_t time;
-
- sysclk_gettime_interrupts_disabled(&time);
- return(time.tv_sec*1000000 + time.tv_nsec/1000);
-}
-#endif /* XPR_DEBUG && (NCPUS == 1) */
-
-enable_bluebox()
-{
-}
-disable_bluebox()
+void
+disable_bluebox(void)
{
}
char *
-machine_boot_info(char *buf, vm_size_t size)
+machine_boot_info(char *buf, __unused vm_size_t size)
{
*buf ='\0';
return buf;