/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/systeminfo.h>
#if defined(__x86)
#endif /* __x86 */
/*
* The driver's capabilities are strictly versioned, allowing userland patching
* without a reboot. The userland should start with a FM_VERSIONS ioctl to
* query the versions of the kernel interfaces, then it's all userland's
* responsibility to prepare arguments etc to match the current kenrel.
* The version of FM_VERSIONS itself is FM_DRV_VERSION.
*/
typedef struct fm_version {
} fm_vers_t;
typedef struct fm_subroutine {
} fm_subr_t;
{ FM_PAGE_OP_VERSION, 1 },
{ FM_CPU_OP_VERSION, 1 },
{ FM_CPU_INFO_VERSION, 1 },
{ FM_TOPO_LEGACY_VERSION, 1 },
{ NULL, 0 }
};
#if defined(__x86)
#endif /* __x86 */
};
static int
{
switch (cmd) {
case DDI_ATTACH:
return (DDI_FAILURE);
}
break;
case DDI_RESUME:
break;
default:
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
switch (cmd) {
case DDI_DETACH:
break;
default:
ret = DDI_FAILURE;
}
return (ret);
}
/*ARGSUSED*/
static int
{
int error;
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
error = DDI_SUCCESS;
break;
case DDI_INFO_DEVT2INSTANCE:
error = DDI_SUCCESS;
break;
default:
error = DDI_FAILURE;
}
return (error);
}
/*ARGSUSED1*/
static int
{
return (EINVAL);
return (ENXIO);
return (0);
}
/*ARGSUSED*/
static int
{
int err;
return (err);
}
/*
* Given a mem-scheme FMRI for a page, execute the given page retire
* command on it.
*/
/*ARGSUSED*/
static int
{
int err;
if (is_i86xpv)
return (ENOTSUP);
!= 0)
return (err);
return (err);
switch (cmd) {
case FM_IOC_PAGE_STATUS:
case FM_IOC_PAGE_RETIRE:
case FM_IOC_PAGE_UNRETIRE:
return (page_unretire(pa));
}
return (ENOTTY);
}
/*ARGSUSED*/
static int
{
char *buf;
int err;
#ifdef _MULTI_DATAMODEL
#endif
return (ENXIO);
return (ENOTTY);
secpolicy_sys_config(CRED(), 0) != 0)
return (EPERM);
switch (model) {
#ifdef _MULTI_DATAMODEL
case DDI_MODEL_ILP32:
sizeof (fm_ioc_data32_t), flag) != 0)
return (EFAULT);
break;
#endif /* _MULTI_DATAMODEL */
case DDI_MODEL_NONE:
default:
flag) != 0)
return (EFAULT);
}
return (ENOTSUP);
return (ENAMETOOLONG);
return (EINVAL);
/*
* Copy in and unpack the input nvlist.
*/
return (EFAULT);
}
if (err != 0)
return (err);
}
if (err != 0) {
return (err);
}
/*
* If the output nvlist contains any data, pack it and copyout.
*/
return (err);
}
return (ENAMETOOLONG);
}
KM_SLEEP)) != 0) {
return (err);
}
return (EFAULT);
}
switch (model) {
#ifdef _MULTI_DATAMODEL
case DDI_MODEL_ILP32:
sizeof (fm_ioc_data32_t), flag) != 0)
return (EFAULT);
break;
#endif /* _MULTI_DATAMODEL */
case DDI_MODEL_NONE:
default:
sizeof (fm_ioc_data_t), flag) != 0)
return (EFAULT);
}
}
return (err);
}
fm_open, /* open */
nulldev, /* close */
nodev, /* strategy */
nodev, /* print */
nodev, /* dump */
nodev, /* read */
nodev, /* write */
fm_ioctl, /* ioctl */
nodev, /* devmap */
nodev, /* mmap */
nodev, /* segmap */
nochpoll, /* poll */
ddi_prop_op, /* prop_op */
NULL, /* streamtab */
};
DEVO_REV, /* devo_rev, */
0, /* refcnt */
fm_info, /* get_dev_info */
nulldev, /* identify */
nulldev, /* probe */
fm_attach, /* attach */
fm_detach, /* detach */
nodev, /* reset */
&fm_cb_ops, /* driver operations */
(struct bus_ops *)0 /* bus operations */
};
};
};
int
_init(void)
{
const fm_vers_t *p;
int ret;
p->version);
}
return (ret);
}
int
{
}
int
_fini(void)
{
int ret;
}
return (ret);
}