generic.c revision 459190a5c46206e7885f6a649a055ceb46be49a7
/*
* 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/machparam.h>
#include <sys/machsystm.h>
#include <sys/elf_SPARC.h>
#include <vm/hat_sfmmu.h>
#include <sys/dditypes.h>
#include <sys/cpu_module.h>
#include <sys/prom_debug.h>
#include <sys/prom_plat.h>
#include <sys/sysmacros.h>
#include <sys/machtrap.h>
#include <sys/simulate.h>
void
cpu_setup(void)
{
extern int mmu_exported_pagesize_mask;
char *generic_isa_set[] = {
"sparcv9+vis",
"sparcv8plus+vis",
};
/*
* The setup common to all CPU modules is done in cpu_setup_common
* routine.
*/
if (broken_md_flag) {
/*
* Turn on the missing bits supported by sun4v architecture in
* MMU pagesize mask returned by MD.
*/
} else {
/*
* According to sun4v architecture each processor must
* support 8K, 64K and 4M page sizes. If any of the page
* size is missing from page size mask, then panic.
*/
if ((mmu_exported_pagesize_mask &
" does not have required sun4v page sizes"
" 8K, 64K and 4M: MD mask is 0x%x",
}
/*
* If processor supports the subset of full 64-bit virtual
* address space, then set VA hole accordingly.
*/
if (va_bits < VA_ADDRESS_SPACE_BITS) {
} else {
hole_start = hole_end = 0;
}
}
void
{
/*
* The Cache node is optional in MD. Therefore in case "Cache"
* does not exists in MD, set the default L2 cache associativity,
* size, linesize for generic CPU module.
*/
if (cpunode->ecache_size == 0)
if (cpunode->ecache_linesize == 0)
if (cpunode->ecache_associativity == 0)
}
void
{
if (pfn != -1) {
/* sparc needs 8-byte align */
}
}
}
void
{
/*
* The cpu_ipipe and cpu_fpu fields are initialized based on
* the execution unit sharing information from the MD. They
* default to the CPU id in the absence of such information.
*/
}
void
{
}
/*ARGSUSED*/
void
{}
/*
* Invalidate a TSB. Since this needs to work on all sun4v
* architecture compliant processors, we use the old method of
* walking the TSB, setting each tag to TSBTAG_INVALID.
*/
void
{
tsbaddr++) {
}
}
/*
* Sun4v kernel must emulate code a generic sun4v processor may not support
* i.e. VIS1 and VIS2.
*/
#define IS_FLOAT(i) (((i) & 0x1000000) != 0)
#define IS_IBIT_SET(x) (x & 0x2000)
int
{
char *badaddr;
int instr;
return (-1);
if (IS_IBIT_SET(instr)) {
} else {
}
return (-1);
}
case SIMU_RETRY:
break; /* regs are already set up */
/*NOTREACHED*/
case SIMU_SUCCESS:
/*
* skip the successfully
* simulated instruction
*/
break;
/*NOTREACHED*/
case SIMU_FAULT:
break;
case SIMU_DZERO:
break;
case SIMU_UNALIGN:
break;
case SIMU_ILLEGAL:
default:
(op3 == IOP_V8_STDFA)))
else
break;
}
return (0);
}
/*
* Trapstat support for generic sun4v processor
*/
int
cpu_trapstat_conf(int cmd)
{
int status;
switch (cmd) {
case CPU_TSTATCONF_INIT:
case CPU_TSTATCONF_FINI:
case CPU_TSTATCONF_ENABLE:
case CPU_TSTATCONF_DISABLE:
break;
default:
break;
}
return (status);
}
/*ARGSUSED*/
void
{
}