6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * CDDL HEADER START
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * The contents of this file are subject to the terms of the
2f48339a0c14421b8826b39fc3ab783a064cb77bjc * Common Development and Distribution License (the "License").
2f48339a0c14421b8826b39fc3ab783a064cb77bjc * You may not use this file except in compliance with the License.
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * See the License for the specific language governing permissions
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * and limitations under the License.
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * When distributing Covered Code, include this CDDL HEADER in each
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * If applicable, add the following below this CDDL HEADER, with the
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * fields enclosed by brackets "[]" replaced with your own identifying
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * information: Portions Copyright [yyyy] [name of copyright owner]
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * CDDL HEADER END
050c9ebdc9d01dca610febe083c1796c5e013868td * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * Use is subject to license terms.
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * Support routines for managing per-CPU state.
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien * The unused argument 'clcode' is needed for our sun4v sibling.
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien/*ARGSUSED*/
6dfee4834394825da35b977ca71cdc965bc7b6a4tsiencmd_xr_fill(fmd_hdl_t *hdl, nvlist_t *nvl, cmd_xr_t *xr, cmd_errcl_t clcode)
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien if (nvlist_lookup_uint16(nvl, FM_EREPORT_PAYLOAD_NAME_SYND,
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien return (-1);
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien if (nvlist_lookup_uint8(nvl, FM_EREPORT_PAYLOAD_NAME_SYND_STATUS,
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien return (-1);
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_NAME_AFAR,
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien return (-1);
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien if (nvlist_lookup_uint8(nvl, FM_EREPORT_PAYLOAD_NAME_AFAR_STATUS,
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien return (-1);
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien return (0);
050c9ebdc9d01dca610febe083c1796c5e013868td * Search for the entry that matches the ena and the AFAR
050c9ebdc9d01dca610febe083c1796c5e013868td * if we have a valid AFAR, otherwise just match the ENA
050c9ebdc9d01dca610febe083c1796c5e013868tdcmd_trw_lookup(uint64_t ena, uint8_t afar_status, uint64_t afar)
050c9ebdc9d01dca610febe083c1796c5e013868td/*ARGSUSED*/
050c9ebdc9d01dca610febe083c1796c5e013868tdcmd_train_match(cmd_errcl_t trw_mask, cmd_errcl_t resolved_err)
050c9ebdc9d01dca610febe083c1796c5e013868td/*ARGSUSED*/
050c9ebdc9d01dca610febe083c1796c5e013868tdcmd_afar_status_check(uint8_t afar_status, cmd_errcl_t clcode)
050c9ebdc9d01dca610febe083c1796c5e013868td return (0);
050c9ebdc9d01dca610febe083c1796c5e013868td return (-1);
050c9ebdc9d01dca610febe083c1796c5e013868td { &cmd.cmd_l3data_serd, "l3cachedata", CMD_PTR_CPU_L3DATA };
050c9ebdc9d01dca610febe083c1796c5e013868td { &cmd.cmd_l2data_serd, "l2cachedata", CMD_PTR_CPU_L2DATA };
050c9ebdc9d01dca610febe083c1796c5e013868tdcmd_fill_errdata(cmd_errcl_t clcode, cmd_cpu_t *cpu, cmd_case_t **cc,
050c9ebdc9d01dca610febe083c1796c5e013868td/*ARGSUSED*/
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien return (-1);
6dfee4834394825da35b977ca71cdc965bc7b6a4tsien return (0);
a255420765b0b2d93935f09709ebad35f6aa7ee3jc/*ARGSUSED*/
2f48339a0c14421b8826b39fc3ab783a064cb77bjccmd_afar_valid(fmd_hdl_t *hdl, nvlist_t *nvl, cmd_errcl_t clcode,
2f48339a0c14421b8826b39fc3ab783a064cb77bjc FM_EREPORT_PAYLOAD_NAME_AFAR_STATUS, &afar_status) == 0) {
2f48339a0c14421b8826b39fc3ab783a064cb77bjc return (0);
2f48339a0c14421b8826b39fc3ab783a064cb77bjc return (-1);
14ea4bb737263733ad80a36b4f73f681c30a6b45sd return (-1);
14ea4bb737263733ad80a36b4f73f681c30a6b45sd if ((ksp = kstat_lookup(kc, "cpu_info", cpuid, NULL)) == NULL ||
14ea4bb737263733ad80a36b4f73f681c30a6b45sd for (kn = ksp->ks_data, i = 0; i < ksp->ks_ndata; i++, kn++) {
14ea4bb737263733ad80a36b4f73f681c30a6b45sd/*ARGSUSED*/
14ea4bb737263733ad80a36b4f73f681c30a6b45sd/*ARGSUSED*/
13faa91230bde46da937bf33010b9accc5bdeb59sd/*ARGSUSED*/
13faa91230bde46da937bf33010b9accc5bdeb59sdcmd_cpu_mkfru(fmd_hdl_t *hdl, char *frustr, char *serialstr, char *partstr)
e97130129ddee9f8432c6fff2dac3c6765280066tsien if (strncmp(frustr, CPU_FRU_FMRI, sizeof (CPU_FRU_FMRI) - 1) != 0)
e97130129ddee9f8432c6fff2dac3c6765280066tsien nvlist_add_string(hcelem, FM_FMRI_HC_ID, comp) != 0) {
e97130129ddee9f8432c6fff2dac3c6765280066tsien if (nvlist_add_uint8(fru, FM_VERSION, FM_HC_SCHEME_VERSION) != 0 ||
e97130129ddee9f8432c6fff2dac3c6765280066tsien nvlist_add_string(fru, FM_FMRI_SCHEME, FM_FMRI_SCHEME_HC) != 0 ||
13faa91230bde46da937bf33010b9accc5bdeb59sd nvlist_add_string(fru, FM_FMRI_HC_PART, partstr) != 0) ||
e97130129ddee9f8432c6fff2dac3c6765280066tsien nvlist_add_nvlist_array(fru, FM_FMRI_HC_LIST, &hcelem, 1) != 0) {
3f1e69bef33050bee99ea1e9992af13fc467281fCheng Sean Yecmd_nvl_create_fault(fmd_hdl_t *hdl, const char *class, uint8_t cert,
3f1e69bef33050bee99ea1e9992af13fc467281fCheng Sean Ye nvlist_t *asru, nvlist_t *fru, nvlist_t *rsrc)
3f1e69bef33050bee99ea1e9992af13fc467281fCheng Sean Ye (void) nvlist_add_nvlist(fru, FM_FMRI_AUTHORITY,