mlsetup.c revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/archsystm.h>
#include <sys/machsystm.h>
#include <sys/autoconf.h>
#include <sys/prom_plat.h>
#include <vm/hat_sfmmu.h>
#include <sys/sysmacros.h>
#include <sys/machtrap.h>
#include <sys/privregs.h>
#include <sys/cpu_module.h>
#include <sys/prom_debug.h>
#include <sys/traptrace.h>
/*
* External Routines:
*/
extern void map_wellknown_devices(void);
extern void hsvc_setup(void);
extern void mach_descrip_startup_init(void);
extern void mach_soft_state_init(void);
int dcache_size;
int dcache_linesize;
int icache_size;
int icache_linesize;
int ecache_size;
int ecache_alignsize;
int ecache_associativity;
int ecache_setsize; /* max possible e$ setsize */
int cpu_setsize; /* max e$ setsize of configured cpus */
int dcache_line_mask; /* spitfire only */
int vac_size; /* cache size in bytes */
int vac_shift; /* log2(vac_size) for ppmapout() */
int vac = 0; /* virtual address cache type (none == 0) */
/*
* fpRAS. An individual sun4* machine class (or perhaps subclass,
* the fpRAS feature. The feature can be suppressed by setting fpras_disable
* or the mechanism can be disabled for individual copy operations with
* fpras_disableids. All these are checked in post_startup() code so
* definitions will need to move up to the common level.
*/
int fpras_implemented;
int fpras_disable;
int fpras_disableids;
/*
* Static Routines:
*/
static void kern_splr_preprom(void);
static void kern_splx_postprom(void);
/*
* Setup routine called right before main(). Interposing this function
* before main() allows us to call it in a machine-independent fashion.
*/
void
{
extern char t0stack[];
extern struct classfuncs sys_classfuncs;
unsigned long long pa;
#ifdef TRAPTRACE
#endif /* TRAPTRACE */
/*
* initialize cpu_self
*/
/*
* initialize t0
*/
/* Can't use va_to_pa here - wait until prom_ initialized */
p0.p_stkpageszc = 0;
p0.p_brkpageszc = 0;
/*
*/
/*
* Initialize lists of available and active CPUs.
*/
(void) prom_set_preprom(kern_splr_preprom);
(void) prom_set_postprom(kern_splx_postprom);
PRM_INFO("mlsetup: now ok to call prom_printf");
/*
* Claim the physical and virtual resources used by panicbuf,
* then map panicbuf. This operation removes the phys and
* virtual addresses from the free lists.
*/
prom_panic("Can't claim panicbuf virtual address");
prom_panic("Can't allocate retained panicbuf physical address");
prom_panic("Can't map panicbuf");
/*
* Negotiate hypervisor services, if any
*/
hsvc_setup();
#ifdef TRAPTRACE
/*
* initialize the trap trace buffer for the boot cpu
* XXX todo, dynamically allocate this buffer too
*/
#endif /* TRAPTRACE */
/*
* Initialize the Machine Description kernel framework
*/
/*
* initialize HV trap trace buffer for the boot cpu
*/
/*
* lgroup framework initialization. This must be done prior
* to devices being mapped.
*/
lgrp_init();
cpu_setup();
prom_printf("unix: kernel halted by -h flag\n");
}
setcputype();
setcpudelay();
}
/*
* These routines are called immediately before and
* immediately after calling into the firmware. The
* firmware is significantly confused by preemption -
* particularly on MP machines - but also on UP's too.
*/
static int saved_spl;
static void
kern_splr_preprom(void)
{
}
static void
kern_splx_postprom(void)
{
}