diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-08-16 11:15:20 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-08-16 11:15:20 +0000 |
commit | 0833839f60181af6fcf14de327d3ba2b30da8ed2 (patch) | |
tree | af7f3254e70fb8ad910d460648f9af42c0210457 /usr/src/lib | |
parent | adf665b5e735d87cf7d6b4e8932fb7dce88e42ad (diff) | |
parent | d3b5f56344d8bfcdd6cfb82446af0e5e55ad9ebe (diff) | |
download | illumos-joyent-0833839f60181af6fcf14de327d3ba2b30da8ed2.tar.gz |
[illumos-gate merge]
commit d3b5f56344d8bfcdd6cfb82446af0e5e55ad9ebe
11528 Makefile.noget can get gone
11529 Use -Wno-maybe-initialized
commit c4ccc1f9004b70b07e4cdb57641c38ab607306c9
11226 Remove NetraCT support
commit dcfeff93f67a1188722a358e0fbfcd604993e573
11561 loader script needs to place .eh_frame after .text
commit a8ffe4975d219124d53dcd9de30126f3a595d28f
11555 gptzfsboot: boot prompt is not refreshed on device change
commit 79940ff6ac581ff9431c474dcfa18c78f1cb7a50
11556 ip_attr.c functions need to not dereference conn_ixa directly after lock drop
commit fe949611d4f0a0f42a6923a31cd3073e5b2bc97c
10540 wsdiff much slower under python3 than python2
commit c1064fd7ce62fe763a4475e9988ffea3b22137de
11541 allocation_classes feature must be enabled to add log device
Conflicts:
usr/src/uts/sparc/Makefile.sparc
usr/src/uts/intel/dev/Makefile
usr/src/uts/i86pc/pcie/Makefile
usr/src/cmd/zoneadmd/Makefile
Diffstat (limited to 'usr/src/lib')
155 files changed, 178 insertions, 3932 deletions
diff --git a/usr/src/lib/abi/apptrace/Makefile.com b/usr/src/lib/abi/apptrace/Makefile.com index 224209a71d..8f760ac522 100644 --- a/usr/src/lib/abi/apptrace/Makefile.com +++ b/usr/src/lib/abi/apptrace/Makefile.com @@ -32,7 +32,7 @@ include ../../Makefile.abi LIBS = $(DYNLIB) CPPFLAGS = -I. $(CPPFLAGS.master) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # No mapfile here MAPFILES = diff --git a/usr/src/lib/auditd_plugins/syslog/Makefile.com b/usr/src/lib/auditd_plugins/syslog/Makefile.com index 624707fa3f..57f13b9b3c 100644 --- a/usr/src/lib/auditd_plugins/syslog/Makefile.com +++ b/usr/src/lib/auditd_plugins/syslog/Makefile.com @@ -49,7 +49,7 @@ CPPFLAGS += -I$(PRAUDIT) CPPFLAGS += -I$(LIBBSM) CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/brand/solaris10/s10_brand/Makefile.com b/usr/src/lib/brand/solaris10/s10_brand/Makefile.com index 242ef383b7..2402984c2e 100644 --- a/usr/src/lib/brand/solaris10/s10_brand/Makefile.com +++ b/usr/src/lib/brand/solaris10/s10_brand/Makefile.com @@ -86,7 +86,7 @@ LDLIBS += -lc -lmapmalloc LINTFLAGS += -erroff=E_STATIC_UNUSED LINTFLAGS64 += -erroff=E_STATIC_UNUSED -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) $(LIBS):= PICS += $(SHAREDOBJS) diff --git a/usr/src/lib/cfgadm_plugins/Makefile.com b/usr/src/lib/cfgadm_plugins/Makefile.com index 7cfd1df65c..142d4f3314 100644 --- a/usr/src/lib/cfgadm_plugins/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/Makefile.com @@ -38,9 +38,6 @@ LINKED_PLATFORMS = SUNW,Ultra-2 LINKED_PLATFORMS += SUNW,Ultra-4 LINKED_PLATFORMS += SUNW,Ultra-250 LINKED_PLATFORMS += SUNW,Ultra-Enterprise -LINKED_PLATFORMS += SUNW,UltraSPARC-IIi-Netract -LINKED_PLATFORMS += SUNW,UltraSPARC-IIe-NetraCT-40 -LINKED_PLATFORMS += SUNW,UltraSPARC-IIe-NetraCT-60 LINKED_PLATFORMS += SUNW,Sun-Blade-100 LINKED_PLATFORMS += SUNW,Sun-Blade-1000 LINKED_PLATFORMS += SUNW,Sun-Blade-1500 @@ -60,7 +57,6 @@ LINKED_PLATFORMS += SUNW,Sun-Fire-V490 LINKED_PLATFORMS += SUNW,Serverblade1 LINKED_PLATFORMS += SUNW,Netra-T12 LINKED_PLATFORMS += SUNW,Netra-T4 -LINKED_PLATFORMS += SUNW,Netra-CP2300 LINKED_PLATFORMS += SUNW,Netra-CP3010 LINKED_DIRS = $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%) diff --git a/usr/src/lib/cfgadm_plugins/fp/Makefile.com b/usr/src/lib/cfgadm_plugins/fp/Makefile.com index e319918c1b..f2cc0b2c64 100644 --- a/usr/src/lib/cfgadm_plugins/fp/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/fp/Makefile.com @@ -47,7 +47,7 @@ CFLAGS64 += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-address diff --git a/usr/src/lib/cfgadm_plugins/ib/Makefile.com b/usr/src/lib/cfgadm_plugins/ib/Makefile.com index 97a2a1816b..d027235875 100644 --- a/usr/src/lib/cfgadm_plugins/ib/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/ib/Makefile.com @@ -46,7 +46,7 @@ CFLAGS64 += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value # not linted diff --git a/usr/src/lib/cfgadm_plugins/pci/Makefile.com b/usr/src/lib/cfgadm_plugins/pci/Makefile.com index 7abe51ddef..33324f565b 100644 --- a/usr/src/lib/cfgadm_plugins/pci/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/pci/Makefile.com @@ -50,7 +50,7 @@ LDLIBS += -lc -ldevice -ldevinfo -lrcm CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/cfgadm_plugins/sata/Makefile.com b/usr/src/lib/cfgadm_plugins/sata/Makefile.com index 1526413a4e..6859fdde2a 100644 --- a/usr/src/lib/cfgadm_plugins/sata/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/sata/Makefile.com @@ -45,7 +45,7 @@ CFLAGS64 += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) LDLIBS += -lc -ldevice -ldevinfo -lrcm -lnvpair diff --git a/usr/src/lib/cfgadm_plugins/sbd/Makefile.com b/usr/src/lib/cfgadm_plugins/sbd/Makefile.com index 39e160404a..2b8f7f5272 100644 --- a/usr/src/lib/cfgadm_plugins/sbd/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/sbd/Makefile.com @@ -50,7 +50,7 @@ LDLIBS += -lc -lkstat -lnvpair CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/cfgadm_plugins/scsi/Makefile.com b/usr/src/lib/cfgadm_plugins/scsi/Makefile.com index 0b75b01975..558f0327df 100644 --- a/usr/src/lib/cfgadm_plugins/scsi/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/scsi/Makefile.com @@ -41,7 +41,7 @@ LIBS= $(DYNLIB) CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-address # not linted diff --git a/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com b/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com index e099697a93..6bd681a4a7 100644 --- a/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com @@ -50,7 +50,7 @@ LIBS= $(DYNLIB) CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-address CERRWARN += -_gcc=-Wno-char-subscripts diff --git a/usr/src/lib/cfgadm_plugins/shp/Makefile.com b/usr/src/lib/cfgadm_plugins/shp/Makefile.com index 8771bcced3..f870d9c700 100644 --- a/usr/src/lib/cfgadm_plugins/shp/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/shp/Makefile.com @@ -50,7 +50,7 @@ LDLIBS += -lc -ldevinfo -lhotplug CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable # not linted diff --git a/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com b/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com index f25d1771d0..8fc548cc33 100644 --- a/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com @@ -55,7 +55,7 @@ CPPFLAGS += -I$(ROOT)/usr/platform/$(PLATFORM)/include CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/cfgadm_plugins/usb/Makefile.com b/usr/src/lib/cfgadm_plugins/usb/Makefile.com index 833c9a6a6d..d1bb4af578 100644 --- a/usr/src/lib/cfgadm_plugins/usb/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/usb/Makefile.com @@ -46,7 +46,7 @@ CFLAGS64 += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value # not linted diff --git a/usr/src/lib/efcode/Makefile.efcode b/usr/src/lib/efcode/Makefile.efcode index b88f04d40a..5bf50c353f 100644 --- a/usr/src/lib/efcode/Makefile.efcode +++ b/usr/src/lib/efcode/Makefile.efcode @@ -50,7 +50,7 @@ CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-type-limits EFCODE64DIR = /usr/lib/efcode/$(MACH64) diff --git a/usr/src/lib/efcode/interpreter/Makefile b/usr/src/lib/efcode/interpreter/Makefile index d7475b45bb..24dd12ef3c 100644 --- a/usr/src/lib/efcode/interpreter/Makefile +++ b/usr/src/lib/efcode/interpreter/Makefile @@ -35,7 +35,7 @@ ROOTCMDDIR = $(EFCODEDIR64) CPPFLAGS += -DDEBUG -DFCODE_INTERNAL CPPFLAGS += -I ../include -I $(ROOT)/usr/platform/sun4u/include CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) LDFLAGS += -R/usr/lib/efcode/$(MACH64) -M mapfile64 LIBS = fcode.so fcdriver.so diff --git a/usr/src/lib/fm/libfmd_log/Makefile.com b/usr/src/lib/fm/libfmd_log/Makefile.com index 6a93e83f61..6bdfd3bbe0 100644 --- a/usr/src/lib/fm/libfmd_log/Makefile.com +++ b/usr/src/lib/fm/libfmd_log/Makefile.com @@ -40,7 +40,7 @@ SRCDIR = ../common CPPFLAGS += -I../common -I. CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) LDLIBS += -lexacct -lnvpair -lgen -lc LINTFLAGS = -msux diff --git a/usr/src/lib/fm/libfmd_msg/Makefile.com b/usr/src/lib/fm/libfmd_msg/Makefile.com index 31c9047656..471a550216 100644 --- a/usr/src/lib/fm/libfmd_msg/Makefile.com +++ b/usr/src/lib/fm/libfmd_msg/Makefile.com @@ -42,7 +42,7 @@ CPPFLAGS += -I../common -I. CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += all_func_returns diff --git a/usr/src/lib/fm/libfmevent/Makefile.com b/usr/src/lib/fm/libfmevent/Makefile.com index 4243705988..81352b3076 100644 --- a/usr/src/lib/fm/libfmevent/Makefile.com +++ b/usr/src/lib/fm/libfmevent/Makefile.com @@ -61,7 +61,7 @@ CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) FMLIBDIR=usr/lib/fm $(BUILD64)FMLIBDIR64=usr/lib/fm/$(MACH64) diff --git a/usr/src/lib/fm/topo/libtopo/Makefile.com b/usr/src/lib/fm/topo/libtopo/Makefile.com index 4f397a589e..d50d99434d 100644 --- a/usr/src/lib/fm/topo/libtopo/Makefile.com +++ b/usr/src/lib/fm/topo/libtopo/Makefile.com @@ -80,7 +80,7 @@ CSTD = $(CSTD_GNU99) CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS += -D_POSIX_PTHREAD_SEMANTICS CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/lib/fm/topo/modules/Makefile.plugin b/usr/src/lib/fm/topo/modules/Makefile.plugin index 1ec87f6970..bbd7cb76e7 100644 --- a/usr/src/lib/fm/topo/modules/Makefile.plugin +++ b/usr/src/lib/fm/topo/modules/Makefile.plugin @@ -58,7 +58,7 @@ ROOTCONF = $($(CLASS)_ROOTCONF) LINTFLAGS = -msux LINTFILES = $(MODULESRCS:%.c=%.ln) $(SHAREDSRCS:%.c=%.ln) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses APIMAP = ../../../libtopo/common/topo_mod.map diff --git a/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com b/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com index 5b71525c9d..5c527bd27d 100644 --- a/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com +++ b/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com @@ -49,7 +49,7 @@ CPPFLAGS += -I../mech -I../crypto -I$(SRC)/uts/common/gssapi/include CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # needs work SMATCH=off diff --git a/usr/src/lib/gss_mechs/mech_dummy/Makefile.com b/usr/src/lib/gss_mechs/mech_dummy/Makefile.com index 4e46b287f7..d8f784220a 100644 --- a/usr/src/lib/gss_mechs/mech_dummy/Makefile.com +++ b/usr/src/lib/gss_mechs/mech_dummy/Makefile.com @@ -42,7 +42,7 @@ CPPFLAGS += -I../../libgss -I$(SRC)/uts/common/gssapi/include \ -I$(ROOT)/usr/include/gssapi CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # needs work SMATCH=off diff --git a/usr/src/lib/gss_mechs/mech_krb5/Makefile.com b/usr/src/lib/gss_mechs/mech_krb5/Makefile.com index f73f15c1a5..f60e973d26 100644 --- a/usr/src/lib/gss_mechs/mech_krb5/Makefile.com +++ b/usr/src/lib/gss_mechs/mech_krb5/Makefile.com @@ -255,7 +255,7 @@ CPPFLAGS += $(KRB5_DEFS) CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-but-set-variable diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_pwd.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_pwd.c index 150b894870..3b44373a01 100644 --- a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_pwd.c +++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/gic_pwd.c @@ -1,6 +1,10 @@ /* * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2019 Joyent, Inc. + */ + #include "k5-int.h" #include "com_err.h" #include <admin.h> @@ -519,34 +523,34 @@ krb5_error_code krb5int_populate_gic_opt ( { int i; krb5_int32 starttime; - krb5_get_init_creds_opt *opt; + krb5_get_init_creds_opt opt; - krb5_get_init_creds_opt_init(opt); + krb5_get_init_creds_opt_init(&opt); if (addrs) - krb5_get_init_creds_opt_set_address_list(opt, (krb5_address **) addrs); + krb5_get_init_creds_opt_set_address_list(&opt, (krb5_address **) addrs); if (ktypes) { for (i=0; ktypes[i]; i++); if (i) - krb5_get_init_creds_opt_set_etype_list(opt, ktypes, i); + krb5_get_init_creds_opt_set_etype_list(&opt, ktypes, i); } if (pre_auth_types) { for (i=0; pre_auth_types[i]; i++); if (i) - krb5_get_init_creds_opt_set_preauth_list(opt, pre_auth_types, i); + krb5_get_init_creds_opt_set_preauth_list(&opt, pre_auth_types, i); } if (options&KDC_OPT_FORWARDABLE) - krb5_get_init_creds_opt_set_forwardable(opt, 1); - else krb5_get_init_creds_opt_set_forwardable(opt, 0); + krb5_get_init_creds_opt_set_forwardable(&opt, 1); + else krb5_get_init_creds_opt_set_forwardable(&opt, 0); if (options&KDC_OPT_PROXIABLE) - krb5_get_init_creds_opt_set_proxiable(opt, 1); - else krb5_get_init_creds_opt_set_proxiable(opt, 0); + krb5_get_init_creds_opt_set_proxiable(&opt, 1); + else krb5_get_init_creds_opt_set_proxiable(&opt, 0); if (creds && creds->times.endtime) { krb5_timeofday(context, &starttime); if (creds->times.starttime) starttime = creds->times.starttime; - krb5_get_init_creds_opt_set_tkt_life(opt, creds->times.endtime - starttime); + krb5_get_init_creds_opt_set_tkt_life(&opt, creds->times.endtime - starttime); } - return krb5int_gic_opt_to_opte(context, opt, opte, 0, + return krb5int_gic_opt_to_opte(context, &opt, opte, 0, "krb5int_populate_gic_opt"); } diff --git a/usr/src/lib/hbaapi/Makefile.com b/usr/src/lib/hbaapi/Makefile.com index cc38763048..936d204b85 100644 --- a/usr/src/lib/hbaapi/Makefile.com +++ b/usr/src/lib/hbaapi/Makefile.com @@ -41,7 +41,7 @@ SRCDIR= ../common INCS += -I$(SRCDIR) CPPFLAGS += $(INCS) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/lib/krb5/kadm5/clnt/Makefile.com b/usr/src/lib/krb5/kadm5/clnt/Makefile.com index ba382f0ce9..7d1ba760d9 100644 --- a/usr/src/lib/krb5/kadm5/clnt/Makefile.com +++ b/usr/src/lib/krb5/kadm5/clnt/Makefile.com @@ -85,7 +85,7 @@ CFLAGS += $(CCVERBOSE) -I.. CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += all_func_returns,indenting,no_if_block diff --git a/usr/src/lib/krb5/kadm5/srv/Makefile.com b/usr/src/lib/krb5/kadm5/srv/Makefile.com index 2f5a4eda60..4242c57ff3 100644 --- a/usr/src/lib/krb5/kadm5/srv/Makefile.com +++ b/usr/src/lib/krb5/kadm5/srv/Makefile.com @@ -92,7 +92,7 @@ CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += all_func_returns,indenting diff --git a/usr/src/lib/krb5/kdb/Makefile.com b/usr/src/lib/krb5/kdb/Makefile.com index 608756d463..bf341da1be 100644 --- a/usr/src/lib/krb5/kdb/Makefile.com +++ b/usr/src/lib/krb5/kdb/Makefile.com @@ -85,7 +85,7 @@ CFLAGS += $(CCVERBOSE) -I.. CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses SMOFF += indenting,all_func_returns,deref_check,signed diff --git a/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com b/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com index e44ff025be..2715dee4aa 100644 --- a/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com @@ -68,7 +68,7 @@ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com index 0fbc9900e9..21245b1a0a 100644 --- a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com @@ -102,7 +102,7 @@ CPPFLAGS += -DHAVE_CONFIG_H \ -I$(SRC)/lib/gss_mechs/mech_krb5/include #for db-ndbm.h CFLAGS += $(CCVERBOSE) -I.. -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com b/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com index 6cf5b5dc2b..2691707bfe 100644 --- a/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com +++ b/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com @@ -65,7 +65,7 @@ CPPFLAGS += -I$(SRC)/lib/krb5 \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ -I$(SRC) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-function # not linted diff --git a/usr/src/lib/libadm/Makefile.com b/usr/src/lib/libadm/Makefile.com index 9896df06ba..5089dc1829 100644 --- a/usr/src/lib/libadm/Makefile.com +++ b/usr/src/lib/libadm/Makefile.com @@ -45,7 +45,7 @@ SRCDIR= ../common CPPFLAGS += -I ../inc CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-char-subscripts # not linted diff --git a/usr/src/lib/libads/Makefile.com b/usr/src/lib/libads/Makefile.com index 9fd803cac9..aa5fde985e 100644 --- a/usr/src/lib/libads/Makefile.com +++ b/usr/src/lib/libads/Makefile.com @@ -45,7 +45,7 @@ CPPFLAGS += -D_REENTRANT -I$(SRCDIR) -I.. # CPPFLAGS += -I$(SRC)/lib/libldap5/include/ldap CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable .KEEP_STATE: diff --git a/usr/src/lib/libadutils/Makefile.com b/usr/src/lib/libadutils/Makefile.com index 4d2f9cd5ae..107734dfdc 100644 --- a/usr/src/lib/libadutils/Makefile.com +++ b/usr/src/lib/libadutils/Makefile.com @@ -46,7 +46,7 @@ CPPFLAGS += -D_REENTRANT -I$(SRCDIR) CPPFLAGS += -I$(SRC)/lib/libldap5/include/ldap CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libast/Makefile.com b/usr/src/lib/libast/Makefile.com index 46c4dad799..b701451368 100644 --- a/usr/src/lib/libast/Makefile.com +++ b/usr/src/lib/libast/Makefile.com @@ -725,7 +725,7 @@ CFLAGS64 += \ $(ASTCFLAGS64) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-clobbered CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/libbc/sparc/Makefile b/usr/src/lib/libbc/sparc/Makefile index 1159628c21..a15a6356b1 100644 --- a/usr/src/lib/libbc/sparc/Makefile +++ b/usr/src/lib/libbc/sparc/Makefile @@ -337,7 +337,7 @@ CERRWARN += -_gcc=-Wno-implicit-function-declaration CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-extra CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-address diff --git a/usr/src/lib/libbsm/Makefile.com b/usr/src/lib/libbsm/Makefile.com index 86449984c6..86c8ebd0fb 100644 --- a/usr/src/lib/libbsm/Makefile.com +++ b/usr/src/lib/libbsm/Makefile.com @@ -87,7 +87,7 @@ CFLAGS += $(CCVERBOSE) LDLIBS += -lsocket -lnsl -lmd -lc -lsecdb -ltsol -linetutil -lscf CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index 579a2b0de7..2ba1094233 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -1027,7 +1027,7 @@ CFLAGS64 += -xinline= CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index afc7110369..76373392b2 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -1076,7 +1076,7 @@ CFLAGS += $(XINLINE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/libc/inc/thr_inlines.h b/usr/src/lib/libc/inc/thr_inlines.h index 66d811f25b..872b23c5de 100644 --- a/usr/src/lib/libc/inc/thr_inlines.h +++ b/usr/src/lib/libc/inc/thr_inlines.h @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ + #ifndef _THR_INLINES_H #define _THR_INLINES_H @@ -140,7 +144,7 @@ gethrtime(void) /* note: caller-saved registers are trashed */ extern __GNU_INLINE int set_lock_byte(volatile uint8_t *__lockp) { - int __value; + int __value = 0; #if defined(__x86) __asm__ __volatile__( "movl $1, %0\n\t" diff --git a/usr/src/lib/libc/port/fp/_base_sup.c b/usr/src/lib/libc/port/fp/_base_sup.c index 52e258d002..eb6a3fde5e 100644 --- a/usr/src/lib/libc/port/fp/_base_sup.c +++ b/usr/src/lib/libc/port/fp/_base_sup.c @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright 2019 Joyent, Inc. + */ + #include "lint.h" #include <sys/types.h> #include "base_conversion.h" @@ -88,7 +92,11 @@ __base_conversion_set_exception(fp_exception_field_type ef) * to leave it for now because it's still used by Sun's old Fortran * runtime libraries. Today this is a bug; in the days of SunOS 4.x, * when the relevant design decisions were made, it was a feature. + * + * Regardless, on 32-bit, 'quadruple' under GCC is not 128 bits, so it + * uses uninitialized memory... */ +#pragma GCC diagnostic ignored "-Wuninitialized" enum fp_class_type __class_quadruple(quadruple *x) { diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index 9f68ffd661..a750be5d98 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -24,7 +24,7 @@ # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> # Copyright 2018 Nexenta Systems, Inc. -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # Copyright 2019 Peter Tribble. # @@ -1105,7 +1105,7 @@ CFLAGS += -xinline= CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index 19efed24ae..810d3d9256 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -25,7 +25,7 @@ # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> # Copyright 2018 Nexenta Systems, Inc. -# Copyright 2018 Joyent, Inc. +# Copyright 2019 Joyent, Inc. # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # Copyright 2019 Peter Tribble. # @@ -1045,7 +1045,7 @@ CFLAGS64 += -xinline= CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/libc_db/Makefile.com b/usr/src/lib/libc_db/Makefile.com index 9fb18a576c..6dfd7e623a 100644 --- a/usr/src/lib/libc_db/Makefile.com +++ b/usr/src/lib/libc_db/Makefile.com @@ -48,7 +48,7 @@ CFLAGS += $(CCVERBOSE) LDLIBS += -lc CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libcmd/Makefile.com b/usr/src/lib/libcmd/Makefile.com index d5e09b13c8..0e8f049eef 100644 --- a/usr/src/lib/libcmd/Makefile.com +++ b/usr/src/lib/libcmd/Makefile.com @@ -135,7 +135,7 @@ CFLAGS64 += \ CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-implicit-function-declaration diff --git a/usr/src/lib/libcpc/Makefile.com b/usr/src/lib/libcpc/Makefile.com index 78ed2818ad..096cab7672 100644 --- a/usr/src/lib/libcpc/Makefile.com +++ b/usr/src/lib/libcpc/Makefile.com @@ -47,7 +47,7 @@ CPPFLAGS += -D_REENTRANT -I../common CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libcrypt/Makefile.com b/usr/src/lib/libcrypt/Makefile.com index 8e98a38912..a7f7632667 100644 --- a/usr/src/lib/libcrypt/Makefile.com +++ b/usr/src/lib/libcrypt/Makefile.com @@ -47,7 +47,7 @@ CPPFLAGS += -D_REENTRANT -I../inc -I../../common/inc -I../../libgen/inc LDLIBS += -lgen -lc CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/libcryptoutil/Makefile.com b/usr/src/lib/libcryptoutil/Makefile.com index 79eab46787..ff22edb318 100644 --- a/usr/src/lib/libcryptoutil/Makefile.com +++ b/usr/src/lib/libcryptoutil/Makefile.com @@ -53,7 +53,7 @@ CPPFLAGS += -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -I$(SRCDIR) LINTFLAGS64 += -errchk=longptr64 CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libctf/Makefile.shared.com b/usr/src/lib/libctf/Makefile.shared.com index 3f2603a29a..39100e6831 100644 --- a/usr/src/lib/libctf/Makefile.shared.com +++ b/usr/src/lib/libctf/Makefile.shared.com @@ -85,6 +85,6 @@ CPPFLAGS += -I$(SRC)/lib/libctf/common \ -DCTF_OLD_VERSIONS CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libcurses/Makefile.com b/usr/src/lib/libcurses/Makefile.com index b3b7a2da0e..51dce6c5bc 100644 --- a/usr/src/lib/libcurses/Makefile.com +++ b/usr/src/lib/libcurses/Makefile.com @@ -150,7 +150,7 @@ CLEANFILES += $(LINTOUT) $(LINTLIB) CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses # not linted diff --git a/usr/src/lib/libdevinfo/Makefile.com b/usr/src/lib/libdevinfo/Makefile.com index 4567bc289f..d27b673721 100644 --- a/usr/src/lib/libdevinfo/Makefile.com +++ b/usr/src/lib/libdevinfo/Makefile.com @@ -42,7 +42,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I.. CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libdhcputil/Makefile.com b/usr/src/lib/libdhcputil/Makefile.com index b8e2721122..c3eaa4cf13 100644 --- a/usr/src/lib/libdhcputil/Makefile.com +++ b/usr/src/lib/libdhcputil/Makefile.com @@ -46,7 +46,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -I$(COMDIR) # not linted diff --git a/usr/src/lib/libdisasm/Makefile.com b/usr/src/lib/libdisasm/Makefile.com index 3e08026f68..543b8e08cd 100644 --- a/usr/src/lib/libdisasm/Makefile.com +++ b/usr/src/lib/libdisasm/Makefile.com @@ -121,7 +121,7 @@ ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM $(LINTLIB) := SRCS = $(COMDIR)/$(LINTSRC) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libdiskmgt/Makefile.com b/usr/src/lib/libdiskmgt/Makefile.com index ee8dee6344..76023e5b57 100644 --- a/usr/src/lib/libdiskmgt/Makefile.com +++ b/usr/src/lib/libdiskmgt/Makefile.com @@ -62,7 +62,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -D_REENTRANT -I$(SRC)/lib/libdiskmgt/common # not linted diff --git a/usr/src/lib/libdladm/Makefile.com b/usr/src/lib/libdladm/Makefile.com index 86b60f468b..d3d811b265 100644 --- a/usr/src/lib/libdladm/Makefile.com +++ b/usr/src/lib/libdladm/Makefile.com @@ -47,7 +47,7 @@ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-unused-label -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -I$(SRCDIR) -D_REENTRANT # not linted diff --git a/usr/src/lib/libdll/Makefile.com b/usr/src/lib/libdll/Makefile.com index 67411c3487..183181c93d 100644 --- a/usr/src/lib/libdll/Makefile.com +++ b/usr/src/lib/libdll/Makefile.com @@ -85,7 +85,7 @@ CFLAGS64 += \ $(ASTCFLAGS64) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # needs work SMOFF += all_func_returns,strcpy_overflow diff --git a/usr/src/lib/libdlpi/Makefile.com b/usr/src/lib/libdlpi/Makefile.com index 474a349943..aadf9c5fa0 100644 --- a/usr/src/lib/libdlpi/Makefile.com +++ b/usr/src/lib/libdlpi/Makefile.com @@ -40,7 +40,7 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -I$(SRCDIR) -D_REENTRANT .KEEP_STATE: diff --git a/usr/src/lib/libdtrace/Makefile.com b/usr/src/lib/libdtrace/Makefile.com index 3e6aa94d9b..b45a334f8f 100644 --- a/usr/src/lib/libdtrace/Makefile.com +++ b/usr/src/lib/libdtrace/Makefile.com @@ -134,7 +134,7 @@ CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch # not linted diff --git a/usr/src/lib/libdtrace_jni/Makefile.com b/usr/src/lib/libdtrace_jni/Makefile.com index 00813b4442..8e4ca4a49b 100644 --- a/usr/src/lib/libdtrace_jni/Makefile.com +++ b/usr/src/lib/libdtrace_jni/Makefile.com @@ -50,7 +50,7 @@ CPPFLAGS += -I../java/native CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS64) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += all_func_returns diff --git a/usr/src/lib/libeti/form/Makefile.com b/usr/src/lib/libeti/form/Makefile.com index 465eddae38..c526d231b3 100644 --- a/usr/src/lib/libeti/form/Makefile.com +++ b/usr/src/lib/libeti/form/Makefile.com @@ -76,7 +76,7 @@ CFLAGS += $(CCVERBOSE) LDLIBS += -lcurses -lc CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-char-subscripts .KEEP_STATE: diff --git a/usr/src/lib/libexacct/Makefile.com b/usr/src/lib/libexacct/Makefile.com index 0be4ef3c27..59c2b0ced3 100644 --- a/usr/src/lib/libexacct/Makefile.com +++ b/usr/src/lib/libexacct/Makefile.com @@ -41,7 +41,7 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -D_FILE_OFFSET_BITS=64 debug := CPPFLAGS += -DLIBEXACCT_DEBUG diff --git a/usr/src/lib/libexacct/demo/Makefile b/usr/src/lib/libexacct/demo/Makefile index 76159a4914..3361389127 100644 --- a/usr/src/lib/libexacct/demo/Makefile +++ b/usr/src/lib/libexacct/demo/Makefile @@ -31,7 +31,7 @@ include ../../../cmd/Makefile.cmd LDLIBS += -lexacct -lproject -lsocket -lnsl CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/libfdisk/Makefile.com b/usr/src/lib/libfdisk/Makefile.com index 27079153c4..64298076cf 100644 --- a/usr/src/lib/libfdisk/Makefile.com +++ b/usr/src/lib/libfdisk/Makefile.com @@ -52,7 +52,7 @@ CFLAGS64 += -D_FILE_OFFSET_BITS=64 LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libfru/libfruraw/Makefile.com b/usr/src/lib/libfru/libfruraw/Makefile.com index 92b14c7756..e4e7e67eab 100644 --- a/usr/src/lib/libfru/libfruraw/Makefile.com +++ b/usr/src/lib/libfru/libfruraw/Makefile.com @@ -53,7 +53,7 @@ CPPFLAGS += -I.. \ CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libfruutils/Makefile.com b/usr/src/lib/libfruutils/Makefile.com index 37c2ba8a6d..c60509e242 100644 --- a/usr/src/lib/libfruutils/Makefile.com +++ b/usr/src/lib/libfruutils/Makefile.com @@ -51,7 +51,7 @@ CPPFLAGS += -I.. -D_REENTRANT CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) $(LINTLIB) := LINTFLAGS = -nvx $(LINTLIB) := LINTFLAGS64 = -nvx -m64 diff --git a/usr/src/lib/libfsmgt/Makefile.com b/usr/src/lib/libfsmgt/Makefile.com index 3c2db0f981..c55c93285b 100644 --- a/usr/src/lib/libfsmgt/Makefile.com +++ b/usr/src/lib/libfsmgt/Makefile.com @@ -53,7 +53,7 @@ CPPFLAGS += -D_REENTRANT -I$(SRC)/lib/libfsmgt/common \ -I$(SRC)/cmd/fs.d/nfs/lib CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libgen/Makefile.com b/usr/src/lib/libgen/Makefile.com index 5fbf71233f..f0c3300e80 100644 --- a/usr/src/lib/libgen/Makefile.com +++ b/usr/src/lib/libgen/Makefile.com @@ -45,7 +45,7 @@ CPPFLAGS += -D_REENTRANT -D_LARGEFILE64_SOURCE -I../inc -I../../common/inc CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libgss/Makefile.com b/usr/src/lib/libgss/Makefile.com index fa824b1cb8..fd3ea535db 100644 --- a/usr/src/lib/libgss/Makefile.com +++ b/usr/src/lib/libgss/Makefile.com @@ -108,7 +108,7 @@ CPPFLAGS += -I$(GSSCRED_DIR) -I$(SRC)/uts/common/gssapi/include \ -DHAVE_STDLIB_H CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-empty-body diff --git a/usr/src/lib/libinetsvc/Makefile.com b/usr/src/lib/libinetsvc/Makefile.com index 9505796f00..1fb0e2b7fa 100644 --- a/usr/src/lib/libinetsvc/Makefile.com +++ b/usr/src/lib/libinetsvc/Makefile.com @@ -42,7 +42,7 @@ $(RELEASE_BUILD)CPPFLAGS += -DNDEBUG CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libipadm/Makefile.com b/usr/src/lib/libipadm/Makefile.com index c2671ea571..40665eed6d 100644 --- a/usr/src/lib/libipadm/Makefile.com +++ b/usr/src/lib/libipadm/Makefile.com @@ -43,7 +43,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -I$(SRCDIR) -D_REENTRANT # not linted diff --git a/usr/src/lib/libipmi/Makefile.com b/usr/src/lib/libipmi/Makefile.com index 0942455097..3ba226cabb 100644 --- a/usr/src/lib/libipmi/Makefile.com +++ b/usr/src/lib/libipmi/Makefile.com @@ -58,7 +58,7 @@ LDLIBS += -lc -lm -lnvpair -lsocket -lnsl CPPFLAGS += $(INCS) CSTD = $(CSTD_GNU99) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libipsecutil/Makefile.com b/usr/src/lib/libipsecutil/Makefile.com index 9e828a0476..33ff1b99d4 100644 --- a/usr/src/lib/libipsecutil/Makefile.com +++ b/usr/src/lib/libipsecutil/Makefile.com @@ -45,7 +45,7 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) -I$(BERDIR) CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += shift_to_zero diff --git a/usr/src/lib/libkmf/libkmf/Makefile.com b/usr/src/lib/libkmf/libkmf/Makefile.com index 1ac577ab76..e860567e48 100644 --- a/usr/src/lib/libkmf/libkmf/Makefile.com +++ b/usr/src/lib/libkmf/libkmf/Makefile.com @@ -70,7 +70,7 @@ CPPFLAGS += -I$(INCDIR) -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com b/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com index 79eb757e56..4a7fbbc270 100644 --- a/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com +++ b/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com @@ -56,7 +56,7 @@ LINTFLAGS64 += -erroff=E_STATIC_UNUSED CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-value -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com b/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com index cbc1a780a4..33f2a7bfe9 100644 --- a/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com +++ b/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com @@ -56,7 +56,7 @@ CPPFLAGS += -D_REENTRANT $(KMFINC) \ CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-value -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libkvm/Makefile.com b/usr/src/lib/libkvm/Makefile.com index 41e4c80071..b89bde5d03 100644 --- a/usr/src/lib/libkvm/Makefile.com +++ b/usr/src/lib/libkvm/Makefile.com @@ -47,7 +47,7 @@ LDLIBS += -lelf -lc CPPFLAGS = -D_KMEMUSER -D_LARGEFILE64_SOURCE=1 -I.. $(CPPFLAGS.master) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += signed diff --git a/usr/src/lib/libldap5/Makefile.com b/usr/src/lib/libldap5/Makefile.com index e0cb907335..d7da0b4f09 100644 --- a/usr/src/lib/libldap5/Makefile.com +++ b/usr/src/lib/libldap5/Makefile.com @@ -114,7 +114,7 @@ CFLAGS += $(CCVERBOSE) $(LOCFLAGS) CFLAGS64 += $(LOCFLAGS) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/libmapid/Makefile.com b/usr/src/lib/libmapid/Makefile.com index 2d7c9e55ca..3384c98518 100644 --- a/usr/src/lib/libmapid/Makefile.com +++ b/usr/src/lib/libmapid/Makefile.com @@ -56,7 +56,7 @@ CPPFLAGS += -I$(SRCDIR) -I$(SMF_DIR) -D_REENTRANT CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += all_func_returns diff --git a/usr/src/lib/libmd/sparc/Makefile b/usr/src/lib/libmd/sparc/Makefile index da93c328ca..9283791fe3 100644 --- a/usr/src/lib/libmd/sparc/Makefile +++ b/usr/src/lib/libmd/sparc/Makefile @@ -39,7 +39,7 @@ EXTPICS = ../capabilities/sun4u/sparc/pics/symcap.o \ ../capabilities/sun4v/sparc/pics/symcap.o # Suppress error for edonr.c __asm__ code -pics/edonr.o := CERRWARN += -_gcc=-Wno-uninitialized +pics/edonr.o := CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/libmtmalloc/Makefile.com b/usr/src/lib/libmtmalloc/Makefile.com index ae66153665..ef87819122 100644 --- a/usr/src/lib/libmtmalloc/Makefile.com +++ b/usr/src/lib/libmtmalloc/Makefile.com @@ -44,7 +44,7 @@ DYNFLAGS += $(ZINTERPOSE) $(LINTLIB) lint := LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN $(LINTLIB) lint := LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/libndmp/Makefile.com b/usr/src/lib/libndmp/Makefile.com index e96223b3ec..39609c3e7e 100644 --- a/usr/src/lib/libndmp/Makefile.com +++ b/usr/src/lib/libndmp/Makefile.com @@ -53,7 +53,7 @@ LDLIBS += -lc -lscf CPPFLAGS += $(INCS) -D_REENTRANT CERRWARN += -_gcc=-Wno-char-subscripts -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SRCS= $(OBJECTS:%.o=$(SRCDIR)/%.c) $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libnisdb/Makefile b/usr/src/lib/libnisdb/Makefile index 66fbf91865..95d5cea6b7 100644 --- a/usr/src/lib/libnisdb/Makefile +++ b/usr/src/lib/libnisdb/Makefile @@ -162,7 +162,7 @@ pics/map_ctrl.o $(UVAR_PICS) := CERRWARN += -_gcc=-Wno-unused-variable # Correcting these might alter logic -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch # not linted diff --git a/usr/src/lib/libnsl/Makefile.com b/usr/src/lib/libnsl/Makefile.com index 5260a7bc81..e3ba39ddc9 100644 --- a/usr/src/lib/libnsl/Makefile.com +++ b/usr/src/lib/libnsl/Makefile.com @@ -197,7 +197,7 @@ CCFLAGS64 += -_CC=-features=conststrings CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-empty-body diff --git a/usr/src/lib/libnvpair/Makefile.com b/usr/src/lib/libnvpair/Makefile.com index 029dff2b7f..3a58a7e630 100644 --- a/usr/src/lib/libnvpair/Makefile.com +++ b/usr/src/lib/libnvpair/Makefile.com @@ -69,7 +69,7 @@ LINTFLAGS64 += -erroff=E_CONSTANT_CONDITION CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT diff --git a/usr/src/lib/libnwam/Makefile.com b/usr/src/lib/libnwam/Makefile.com index db26d0d23f..d793239a44 100644 --- a/usr/src/lib/libnwam/Makefile.com +++ b/usr/src/lib/libnwam/Makefile.com @@ -55,7 +55,7 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) -D_REENTRANT CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libpam/Makefile.com b/usr/src/lib/libpam/Makefile.com index 3eb16f8baf..d96ba001ee 100644 --- a/usr/src/lib/libpam/Makefile.com +++ b/usr/src/lib/libpam/Makefile.com @@ -39,7 +39,7 @@ LDLIBS += -lc CFLAGS += $(CCVERBOSE) CPPFLAGS += -I $(SRCDIR) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/libpcp/Makefile.com b/usr/src/lib/libpcp/Makefile.com index a90f67ec90..65ba8001d7 100644 --- a/usr/src/lib/libpcp/Makefile.com +++ b/usr/src/lib/libpcp/Makefile.com @@ -47,7 +47,7 @@ LINKED_LIBPCP1_DIR = \ LIBS = $(DYNLIB) $(LINTLIB) CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) LDLIBS += -lc -lumem -ldevinfo PLATLIBS = $(USR_PLAT_DIR)/$(PLATFORM)/lib INS.slink6= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/libpcp.so.1 $@ diff --git a/usr/src/lib/libpicltree/Makefile.com b/usr/src/lib/libpicltree/Makefile.com index 1707ecebc6..9fe3266a50 100644 --- a/usr/src/lib/libpicltree/Makefile.com +++ b/usr/src/lib/libpicltree/Makefile.com @@ -37,7 +37,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CPPFLAGS += -D_REENTRANT -I.. -I../../libpicl -I$(SRC)/cmd/picl/plugins/inc CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libpkg/Makefile.com b/usr/src/lib/libpkg/Makefile.com index e3f93d3959..227b3833d8 100644 --- a/usr/src/lib/libpkg/Makefile.com +++ b/usr/src/lib/libpkg/Makefile.com @@ -65,7 +65,7 @@ LDLIBS += -lc -lscf -ladm CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-clobbered CERRWARN += -_gcc=-Wno-switch diff --git a/usr/src/lib/libpool/Makefile.com b/usr/src/lib/libpool/Makefile.com index d1c3972cae..51a3e7a5a6 100644 --- a/usr/src/lib/libpool/Makefile.com +++ b/usr/src/lib/libpool/Makefile.com @@ -54,7 +54,7 @@ CPPFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64 \ CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libpp/Makefile.com b/usr/src/lib/libpp/Makefile.com index 2710fe8873..0ea3146862 100644 --- a/usr/src/lib/libpp/Makefile.com +++ b/usr/src/lib/libpp/Makefile.com @@ -100,7 +100,7 @@ CFLAGS64 += \ $(ASTCFLAGS64) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-empty-body CERRWARN += -_gcc=-Wno-unused-value diff --git a/usr/src/lib/libproc/Makefile.com b/usr/src/lib/libproc/Makefile.com index bb72f8dc17..7ed72f97ed 100644 --- a/usr/src/lib/libproc/Makefile.com +++ b/usr/src/lib/libproc/Makefile.com @@ -95,7 +95,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-unused-label diff --git a/usr/src/lib/libproject/Makefile.com b/usr/src/lib/libproject/Makefile.com index 9f5984e877..333dc5fcf7 100644 --- a/usr/src/lib/libproject/Makefile.com +++ b/usr/src/lib/libproject/Makefile.com @@ -49,7 +49,7 @@ CLEANFILES += $(LINTOUT) $(LINTLIB) CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) LDLIBS += -lc -lsecdb -lproc -lpool $(LINTLIB) := SRCS = ../common/llib-lproject diff --git a/usr/src/lib/libprtdiag/Makefile.com b/usr/src/lib/libprtdiag/Makefile.com index b0fb2b65bb..6994883b47 100644 --- a/usr/src/lib/libprtdiag/Makefile.com +++ b/usr/src/lib/libprtdiag/Makefile.com @@ -45,7 +45,7 @@ IFLAGS += -I $(UTSBASE)/sun4u/serengeti CPPFLAGS = $(IFLAGS) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-label diff --git a/usr/src/lib/libprtdiag_psr/sparc/Makefile b/usr/src/lib/libprtdiag_psr/sparc/Makefile index 3961e8fd4d..2755dcd558 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/Makefile +++ b/usr/src/lib/libprtdiag_psr/sparc/Makefile @@ -26,8 +26,8 @@ # lib/libprtdiag_psr/sparc/Makefile PRTDIAG_PLATFORMS= desktop tazmo javelin sunfire serengeti \ - montecarlo littleneck daktari cherrystone \ - lw8 snowbird ontario schumacher opl montoya monza + littleneck daktari cherrystone \ + lw8 ontario schumacher opl montoya monza all := TARGET= all lint := TARGET= lint diff --git a/usr/src/lib/libprtdiag_psr/sparc/Makefile.com b/usr/src/lib/libprtdiag_psr/sparc/Makefile.com index cc52a6ef2c..af44a80223 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/Makefile.com +++ b/usr/src/lib/libprtdiag_psr/sparc/Makefile.com @@ -54,7 +54,7 @@ CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-address IFLAGS += -I $(UTSBASE)/sun4u IFLAGS += -I $(UTSCLOSED)/sun4u diff --git a/usr/src/lib/libprtdiag_psr/sparc/montecarlo/Makefile b/usr/src/lib/libprtdiag_psr/sparc/montecarlo/Makefile deleted file mode 100644 index a9b0ef79a2..0000000000 --- a/usr/src/lib/libprtdiag_psr/sparc/montecarlo/Makefile +++ /dev/null @@ -1,104 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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. -# -# lib/libprtdiag_psr/sparc/montecarlo/Makefile - -LIBBASE = ../../../../../src/lib -UTSBASE = ../../../../uts -PLATFORM_OBJECTS= montecarlo.o - -include ../Makefile.com - -IFLAGS = -I$(USR_PLAT_DIR)/sun4u/include -I../../../libprtdiag/inc -I$(LIBBASE)/libdevinfo -IFLAGS += -I$(UTSBASE)/sun4u/sys -IFLAGS += -I$(UTSBASE)/sun4u/montecarlo/sys -LINTFLAGS += $(IFLAGS) -LDLIBS += -L$(LIBBASE)/libdevinfo -ldevinfo -L$(LIBBASE)/libcfgadm -lcfgadm \ - -lkstat -# -# links in /usr/platform -# -LINKED_PLATFORMS = SUNW,UltraSPARC-IIe-NetraCT-40 - -LINKED_DIRS = $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%) -LINKED_LIB_DIRS = $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib) -LINKED_PRTDIAG_DIRS = \ - $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib/libprtdiag_psr.so.1) - -# -# SUNW,UltraSPARC-IIi-Netract and SUNW,UltraSPARC-IIe-NetraCT-40 platform -# should install into SUNW,UltraSPARC-IIi-Netract. -# SUNW,UltraSPARC-IIe-NetraCT-40 platform can link to -# /usr/platform/SUNW,UltraSPARC-IIi-Netract/lib/libprtdiag_psr.so -# -PLATFORM=SUNW,UltraSPARC-IIi-Netract - -$(USR_PLAT_DIR)/$(PLATFORM)/lib/libprtdiag_psr.so.1 := FILEMODE= 0755 - -.KEEP_STATE: - -PLATLIBS= $(PLATFORM:%=$(USR_PLAT_DIR)/%/lib/) - -install: all $(PLATLIBS) $(USR_PSM_LIBS) \ - $(LINKED_PRTDIAG_DIRS) - -# -# install rules for SUNW,UltraSPARC-IIi-Netract/lib/libprtdiag_psr.so -# -$(PLATLIBS): - $(INS.dir) - -$(USR_PSM_LIB_DIR): - cd $(UTSBASE)/sun4u/montecarlo; $(MAKE) $(USR_PSM_LIB_DIR) - -$(USR_PSM_LIB_DIR)/%: % $(USR_PSM_LIB_DIR) - $(INS.file) - -$(LINKED_DIRS): $(USR_PLAT_DIR) - -$(INS.dir) - -$(LINKED_LIB_DIRS): $(LINKED_DIRS) - -$(INS.dir) - -$(LINKED_PRTDIAG_DIRS): $(LINKED_LIB_DIRS) - -$(INS.slink6) - - -# New additions to generate msg file -POFILE = libprtdiag_psr_montecarlo.po -POFILES = montecarlo.po - -_msg: $(MSGDOMAIN) $(POFILE) - $(RM) $(MSGDOMAIN)/$(POFILE) - $(CP) $(POFILE) $(MSGDOMAIN) - -$(POFILE): $(POFILES) - $(RM) $@ - $(CAT) $(POFILES) > $@ - -$(POFILES): - $(RM) messages.po - $(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext common/montecarlo.c` - $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@ - $(RM) messages.po diff --git a/usr/src/lib/libprtdiag_psr/sparc/montecarlo/common/montecarlo.c b/usr/src/lib/libprtdiag_psr/sparc/montecarlo/common/montecarlo.c deleted file mode 100644 index dce27e6fe0..0000000000 --- a/usr/src/lib/libprtdiag_psr/sparc/montecarlo/common/montecarlo.c +++ /dev/null @@ -1,2451 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - * - * Netract Platform specific functions. - * - * called when : - * machine_type == MTYPE_MONTECARLO - */ - -/* includes */ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stddef.h> -#include <unistd.h> -#include <ctype.h> -#include <string.h> -#include <strings.h> -#include <stropts.h> -#include <fcntl.h> -#include <kvm.h> -#include <kstat.h> -#include <sys/types.h> -#include <sys/utsname.h> -#include <sys/openpromio.h> -#include <sys/sunddi.h> -#include <sys/ddi_impldefs.h> -#include <sys/devinfo_impl.h> -#include <sys/ioccom.h> -#include <sys/systeminfo.h> -#include <libintl.h> -#include <config_admin.h> -#include "pdevinfo.h" -#include "display.h" -#include "pdevinfo_sun4u.h" -#include "display_sun4u.h" -#include "libprtdiag.h" -#include "libdevinfo.h" - -/* MC specific header, might just include from MC space */ -#include "mct_topology.h" -#include "envctrl_gen.h" -#include "pcf8574_nct.h" -#include "netract_gen.h" -#include "hscimpl.h" -#include "scsbioctl.h" - -#if !defined(TEXT_DOMAIN) -#define TEXT_DOMAIN "SYS_TEST" -#endif - -/* globals */ -#define MAXNAMESZ 128 -#define MAX_NODE_NAME_SZ 32 - -/* this values equates to Max Tree depth for now */ -#define MAXIMUM_DEVS 64 - -typedef char device_info_t[MAX_NODE_NAME_SZ]; - -typedef struct { - cfga_list_data_t *ldatap; - int req; /* If set, this list_data was requested by user */ -} ap_out_t; - - -typedef struct { - uint_t slot_addr; - uint_t slot_stat; - uint_t slot_cond; - device_info_t devs_info[MAXIMUM_DEVS]; - uint_t number_devs; -} mc_slot_info_t; - -typedef struct { - mc_slot_info_t mc_slot_info[MC_MAX_SLOTS]; -} slot_data_t; - - -extern char *progname; -extern int print_flag; - -/* These are used to store all force loads of the drivers */ -static int ps_fd[MC_MAX_PS]; -static int oprom_fd; -static int slot_index = 0; -static int idx_minuscpu = 0; -static int num_devs = 0; -static int sd_instances[MC_MAX_SLOTS*15]; -static int gpio_instances[MC_MAX_PS+MC_MAX_FAN]; -static int sd_count = 0; -static int st_instance; -static int gpio_count = 0; -static int slot_table_not_found = 0; - -/* default not present */ -static int alarm_card_present = 0; -static int cpu_ftm_present = 0; - -/* - * We will store all kstat in globals so that - * we can browse thru them later - */ -static int fail_syssoft_prop = 0; -static int fail_drv_prop = 0; -di_node_t rootnode; /* root nexus */ -slot_data_t mc_slots_data; - -/* scsb driver kstats */ -scsb_ks_leddata_t scsb_ks_leddata; -scsb_ks_state_t scsb_ks_state; -mct_topology_t scsb_ks_topo; - -/* pcf8574(gpio) driver kstats */ -envctrl_cpuvoltage_t pcf8574_ks_cpuv; -envctrl_pwrsupp_t pcf8574_ks_ps1; -envctrl_fantray_t pcf8574_ks_fant1; -envctrl_pwrsupp_t pcf8574_ks_ps2; -envctrl_fantray_t pcf8574_ks_fant2; - -/* pcf8591(adc-dac) driver kstats */ -envctrl_temp_t pcf8591_ks_temp; - -hsc_slot_table_t hotswap_slot_table[MC_MAX_SLOTS]; -hsc_prom_slot_table_t prom_slot_table[MC_MAX_SLOTS]; - -static char *hotswap_mode = NULL; -static char *slot_auto_config[MC_MAX_SLOTS]; -static int slot_table_size; - -/* - * use this to ascertain what's the system, - * default is tonga, we can add more for future variations - * 0=tonga, 1=montecarlo - * we need also to figure out what the system version is - * 0 = 1.5, 1 = 1.0, 0.6 etc. - */ -int montecarlo = 0; -int version_p15_and_p20 = 0; - -#define MAX_PRTDIAG_INFO_LENGTH 1024 -#define MAX_PRTDIAG_FRUS 22 -#define BIT_TEST(X, N) ((X) & (1 << (N))) -#define SLOT1_OK_BIT 0 -#define SLOT2_OK_BIT 1 -#define SLOT3_OK_BIT 2 -#define SLOT4_OK_BIT 3 -#define SLOT5_OK_BIT 4 -#define SLOT6_OK_BIT 5 -#define SLOT7_OK_BIT 6 -#define SLOT8_OK_BIT 7 -#define PDU1_OK_BIT SLOT2_OK_BIT -#define PDU2_OK_BIT SLOT4_OK_BIT -#define FTM_OK_BIT SLOT5_OK_BIT -#define SCB_OK_BIT SLOT6_OK_BIT -#define FAN1_OK_BIT SLOT1_OK_BIT -#define FAN2_OK_BIT SLOT2_OK_BIT -#define DISK1_OK_BIT SLOT4_OK_BIT -#define DISK2_OK_BIT SLOT5_OK_BIT -#define DISK3_OK_BIT SLOT6_OK_BIT -#define PS1_OK_BIT SLOT7_OK_BIT -#define PS2_OK_BIT SLOT8_OK_BIT -#define S_FREE(x) (((x) != NULL) ? (free(x), (x) = NULL) : (void *)0) -#define ENVC_DEBUG_MODE 0x03 -#define OPENPROMDEV "/dev/openprom" -#define I2C_PCF8591_NAME "adc-dac" -#define I2C_KSTAT_CPUTEMP "adc_temp" -#define SCSB_DEV "scsb" -#define SDERR "sderr" -#define STERR "sterr" -#define OK "ok" -#define NOK "Not ok" -#define ON "on" -#define OFF "off" -#define BLINK "blink" -#define NA "Not Available" -#define UK "Unknown " -#define YES "Yes" -#define NO "No " -#define LO "low" -#define HI "high" -#define BLANK " " -#define SYSSOFT_PROP "System software" -#define DRV_PROP "Driver" -#define HSC_PROP_NAME "hsc-slot-map" -#define HSC_MODE "hotswap-mode" -#define PCI_ROOT_AP "pci" -#define PROPS "Properties:" -#define BOARDTYPE "Board Type:" -#define DEVS "Devices:" -#define CPCI_IO "CompactPCI IO Slot" -#define AC_CARD "Alarm Card" -#define CPU_FTM "Front Transition Module" -#define SCTRL_PROM_P06 0x00 -#define SCTRL_PROM_P10 0x01 -#define SCTRL_PROM_P15 0x02 -#define SCTRL_PROM_P20 0x03 - -#define RMM_NUMBER 3 - -#define MONTECARLO_PLATFORM "SUNW,UltraSPARC-IIi-Netract" -#define MAKAHA_PLATFORM "SUNW,UltraSPARC-IIe-NetraCT-40" - -/* - * The follow table is indexed with the enum's defined by mct_slot_occupant_t - * OC_UNKN OC_CPU OC_AC OC_BHS OC_FHS OC_HAHS - * OC_QFE OC_FRCH OC_COMBO OC_PMC OC_ATM - * - * But "scsb" can currently identify only CPU and Alarm Cards by known - * slot numbers. - */ -char *slot_occupants[] = { - CPCI_IO, - "CPU board ", - CPCI_IO, - "Basic HotSwap Board", - "Full HotSwap Board", - "HA Board", - "QFE Board", - "Fresh Choice Board", - "SUN Combo Board", - "PMC Board", - "ATM Board" - }; - -static char *prtdiag_fru_types[] = { - "I/O ", /* 0 */ - "CPU ", - "PSU ", - "HDD ", - "FAN ", - "Alarm Card ", - "SCB ", - "SSB ", - "CFTM ", - "CRTM ", - "PRTM ", - "Midplane " /* 11 */ - }; - -char prtdiag_fru_info[MAX_PRTDIAG_FRUS][MAX_PRTDIAG_INFO_LENGTH]; - -#define SCB_REG_READ 1 -#define SCB_REG_WRITE 2 - -/* Standard Device nodes - hardwired for now */ -/* will include fan tray later, cpu voltage not impl */ -static char *scsb_node = NULL; -static char **ps_node = NULL; -static char *temp_node = NULL; - -static char *mc_scsb_node = -"/devices/pci@1f,0/pci@1,1/ebus@1/i2c@14,600000/sysctrl@0,80:scsb"; - -static char *ot_scsb_node = -"/devices/pci@1f,0/pci@1,1/ebus@3/sysmgmt@14,600000/sysctrl@0,80:scsb"; - -static char *mc_ps_node[] = { -"/devices/pci@1f,0/pci@1,1/ebus@1/i2c@14,600000/gpio@0,7c:pwrsuppply", -"/devices/pci@1f,0/pci@1,1/ebus@1/i2c@14,600000/gpio@0,7e:pwrsuppply" -}; - -static char *ot_ps_node[] = { -"/devices/pci@1f,0/pci@1,1/ebus@3/sysmgmt@14,600000/gpio@0,7c:pwrsuppply", -"/devices/pci@1f,0/pci@1,1/ebus@3/sysmgmt@14,600000/gpio@0,7e:pwrsuppply" -}; - -static char *mc_temp_node = -"/devices/pci@1f,0/pci@1,1/ebus@1/i2c@14,600000/adc-dac@0,9e:cputemp"; - -/* - * these functions will overlay the symbol table of libprtdiag - * at runtime (netract systems only) - * display functions - */ -int display(Sys_tree *, Prom_node *, struct system_kstat_data *, int); -/* local functions */ -/* - * prom function - */ -static void gather_diaginfo(int flag); -static int extract_slot_table_from_obp(); -static int mc_next(int id); -static void mc_walk(int id); -static int mc_child(int id); -static void mc_dump_node(int id); -static int mc_getpropval(struct openpromio *opp); - -#ifdef REDUNDANT_INFO -static int mc_get_cpu_freq(Prom_node *node); -static int mc_get_ecache_size(Prom_node *node); -static void mc_display_cpus(Board_node *board); -static void mc_display_cpu_devices(Sys_tree *tree); -#endif /* REDUNDANT_INFO */ - -static void netract_disp_prom_version(); - -/* - * Since we do not have a system wide kstat for MC/Tg - * here we have to do specific kstats to drivers that - * post this information - MC/Tg specific drivers - * that post kstat here are : scsb, pcf8574(gpio) and pcf8591 - */ -static int analyze_nodes(di_node_t, void*); -static void analyze_pcipci_siblings(di_node_t); -static void display_mc_prtdiag_info(); -static int dump_devs(di_node_t, void *); -static void prtdiag_devinfo(void); -static void force_load_drivers(); -static int dump_prop_list(char *name, - di_node_t node, di_prop_t (*nxtprop)()); -static void *config_calloc_check(size_t nelem, size_t elsize); -static void explore_slot_occupants(); -static void do_scsb_kstat(); -static void do_pcf8574_kstat(); -static void do_pcf8591_kstat(); -static void do_promversion(); -static int mc_promopen(int oflag); -static int scsi_disk_status(int disk_number); -static void alarm_card_occupant(); -static int scsb_mode(int fd, scsb_op_t sop, uint8_t *new_mode); -static int scsb_ioc_reg_read(int fd, uchar_t index, - scsb_ioc_rdwr_t *ioc_rd, int num); - -static int check_platform(); - -int -display(Sys_tree *tree, - Prom_node *root, - struct system_kstat_data *kstats, - int syserrlog) -{ - int exit_code = 0; /* init to all OK */ - void *value; /* used for opaque PROM data */ - struct mem_total memory_total; /* Total memory in system */ - struct grp_info grps; /* Info on all groups in system */ -#ifdef lint - syserrlog = syserrlog; -#endif - sys_clk = -1; /* System clock freq. (in MHz) */ - /* - * Now display the machine's configuration. We do this if we - * are not logging or exit_code is set (machine is broke). - */ - if (!logging || exit_code) { - struct utsname uts_buf; - - /* - * Display system banner - */ - (void) uname(&uts_buf); - - log_printf(dgettext(TEXT_DOMAIN, - "System Configuration: Oracle Corporation" - " %s %s\n"), uts_buf.machine, - get_prop_val(find_prop(root, "banner-name")), 0); - - /* display system clock frequency */ - value = get_prop_val(find_prop(root, "clock-frequency")); - if (value != NULL) { - sys_clk = ((*((int *)value)) + 500000) / 1000000; - log_printf(dgettext(TEXT_DOMAIN, - "System clock frequency: " - "%d MHz\n"), sys_clk, 0); - } - - /* Display the Memory Size */ - display_memorysize(tree, kstats, &grps, &memory_total); - /* Lets make sure we have all the needed drivers loaded */ - /* display Montecarlo/Tonga FRU information */ - if (!extract_slot_table_from_obp()) - log_printf(dgettext(TEXT_DOMAIN, - "\r\nslot-table not available\r\n"), 0); - do_scsb_kstat(); - force_load_drivers(); - gather_diaginfo(print_flag && !logging); - /* figure out if ac is present */ - alarm_card_occupant(); - /* platform specific display mod */ - display_mc_prtdiag_info(); - di_fini(rootnode); - netract_disp_prom_version(); - } /* if (!logging || exit_code) */ - - return (exit_code); - -} /* display(....) */ - -static int -check_platform() -{ - char si_platform[SYS_NMLN]; - - /* - * Check for the platform: Montecarlo or Makaha/CP2040 based - */ - if (sysinfo(SI_PLATFORM, si_platform, sizeof (si_platform)) == -1) { - return (-1); - } - - if ((strncmp(si_platform, MONTECARLO_PLATFORM, - strlen(MONTECARLO_PLATFORM))) == 0) { - scsb_node = mc_scsb_node; - ps_node = mc_ps_node; - temp_node = mc_temp_node; - } else if ((strncmp(si_platform, MAKAHA_PLATFORM, - strlen(MAKAHA_PLATFORM))) == 0) { - scsb_node = ot_scsb_node; - ps_node = ot_ps_node; - temp_node = NULL; - } else { - return (-1); - } - - return (0); -} - -void -force_load_drivers() -{ - int i; - - if (NULL == scsb_node || NULL == ps_node) { - if (check_platform() == -1) { - return; - } - } - - /* check scb/ssb presence */ - if (scsb_ks_state.scb_present || scsb_ks_state.ssb_present) { - if (open(scsb_node, O_RDONLY) < 0) - log_printf(dgettext(TEXT_DOMAIN, - "\nscsb open FAILED!"), 0); - } - - /* check the num of PS we have */ - for (i = 0; i < scsb_ks_topo.max_units[PS]; ++i) { - if (scsb_ks_topo.mct_ps[i].fru_status == FRU_PRESENT) { - if ((ps_fd[i] = open(ps_node[i], O_RDONLY)) < 0) - log_printf(dgettext(TEXT_DOMAIN, - "\npowersupply%d open failed"), - i, 0); - } - } /* for */ - - /* open the cpu temp driver */ - if (temp_node) { - if (open(temp_node, O_RDONLY) < 0) - log_printf(dgettext(TEXT_DOMAIN, - "\ncputemp open FAILED!"), 0); - } -} - - -void -explore_slot_occupants() -{ - char *cp = NULL; - int index; - int ret = CFGA_ERROR; - char *estrp = NULL; - cfga_list_data_t *list_array = NULL; - ap_out_t *out_array = NULL; - int nlist = 0; - char *prefilt_optp = NULL; - int dyn_exp = 1; - char *plat_opts = NULL; - - ret = config_list_ext(0, NULL, &list_array, - &nlist, plat_opts, prefilt_optp, &estrp, - dyn_exp ? CFGA_FLAG_LIST_ALL : 0); - if (ret != CFGA_OK) { - log_printf(dgettext(TEXT_DOMAIN, - "\ncannot explore configuration"), 0); - return; - } - assert(nlist != 0); - out_array = config_calloc_check(nlist, sizeof (*out_array)); - if (out_array == NULL) { - ret = CFGA_LIB_ERROR; - goto bail; - } - /* create a list of output stat data */ - for (index = 0; index < nlist; index++) { - out_array[index].ldatap = &list_array[index]; - out_array[index].req = 0; - } - - for (index = 0; index < nlist; index++) { - if ((cp = strstr(out_array[index].ldatap->ap_phys_id, - "cpci_slot")) != NULL) { - mc_slots_data.mc_slot_info[idx_minuscpu].slot_stat - = out_array[index].ldatap->ap_o_state; - mc_slots_data.mc_slot_info[idx_minuscpu].slot_cond - = out_array[index].ldatap->ap_cond; - idx_minuscpu++; - } - } -bail: - S_FREE(list_array); - S_FREE(out_array); -} - - -/* - * config_calloc_check - perform allocation, check result and - * set error indicator - */ -void * -config_calloc_check( - size_t nelem, - size_t elsize) -{ - void *p; - static char alloc_fail[] = - "%s: memory allocation failed (%d*%d bytes)\n"; - - p = calloc(nelem, elsize); - if (p == NULL) { - log_printf(dgettext(TEXT_DOMAIN, alloc_fail), nelem, elsize, 0); - } - return (p); -} - - -void -do_scsb_kstat() -{ - kstat_ctl_t *kc; - kstat_t *ksp_leddata; - kstat_t *ksp_state; - kstat_t *ksp_topo; - scsb_ks_leddata_t *pks_leddata; - scsb_ks_state_t *pks_state; - mct_topology_t *pks_topo; - int i; - -#ifdef DEBUG_TEMP1 - int index; -#endif - if (!(kc = kstat_open())) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_open failed", 0); -#endif - return; - } -#ifdef lint - kc = kc; -#endif - /* get kstat on scsb led data */ - if ((ksp_leddata = kstat_lookup(kc, SCSB_DEV, 0, SCSB_KS_LEDDATA)) - == NULL) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_lookup for scsb_leddata failed", 0); -#endif - return; - } - if (kstat_read(kc, ksp_leddata, NULL) == -1) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_read for scsb_leddata failed", 0); -#endif - return; - } - pks_leddata = (scsb_ks_leddata_t *)ksp_leddata->ks_data; - scsb_ks_leddata = *pks_leddata; /* set the globals for future */ -#ifdef DEBUG_LEDS - /* dump the kstat leddata */ - printf("\nDumping LED regs: "); - for (i = 0; i < SCSB_LEDDATA_REGISTERS; ++i) { - log_printf("0x%x ", pks_leddata->scb_led_regs[i] & 0xff, 0); - } - log_printf("\n", 0); -#endif - /* get kstat on scsb states */ - if ((ksp_state = kstat_lookup(kc, SCSB_DEV, 0, SCSB_KS_STATE)) - == NULL) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_lookup for scsb_state failed", 0); -#endif - return; - } - if (kstat_read(kc, ksp_state, NULL) == -1) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_read for scsb_state failed", 0); -#endif - return; - } - pks_state = (scsb_ks_state_t *)ksp_state->ks_data; - scsb_ks_state = *pks_state; /* set the global for future */ -#ifdef DEBUG_TEMP1 - /* dump the kstat state */ - log_printf("\tSCB is%spresent\n", - pks_state->scb_present ? " " : " not ", 0); - log_printf("\tSSB is%spresent\n", - pks_state->ssb_present ? " " : " not ", 0); - log_printf("\tscsb is%sfrozen\n", - pks_state->scsb_frozen ? " " : " not ", 0); - log_printf("\tscsb mode: ", 0); - switch (pks_state->scsb_mode) { - case ENVC_DEBUG_MODE: - log_printf("DEBUG MODE\n", 0); - break; - case ENVCTRL_DIAG_MODE: - log_printf("DIAGNOSTIC MODE\n", 0); - break; - case ENVCTRL_NORMAL_MODE: - log_printf("NORMAL MODE\n", 0); - break; - } - log_printf("\tscsb event code: 0x%x\n", pks_state->event_code, 0); -#endif /* DEBUG_TEMP1 */ - - if ((ksp_topo = kstat_lookup(kc, SCSB_DEV, 0, SCSB_KS_TOPOLOGY)) - == NULL) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_lookup for scsb_topo failed", 0); -#endif - return; - } - if (kstat_read(kc, ksp_topo, NULL) == -1) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_read for scsb_topo failed", 0); -#endif - return; - } - pks_topo = (mct_topology_t *)ksp_topo->ks_data; - scsb_ks_topo = *pks_topo; /* set the global for future */ - /* - * we need to set this so that we can get status info - * for the 2 powersupplies in MC as we need to get - * kstat from both driver instances for environment - */ - if (pks_topo->mid_plane.fru_id == SCTRL_MPID_HALF) - montecarlo = 1; /* Monte Carlo */ - /* - * HW version 0.6 and 1.0 had different led maps - * its assumed that HW 2.0 would not change this - * need to modify if it does - */ - if ((pks_topo->mct_scb[0].fru_version == SCTRL_PROM_P15) || - (pks_topo->mct_scb[0].fru_version == SCTRL_PROM_P20)) { - version_p15_and_p20 = 1; - } - - /* set flag to note that CFTM is present */ - for (i = 0; i < pks_topo->max_units[CFTM]; ++i) { - if (pks_topo->mct_cftm[i].fru_status == FRU_PRESENT) - cpu_ftm_present = 1; - } - -#ifdef DEBUG_TEMP1 - /* - * Midplane - */ - log_printf("Midplane type: ", 0); - if (pks_topo->mid_plane.fru_id == SCTRL_MPID_HALF) - log_printf("Netra ct800 server\n", 0); - else - log_printf("Netra ct400 server%s\n", - pks_topo->mid_plane.fru_id == - SCTRL_MPID_QUARTER_NODSK ? ", no disk" : " with disk", 0); - log_printf("Midplane version: %d\n", - pks_topo->mid_plane.fru_version, 0); - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_scb[0].fru_type, - pks_topo->mct_scb[0].fru_unit, - pks_topo->mct_scb[0].fru_id, - pks_topo->mct_scb[0].fru_version, 0); - /* - * Slots - */ - log_printf("Slots present out of maximum %d\n", - pks_topo->max_units[SLOT], 0); - for (i = 0; i < pks_topo->max_units[SLOT]; ++i) { - if (pks_topo->mct_slots[i].fru_status != FRU_PRESENT) - continue; - index = (int)pks_topo->mct_slots[i].fru_type; - log_printf("\tSlot %d occupant: %s;", - pks_topo->mct_slots[i].fru_unit, slot_occupants[index], 0); - log_printf(" ID 0x%x; VER 0x%x ; ", - pks_topo->mct_slots[i].fru_id, - pks_topo->mct_slots[i].fru_version, 0); - log_printf(" Slot health %d\n", - pks_topo->mct_slots[i].fru_health, 0); - /* pks_topo->mct_slots[i].fru_health */ - } - - /* - * PDU - */ - log_printf("PDUs present out of maximum %d\n", - pks_topo->max_units[PDU], 0); - for (i = 0; i < pks_topo->max_units[PDU]; ++i) { - if (pks_topo->mct_pdu[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_pdu[i].fru_type, - pks_topo->mct_pdu[i].fru_unit, - pks_topo->mct_pdu[i].fru_id, - pks_topo->mct_pdu[i].fru_version, 0); - /* pks_topo->mct_pdu[i].fru_health */ - } - - /* - * Power Supplies - */ - log_printf("Power Supplies present out of maximum %d\n", - pks_topo->max_units[PS], 0); - for (i = 0; i < pks_topo->max_units[PS]; ++i) { - if (pks_topo->mct_ps[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_ps[i].fru_type, - pks_topo->mct_ps[i].fru_unit, - pks_topo->mct_ps[i].fru_id, - pks_topo->mct_ps[i].fru_version, 0); - } - - /* - * Disks - */ - log_printf("Disks present out of maximum %d\n", - pks_topo->max_units[DISK], 0); - for (i = 0; i < pks_topo->max_units[DISK]; ++i) { - if (pks_topo->mct_disk[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_disk[i].fru_type, - pks_topo->mct_disk[i].fru_unit, - pks_topo->mct_disk[i].fru_id, - pks_topo->mct_disk[i].fru_version, 0); - } - - /* - * Fans - */ - log_printf("Fans present out of maximum %d\n", - pks_topo->max_units[FAN], 0); - for (i = 0; i < pks_topo->max_units[FAN]; ++i) { - if (pks_topo->mct_fan[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_fan[i].fru_type, - pks_topo->mct_fan[i].fru_unit, - pks_topo->mct_fan[i].fru_id, - pks_topo->mct_fan[i].fru_version, 0); - } - - /* - * SCBs - */ - log_printf("SCBs present out of maximum %d\n", - pks_topo->max_units[SCB], 0); - for (i = 0; i < pks_topo->max_units[SCB]; ++i) { - if (pks_topo->mct_scb[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_scb[i].fru_type, - pks_topo->mct_scb[i].fru_unit, - pks_topo->mct_scb[i].fru_id, - pks_topo->mct_scb[i].fru_version, 0); - } - - /* - * SSBs - */ - log_printf("SSBs present out of maximum %d\n", - pks_topo->max_units[SSB], 0); - for (i = 0; i < pks_topo->max_units[SSB]; ++i) { - if (pks_topo->mct_ssb[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_ssb[i].fru_type, - pks_topo->mct_ssb[i].fru_unit, - pks_topo->mct_ssb[i].fru_id, - pks_topo->mct_ssb[i].fru_version, 0); - } - - /* - * Alarms Cards - */ - log_printf("Alarm Cards present out of maximum %d\n", - pks_topo->max_units[ALARM], 0); - for (i = 0; i < pks_topo->max_units[ALARM]; ++i) { - if (pks_topo->mct_alarm[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d; unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_alarm[i].fru_type, - pks_topo->mct_alarm[i].fru_unit, - pks_topo->mct_alarm[i].fru_id, - pks_topo->mct_alarm[i].fru_version, 0); - } - - /* - * CFTMs - */ - log_printf("CFTMs present out of maximum %d\n", - pks_topo->max_units[CFTM], 0); - for (i = 0; i < pks_topo->max_units[CFTM]; ++i) { - if (pks_topo->mct_cftm[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_cftm[i].fru_type, - pks_topo->mct_cftm[i].fru_unit, - pks_topo->mct_cftm[i].fru_id, - pks_topo->mct_cftm[i].fru_version, 0); - } - - /* - * CRTMs - */ - log_printf("CRTMs present out of maximum %d\n", - pks_topo->max_units[CRTM], 0); - for (i = 0; i < pks_topo->max_units[CRTM]; ++i) { - if (pks_topo->mct_crtm[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_crtm[i].fru_type, - pks_topo->mct_crtm[i].fru_unit, - pks_topo->mct_crtm[i].fru_id, - pks_topo->mct_crtm[i].fru_version, 0); - } - - /* - * PRTMs - */ - log_printf("PRTMs present out of maximum %d\n", - pks_topo->max_units[PRTM], 0); - for (i = 0; i < pks_topo->max_units[PRTM]; ++i) { - if (pks_topo->mct_prtm[i].fru_status != FRU_PRESENT) - continue; - log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n", - pks_topo->mct_prtm[i].fru_type, - pks_topo->mct_prtm[i].fru_unit, - pks_topo->mct_prtm[i].fru_id, - pks_topo->mct_prtm[i].fru_version, 0); - } -#endif /* DEBUG_TEMP1 */ - -} /* do_scsb_kstat(...) */ - - -void -do_pcf8574_kstat() -{ - kstat_ctl_t *kc; - kstat_t *ksp_ps; - kstat_t *ksp_fan; - envctrl_pwrsupp_t *pks_ps; - envctrl_fantray_t *pks_fan; - int i; - char *kstat_name = NULL; - - if (!(kc = kstat_open())) { -#ifdef DEBUG_TEMP - log_printf("\nkstat_open for pcf8574 failed", 0); -#endif - return; - } - -#ifdef lint - kc = kc; -#endif - /* get kstat on gpio powersupply and fan states */ - for (i = 0; i < scsb_ks_topo.max_units[PS]; ++i) { - if (i == 1) { - kstat_name = I2C_KSTAT_PWRSUPPLY; - strncat(kstat_name, "1", 1); - } else { - kstat_name = I2C_KSTAT_PWRSUPPLY; - strncat(kstat_name, "2", 1); - } - if ((ksp_ps = kstat_lookup(kc, I2C_PCF8574_NAME, 0, kstat_name)) - == NULL) { -#ifdef DEBUG_TEMP - log_printf("\nks lookup for pwrsupply%d failed", - i+1, 0); -#endif - return; - } - if (kstat_read(kc, ksp_ps, NULL) == -1) { -#ifdef DEBUG_TEMP - log_printf("\nks read for pwrsupply%d failed", i+1, 0); -#endif - return; - } - pks_ps = (envctrl_pwrsupp_t *)ksp_ps->ks_data; - if (i == 1) - pcf8574_ks_ps1 = *pks_ps; /* ps 1 */ - else - pcf8574_ks_ps2 = *pks_ps; /* ps 2 */ - } /* for */ - for (i = 0; i < scsb_ks_topo.max_units[FAN]; ++i) { - if (i == 1) { - kstat_name = I2C_KSTAT_FANTRAY; - strncat(kstat_name, "1", 1); - } else { - kstat_name = I2C_KSTAT_FANTRAY; - strncat(kstat_name, "2", 1); - } - if ((ksp_fan = kstat_lookup(kc, I2C_PCF8574_NAME, - 0, kstat_name)) == NULL) { -#ifdef DEBUG_TEMP - log_printf("\nks lookup for fantray%d failed", - i+1, 0); -#endif - return; - } - if (kstat_read(kc, ksp_fan, NULL) == -1) { -#ifdef DEBUG_TEMP - log_printf("\nks read for fantray%d failed", i+1, 0); -#endif - return; - } - pks_fan = (envctrl_fantray_t *)ksp_fan->ks_data; - if (i == 1) - pcf8574_ks_fant1 = *pks_fan; /* fan 1 */ - else - pcf8574_ks_fant2 = *pks_fan; /* fan 2 */ - } /* for */ - kstat_close(kc); - -} /* do_pcf8574_kstat(...) */ - -void -do_pcf8591_kstat() -{ - kstat_ctl_t *kc; - kstat_t *ksp_temp; - - envctrl_temp_t *pks_temp; - - if (!(kc = kstat_open())) { -#ifdef DEBUG_TEMP - log_printf("ks open for pcf8591 failed", 0); -#endif - return; - } -#ifdef lint - kc = kc; -#endif - /* get kstat on adc driver's CPU temperature data */ - if ((ksp_temp = kstat_lookup(kc, I2C_PCF8591_NAME, - -1, I2C_KSTAT_CPUTEMP)) - == NULL) { -#ifdef DEBUG_TEMP - log_printf("ks lookup for adc_temp failed", 0); -#endif - return; - } - if (kstat_read(kc, ksp_temp, NULL) == -1) { -#ifdef DEBUG_TEMP - log_printf("ks read for adc_temp failed", 0); -#endif - return; - } - pks_temp = (envctrl_temp_t *)ksp_temp->ks_data; - pcf8591_ks_temp = *pks_temp; - kstat_close(kc); -} /* do_pcf8591_kstat(.) */ - - -void -gather_diaginfo(int flag) -{ - if (flag) { - /* gather system environmental conditions. */ - /* obtain kstat info from gpio & temp. driver */ - do_pcf8574_kstat(); - do_pcf8591_kstat(); - explore_slot_occupants(); /* fill in some occupant info */ - prtdiag_devinfo(); - analyze_pcipci_siblings(rootnode); - } - -} /* display_diaginfo(...) */ - -void -netract_disp_prom_version() -{ - /* Display Prom revision header */ - log_printf(dgettext(TEXT_DOMAIN, "System Board PROM revision:\n"), 0); - log_printf("---------------------------\n", 0); - do_promversion(); - -} /* netract_disp_prom_version(.) */ - - -/* - * Get and print the PROM version. - */ -void -do_promversion(void) -{ - Oppbuf oppbuf; - struct openpromio *opp = &(oppbuf.opp); - - if (mc_promopen(O_RDONLY)) { - log_printf(dgettext(TEXT_DOMAIN, - "\nCannot open openprom device"), 0); - return; - } - - opp->oprom_size = MAXVALSIZE; - if (ioctl(oprom_fd, OPROMGETVERSION, opp) < 0) { - perror("\nOPROMGETVERSION ioctl failed"); - return; - } - log_printf("%s\n", opp->oprom_array, 0); - - if (close(oprom_fd) < 0) { - log_printf(dgettext(TEXT_DOMAIN, - "\nclose error on %s"), OPENPROMDEV, 0); - return; - } -} /* do_promversion() */ - -int -mc_promopen(int oflag) -{ - for (;;) { - if ((oprom_fd = open(OPENPROMDEV, oflag)) < 0) { - if (errno == EAGAIN) { - (void) sleep(5); - continue; - } - if (errno == ENXIO) - return (-1); - log_printf(dgettext(TEXT_DOMAIN, - "\ncannot open %s"), OPENPROMDEV, 0); - return (1); - } else - return (0); - } -} - - -/* - * This will return -1 for status unknown, 0 for OK, and 1 for failed (scsi - * hard errors) - * swiped from envmon policies - */ -int -scsi_disk_status(int disk_number) -{ - kstat_ctl_t *kc; - kstat_t *ksp_disk; - kstat_named_t *disk_data; - - int i; - int nlist = 0; - cfga_list_data_t *list_array = NULL; - char *ap_ids[] = {"c0"}; - - if ((kc = kstat_open()) == NULL) { - log_printf(dgettext(TEXT_DOMAIN, "\nks open failed"), 0); - return (-1); - } - - if (disk_number == RMM_NUMBER) { /* RMM */ - if (config_list_ext(1, ap_ids, &list_array, &nlist, - NULL, NULL, NULL, CFGA_FLAG_LIST_ALL) != CFGA_OK) { - kstat_close(kc); - return (-1); - } - for (i = 0; i < nlist; i++) { - if (strstr(list_array[i].ap_phys_id, "rmt/0") != NULL) { - /* Tape drive */ - if (list_array[i].ap_o_state == - CFGA_STAT_UNCONFIGURED) { - kstat_close(kc); - return (-1); - } - if ((ksp_disk = kstat_lookup(kc, STERR, - st_instance, NULL)) == NULL) { - kstat_close(kc); - return (-1); - } - break; - } else if (strstr(list_array[i].ap_phys_id, - "dsk/c0t6d0") != NULL) { - /* CD_ROM */ - if (list_array[i].ap_o_state == - CFGA_STAT_UNCONFIGURED) { - kstat_close(kc); - return (-1); - } - if ((ksp_disk = kstat_lookup(kc, SDERR, - sd_instances[disk_number-1], NULL)) == - NULL) { - kstat_close(kc); - return (-1); - } - break; - } - } - } else { /* Hard disk */ - if ((ksp_disk = kstat_lookup(kc, SDERR, - sd_instances[disk_number-1], NULL)) == NULL) { - kstat_close(kc); - return (-1); - } - } - - if (kstat_read(kc, ksp_disk, NULL) == -1) { - log_printf(dgettext(TEXT_DOMAIN, - "\nks read error for disk%d, drv inst%d"), - disk_number, sd_instances[disk_number-1], 0); - kstat_close(kc); - return (-1); - } - disk_data = KSTAT_NAMED_PTR(ksp_disk); - /* - * if disk_data[].value is >0, we have a problem - */ - if (disk_data[1].value.ui32 == 0) { - kstat_close(kc); - return (0); - } else { - kstat_close(kc); - return (1); - } -} - - -void -prtdiag_devinfo(void) -{ - uint_t flag; - /* lets get everything we can from kernel */ - flag = DINFOSUBTREE|DINFOPROP; - rootnode = di_init("/", flag); - if (rootnode == DI_NODE_NIL) { - log_printf(dgettext(TEXT_DOMAIN, - "\nprtdiag_devinfo: di_init() failed"), 0); - return; - } - (void) di_walk_node(rootnode, DI_WALK_CLDFIRST, NULL, - dump_devs); -} - - -/* - * gather information about this node, returns appropriate code. - * specific information we seek are driver names, instances - * we will initialize some globals depending on what we find - * from the kernel device tree info and may be private data - * if required - */ -/*ARGSUSED1*/ -int -dump_devs(di_node_t node, void *arg) -{ - char *driver_name; - - driver_name = di_driver_name(node); - /* we will initialize our globals here */ - if ((di_instance(node) >= 0) && - (driver_name != NULL) && - (!(di_state(node) & DI_DRIVER_DETACHED))) { - if (strcmp(driver_name, "pcf8574") == 0) { - gpio_instances[gpio_count] = di_instance(node); - gpio_count++; - } else if (strcmp(driver_name, "sd") == 0) { - sd_instances[sd_count] = di_instance(node); - sd_count++; - } else if (strcmp(driver_name, "st") == 0) { - st_instance = di_instance(node); - } - } - - if (strcmp(di_node_name(node), "pseudo") == 0) - return (DI_WALK_PRUNECHILD); - else - return (DI_WALK_CONTINUE); -} - - - -/* - * Returns 0 if error , 1 otherwise - */ -int -dump_prop_list(char *name, di_node_t node, di_prop_t (*nxtprop)()) -{ - int prop_len, i, k, max_slots_minus_cpu, n; - uchar_t *prop_data; - char *p; - char *temp_s; - di_prop_t prop, next; - int ret_value = 0; - - max_slots_minus_cpu = scsb_ks_topo.max_units[SLOT]-1; - - if ((next = nxtprop(node, DI_PROP_NIL)) == DI_PROP_NIL) - return (0); - while (next != DI_PROP_NIL) { - int maybe_str = 1, npossible_strs = 0; - prop = next; - next = nxtprop(node, prop); - /* - * get prop length and value: - * private interface--always success - */ - prop_len = di_prop_rawdata(prop, &prop_data); - if (di_prop_type(prop) == DDI_PROP_UNDEF_IT) { - continue; - } - - if (prop_len == 0) { - continue; - } - if (prop_data[prop_len - 1] != '\0') { - maybe_str = 0; - } else { - /* - * Every character must be a string character or a \0, - * and there must not be two \0's in a row. - */ - for (i = 0; i < prop_len; i++) { - if (prop_data[i] == '\0') { - npossible_strs++; - } else if (!isascii(prop_data[i]) || - iscntrl(prop_data[i])) { - maybe_str = 0; - break; - } - - if ((i > 0) && (prop_data[i] == '\0') && - (prop_data[i - 1] == '\0')) { - maybe_str = 0; - break; - } - } - } - - if (maybe_str) { - p = (char *)prop_data; - for (i = 0; i < npossible_strs - 1; i++) { - if ((strcmp(name, SYSSOFT_PROP) == 0) && - (strcmp(di_prop_name(prop), - HSC_PROP_NAME) == 0)) { - temp_s = p; - temp_s += strlen(temp_s) + 1; - } - p += strlen(p) + 1; - } - - if ((strcmp(name, SYSSOFT_PROP) == 0) && - (strcmp(di_prop_name(prop), HSC_PROP_NAME) == 0)) { - temp_s = temp_s - prop_len+2; - for (k = 0, n = 0; k < prop_len; k++) { - if (temp_s[k] == 0) { - n++; - } - } - if (n % 4) { - log_printf(dgettext(TEXT_DOMAIN, - "\nbad slot-table(%d)\n"), n); - slot_table_not_found = 0; - return (ret_value); - } - slot_table_size = n / 4; - /* - * NOTE : We save slot table info in order - */ - for (k = 0; k < slot_table_size; k++) { - char *nexus, *pcidev, *phys_slotname; - char *ga; - /* - * Pick off pointer to nexus - * path or PROM handle - */ - nexus = temp_s; - while (*temp_s != NULL) - temp_s++; - temp_s++; - - /* - * Pick off pointer to the - * pci device number - */ - pcidev = temp_s; - while (*temp_s != NULL) - temp_s++; - temp_s++; - - /* Pick off physical slot no */ - phys_slotname = temp_s; - while (*temp_s != NULL) - temp_s++; - temp_s++; - - /* - * Pick off GA bits which - * we dont use for now. - */ - ga = temp_s; - while (*temp_s != NULL) - temp_s++; - temp_s++; - - hotswap_slot_table[k].pslotnum - = atoi(phys_slotname); - hotswap_slot_table[k].ga = atoi(ga); - hotswap_slot_table[k].pci_devno - = atoi(pcidev); - strcpy(hotswap_slot_table[k].nexus, - nexus); - } /* for (k = 0; k < slot_table_size; k++) */ - - ret_value = 1; - } else /* (strcmp(name, SYSSOFT_PROP) */ - slot_table_not_found = 1; - - /* - * now we want to save off the info - * we would use later - */ - if ((strcmp(name, DRV_PROP) == 0) && - (strcmp(di_prop_name(prop), HSC_MODE) == 0)) { - hotswap_mode = p; - ret_value = 1; - } else if ((strcmp(name, DRV_PROP) == 0) && - (strcmp(di_prop_name(prop), HSC_MODE) != 0)) { - /* save it in order in the right index */ - slot_auto_config[max_slots_minus_cpu] = p; - max_slots_minus_cpu--; - ret_value = 1; - } - - } else { - for (i = 0; i < prop_len; ++i) { -#if 0 - unsigned char byte; - byte = (unsigned char)prop_data[i]; - log_printf("%2.2x", byte, 0); -#endif - } - } - } - return (ret_value); -} - - -void -display_mc_prtdiag_info() -{ - int i, index; - int s_index, i1; - int tg_cpu_index = 0; - char *mcfru_type, *status, *mc_ok_led, *mc_nok_led; - char *misc_info, *health, *board_type; - - log_printf("===============================", 0); - log_printf(dgettext(TEXT_DOMAIN, - " FRU Information ================================\n"), 0); - log_printf(dgettext(TEXT_DOMAIN, - "FRU FRU FRU Green Amber"), 0); - log_printf(dgettext(TEXT_DOMAIN, " Miscellaneous\n"), 0); - log_printf(dgettext(TEXT_DOMAIN, - "Type Unit# Present LED LED"), 0); - log_printf(dgettext(TEXT_DOMAIN, " Information\n"), 0); - - log_printf("---------- ----- ------- ----- -----", 0); - log_printf(" ----------------------------------\n", 0); - - if (scsb_ks_topo.mid_plane.fru_id == SCTRL_MPID_HALF) - misc_info = "Netra ct800"; - else { - misc_info = "Netra ct400"; - } - mcfru_type = prtdiag_fru_types[MIDPLANE]; - switch (scsb_ks_topo.mid_plane.fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; break; - default: - status = NA; break; - } - mc_ok_led = " "; - mc_nok_led = " "; - - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s %-5s %s\n"), - mcfru_type, scsb_ks_topo.mid_plane.fru_unit, - status, mc_ok_led, mc_nok_led, - misc_info, 0); - log_printf(dgettext(TEXT_DOMAIN, "%46s%s\n"), BLANK, PROPS, 0); - log_printf(dgettext(TEXT_DOMAIN, "%49sVersion=%d\n"), BLANK, - scsb_ks_topo.mid_plane.fru_version, 0); - log_printf(dgettext(TEXT_DOMAIN, "%49sMaximum Slots=%d\n"), BLANK, - scsb_ks_topo.max_units[SLOT], 0); - - /* SCB & SSB */ - mcfru_type = prtdiag_fru_types[SCB]; - for (i = 0; i < scsb_ks_topo.max_units[SCB]; ++i) { - misc_info = "System Controller Board"; - if (version_p15_and_p20) { - mc_ok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.blink_leds[1] - & 0xff), SCB_OK_BIT) ? BLINK : - (BIT_TEST((scsb_ks_leddata.leds.p15.ok_leds[1] - & 0xff), SCB_OK_BIT) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.nok_leds[1] - & 0xff), SCB_OK_BIT) ? ON:OFF; - } else { - /* - * support for 1.0 systems - - * Hack! - should use tables ? - */ - mc_ok_led = - (BIT_TEST((scsb_ks_leddata.leds.p10.ok_leds[2] - & 0xff), 0) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p10.nok_leds[2] - & 0xff), 0) ? ON:OFF; - } - switch (scsb_ks_topo.mct_scb[i].fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; - break; - default: - status = NA; - break; - } - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s %-5s %s\n"), - mcfru_type, scsb_ks_topo.mct_scb[i].fru_unit, - status, mc_ok_led, mc_nok_led, misc_info, 0); - log_printf(dgettext(TEXT_DOMAIN, "%46s%s\n"), BLANK, PROPS, 0); - log_printf(dgettext(TEXT_DOMAIN, "%49sVersion=%d\n"), BLANK, - scsb_ks_topo.mct_scb[0].fru_version, 0); - if (fail_drv_prop == 1) - log_printf(dgettext(TEXT_DOMAIN, - "%49s%s=%s\n"), BLANK, HSC_MODE, - hotswap_mode, 0); - } /* for */ - - mcfru_type = prtdiag_fru_types[SSB]; - for (i = 0; i < scsb_ks_topo.max_units[SSB]; ++i) { - misc_info = "System Status Panel"; - switch (scsb_ks_topo.mct_ssb[i].fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; - break; - default: - status = NA; - break; - } - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s %-5s %s\n"), - mcfru_type, scsb_ks_topo.mct_ssb[i].fru_unit, - status, BLANK, BLANK, misc_info, 0); - } /* for */ - - /* Slots */ - for (i = 0; i < scsb_ks_topo.max_units[SLOT]; ++i) { - if (montecarlo) { - if (scsb_ks_topo.mct_slots[i].fru_unit == 1) - mcfru_type = prtdiag_fru_types[1]; - else - mcfru_type = prtdiag_fru_types[SLOT]; - /* - * Another way this could have been done is, - * to read the sub system id - * it is 0x6722 for Alarm Card - * but this id is only valid for the new ACs - * older ACs still have the same susbsystem - * id as most other Sun PCI cards - * We cannot completely rely on this. - * Also,it turns out that Sun OpenBoot does not - * always follow IEEE 1275 std, hence in a few - * systems, the "subsystem-id" published by the - * PROM could not be found - * We know the AC slot# if present on both MC&Tg - * Hence we check on both - now we are sure - * that we have found an AC - */ - if ((scsb_ks_topo.mct_slots[i].fru_unit == 8) && - (alarm_card_present == 1)) - board_type = AC_CARD; - else - board_type = UK; - } else { - if (scsb_ks_topo.mct_slots[i].fru_unit == 3) - mcfru_type = prtdiag_fru_types[1]; - else - mcfru_type = prtdiag_fru_types[SLOT]; - /* - * Another way this could have been done is, - * to read the sub system id - * it is 0x6722 for Alarm Card - * but this id is only valid for the new ACs - * older ACs still have the same susbsystem - * id as most other Sun PCI cards - * We cannot completely rely on this. - * Also,it turns out that Sun OpenBoot does not - * always follow IEEE 1275 std, hence in a few - * systems, the "subsystem-id" published by the - * PROM could not be found - * We know the AC slot# if present on both MC&Tg - * Hence we check on both - now we are sure - * that we have found an AC - */ - if ((scsb_ks_topo.mct_slots[i].fru_unit == 1) && - (alarm_card_present == 1)) - board_type = AC_CARD; - else - board_type = UK; - } - if (version_p15_and_p20) { - mc_ok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.blink_leds[0] - & 0xff), i) ? BLINK : - (BIT_TEST((scsb_ks_leddata.leds.p15.ok_leds[0] - & 0xff), i) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.nok_leds[0] - & 0xff), i) ? ON:OFF; - } else { - /* - * support for 1.0 systems - - * Hack! - should use tables ? - */ - if (scsb_ks_topo.mct_slots[i].fru_unit == 7) { - mc_ok_led = - BIT_TEST( - (scsb_ks_leddata.leds.p10.blink_leds[1] - & 0xff), 0) ? BLINK : - (BIT_TEST( - (scsb_ks_leddata.leds.p10.ok_leds[1] - & 0xff), 0) ? ON:OFF); - mc_nok_led = - BIT_TEST( - (scsb_ks_leddata.leds.p10.nok_leds[1] - & 0xff), 0) ? ON:OFF; - } else if (scsb_ks_topo.mct_slots[i].fru_unit == 8) { - mc_ok_led = - BIT_TEST( - (scsb_ks_leddata.leds.p10.blink_leds[1] - & 0xff), 1) ? BLINK : - (BIT_TEST( - (scsb_ks_leddata.leds.p10.ok_leds[1] - & 0xff), 1) ? ON:OFF); - mc_nok_led = - BIT_TEST( - (scsb_ks_leddata.leds.p10.nok_leds[1] - & 0xff), 1) ? ON:OFF; - } else { - /* - * for all other slots offset, - * index are the same - */ - mc_ok_led = - BIT_TEST( - (scsb_ks_leddata.leds.p10.blink_leds[0] - & 0xff), i) ? BLINK : - (BIT_TEST( - (scsb_ks_leddata.leds.p10.ok_leds[0] - & 0xff), i) ? ON:OFF); - mc_nok_led = - BIT_TEST( - (scsb_ks_leddata.leds.p10.nok_leds[0] - & 0xff), i) ? ON:OFF; - } - - } /* else if (!version_p15_and_p20) */ - - switch (scsb_ks_topo.mct_slots[i].fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; - break; - default: - status = NA; - break; - } - - index = (int)scsb_ks_topo.mct_slots[i].fru_type; - if (montecarlo) { - if (scsb_ks_topo.mct_slots[i].fru_unit == 1) { - /* cpu slot */ - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s "), - mcfru_type, - scsb_ks_topo.mct_slots[i].fru_unit, - status, mc_ok_led, mc_nok_led, 0); - log_printf(dgettext(TEXT_DOMAIN, "%-5s %s\n"), - mc_nok_led, - slot_occupants[index], 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49stemperature(celsius):%d\n"), - BLANK, - pcf8591_ks_temp.value, 0); -#ifdef NEVER - log_printf(dgettext(TEXT_DOMAIN, - "%49sminimum temperature:%d\n"), - BLANK, - pcf8591_ks_temp.min, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49swarning temp. threshold:%d\n"), - BLANK, - pcf8591_ks_temp.warning_threshold, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sshutdown temp.threshold:%d\n"), - BLANK, - pcf8591_ks_temp.shutdown_threshold, 0); -#endif /* NEVER */ - } else if ((scsb_ks_topo.mct_slots[i].fru_unit == 2) && - (cpu_ftm_present == 1)) { - /* CFTM slot */ - /* - * The CFTM can only be present in Slot 2 - * for Netract-800, for Netract-400 the FTM - * is not sitted in a Slot. Hence, this is - * another special case and we need to handle - * this differently than other slots - */ - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s "), - mcfru_type, - scsb_ks_topo.mct_slots[i].fru_unit, - status, mc_ok_led, mc_nok_led, 0); - log_printf(dgettext(TEXT_DOMAIN, "%-5s %s\n"), - mc_nok_led, - CPU_FTM, 0); - } else { - if (fail_drv_prop == 1) { - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s "), - mcfru_type, - scsb_ks_topo.mct_slots[i].fru_unit, - status, mc_ok_led, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%-5s %s\n"), - mc_nok_led, - slot_occupants[index], 0); - log_printf(dgettext(TEXT_DOMAIN, - "%46s%s\n"), BLANK, - PROPS, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sauto-config=%s\n"), - BLANK, - slot_auto_config[i], 0); - } else { - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s "), - mcfru_type, - scsb_ks_topo.mct_slots[i].fru_unit, - status, mc_ok_led, 0); - log_printf(dgettext(TEXT_DOMAIN, "%-5s %s\n"), - mc_nok_led, - slot_occupants[index], 0); - } - } - } else { /* tonga */ - if (scsb_ks_topo.mct_slots[i].fru_unit == 3) { - /* cpu slot */ - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s "), - mcfru_type, - scsb_ks_topo.mct_slots[i].fru_unit, - status, mc_ok_led, 0); - log_printf(dgettext(TEXT_DOMAIN, "%-5s %s\n"), - mc_nok_led, - slot_occupants[index], 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49stemperature(celsius):%d\n"), - BLANK, - pcf8591_ks_temp.value, 0); -#ifdef NEVER - - log_printf(dgettext(TEXT_DOMAIN, - "%49sminimum temperature:%d\n"), - BLANK, - pcf8591_ks_temp.min, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49swarning temp. threshold:%d\n"), - BLANK, - pcf8591_ks_temp.warning_threshold, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sshutdown temp. threshold:%d\n"), - BLANK, - pcf8591_ks_temp.shutdown_threshold, 0); -#endif /* NEVER */ - } else { - if (fail_drv_prop == 1) { - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s "), - mcfru_type, - scsb_ks_topo.mct_slots[i].fru_unit, - status, mc_ok_led, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%-5s %s\n"), - mc_nok_led, - slot_occupants[index], 0); - - log_printf(dgettext(TEXT_DOMAIN, - "%46s%s\n"), BLANK, PROPS, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sauto-config=%s\n"), - BLANK, - slot_auto_config[tg_cpu_index+1], - 0); - if (scsb_ks_topo.mct_slots[i].fru_unit - != 3) - tg_cpu_index++; - } else { - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s "), - mcfru_type, - scsb_ks_topo.mct_slots[i].fru_unit, - status, mc_ok_led, 0); - log_printf(dgettext(TEXT_DOMAIN, "%-5s %s\n"), - mc_nok_led, - slot_occupants[index], 0); - } - } - } - /* we first match the correct slot numbers */ - for (s_index = 0; s_index < slot_table_size; s_index++) { - if (slot_table_not_found == 1) { - /* use prom table */ - if (scsb_ks_topo.mct_slots[i].fru_unit == - prom_slot_table[s_index].pslotnum) { - /* - * search for the addr/pci num - * in all slot info structs - */ - for (i1 = 0; i1 < slot_index; - i1++) { - if (prom_slot_table[s_index].pci_devno == - mc_slots_data.mc_slot_info[i1].slot_addr) { - int nd; - log_printf(dgettext(TEXT_DOMAIN, - "%46s%s%s\n"), BLANK, - BOARDTYPE, board_type, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%46s%s\n"), BLANK, DEVS, 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49s%s\n"), BLANK, - PCI_ROOT_AP, 0); - for (nd = 0; - nd < mc_slots_data.mc_slot_info[i1].number_devs; - nd++) { - log_printf(dgettext(TEXT_DOMAIN, "%52s%s\n"), BLANK, - mc_slots_data.mc_slot_info[i1].devs_info[nd], - 0); - } /* for */ - - } /* if */ - - } /* for(i1) */ - - } /* if */ - - } else { - /* use solaris lot table */ - if (fail_syssoft_prop == 1) { - if (scsb_ks_topo.mct_slots[i].fru_unit == - hotswap_slot_table[s_index].pslotnum) { - /* - * search for the addr/pci - * num in all slot info structs - */ - for (i1 = 0; i1 < slot_index; i1++) { - if (hotswap_slot_table[s_index].pci_devno == - mc_slots_data.mc_slot_info[i1].slot_addr) { - int nd; - for (nd = 0; - nd < mc_slots_data.mc_slot_info[i1].number_devs; - nd++) { - log_printf(dgettext(TEXT_DOMAIN, "%49s%s\n"), BLANK, - mc_slots_data.mc_slot_info[i1].devs_info[nd], - 0); - } - } /* if */ - - } /* for(i1) */ - - } /* if */ - - } /* (fail_syssoft_prop == 1) */ - - } /* (slot_table_not_found == 1) */ - - } /* for(s_index) */ - - } /* for */ - mcfru_type = "PDU"; - misc_info = "Power Distribution Unit"; - for (i = 0; i < scsb_ks_topo.max_units[PDU]; ++i) { - if (version_p15_and_p20) { - mc_ok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.blink_leds[1] - & 0xff), PDU1_OK_BIT+i*2) ? BLINK : - (BIT_TEST((scsb_ks_leddata.leds.p15.ok_leds[1] - & 0xff), PDU1_OK_BIT+i*2) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.nok_leds[1] - & 0xff), PDU1_OK_BIT+i*2) ? ON:OFF; - } - switch (scsb_ks_topo.mct_pdu[i].fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; - break; - default: - status = NA; - break; - } - if (version_p15_and_p20) { - log_printf(dgettext(TEXT_DOMAIN, - "%-10s %-5d %-7s %-5s %-5s %s\n"), - mcfru_type, scsb_ks_topo.mct_pdu[i].fru_unit, - status, mc_ok_led, mc_nok_led, misc_info, 0); - } else { - log_printf(dgettext(TEXT_DOMAIN, - "%-10s %-5d %-7s%18s%s\n"), - mcfru_type, scsb_ks_topo.mct_pdu[i].fru_unit, - status, BLANK, misc_info, 0); - } - } /* for */ - - /* PS */ - mcfru_type = prtdiag_fru_types[PS]; - misc_info = "Power Supply Unit"; - for (i = 0; i < scsb_ks_topo.max_units[PS]; ++i) { - if (version_p15_and_p20) { - mc_ok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.blink_leds[2] - & 0xff), PS1_OK_BIT+i) ? BLINK : - (BIT_TEST((scsb_ks_leddata.leds.p15.ok_leds[2] - & 0xff), PS1_OK_BIT+i) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.nok_leds[2] - & 0xff), PS1_OK_BIT+i) ? ON:OFF; - } else { - /* - * support for 1.0 systems - - * Hack! - should use tables ? - */ - mc_ok_led = - (BIT_TEST((scsb_ks_leddata.leds.p10.ok_leds[2] - & 0xff), 1+i) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p10.nok_leds[2] - & 0xff), 1+i) ? ON:OFF; - } - switch (scsb_ks_topo.mct_ps[i].fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; - break; - default: - status = NA; - break; - } - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s %-5s %s\n"), - mcfru_type, scsb_ks_topo.mct_ps[i].fru_unit, - status, mc_ok_led, mc_nok_led, - misc_info, 0); - if (scsb_ks_topo.mct_ps[i].fru_status == FRU_PRESENT) { - if (scsb_ks_topo.mct_ps[i].fru_unit == 1) { - log_printf(dgettext(TEXT_DOMAIN, - "%49scondition:%s\n"), BLANK, - ((pcf8574_ks_ps1.ps_ok)? NOK:OK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49stemperature:%s\n"), BLANK, - ((pcf8574_ks_ps1.temp_ok)? NOK:OK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sps fan:%s\n"), BLANK, - ((pcf8574_ks_ps1.psfan_ok)? NOK:OK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49ssupply:%s\n"), BLANK, - ((pcf8574_ks_ps1.on_state)? OFF:ON), 0); - } else { - log_printf(dgettext(TEXT_DOMAIN, - "%49scondition:%s\n"), BLANK, - ((pcf8574_ks_ps2.ps_ok)? NOK:OK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49stemperature:%s\n"), BLANK, - ((pcf8574_ks_ps2.temp_ok)? NOK:OK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sps fan:%s\n"), BLANK, - ((pcf8574_ks_ps2.psfan_ok)? NOK:OK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49ssupply:%s\n"), BLANK, - ((pcf8574_ks_ps2.on_state)? OFF:ON), 0); - } /* if */ - } - - } /* for */ - - /* Fan tray */ - mcfru_type = prtdiag_fru_types[FAN]; - misc_info = "Fan Tray"; - for (i = 0; i < scsb_ks_topo.max_units[FAN]; ++i) { - if (version_p15_and_p20) { - mc_ok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.blink_leds[2] - & 0xff), FAN1_OK_BIT+i) ? BLINK : - (BIT_TEST((scsb_ks_leddata.leds.p15.ok_leds[2] - & 0xff), FAN1_OK_BIT+i) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.nok_leds[2] - & 0xff), FAN1_OK_BIT+i) ? ON:OFF; - } else { - /* - * support for 1.0 systems - - * Hack! - should use tables ? - */ - mc_ok_led = - (BIT_TEST((scsb_ks_leddata.leds.p10.ok_leds[3] - & 0xff), 3+i) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p10.nok_leds[3] - & 0xff), 3+i) ? ON:OFF; - } - switch (scsb_ks_topo.mct_fan[i].fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; - break; - default: - status = NA; - break; - } - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s %-5s %s\n"), - mcfru_type, scsb_ks_topo.mct_fan[i].fru_unit, - status, mc_ok_led, mc_nok_led, - misc_info, 0); - if (scsb_ks_topo.mct_fan[i].fru_status == FRU_PRESENT) { - if (scsb_ks_topo.mct_fan[i].fru_unit == 1) { - log_printf(dgettext(TEXT_DOMAIN, - "%49scondition:%s\n"), BLANK, - ((pcf8574_ks_fant1.fan_ok)? OK:NOK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sfan speed:%s\n"), BLANK, - ((pcf8574_ks_fant1.fanspeed)? HI:LO), 0); - } else { - log_printf(dgettext(TEXT_DOMAIN, - "%49scondition:%s\n"), BLANK, - ((pcf8574_ks_fant2.fan_ok)? OK:NOK), 0); - log_printf(dgettext(TEXT_DOMAIN, - "%49sfan speed:%s\n"), BLANK, - ((pcf8574_ks_fant2.fanspeed)? HI:LO), 0); - } - } - - } /* for */ - - /* DISKS */ - for (i = 0; i < scsb_ks_topo.max_units[DISK]; ++i) { - if (scsb_ks_topo.mct_disk[i].fru_unit != RMM_NUMBER) - mcfru_type = prtdiag_fru_types[DISK]; - else - mcfru_type = "RMM "; - switch (scsb_ks_topo.mct_disk[i].fru_status) { - case FRU_PRESENT: - status = YES; - break; - case FRU_NOT_PRESENT: - status = NO; - break; - case FRU_NOT_AVAILABLE: - status = NA; - break; - default: - status = NA; - break; - } - if (version_p15_and_p20) { - mc_ok_led = - BIT_TEST((scsb_ks_leddata.scb_led_regs[8] - & 0xff), DISK1_OK_BIT+i) ? BLINK : - (BIT_TEST((scsb_ks_leddata.leds.p15.ok_leds[2] - & 0xff), DISK1_OK_BIT+i) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p15.nok_leds[2] - & 0xff), DISK1_OK_BIT+i) ? ON:OFF; - } else { - /* - * support for 1.0 systems - - * Hack! - should use tables ? - */ - mc_ok_led = - (BIT_TEST((scsb_ks_leddata.leds.p10.ok_leds[2] - & 0xff), DISK1_OK_BIT+i) ? ON:OFF); - mc_nok_led = - BIT_TEST((scsb_ks_leddata.leds.p10.nok_leds[2] - & 0xff), DISK1_OK_BIT+i) ? ON:OFF; - } - /* print everything except condition */ - if (scsb_ks_topo.mct_disk[i].fru_unit != RMM_NUMBER) { - misc_info = "Hard Disk Drive"; - log_printf(dgettext(TEXT_DOMAIN, - "%10s %-5d %-7s %-5s %-5s %s\n"), - mcfru_type, scsb_ks_topo.mct_disk[i].fru_unit-1, - status, mc_ok_led, mc_nok_led, misc_info, 0); - } else { - misc_info = "Removable Media Module"; - log_printf(dgettext(TEXT_DOMAIN, - "%10s %5s %-7s %-5s %-5s %s\n"), - mcfru_type, BLANK, - status, mc_ok_led, mc_nok_led, misc_info, 0); - } - - /* find out fru health from the SCSI drivers */ - if (scsb_ks_topo.mct_disk[i].fru_status == FRU_PRESENT) { - switch ( - scsi_disk_status( - scsb_ks_topo.mct_disk[i].fru_unit)) { - case 0: - health = OK; - break; - case 1: - health = NOK; - break; - case -1: - health = UK; - break; - default: - health = NA; - break; - } - log_printf(dgettext(TEXT_DOMAIN, - "%49scondition:%s\n"), BLANK, health, 0); - } - - } /* for */ - - log_printf(dgettext(TEXT_DOMAIN, "\n"), 0); - -} /* display_mc_prtdiag_info() */ - - -void -analyze_pcipci_siblings(di_node_t node) -{ - di_node_t lc_node; - /* we will find all the dev info for slots first */ - lc_node = di_drv_first_node("pci_pci", node); - lc_node = di_child_node(lc_node); - /* we are at "pci" node now */ - do { - if (di_walk_node(lc_node, DI_WALK_CLDFIRST, - NULL, analyze_nodes) != 0) { - return; - } - } while ((lc_node = di_sibling_node(lc_node)) != DI_NODE_NIL); - - /* now we wll gather info on sysctrl */ - lc_node = di_drv_first_node(SCSB_DEV, node); - if (lc_node != DI_NODE_NIL) - analyze_nodes(lc_node, "sysctrl"); -} /* analyze_pcipci_siblings(.) */ - - -int -analyze_nodes(di_node_t l_node, void *arg) -{ - char *temp; - char *name, *pname; - di_node_t parent; - /* - * we will figure out whether the parent node is "pci" type - * we will save info only in this case as we only want to - * print out the nodes under AP and not others - */ - parent = di_parent_node(l_node); - pname = di_node_name(parent); - name = di_node_name(l_node); - /* - * if this is PCI bridge, we know that this is the AP for slots - * hence, we will save off the address(to convert to slot mapping) - * later, and also we will start saving off slot info struct for - * reporting later - * we will save the immediate childs of this bridge only - */ - if (strcmp(name, "pci") == 0) { - num_devs = 0; - if ((temp = di_bus_addr(l_node)) != NULL) { - mc_slots_data.mc_slot_info[slot_index].slot_addr - = (int)strtol(temp, (char **)NULL, 16); - } - slot_index++; - } else { - if (strcmp(pname, "pci") == 0) { - if ((mc_slots_data.mc_slot_info[slot_index-1].devs_info[num_devs]) - != NULL) { - (void) strcat( - mc_slots_data.mc_slot_info[slot_index-1].devs_info[num_devs], - name); - } else { - (void) strcpy( - mc_slots_data.mc_slot_info[slot_index-1].devs_info[num_devs], - name); - } /* if ((mc_slots_data.mc_slot_inf */ - - num_devs++; - mc_slots_data.mc_slot_info[slot_index-1].number_devs - = num_devs; - } /* if parent is pci */ - - } /* if node is pci */ - if (arg != NULL) { - if (strcmp((char *)arg, "sysctrl") == 0) { - if (dump_prop_list("System", l_node, - di_prop_sys_next)) { - (void) dump_prop_list(NULL, l_node, - di_prop_global_next); - } else { - fail_syssoft_prop = - dump_prop_list(SYSSOFT_PROP, - l_node, di_prop_global_next); - } - - fail_drv_prop = - dump_prop_list(DRV_PROP, l_node, - di_prop_drv_next); - /* - * (void) dump_prop_list("Hardware", - * l_node, di_prop_hw_next); - */ - /* dump_priv_data(l_node); */ - } - } - - return (0); - -} /* analyze_nodes(..) */ - - - -/* - * To get the slot information, - * The OBP defines the 'slot-table' property. But the OS - * can override it with 'hsc-slot-map' property - * through the .conf file. - * Since the formats are different, 2 different property names - * are chosen. - * The OBP property format is - * <phandle>,<pci-devno>,<phys-slotno>,<ga-bits> - * The OS property format is (ga-bits is not used however) - * <busnexus-path>,<pci-devno>,<phys-slotno>,<ga-bits> - * returns 0 on error, 1 otherwise - */ -int -extract_slot_table_from_obp() -{ - if (mc_promopen(O_RDONLY)) { - log_printf(dgettext(TEXT_DOMAIN, - "\ncannot open openprom device"), 0); - return (0); - } - - if (mc_next(0) == 0) - return (0); - mc_walk(mc_next(0)); - - if (close(oprom_fd) < 0) { - log_printf(dgettext(TEXT_DOMAIN, - "\nclose error on %s"), OPENPROMDEV, 0); - return (0); - } - - return (1); - -} /* extract_slot_table_from_obp() */ - - -int -mc_next(int id) -{ - Oppbuf oppbuf; - struct openpromio *opp = &(oppbuf.opp); - - bzero(oppbuf.buf, BUFSIZE); - opp->oprom_size = MAXVALSIZE; - opp->oprom_node = id; - if (ioctl(oprom_fd, OPROMNEXT, opp) < 0) { - log_printf(dgettext(TEXT_DOMAIN, "\nError OPROMNEXT"), 0); - return (0); - } - return (opp->oprom_node); - -} /* mc_next(.) */ - - -void -mc_walk(int id) -{ - int curnode; - mc_dump_node(id); - if (curnode = mc_child(id)) - mc_walk(curnode); - if (curnode = mc_next(id)) - mc_walk(curnode); -} /* mc_walk(.) */ - -int -mc_child(int id) -{ - Oppbuf oppbuf; - struct openpromio *opp = &(oppbuf.opp); - - bzero(oppbuf.buf, BUFSIZE); - opp->oprom_size = MAXVALSIZE; - opp->oprom_node = id; - if (ioctl(oprom_fd, OPROMCHILD, opp) < 0) { - perror("\nOPROMCHILD"); - exit(0); - } - return (opp->oprom_node); - -} /* mc_child(.) */ - - -/* - * Print all properties and values - */ -void -mc_dump_node(int id) -{ - int k; - Oppbuf oppbuf; - hsc_prom_slot_table_t *hpstp; - struct openpromio *opp = &(oppbuf.opp); - - /* get first prop by asking for null string */ - bzero(oppbuf.buf, BUFSIZE); - for (;;) { - /* - * get next property name - */ - opp->oprom_size = MAXNAMESZ; - - if (ioctl(oprom_fd, OPROMNXTPROP, opp) < 0) { - perror("\nOPROMNXTPROP"); - return; - } - if (opp->oprom_size == 0) - break; - if (strcmp(opp->oprom_array, "slot-table") == 0) { - if (mc_getpropval(opp) || opp->oprom_size - == (uint_t)-1) { - log_printf(dgettext(TEXT_DOMAIN, - "\ndata not available"), 0); - return; - } else { - slot_table_size = - opp->oprom_size / - sizeof (hsc_prom_slot_table_t); - hpstp = - (hsc_prom_slot_table_t *)opp->oprom_array; - for (k = 0; k < slot_table_size; k++, hpstp++) { - prom_slot_table[k].pslotnum = - hpstp->pslotnum; - prom_slot_table[k].ga = - hpstp->ga; - prom_slot_table[k].pci_devno = - hpstp->pci_devno; - prom_slot_table[k].phandle = - hpstp->phandle; - } /* for (k = 0; k < slot_table_size; k++) */ - - } - } - } - -} /* mc_dump_node(.) */ - - -int -mc_getpropval(struct openpromio *opp) -{ - opp->oprom_size = MAXVALSIZE; - if (ioctl(oprom_fd, OPROMGETPROP, opp) < 0) { - log_printf(dgettext(TEXT_DOMAIN, "\nError OPROMGETPROP"), 0); - return (1); - } - return (0); - -} /* mc_getpropval(.) */ - - - -/* - * This function returns nothing. - */ -void -alarm_card_occupant() -{ - int scsb_fd; - scsb_ioc_rdwr_t ioc_read; - uint8_t new_mode = 0; - uint8_t old_mode = 0; - uchar_t reg_index; - - if (NULL == scsb_node) { - if (check_platform() == -1) { - return; - } - } - - if (version_p15_and_p20 == 1) - reg_index = 0xe9; /* config status reg offset on SCB */ - else - reg_index = 0xd7; /* config status reg offset on SCB */ - - if ((scsb_fd = open(scsb_node, O_RDONLY)) < 0) { - log_printf(dgettext(TEXT_DOMAIN, - "\n%s open failed"), scsb_node, 0); - return; - } - - /* save off the old mode */ - if (scsb_mode(scsb_fd, GET, &old_mode) == 0) - return; - /* we put scsb in diag mode to read this specific ioctl */ - new_mode = ENVCTRL_DIAG_MODE; - if (scsb_mode(scsb_fd, SET, &new_mode) == 0) - return; - /* now lets read the config register */ - if (scsb_ioc_reg_read(scsb_fd, reg_index, &ioc_read, 1) == 0) - return; - /* restore the original mode */ - if (scsb_mode(scsb_fd, SET, &old_mode) == 0) - return; - alarm_card_present = (BIT_TEST(ioc_read.ioc_rbuf[0]&0xff, 0) ? 1:0); - -} /* alarm_card_occupant() */ - - -/* - * This function changes the SCSB mode to the desired one - * 1 on sucess, 0 otherwise - */ -int -scsb_mode(int fd, scsb_op_t sop, uint8_t *new_mode) -{ - struct strioctl sioc; - - if (sop == GET) - sioc.ic_cmd = ENVC_IOC_GETMODE; - else - sioc.ic_cmd = ENVC_IOC_SETMODE; - - sioc.ic_timout = 0; - sioc.ic_len = sizeof (uint8_t); - sioc.ic_dp = (char *)new_mode; - - - if (ioctl(fd, I_STR, &sioc) == -1) { - log_printf(dgettext(TEXT_DOMAIN, - "\nscsb_mode():scsb ioctl() failed"), 0); - return (0); - } - return (1); - -} /* scsb_mode(...) */ - - -/* - * 1 on success, 0 otherwise - */ -int -scsb_ioc_reg_read(int fd, uchar_t index, scsb_ioc_rdwr_t *ioc_rd, int num) -{ - struct strioctl sioc; - scsb_ioc_rdwr_t *rdwrp; - - rdwrp = ioc_rd; - sioc.ic_timout = 0; - sioc.ic_len = sizeof (scsb_ioc_rdwr_t); - sioc.ic_dp = (char *)rdwrp; - /* setup read command before ioctl */ - sioc.ic_cmd = SCSBIOC_REG_READ; - rdwrp->ioc_wlen = 0; - rdwrp->ioc_rlen = num; - rdwrp->ioc_regindex = index; - if (ioctl(fd, I_STR, &sioc) == -1) { - log_printf(dgettext(TEXT_DOMAIN, - "scsb_ioc_reg_read(): scsb ioctl() failed\n"), 0); - return (0); - } - return (1); - -} /* scsb_ioc_reg_read(....) */ diff --git a/usr/src/lib/libprtdiag_psr/sparc/snowbird/Makefile b/usr/src/lib/libprtdiag_psr/sparc/snowbird/Makefile deleted file mode 100644 index 471bad4ac6..0000000000 --- a/usr/src/lib/libprtdiag_psr/sparc/snowbird/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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. -# -# lib/libprtdiag_psr/sparc/snowbird/Makefile -# -# Need to make libctsmc library first. -# -LIBCTSMC = ../../../../../src/cmd/picl/plugins/sun4u/snowbird/lib/libctsmc -all: ctsmclib -ctsmclib: $(LIBCTSMC)/libctsmc.c $(LIBCTSMC)/smclib.h - cd $(LIBCTSMC); $(MAKE) - -LIBBASE = ../../../../../src/lib -UTSBASE = ../../../../uts -SUN4U_INC_BASE = $(UTSBASE)/sun4u/sys -SB_INC_BASE = $(UTSBASE)/sun4u/snowbird/sys - -PLATFORM_OBJECTS= snowbird.o - -include ../Makefile.com - -IFLAGS = -I$(USR_PLAT_DIR)/sun4u/include -I../../../libprtdiag/inc -I$(LIBBASE)/libdevinfo -IFLAGS += -I$(SUN4U_INC_BASE) -I$(SB_INC_BASE) -I$(SRC)/cmd/picl/plugins/inc -IFLAGS += -I$(LIBCTSMC) -LINTFLAGS += $(IFLAGS) -LDLIBS += -L$(LIBCTSMC) -LDLIBS += -L$(LIBBASE)/libdevinfo -ldevinfo -L$(LIBBASE)/libcfgadm \ - -lcfgadm -lpicl -lctsmc -DYNFLAGS += -R/usr/platform/SUNW,Netra-CP2300/lib - - -# -# SUNW,Netra-CP2300 platform can link to -# /usr/platform/SUNW,Netra-CP2300/lib/libprtdiag_psr.so -# -PLATFORM=SUNW,Netra-CP2300 - -$(USR_PLAT_DIR)/$(PLATFORM)/lib/libprtdiag_psr.so.1 := FILEMODE= 0755 - -.KEEP_STATE: - -PLATLIBS= $(PLATFORM:%=$(USR_PLAT_DIR)/%/lib/) - -install: all $(PLATLIBS) $(USR_PSM_LIBS) - -# -# install rules for SUNW,Netra-CP2300/lib/libprtdiag_psr.so -# -$(PLATLIBS): - $(INS.dir) - -$(USR_PSM_LIB_DIR): - cd $(UTSBASE)/sun4u/snowbird; $(MAKE) $(USR_PSM_LIB_DIR) - -$(USR_PSM_LIB_DIR)/%: % $(USR_PSM_LIB_DIR) - $(INS.file) - -# New additions to generate msg file -POFILE = libprtdiag_psr_snowbird.po -POFILES = snowbird.po - -_msg: $(MSGDOMAIN) $(POFILE) - $(RM) $(MSGDOMAIN)/$(POFILE) - $(CP) $(POFILE) $(MSGDOMAIN) - -$(POFILE): $(POFILES) - $(RM) $@ - $(CAT) $(POFILES) > $@ - -$(POFILES): - $(RM) messages.po - $(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext common/snowbird.c` - $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@ - $(RM) messages.po diff --git a/usr/src/lib/libprtdiag_psr/sparc/snowbird/common/snowbird.c b/usr/src/lib/libprtdiag_psr/sparc/snowbird/common/snowbird.c deleted file mode 100644 index 2d23399c4d..0000000000 --- a/usr/src/lib/libprtdiag_psr/sparc/snowbird/common/snowbird.c +++ /dev/null @@ -1,1116 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - */ - - -/* - * This program prints the diagnostics of Sanibel system. It - * also prints other miscellaneous information about watchdog, temperature - * of CPU sensor, firmware versions of SMC and, micro controller role - * etc. The basic sources of output is PICL, and SMC. - */ - -/* includes */ - -#include <stdio.h> -#include <strings.h> -#include <ctype.h> -#include <string.h> -#include <time.h> -#include <dirent.h> -#include <sys/param.h> -#include <picl.h> -#include <libintl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/systeminfo.h> -#include <sys/openpromio.h> -#include <fcntl.h> -#include <smc_if.h> -#include <stropts.h> -#include <alloca.h> -#include <errno.h> -#include <poll.h> -#include <stdlib.h> -#include <unistd.h> -#include <kstat.h> -#include <sys/utsname.h> -#include <stddef.h> -#include <pdevinfo.h> -#include <display_sun4u.h> -#include <libprtdiag.h> -#include <smclib.h> -#include <smc_commands.h> -#include <picldefs.h> - -/* #defines for the PICL library API usage and local static variables */ -#define PD_CPCI_SLOT_TYPE "cpci" -#define PD_PCI_SLOT_TYPE "pci" -#define PD_PRESENT 1 -#define PD_BLANK " " -#define PD_ENABLED 1 -#define PD_DISABLED 0 -#define SNOWBIRD "SUNW,Netra-CP2300" -#define CHASSIS_NODE_NAME "chassis" - -/* #defines for the SMC and IPMI commands */ -#define POLL_TIMEOUT 10000 -#define DEFAULT_SEQN 0xff - -/* SMC driver */ -#define PD_SMC_DRV_PATH "/dev/ctsmc" - -/* Constants */ -#define OBP_PROP_BANNER_NAME "banner-name" -#define OBP_PROP_CLOCK_FREQ "clock-frequency" - - - -/* #defines for local usage */ -#define PD_SUCCESS 0 -#define PD_FAILURE 1 -#define PD_INTERNAL_FAILURE 2 -#define PD_ERROR -1 - -/* static global variables */ -static int pd_print_option; -static uint8_t pd_smc_glbl_enabl_rsp[2]; -static boolean_t pd_hdr_prt = B_TRUE; -static int pd_smc_fd = 0; - - -/* function declarations used in this program */ -static uint32_t pd_check_for_snowbird(); -static uint32_t pd_prt_snowbird_diag(); -static uint32_t pd_check_cpu_health(); -static uint32_t pd_check_tty_debug_mode(); -static uint32_t pd_query_SMC_firmware_version(); -static uint32_t pd_check_slots(); -int32_t pd_prt_slot_info(picl_nodehdl_t, void *); -int do_prominfo(int syserrlog, char *pname, int log_flag, int prt_flag); -static uint32_t pd_query_watchdog_state(); -int pd_check_wd_state(picl_nodehdl_t, void *); -static uint32_t pd_print_fruinfo_hdr(); -static uint32_t pd_print_device_info(int); -static uint32_t pd_get_role_information(); -static uint32_t pd_get_message_flags(); -static uint32_t pd_get_reset_mode(); -static uint32_t pd_get_sensor_reading(); -static uint32_t pd_get_sensor_threshold(); -static uint32_t pd_prt_cpci_condition(picl_nodehdl_t nodeh); -static uint32_t pd_check_location_parent(picl_nodehdl_t nodeh); -static uint64_t -picldiag_get_uint_propval(picl_nodehdl_t modh, char *prop_name, int *ret); -static int picldiag_get_clock_freq(picl_nodehdl_t modh, uint32_t *freq); -static int display_system_clock(picl_nodehdl_t plafh); - -/* - * return the value of the uint prop - */ -static uint64_t -picldiag_get_uint_propval(picl_nodehdl_t modh, char *prop_name, int *ret) -{ - int err; - picl_prophdl_t proph; - picl_propinfo_t pinfo; - uint8_t uint8v; - uint16_t uint16v; - uint32_t uint32v; - uint64_t uint64v; - - err = picl_get_propinfo_by_name(modh, prop_name, &pinfo, &proph); - if (err != PICL_SUCCESS) { - *ret = err; - return (0); - } - - /* - * If it is not an int or uint prop, return failure - */ - if ((pinfo.type != PICL_PTYPE_INT) && - (pinfo.type != PICL_PTYPE_UNSIGNED_INT)) { - *ret = PICL_FAILURE; - return (0); - } - - /* uint prop */ - - switch (pinfo.size) { - case sizeof (uint8_t): - err = picl_get_propval(proph, &uint8v, sizeof (uint8v)); - *ret = err; - return (uint8v); - case sizeof (uint16_t): - err = picl_get_propval(proph, &uint16v, sizeof (uint16v)); - *ret = err; - return (uint16v); - case sizeof (uint32_t): - err = picl_get_propval(proph, &uint32v, sizeof (uint32v)); - *ret = err; - return (uint32v); - case sizeof (uint64_t): - err = picl_get_propval(proph, &uint64v, sizeof (uint64v)); - *ret = err; - return (uint64v); - default: /* not supported size */ - *ret = PICL_FAILURE; - return (0); - } -} - - - -/* - * get the clock frequency - */ -static int -picldiag_get_clock_freq(picl_nodehdl_t modh, uint32_t *freq) -{ -#define ROUND_TO_MHZ(x) (((x) + 500000)/ 1000000) - - int err; - uint64_t clk_freq; - - clk_freq = picldiag_get_uint_propval(modh, OBP_PROP_CLOCK_FREQ, &err); - if (err != PICL_SUCCESS) - return (err); - - *freq = ROUND_TO_MHZ(clk_freq); - - return (PICL_SUCCESS); -} - - -/* - * display the clock frequency - */ -static int -display_system_clock(picl_nodehdl_t plafh) -{ - uint32_t system_clk; - int err; - - err = picldiag_get_clock_freq(plafh, &system_clk); - if (err != PICL_SUCCESS) - return (err); - - log_printf(dgettext(TEXT_DOMAIN, - "System clock frequency: %d MHZ\n"), system_clk); - - return (PICL_SUCCESS); -} - - -/* - * get the value by the property name of the string prop - * Caller must free the outbuf - */ -static int -picldiag_get_string_propval(picl_nodehdl_t modh, char *prop_name, char **outbuf) -{ - int err; - picl_prophdl_t proph; - picl_propinfo_t pinfo; - char *prop_value; - - err = picl_get_propinfo_by_name(modh, prop_name, &pinfo, &proph); - if (err != PICL_SUCCESS) - return (err); - - /* - * If it is not a string prop, return NULL - */ - if (pinfo.type != PICL_PTYPE_CHARSTRING) - return (PICL_FAILURE); - - prop_value = malloc(pinfo.size); - if (prop_value == NULL) - return (PICL_FAILURE); - - err = picl_get_propval(proph, prop_value, pinfo.size); - if (err != PICL_SUCCESS) { - free(prop_value); - return (err); - } - - *outbuf = prop_value; - return (PICL_SUCCESS); -} - - - -/* - * display platform banner - */ -static int -display_platform_banner(picl_nodehdl_t plafh) -{ - char *platform; - char *banner_name; - int err; - - /* - * get PICL_PROP_MACHINE and PICL_PROP_BANNER_NAME - */ - log_printf(dgettext(TEXT_DOMAIN, - "System Configuration: Oracle Corporation "), 0); - err = picldiag_get_string_propval(plafh, PICL_PROP_MACHINE, - &platform); - if (err != PICL_SUCCESS) - return (err); - log_printf(" %s", platform, 0); - free(platform); - - err = picldiag_get_string_propval(plafh, OBP_PROP_BANNER_NAME, - &banner_name); - if (err != PICL_SUCCESS) - return (err); - log_printf(" %s", banner_name, 0); - free(banner_name); - - log_printf("\n", 0); - return (PICL_SUCCESS); -} - -/* - * search children to get the node by the nodename - */ -static int -picldiag_get_node_by_name(picl_nodehdl_t rooth, char *name, - picl_nodehdl_t *nodeh) -{ - picl_nodehdl_t childh; - int err; - char *nodename; - - nodename = alloca(strlen(name) + 1); - if (nodename == NULL) - return (PICL_FAILURE); - - err = picl_get_propval_by_name(rooth, PICL_PROP_CHILD, &childh, - sizeof (picl_nodehdl_t)); - - while (err == PICL_SUCCESS) { - err = picl_get_propval_by_name(childh, PICL_PROP_NAME, - nodename, (strlen(name) + 1)); - if (err != PICL_SUCCESS) { - err = picl_get_propval_by_name(childh, PICL_PROP_PEER, - &childh, sizeof (picl_nodehdl_t)); - continue; - } - - if (strcmp(nodename, name) == 0) { - *nodeh = childh; - return (PICL_SUCCESS); - } - - err = picl_get_propval_by_name(childh, PICL_PROP_PEER, - &childh, sizeof (picl_nodehdl_t)); - } - - return (err); -} - - -/* - * This routine is invoked when prtdiag starts execution. It prints - * system configuration, memory size, initializes PICL and acts as - * a driver routine for prtdiag output for Snowbird. - */ -/* ARGSUSED */ -int -do_prominfo(int syserrlog, char *pname, int log_flag, int prt_flag) -{ - - struct mem_total memory_total; /* total memory in system */ - struct grp_info grps; - uint8_t status = PD_SUCCESS; - picl_nodehdl_t rooth; - picl_nodehdl_t plafh; - struct system_kstat_data *kstats = NULL; - Sys_tree *tree = NULL; - - sys_clk = -1; - pd_print_option = syserrlog; - - if ((status = picl_initialize()) != PICL_SUCCESS) { - log_printf("prtdiag: failed to initialize the PICL\n", 0); - exit(1); - } - - if ((status = picl_get_root(&rooth)) != PICL_SUCCESS) { - log_printf("prtdiag: failed\n", 0); - exit(1); - } - - status = picldiag_get_node_by_name(rooth, PICL_NODE_PLATFORM, &plafh); - if (status != PICL_SUCCESS) - return (status); - - if (!log_flag) { - - status = display_platform_banner(plafh); - if (status != PICL_SUCCESS) - return (status); - - status = display_system_clock(plafh); - if (status != PICL_SUCCESS) - return (status); - - /* display the memory Size */ - display_memorysize(tree, kstats, &grps, &memory_total); - } - - if ((pd_smc_fd = open(PD_SMC_DRV_PATH, O_RDWR)) == -1) - return (PD_FAILURE); - - if ((status = pd_check_for_snowbird()) != PD_SUCCESS) - return (status); - - if ((status = pd_prt_snowbird_diag()) != PD_SUCCESS) - return (status); - - (void) close(pd_smc_fd); - - if (picl_shutdown() != PICL_SUCCESS) - return (PD_INTERNAL_FAILURE); - - return (PD_SUCCESS); - -} - -/* - * This routine prints out the platform name. - */ - -static uint32_t -pd_check_for_snowbird() -{ - - char si_platform[30]; - - if (sysinfo(SI_PLATFORM, si_platform, sizeof (si_platform)) == -1) { - return (PD_FAILURE); - } - /* is it a Snowbird? */ - if (strcmp(si_platform, SNOWBIRD) != 0) - return (PD_FAILURE); - - log_printf("platform Type : %s\n", si_platform, 0); - return (PD_SUCCESS); - -} - - -/* - * Driver routine for satellite specific output. This is also used by - * host driver routine as all satellite information is printed by host. - * It also prints some host specific information for formatting purposes - */ - -static uint32_t -pd_prt_snowbird_diag() -{ - uint8_t status = PD_SUCCESS; - if ((status = pd_check_cpu_health()) != PD_SUCCESS) { - return (status); - } - if (pd_print_option) { - - log_printf( - "\n %11s Other Miscellaneous Information \n", - PD_BLANK, 0); - log_printf( - "%12s ------------------------------- \n", - PD_BLANK, 0); - - if ((status = pd_get_role_information()) != PD_SUCCESS) { - return (status); - } - - if (pd_smc_glbl_enabl_rsp[1] & 0x10) { - log_printf( - "IPMI Response Notification\t\tEnabled\n", 0); - } else { - log_printf( - "IPMI Response Notification\t\tDisabled\n", 0); - } - if ((status = pd_query_SMC_firmware_version()) != PD_SUCCESS) { - return (status); - } - - if ((status = pd_check_tty_debug_mode()) != PD_SUCCESS) { - return (status); - } - - if ((status = pd_get_reset_mode()) != PD_SUCCESS) { - return (status); - } - - if ((status = pd_get_message_flags()) != PD_SUCCESS) { - return (status); - } - - if ((status = pd_query_watchdog_state()) != PD_SUCCESS) { - return (status); - } - - if ((status = pd_get_sensor_reading()) != PD_SUCCESS) { - return (status); - } - - if ((status = pd_get_sensor_threshold()) != PD_SUCCESS) { - return (status); - } - - } - return (status); - -} - -/* - * This routine prints the mode in which SMC is running. It uses the - * response from SMC global enables to determine the mode - */ -static uint32_t -pd_check_tty_debug_mode() -{ - - if (pd_smc_glbl_enabl_rsp[1] & 0x20) { - log_printf("SMC verbose mode\t\t\tON\n", 0); - } else { - log_printf("SMC verbose mode\t\t\tOFF\n", 0); - } - - return (PD_SUCCESS); -} - -/* This routine prints SMC f/w version */ -static uint32_t -pd_query_SMC_firmware_version() -{ - - sc_reqmsg_t req_pkt; - sc_rspmsg_t rsp_pkt; - uint8_t ver, rev, bldrev; - - - smc_init_smc_msg(&req_pkt, SMC_QUERY_FIRMWARE_VERSION, - DEFAULT_SEQN, 0); - smc_send_msg(-1, &req_pkt, &rsp_pkt, POLL_TIMEOUT); - ver = (rsp_pkt.data[0] & 0xf0) >> 4; - rev = rsp_pkt.data[0] & 0x0f; - bldrev = rsp_pkt.data[2] & 0x3f; - - log_printf("SMC f/w version is\t\t\t%d.%d.%d\n", ver, rev, bldrev, 0); - - return (PD_SUCCESS); - -} - -/* - * This routine checks CPU's health by using SMC self test results command - * It acts as driver routine for printing cPCI slot information - */ -static uint32_t -pd_check_cpu_health() -{ - - sc_reqmsg_t req_pkt; - sc_rspmsg_t rsp_pkt; - uint8_t dev_id = 0x1f; -#ifdef DEBUG - uint8_t i2c_chk = 0x40; -#endif - uint8_t mem_test = 0x20; - - smc_init_smc_msg(&req_pkt, SMC_GET_SMC_SELF_TEST_RESULT, - DEFAULT_SEQN, 0); - smc_send_msg(-1, &req_pkt, &rsp_pkt, POLL_TIMEOUT); - - dev_id = rsp_pkt.data[0] & dev_id; - -#ifdef DEBUG - if (rsp_pkt.data[0] & i2c_chk) { - pd_print_device_info(dev_id); - } -#endif - if (rsp_pkt.data[0] & mem_test) { - pd_print_device_info(dev_id); - } - return (pd_check_slots()); - -} - -/* - * This routine decodes error message for CPU failures and prints details - * of the failure - */ -static uint32_t -pd_print_device_info(int dev_id) -{ - - switch (dev_id) { - case 1: - log_printf("Mux Philip 9540\n", 0); - break; - case 2: - log_printf("cpu temp max1617\n", 0); - break; - case 3: - log_printf("pmc temp max 1617\n", 0); - break; - case 4: - log_printf("MB HS temp max 1617\n", 0); - break; - case 5: - log_printf("MB mem temp max1617\n", 0); - break; - case 6: - log_printf("MB gpio Philip8574\n", 0); - break; - case 7: - log_printf("MB Fru ID ID i2c eep\n", 0); - break; - case 8: - log_printf("MB enet ID ID i2d eep\n", 0); - break; - case 9: - log_printf("MB gpio Philip8574A\n", 0); - break; - case 10: - log_printf("SDRAM mod1 temp max1617\n", 0); - break; - case 11: - log_printf("SDRAM mod ID ID i2c eep\n", 0); - break; - case 12: - log_printf("SDRAM mod2 temp max1617\n", 0); - break; - case 13: - log_printf("SDRAM mod ID ID i2c eep\n", 0); - break; - case 14: - log_printf("Power mod temp ds1721\n", 0); - break; - case 15: - log_printf("Power mod gpio Philip 8574\n", 0); - break; - case 16: - log_printf("Power mod ID eep ST M24C01\n", 0); - break; - case 17: - log_printf("SMC ID i2c eep\n", 0); - break; - - default: - log_printf("device id unknown\n", 0); - break; - - } - - return (PD_SUCCESS); - -} - -/* - * This routine walks PICL tree by "Location" class and calls prt_slot_info - * routine to print the slot information - */ - -/*ARGSUSED*/ -static uint32_t -pd_check_slots() -{ - - picl_nodehdl_t nodeh; - char *c_args = NULL; - - if (picl_get_root(&nodeh) != PICL_SUCCESS) - return (PD_INTERNAL_FAILURE); - - - if (picl_walk_tree_by_class(nodeh, PICL_CLASS_LOCATION, - (void *)c_args, pd_prt_slot_info) != PICL_SUCCESS) { - return (PD_INTERNAL_FAILURE); - } - - return (PD_SUCCESS); - -} - - -/*ARGSUSED*/ -int32_t - -pd_prt_slot_info(picl_nodehdl_t nodeh, void *c_args) -{ - - char *valbuf; - char label_txt[30]; - int unit_no = -1, ctr = 0; - picl_nodehdl_t childh; - picl_propinfo_t propinfo; - picl_prophdl_t proph; - - /* if not immediate child of "chassis" node, ignore it */ - if (pd_check_location_parent(nodeh) != PD_SUCCESS) - return (PD_INTERNAL_FAILURE); - - - /* get the label on the location */ - if (picl_get_prop_by_name(nodeh, PICL_PROP_LABEL, - &proph) != PICL_SUCCESS) - return (PD_INTERNAL_FAILURE); - - if (picl_get_propinfo(proph, &propinfo) != PICL_SUCCESS) - return (PD_INTERNAL_FAILURE); - - valbuf = (char *) malloc(sizeof (char) * (propinfo.size)); - if (valbuf == NULL) - return (PD_INTERNAL_FAILURE); - - if (picl_get_propval(proph, (void *)valbuf, propinfo.size) - != PICL_SUCCESS) { - free(valbuf); - return (PD_INTERNAL_FAILURE); - } - - while (valbuf[ctr] != ' ' && valbuf[ctr] != NULL) { - label_txt[ctr] = valbuf[ctr]; - ++ctr; - } - - label_txt[ctr++] = '\0'; - - if (valbuf[ctr] != NULL) { - unit_no = atoi(valbuf+ctr); - } - - free(valbuf); - - /* get the slot type for the location */ - if (picl_get_prop_by_name(nodeh, PICL_PROP_SLOT_TYPE, - &proph) != PICL_SUCCESS) - return (PD_INTERNAL_FAILURE); - - if (picl_get_propinfo(proph, & propinfo) != PICL_SUCCESS) - return (PD_INTERNAL_FAILURE); - - valbuf = (char *) malloc(sizeof (char) * (propinfo.size)); - if (valbuf == NULL) - return (PD_INTERNAL_FAILURE); - - if (picl_get_propval(proph, (void *)valbuf, - propinfo.size) != PICL_SUCCESS) { - free(valbuf); - return (PD_INTERNAL_FAILURE); - } - - if ((strcmp(valbuf, PD_CPCI_SLOT_TYPE) == 0) || - (strcmp(valbuf, PD_PCI_SLOT_TYPE) == 0)) { - (void) pd_print_fruinfo_hdr(); - log_printf("\n%s ", label_txt, 0); - - /* For Snowbird no unit number is present on the label */ - unit_no = 1; - log_printf(" %d Yes cPSB IO Slot\n", unit_no, 0); - - if (picl_get_propval_by_name(nodeh, PICL_PROP_CHILD, - &childh, sizeof (childh)) == PICL_SUCCESS) { - pd_prt_cpci_condition(childh); - } - /* For Snowbird auto configuration is always enabled */ - log_printf("%29s Properties:\n", PD_BLANK, 0); - log_printf("%31s auto-config = enabled\n", PD_BLANK, 0); - } - - - free(valbuf); - return (PD_SUCCESS); - -} - - - -static uint32_t -pd_print_fruinfo_hdr() -{ - - log_printf( - "\n %19s FRU Information \n", - PD_BLANK, 0); - log_printf( - "%11s ------------------------------------------------\n", - PD_BLANK, 0); - - log_printf(dgettext(TEXT_DOMAIN, - "FRU FRU FRU Miscellaneous\n"), 0); - log_printf(dgettext(TEXT_DOMAIN, - "Type Unit# Present Information\n"), 0); - log_printf("---- ----- -------", 0); - log_printf(" --------------------------------\n", 0); - return (PD_SUCCESS); - -} - -static uint32_t -pd_check_location_parent(picl_nodehdl_t nodeh) -{ - - picl_nodehdl_t parenth; - char *prop_name; - - if (picl_get_propval_by_name(nodeh, PICL_PROP_PARENT, - &parenth, sizeof (parenth)) != PICL_SUCCESS) { - return (PD_FAILURE); - } - - prop_name = (char *) malloc(sizeof (char) * PICL_PROPNAMELEN_MAX); - if (prop_name == NULL) { - return (PD_FAILURE); - } - - if (picl_get_propval_by_name(parenth, PICL_PROP_NAME, (void *)prop_name, - PICL_PROPNAMELEN_MAX) != PICL_SUCCESS) { - free(prop_name); - return (PD_FAILURE); - } - - if (strcmp(prop_name, CHASSIS_NODE_NAME) == 0) { - free(prop_name); - return (PD_SUCCESS); - } else { - free(prop_name); - return (PD_FAILURE); - } - -} - - -/*ARGSUSED*/ -static uint32_t -pd_query_watchdog_state() -{ - - picl_nodehdl_t nodehandle; - char *c_args = NULL; - - if (picl_get_root(&nodehandle) != PICL_SUCCESS) { - return (PD_INTERNAL_FAILURE); - } - - if (picl_walk_tree_by_class(nodehandle, PICL_CLASS_WATCHDOG_TIMER, - (void *)c_args, pd_check_wd_state) != PICL_SUCCESS) - return (PD_INTERNAL_FAILURE); - - return (PD_SUCCESS); - -} - -/*ARGSUSED*/ -int -pd_check_wd_state(picl_nodehdl_t nodeh, void *c_args) -{ - - char *prop_name, *valbuf; - picl_propinfo_t propinfo; - picl_prophdl_t proph; - - prop_name = (char *) malloc(sizeof (char) * PICL_PROPNAMELEN_MAX); - if (prop_name == NULL) { - return (PICL_WALK_TERMINATE); - } - - if (picl_get_propval_by_name(nodeh, PICL_PROP_NAME, - (void *)prop_name, PICL_PROPNAMELEN_MAX) != PICL_SUCCESS) { - free(prop_name); - return (PICL_WALK_TERMINATE); - } - - if ((picl_get_prop_by_name(nodeh, PICL_PROP_STATE, - &proph)) != PICL_SUCCESS) { - free(prop_name); - return (PICL_WALK_TERMINATE); - } - - if ((picl_get_propinfo(proph, &propinfo)) != PICL_SUCCESS) { - free(prop_name); - return (PICL_WALK_TERMINATE); - } - - valbuf = (char *) malloc(sizeof (char) * (propinfo.size)); - if (valbuf == NULL) { - free(prop_name); - return (PICL_WALK_TERMINATE); - } - - if ((picl_get_propval(proph, (void *)valbuf, - propinfo.size)) != PICL_SUCCESS) { - free(valbuf); - free(prop_name); - return (PICL_WALK_TERMINATE); - } - - if (pd_hdr_prt) { - log_printf("\n Watch Dog Status \n", 0); - log_printf(" ---------------- \n", 0); - log_printf("Node Status\n", 0); - log_printf("---- ------\n", 0); - pd_hdr_prt = B_FALSE; - } - - log_printf("%s ", prop_name, 0); - log_printf("%s\n", valbuf, 0); - - free(prop_name); - free(valbuf); - return (PICL_WALK_CONTINUE); - -} - - -static uint32_t -pd_get_role_information() -{ - - sc_reqmsg_t req_pkt; - sc_rspmsg_t rsp_pkt; - uint8_t usparc_role; - - smc_init_smc_msg(&req_pkt, SMC_GET_ROLE_INFO, - DEFAULT_SEQN, 0); - smc_send_msg(-1, &req_pkt, &rsp_pkt, POLL_TIMEOUT); - usparc_role = rsp_pkt.data[1]; - - log_printf(dgettext(TEXT_DOMAIN, - "UltraSPARC Host Role\t\t\t"), 0); - if (usparc_role & 0x80) { - log_printf( - dgettext(TEXT_DOMAIN, - "System Board Computer (SBC)\n"), 0); - } - if (usparc_role & 0x40) { - log_printf(dgettext(TEXT_DOMAIN, - "Standby System Board Computer (Standby SBC)\n"), 0); - } - if (usparc_role & 0x20) { - log_printf(dgettext(TEXT_DOMAIN, - "Alternate System Board Computer (Alternate SBC)\n"), 0); - } - if (usparc_role & 0x10) { - log_printf(dgettext(TEXT_DOMAIN, - "Satellite Board Computer (SAT)\n"), 0); - } - return (PD_SUCCESS); - -} - - -static uint32_t -pd_get_message_flags() -{ - - sc_reqmsg_t req_pkt; - sc_rspmsg_t rsp_pkt; - - smc_init_smc_msg(&req_pkt, SMC_GET_MESSAGE_FLAGS, - DEFAULT_SEQN, 0); - smc_send_msg(-1, &req_pkt, &rsp_pkt, POLL_TIMEOUT); - - if (rsp_pkt.data[0] & 0x01) { - log_printf("Messages Available in queue Recieving\n", 0); - } else { - log_printf("No messages in queue for Recieving\n", 0); - } - - return (PD_SUCCESS); - - -} - - - -static uint32_t -pd_get_reset_mode() -{ - - sc_reqmsg_t req_pkt; - sc_rspmsg_t rsp_pkt; - - - smc_init_smc_msg(&req_pkt, SMC_GET_CONFIG_BLOCK, - DEFAULT_SEQN, 0); - smc_send_msg(-1, &req_pkt, &rsp_pkt, POLL_TIMEOUT); - - log_printf("Reset Mode\t\t\t\t%x \n", rsp_pkt.data[2], 0); - - return (PD_SUCCESS); - -} - - -static uint32_t -pd_get_sensor_reading() -{ - - - sc_reqmsg_t req_pkt; - sc_rspmsg_t rsp_pkt; - - req_pkt.data[0] = 0x0e; - - smc_init_smc_msg(&req_pkt, SMC_SENSOR_READING_GET, - DEFAULT_SEQN, 1); - smc_send_msg(-1, &req_pkt, &rsp_pkt, POLL_TIMEOUT); - log_printf("\nCPU Node Temperature Information\n", PD_BLANK, 0); - log_printf("--------------------------------\n", PD_BLANK, 0); - log_printf("Temperature Reading: %d\n\n", rsp_pkt.data[0], 0); - - return (PD_SUCCESS); - -} - - -static uint32_t -pd_get_sensor_threshold() -{ - - - sc_reqmsg_t req_pkt; - sc_rspmsg_t rsp_pkt; - uint8_t thres_mask; - req_pkt.data[0] = 0x0e; - - smc_init_smc_msg(&req_pkt, SMC_SENSOR_THRESHOLD_GET, - DEFAULT_SEQN, 1); - smc_send_msg(-1, &req_pkt, &rsp_pkt, POLL_TIMEOUT); - log_printf("Critical Threshold Information\n", 0); - log_printf("------------------------------\n", 0); - - thres_mask = rsp_pkt.data[0]; - - if (thres_mask & 0x20) { - log_printf("High Power-Off Threshold %9s", PD_BLANK, 0); - if (rsp_pkt.data[6] & 0x80) { - log_printf("-%d\n", - (int)((uint8_t)~rsp_pkt.data[6] + 1), 0); - } else { - log_printf(" %d\n", rsp_pkt.data[6], 0); - } - } - - if (thres_mask & 0x10) { - log_printf("High Shutdown Threshold %10s", PD_BLANK, 0); - if (rsp_pkt.data[5] & 0x80) { - log_printf("-%d\n", - (int)((uint8_t)~rsp_pkt.data[5] + 1), 0); - } else { - log_printf(" %d\n", rsp_pkt.data[5], 0); - } - } - - - if (thres_mask & 0x08) { - log_printf("High Warning Threshold %11s", PD_BLANK, 0); - if (rsp_pkt.data[4] & 0x80) { - log_printf("-%d\n", - (int)((uint8_t)~rsp_pkt.data[4] + 1), 0); - } else { - log_printf(" %d\n", rsp_pkt.data[4], 0); - } - } - - if (thres_mask & 0x04) { - log_printf("Low Power Off Threshold %10s", PD_BLANK, 0); - if (rsp_pkt.data[3] & 0x80) { - log_printf("-%d\n", - (int)((uint8_t)~rsp_pkt.data[3] + 1), 0); - } else { - log_printf(" %d\n", rsp_pkt.data[3], 0); - } - } - - if (thres_mask & 0x02) { - log_printf("Low Shutdown Threshold %11s", PD_BLANK, 0); - if (rsp_pkt.data[2] & 0x80) { - log_printf("-%d\n", - (int)((uint8_t)~rsp_pkt.data[2] + 1), 0); - } else { - log_printf(" %d\n", rsp_pkt.data[2], 0); - } - } - - if (thres_mask & 0x01) { - log_printf("Low Warning Threshold %12s", PD_BLANK, 0); - if (rsp_pkt.data[1] & 0x80) { - log_printf("-%d\n", - (int)((uint8_t)~rsp_pkt.data[1] + 1), 0); - } else { - log_printf(" %d\n", rsp_pkt.data[1], 0); - } - } - - return (PD_SUCCESS); - -} - - - -static uint32_t -pd_prt_cpci_condition(picl_nodehdl_t nodeh) -{ - - picl_propinfo_t propinfo; - picl_prophdl_t proph; - char *valbuf; - - - if (picl_get_prop_by_name(nodeh, PICL_PROP_CONDITION, - &proph) != PICL_SUCCESS) { - return (PD_FAILURE); - } - - if (picl_get_propinfo(proph, &propinfo) != PICL_SUCCESS) { - return (PD_FAILURE); - } - - valbuf = (char *) malloc(sizeof (char) * (propinfo.size)); - if (valbuf == NULL) { - return (PD_FAILURE); - } - - if (picl_get_propval(proph, (void *)valbuf, - propinfo.size) != PICL_SUCCESS) { - free(valbuf); - return (PD_FAILURE); - } - - - log_printf("%29s Condition : %s\n", PD_BLANK, valbuf, 0); - - free(valbuf); - return (PD_SUCCESS); - - -} diff --git a/usr/src/lib/libresolv/Makefile b/usr/src/lib/libresolv/Makefile index fe94b16c25..890a36db45 100644 --- a/usr/src/lib/libresolv/Makefile +++ b/usr/src/lib/libresolv/Makefile @@ -59,7 +59,7 @@ LDLIBS += -lsocket -lnsl -lc CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/librpcsvc/Makefile.com b/usr/src/lib/librpcsvc/Makefile.com index 15b6c6cb48..d8c1a5e0fb 100644 --- a/usr/src/lib/librpcsvc/Makefile.com +++ b/usr/src/lib/librpcsvc/Makefile.com @@ -51,7 +51,7 @@ CPPFLAGS += -DYP CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libscf/Makefile.com b/usr/src/lib/libscf/Makefile.com index 071818bef9..a534abf962 100644 --- a/usr/src/lib/libscf/Makefile.com +++ b/usr/src/lib/libscf/Makefile.com @@ -61,7 +61,7 @@ CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libsec/Makefile.com b/usr/src/lib/libsec/Makefile.com index 58834e08f1..47fcc11acb 100644 --- a/usr/src/lib/libsec/Makefile.com +++ b/usr/src/lib/libsec/Makefile.com @@ -48,7 +48,7 @@ CPPFLAGS += -I$(SRCDIR) -I. -I../../../common/acl LDLIBS += -lc -lavl -lidmap CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/libsecdb/Makefile.com b/usr/src/lib/libsecdb/Makefile.com index 1c2076cdc7..aa027f0efa 100644 --- a/usr/src/lib/libsecdb/Makefile.com +++ b/usr/src/lib/libsecdb/Makefile.com @@ -45,7 +45,7 @@ LINTFLAGS += -DPIC LINTFLAGS64 += -DPIC CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/libshare/Makefile.com b/usr/src/lib/libshare/Makefile.com index 3628432a6a..efc6613377 100644 --- a/usr/src/lib/libshare/Makefile.com +++ b/usr/src/lib/libshare/Makefile.com @@ -46,7 +46,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CSTD += $(CSTD_GNU99) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch # not linted diff --git a/usr/src/lib/libshare/autofs/Makefile.com b/usr/src/lib/libshare/autofs/Makefile.com index 0123923ddb..30c604222b 100644 --- a/usr/src/lib/libshare/autofs/Makefile.com +++ b/usr/src/lib/libshare/autofs/Makefile.com @@ -48,7 +48,7 @@ LDLIBS += -lshare -lscf -lumem -lc -lxml2 CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libshare/nfs/Makefile.com b/usr/src/lib/libshare/nfs/Makefile.com index f6675414cf..e6e9ca01b4 100644 --- a/usr/src/lib/libshare/nfs/Makefile.com +++ b/usr/src/lib/libshare/nfs/Makefile.com @@ -50,7 +50,7 @@ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -D_REENTRANT -I$(NFSLIB_DIR) \ -I$(ADJUNCT_PROTO)/usr/include/libxml2 -I$(SRCDIR)/../common diff --git a/usr/src/lib/libshare/smbfs/Makefile.com b/usr/src/lib/libshare/smbfs/Makefile.com index 36b4875560..c07e975163 100644 --- a/usr/src/lib/libshare/smbfs/Makefile.com +++ b/usr/src/lib/libshare/smbfs/Makefile.com @@ -42,7 +42,7 @@ LDLIBS += -lshare -lscf -lumem -luuid -lc -lxml2 -lsmbfs CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -D_REENTRANT -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ -I$(SRCDIR)/../common -I$(SRC)/lib/libsmbfs -I$(SRC)/uts/common diff --git a/usr/src/lib/libshell/Makefile.com b/usr/src/lib/libshell/Makefile.com index b904c0fe5f..b185d93851 100644 --- a/usr/src/lib/libshell/Makefile.com +++ b/usr/src/lib/libshell/Makefile.com @@ -158,7 +158,7 @@ CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-clobbered CERRWARN += -_gcc=-Wno-char-subscripts diff --git a/usr/src/lib/libsldap/Makefile.com b/usr/src/lib/libsldap/Makefile.com index 4854275b4b..1404a24572 100644 --- a/usr/src/lib/libsldap/Makefile.com +++ b/usr/src/lib/libsldap/Makefile.com @@ -54,7 +54,7 @@ LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libslp/Makefile.com b/usr/src/lib/libslp/Makefile.com index 0e8f4f70c0..23e7d1f0c5 100644 --- a/usr/src/lib/libslp/Makefile.com +++ b/usr/src/lib/libslp/Makefile.com @@ -46,7 +46,7 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I../clib -I$(JAVA_ROOT)/include \ -I$(JAVA_ROOT)/include/solaris -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses # not linted diff --git a/usr/src/lib/libsmbfs/Makefile.com b/usr/src/lib/libsmbfs/Makefile.com index be5ad05c42..71a0d83728 100644 --- a/usr/src/lib/libsmbfs/Makefile.com +++ b/usr/src/lib/libsmbfs/Makefile.com @@ -95,7 +95,7 @@ LDLIBS += -lsocket -lnsl -lc -lmd -lpkcs11 -lkrb5 -lsec -lidmap -lscf -luuid # normal warnings... CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable # not linted diff --git a/usr/src/lib/libsocket/Makefile.com b/usr/src/lib/libsocket/Makefile.com index f4b4ac28e6..bc51201190 100644 --- a/usr/src/lib/libsocket/Makefile.com +++ b/usr/src/lib/libsocket/Makefile.com @@ -57,7 +57,7 @@ CPPFLAGS += -DSYSV -D_REENTRANT -I../../common/inc %/rcmd.o := CPPFLAGS += -DNIS CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/lib/libsqlite/Makefile.com b/usr/src/lib/libsqlite/Makefile.com index 5e1f3d8072..8dd20a4ce9 100644 --- a/usr/src/lib/libsqlite/Makefile.com +++ b/usr/src/lib/libsqlite/Makefile.com @@ -97,7 +97,7 @@ MYCPPFLAGS = -D_REENTRANT -DTHREADSAFE=1 -DHAVE_USLEEP=1 -I. -I.. -I$(SRCDIR) CPPFLAGS += $(MYCPPFLAGS) CERRWARN += -_gcc=-Wno-implicit-function-declaration -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-unused-label diff --git a/usr/src/lib/libtnfctl/Makefile.com b/usr/src/lib/libtnfctl/Makefile.com index b9392268ce..47d3ca9527 100644 --- a/usr/src/lib/libtnfctl/Makefile.com +++ b/usr/src/lib/libtnfctl/Makefile.com @@ -75,7 +75,7 @@ CPPFLAGS += -I$(SRC)/lib/libtnfprobe -D_REENTRANT -I$(SRC)/cmd/sgs/include LINTFLAGS += -y -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-empty-body CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/lib/libtnfprobe/Makefile.com b/usr/src/lib/libtnfprobe/Makefile.com index bfdceac994..5dbde86c95 100644 --- a/usr/src/lib/libtnfprobe/Makefile.com +++ b/usr/src/lib/libtnfprobe/Makefile.com @@ -65,7 +65,7 @@ LINTFLAGS += -y CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libtsnet/Makefile.com b/usr/src/lib/libtsnet/Makefile.com index 4eb55a843f..a929254ab1 100644 --- a/usr/src/lib/libtsnet/Makefile.com +++ b/usr/src/lib/libtsnet/Makefile.com @@ -47,7 +47,7 @@ LDLIBS += -lsocket -lnsl -lc -lsecdb -ltsol LIBTSOLINC = $(SRC)/lib/libtsol/common CPPFLAGS += -D_REENTRANT -I$(LIBTSOLINC) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/libtsol/Makefile.com b/usr/src/lib/libtsol/Makefile.com index 5028745796..478376427c 100644 --- a/usr/src/lib/libtsol/Makefile.com +++ b/usr/src/lib/libtsol/Makefile.com @@ -60,7 +60,7 @@ CPPFLAGS += -D_REENTRANT -I$(SRCDIR) -I$(COMMONDIR) LINTFLAGS64 += -m64 -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libv12n/Makefile.com b/usr/src/lib/libv12n/Makefile.com index e8321c0a6b..72ec120aee 100644 --- a/usr/src/lib/libv12n/Makefile.com +++ b/usr/src/lib/libv12n/Makefile.com @@ -39,7 +39,7 @@ SRCS = $(MACHCOBJS:%.o=../$(MACH)/%.c) CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) $(LINTLIB) := SRCS = ../common/llib-lv12n diff --git a/usr/src/lib/libwrap/Makefile.com b/usr/src/lib/libwrap/Makefile.com index 40e2f11d0a..b5fb0e21be 100644 --- a/usr/src/lib/libwrap/Makefile.com +++ b/usr/src/lib/libwrap/Makefile.com @@ -59,7 +59,7 @@ CERRWARN += -erroff=E_OLD_STYLE_DECL_HIDES_PROTO CERRWARN += -_gcc=-Wno-return-type CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/libxcurses/Makefile.com b/usr/src/lib/libxcurses/Makefile.com index 1449690433..d60e9683ab 100644 --- a/usr/src/lib/libxcurses/Makefile.com +++ b/usr/src/lib/libxcurses/Makefile.com @@ -114,7 +114,7 @@ ROOTLIBS= $(LIBS:%=$(ROOTLIBDIR)/%) $(LINTLIB):= SRCS=../src/libc/llib-lcurses $(LINTLIB):= CPPFLAGS += -D_XOPEN_SOURCE_EXTENDED -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/lib/libxcurses2/Makefile.com b/usr/src/lib/libxcurses2/Makefile.com index 41235cf283..12a063c414 100644 --- a/usr/src/lib/libxcurses2/Makefile.com +++ b/usr/src/lib/libxcurses2/Makefile.com @@ -97,7 +97,7 @@ LINTSRC= $(LINTLIB:%.ln=%) LDLIBS += -lc CPPFLAGS = -I../h -I../src/libc/xcurses $(CPPFLAGS.master) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-value # not linted diff --git a/usr/src/lib/libzonecfg/Makefile.com b/usr/src/lib/libzonecfg/Makefile.com index de53f975e3..a97490c557 100644 --- a/usr/src/lib/libzonecfg/Makefile.com +++ b/usr/src/lib/libzonecfg/Makefile.com @@ -45,7 +45,7 @@ SRCS = \ $(XML_OBJS:%.o=$(XMLDIR)/%.c) \ CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/libxml2 -I$(SRCDIR) -D_REENTRANT -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libzonestat/Makefile.com b/usr/src/lib/libzonestat/Makefile.com index ca7b710a18..1efc7bf720 100644 --- a/usr/src/lib/libzonestat/Makefile.com +++ b/usr/src/lib/libzonestat/Makefile.com @@ -36,7 +36,7 @@ SRCDIR = ../common CPPFLAGS += -I../common -mt -D_POSIX_PTHREAD_SEMANTICS $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/madv/Makefile.com b/usr/src/lib/madv/Makefile.com index 955c8287e1..877c35517f 100644 --- a/usr/src/lib/madv/Makefile.com +++ b/usr/src/lib/madv/Makefile.com @@ -41,7 +41,7 @@ CPPFLAGS += -D_REENTRANT DYNFLAGS += $(ZNOVERSION) $(ZINTERPOSE) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/mpapi/libmpapi/Makefile.com b/usr/src/lib/mpapi/libmpapi/Makefile.com index d62912f592..cc109f0534 100644 --- a/usr/src/lib/mpapi/libmpapi/Makefile.com +++ b/usr/src/lib/mpapi/libmpapi/Makefile.com @@ -46,7 +46,7 @@ DYNFLAGS += -z initarray=InitLibrary CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/mpss/Makefile.com b/usr/src/lib/mpss/Makefile.com index 6988a90742..9d54dff9ab 100644 --- a/usr/src/lib/mpss/Makefile.com +++ b/usr/src/lib/mpss/Makefile.com @@ -41,7 +41,7 @@ CPPFLAGS += -D_REENTRANT DYNFLAGS += $(BLOCAL) $(ZNOVERSION) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) .KEEP_STATE: diff --git a/usr/src/lib/nsswitch/Makefile.com b/usr/src/lib/nsswitch/Makefile.com index 570ae3a035..f10f086315 100644 --- a/usr/src/lib/nsswitch/Makefile.com +++ b/usr/src/lib/nsswitch/Makefile.com @@ -37,7 +37,7 @@ LINTOUT = lint.out CPPFLAGS += -D_REENTRANT CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-address diff --git a/usr/src/lib/pam_modules/unix_cred/Makefile.com b/usr/src/lib/pam_modules/unix_cred/Makefile.com index 45c444f9b2..80e273840f 100644 --- a/usr/src/lib/pam_modules/unix_cred/Makefile.com +++ b/usr/src/lib/pam_modules/unix_cred/Makefile.com @@ -31,7 +31,7 @@ include ../../Makefile.pam_modules LDLIBS += -lbsm -lpam -lsecdb -lproject -lc CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) all: $(LIBS) diff --git a/usr/src/lib/passwdutil/Makefile.com b/usr/src/lib/passwdutil/Makefile.com index d62fa7963d..84d02df746 100644 --- a/usr/src/lib/passwdutil/Makefile.com +++ b/usr/src/lib/passwdutil/Makefile.com @@ -58,7 +58,7 @@ CPPFLAGS += -DENABLE_SUNOS_AGING -D_REENTRANT \ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-label # not linted diff --git a/usr/src/lib/pkcs11/libpkcs11/Makefile.com b/usr/src/lib/pkcs11/libpkcs11/Makefile.com index 7c8d79737a..cb9dcf89bd 100644 --- a/usr/src/lib/pkcs11/libpkcs11/Makefile.com +++ b/usr/src/lib/pkcs11/libpkcs11/Makefile.com @@ -77,7 +77,7 @@ CPPFLAGS += -I$(INCDIR) -I$(SRCDIR) -D_REENTRANT LINTFLAGS64 += -errchk=longptr64 CERRWARN += -_gcc=-Wno-unused-label -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile index 5fdac2dd0c..848a6b55b2 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile @@ -40,7 +40,7 @@ include $(SRC)/lib/Makefile.lib.64 CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com index 1bb12a3b2f..510beb92b6 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com +++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com @@ -42,7 +42,7 @@ AS_CPPFLAGS += -D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) ASFLAGS += $(AS_PICFLAGS) -P CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function CPPFLAGS += -D$(PLATFORM) -I$(CRYPTODIR) -I$(UTSDIR) \ diff --git a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com index ad19150a23..a8b0e7db18 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com +++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com @@ -36,7 +36,7 @@ AS_CPPFLAGS += -D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) ASFLAGS += $(AS_PICFLAGS) -P CFLAGS += $(CCVERBOSE) -xO5 -xbuiltin=%all -dalign CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-function CPPFLAGS += -D$(PLATFORM) -I$(CRYPTODIR) -I$(UTSDIR) \ diff --git a/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile index 4968174065..11c2507cee 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile @@ -33,7 +33,7 @@ include $(SRC)/lib/Makefile.lib CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile index deea108eac..398c8265dc 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile @@ -44,7 +44,7 @@ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS LDLIBS += -lcryptoutil -lc diff --git a/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile index 8bde047675..d90a6125f0 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile @@ -45,7 +45,7 @@ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CPPFLAGS += -I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS LDLIBS += -lcryptoutil -lc diff --git a/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com b/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com index d29e303e77..9cf7027144 100644 --- a/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com +++ b/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com @@ -86,7 +86,7 @@ LDLIBS += -lc -lcryptoutil -lmd CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-label # not linted diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com b/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com index c571c0b278..a837802e81 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com @@ -130,7 +130,7 @@ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-empty-body diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com b/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com index d09d2012f0..244d460f5e 100644 --- a/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com +++ b/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com @@ -95,7 +95,7 @@ CSTD= $(CSTD_GNU99) CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-label -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/print/libipp-listener/Makefile.com b/usr/src/lib/print/libipp-listener/Makefile.com index a111a471e0..158935f9f1 100644 --- a/usr/src/lib/print/libipp-listener/Makefile.com +++ b/usr/src/lib/print/libipp-listener/Makefile.com @@ -53,7 +53,7 @@ CPPFLAGS += -I../../libpapi-common/common CPPFLAGS += -I../../libipp-core/common CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/print/libpapi-ipp/Makefile.com b/usr/src/lib/print/libpapi-ipp/Makefile.com index b96b6fef71..90cf130adb 100644 --- a/usr/src/lib/print/libpapi-ipp/Makefile.com +++ b/usr/src/lib/print/libpapi-ipp/Makefile.com @@ -53,7 +53,7 @@ CPPFLAGS += -I../../libhttp-core/common CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/rpcsec_gss/Makefile.com b/usr/src/lib/rpcsec_gss/Makefile.com index 2dca6fe9e2..ea159a6692 100644 --- a/usr/src/lib/rpcsec_gss/Makefile.com +++ b/usr/src/lib/rpcsec_gss/Makefile.com @@ -38,7 +38,7 @@ CPPFLAGS += -D_REENTRANT -I$(SRC)/uts/common/gssapi/include \ CFLAGS += $(XFFLAG) CFLAGS64 += $(XFFLAG) -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses # not linted diff --git a/usr/src/lib/sasl_plugins/Makefile.com b/usr/src/lib/sasl_plugins/Makefile.com index 09eb2bd2bd..af5b810455 100644 --- a/usr/src/lib/sasl_plugins/Makefile.com +++ b/usr/src/lib/sasl_plugins/Makefile.com @@ -31,7 +31,7 @@ include $(SRC)/lib/Makefile.lib CPPFLAGS += -I$(SRC)/lib/libsasl/include -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/scsi/libses/Makefile.defs b/usr/src/lib/scsi/libses/Makefile.defs index 32f6075d32..a8b5669944 100644 --- a/usr/src/lib/scsi/libses/Makefile.defs +++ b/usr/src/lib/scsi/libses/Makefile.defs @@ -31,7 +31,7 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-label SMOFF += all_func_returns diff --git a/usr/src/lib/scsi/libsmp/Makefile.com b/usr/src/lib/scsi/libsmp/Makefile.com index 13760167b9..748963db4e 100644 --- a/usr/src/lib/scsi/libsmp/Makefile.com +++ b/usr/src/lib/scsi/libsmp/Makefile.com @@ -43,7 +43,7 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-type-limits -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) SMOFF += all_func_returns diff --git a/usr/src/lib/smbsrv/libmlsvc/Makefile.com b/usr/src/lib/smbsrv/libmlsvc/Makefile.com index b0a3f80560..a3c41456f4 100644 --- a/usr/src/lib/smbsrv/libmlsvc/Makefile.com +++ b/usr/src/lib/smbsrv/libmlsvc/Makefile.com @@ -93,7 +93,7 @@ CPPFLAGS += -Dsyslog=smb_syslog $(ENABLE_SMB_PRINTING) CPPFLAGS += -DHAVE_CUPS CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/smbsrv/libsmb/Makefile.com b/usr/src/lib/smbsrv/libsmb/Makefile.com index fc3c4e0b6b..39af0ff072 100644 --- a/usr/src/lib/smbsrv/libsmb/Makefile.com +++ b/usr/src/lib/smbsrv/libsmb/Makefile.com @@ -86,7 +86,7 @@ LDLIBS += -lsec -lidmap -lreparse -lcmdutils -lavl LDLIBS += -lnvpair -lresolv -lsocket -lnsl -lc CPPFLAGS += $(INCS) -D_REENTRANT CPPFLAGS += -Dsyslog=smb_syslog -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-char-subscripts CERRWARN += -_gcc=-Wno-switch diff --git a/usr/src/lib/smbsrv/libsmbns/Makefile.com b/usr/src/lib/smbsrv/libsmbns/Makefile.com index 8011d3305a..4d7fff71ad 100644 --- a/usr/src/lib/smbsrv/libsmbns/Makefile.com +++ b/usr/src/lib/smbsrv/libsmbns/Makefile.com @@ -55,7 +55,7 @@ LDLIBS += -lsmb -lads -lgss -lcmdutils -lldap \ CPPFLAGS += -D_REENTRANT CPPFLAGS += -Dsyslog=smb_syslog CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off diff --git a/usr/src/lib/smhba/Makefile.com b/usr/src/lib/smhba/Makefile.com index d512f5b80a..296cc8949a 100644 --- a/usr/src/lib/smhba/Makefile.com +++ b/usr/src/lib/smhba/Makefile.com @@ -47,7 +47,7 @@ CPPFLAGS += $(INCS) CPPFLAGS += -DPOSIX_THREADS CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-function SMOFF += indenting,all_func_returns diff --git a/usr/src/lib/storage/liba5k/Makefile.com b/usr/src/lib/storage/liba5k/Makefile.com index 202c11bdfd..91c40ddda7 100644 --- a/usr/src/lib/storage/liba5k/Makefile.com +++ b/usr/src/lib/storage/liba5k/Makefile.com @@ -45,7 +45,7 @@ LINTFLAGS += $(COMMON_LINTFLAGS) LINTFLAGS64 += $(COMMON_LINTFLAGS) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) LDLIBS += -lc -ldevice -lg_fc diff --git a/usr/src/lib/storage/libg_fc/Makefile.com b/usr/src/lib/storage/libg_fc/Makefile.com index 2b8c54f021..41a7abbac5 100644 --- a/usr/src/lib/storage/libg_fc/Makefile.com +++ b/usr/src/lib/storage/libg_fc/Makefile.com @@ -50,7 +50,7 @@ LINTFLAGS += $(COMMON_LINTFLAGS) LINTFLAGS64 += $(COMMON_LINTFLAGS) CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/udapl/udapl_tavor/Makefile.com b/usr/src/lib/udapl/udapl_tavor/Makefile.com index 60ff446a17..e6276a203d 100644 --- a/usr/src/lib/udapl/udapl_tavor/Makefile.com +++ b/usr/src/lib/udapl/udapl_tavor/Makefile.com @@ -150,7 +150,7 @@ LINTFLAGS += -DDAPL_DBG LINTFLAGS64 += -DDAPL_DBG CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch $(NOT_RELEASE_BUILD)CPPFLAGS += -DDAPL_DBG |