mp_implfuncs.c revision 5f890c5ea34c9c865176a1fbac1b73191b061c1c
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <vm/seg_kmem.h>
#define PSMI_1_6
#include <sys/psm_modctl.h>
#include <sys/smp_impldefs.h>
#if defined(__xpv)
#include <sys/hypervisor.h>
#include <vm/kboot_mmu.h>
#endif
/*
* External reference functions
*/
extern void *get_next_mach(void *, char *);
extern void close_mach_list(void);
extern void open_mach_list(void);
/*
* from startup.c - kernel VA range allocator for device mappings
*/
void psm_modloadonly(void);
void psm_install(void);
/*
* Local Function Prototypes
*/
static char *psm_get_impl_module(int first);
struct mod_ops mod_psmops = {
};
};
static struct modlinkage *
{
int memsz;
struct modlinkage *mlinkp;
sizeof (struct psm_sw);
if (!mlinkp) {
return (NULL);
}
return (mlinkp);
}
static void
{
if (!mlinkp)
return;
}
int
{
int status;
struct modlinkage *mlinkp;
if (!*modlpp) {
if (!mlinkp)
return (ENOSPC);
} else
if (status) {
} else
return (status);
}
/*ARGSUSED1*/
int
{
int status;
if (status == 0) {
}
return (status);
}
int
{
int status;
struct modlinkage *mlinkp;
if (!*modlpp) {
if (!mlinkp)
return ((int)NULL);
} else
if (!status) {
} else
return (status);
}
int
{
}
int
{
}
psm_get_cpu_id(void)
{
}
{
if (len == 0)
return (0);
#ifdef __xpv
/*
* If we're dom0, we're starting from a MA. translate that to a PA
* XXPV - what about driver domains???
*/
if (DOMAIN_IS_INITDOMAIN(xen_info)) {
(addr & MMU_PAGEOFFSET);
} else {
}
#else
#endif
return (0);
}
void
{
if (len == 0)
return;
}
{
if (prot & PSM_PROT_WRITE)
phys_prot |= PROT_WRITE;
}
{
}
{
}
void
{
if (len == 0)
return;
}
/*ARGSUSED1*/
static int
{
return (0);
}
/*ARGSUSED1*/
static int
{
return (EBUSY);
}
return (0);
}
return (0);
}
/*ARGSUSED1*/
static int
{
return (0);
}
#if defined(__xpv)
#define DEFAULT_PSM_MODULE "xpv_uppc"
#else
#define DEFAULT_PSM_MODULE "uppc"
#endif
static char *
psm_get_impl_module(int first)
{
static char **pnamep;
static char *psm_impl_module_list[] = {
(char *)0
};
static char machname[MAXNAMELEN];
if (first)
if (*pnamep != (char *)0)
return (*pnamep++);
if (mhdl)
return (machname);
return ((char *)0);
}
void
psm_modload(void)
{
char *this;
this = psm_get_impl_module(0)) {
}
}
#if defined(__xpv)
#define NOTSUP_MSG "This version of Solaris xVM does not support this hardware"
#else
#define NOTSUP_MSG "This version of Solaris does not support this hardware"
#endif /* __xpv */
void
psm_install(void)
{
char machstring[15];
psmcnt++;
continue;
}
}
/* remove the unsuccessful psm modules */
if (err)
&machstring[0], err);
}
if (psmcnt == 0)
(*psminitf)();
}
/*
* Return 1 if kernel debugger is present, and 0 if not.
*/
int
psm_debugger(void)
{
}