chip_label.c (64d1d4ab) chip_label.c (f2dbfd32)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 8 unchanged lines hidden (view full) ---

17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 8 unchanged lines hidden (view full) ---

17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 *
26 * Copyright 2019, Joyent, Inc.
25 */
26
27#include <stdio.h>
28#include <stdlib.h>
29#include <stdarg.h>
30#include <string.h>
31#include <strings.h>
32#include <libnvpair.h>

--- 523 unchanged lines hidden (view full) ---

556
557 for (i = 0; i < ncpu; i++) {
558 if (nvlist_lookup_int32(cpus[i], FM_PHYSCPU_INFO_CHIP_ID,
559 &chipid) != 0 || chipid >= 64) {
560 topo_mod_dprintf(mod, "lookup chipid failed\n");
561 nchip = -1;
562 break;
563 }
27 */
28
29#include <stdio.h>
30#include <stdlib.h>
31#include <stdarg.h>
32#include <string.h>
33#include <strings.h>
34#include <libnvpair.h>

--- 523 unchanged lines hidden (view full) ---

558
559 for (i = 0; i < ncpu; i++) {
560 if (nvlist_lookup_int32(cpus[i], FM_PHYSCPU_INFO_CHIP_ID,
561 &chipid) != 0 || chipid >= 64) {
562 topo_mod_dprintf(mod, "lookup chipid failed\n");
563 nchip = -1;
564 break;
565 }
564 if ((bitmap & (1 << chipid)) != 0) {
565 bitmap |= (1 << chipid);
566 if ((bitmap & (1ULL << chipid)) != 0) {
567 bitmap |= (1ULL << chipid);
566 nchip++;
567 }
568 }
569
570 for (i = 0; i < ncpu; i++)
571 nvlist_free(cpus[i]);
572 umem_free(cpus, sizeof (nvlist_t *) * ncpu);
573

--- 81 unchanged lines hidden (view full) ---

655 * i.e.: CPU %d DIMM %d
656 *
657 * offset: a numeric offset that we'll number the dimms from. This is to
658 * allow for the fact that some systems may number the dimm slots
659 * from zero while others may start from one
660 *
661 * This function computes the DIMM slot number using the following formula:
662 *
568 nchip++;
569 }
570 }
571
572 for (i = 0; i < ncpu; i++)
573 nvlist_free(cpus[i]);
574 umem_free(cpus, sizeof (nvlist_t *) * ncpu);
575

--- 81 unchanged lines hidden (view full) ---

657 * i.e.: CPU %d DIMM %d
658 *
659 * offset: a numeric offset that we'll number the dimms from. This is to
660 * allow for the fact that some systems may number the dimm slots
661 * from zero while others may start from one
662 *
663 * This function computes the DIMM slot number using the following formula:
664 *
663 * slot = cs - (cs % 2) + channel + offset
665 * slot = cs - (cs % 2) + channel + offset
664 */
665/* ARGSUSED */
666int
667simple_cs_label_mp(topo_mod_t *mod, tnode_t *node, topo_version_t vers,
668 nvlist_t *in, nvlist_t **out)
669{
670 char *fmtstr, buf[BUFSZ];
671 tnode_t *chip, *chan;

--- 154 unchanged lines hidden ---
666 */
667/* ARGSUSED */
668int
669simple_cs_label_mp(topo_mod_t *mod, tnode_t *node, topo_version_t vers,
670 nvlist_t *in, nvlist_t **out)
671{
672 char *fmtstr, buf[BUFSZ];
673 tnode_t *chip, *chan;

--- 154 unchanged lines hidden ---