From 155272b34173e814a1936bdb1fb66e41225225c6 Mon Sep 17 00:00:00 2001 From: Jason King Date: Fri, 21 Feb 2020 20:37:24 -0600 Subject: OS-8115 Add support for zfs.sync.change-key channel program (#264) Reviewed by: Jerry Jelinek Approved by: Jerry Jelinek --- usr/src/lib/libzfs_core/common/libzfs_core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'usr/src/lib') diff --git a/usr/src/lib/libzfs_core/common/libzfs_core.c b/usr/src/lib/libzfs_core/common/libzfs_core.c index aad4104fa5..628b1cc8ff 100644 --- a/usr/src/lib/libzfs_core/common/libzfs_core.c +++ b/usr/src/lib/libzfs_core/common/libzfs_core.c @@ -25,6 +25,7 @@ * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 RackTop Systems. * Copyright (c) 2017 Datto Inc. + * Copyright 2020 Joyent, Inc. */ /* @@ -1021,6 +1022,7 @@ lzc_channel_program_impl(const char *pool, const char *program, boolean_t sync, { int error; nvlist_t *args; + nvlist_t *hidden_args = NULL; args = fnvlist_alloc(); fnvlist_add_string(args, ZCP_ARG_PROGRAM, program); @@ -1028,6 +1030,22 @@ lzc_channel_program_impl(const char *pool, const char *program, boolean_t sync, fnvlist_add_boolean_value(args, ZCP_ARG_SYNC, sync); fnvlist_add_uint64(args, ZCP_ARG_INSTRLIMIT, instrlimit); fnvlist_add_uint64(args, ZCP_ARG_MEMLIMIT, memlimit); + + /* + * If any hidden arguments are passed, we pull them out of 'args' + * and into a separate nvlist so spa_history_nvl() doesn't log + * their values. + */ + if (nvlist_lookup_nvlist(argnvl, ZPOOL_HIDDEN_ARGS, + &hidden_args) == 0) { + nvlist_t *argcopy = fnvlist_dup(argnvl); + + fnvlist_add_nvlist(args, ZPOOL_HIDDEN_ARGS, hidden_args); + fnvlist_remove(argcopy, ZPOOL_HIDDEN_ARGS); + fnvlist_add_nvlist(args, ZCP_ARG_ARGLIST, argcopy); + nvlist_free(argcopy); + } + error = lzc_ioctl(ZFS_IOC_CHANNEL_PROGRAM, pool, args, outnvl); fnvlist_free(args); -- cgit v1.2.3 From 1f12ad8d4c92be414790542c59057b38da62884c Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 24 Feb 2020 18:45:04 +0000 Subject: OS-8120 fix ldd guidance for GCC4 build Reviewed by: Jerry Jelinek Approved by: Jerry Jelinek --- usr/src/Makefile.master | 4 ++++ usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com | 6 ++---- usr/src/lib/libidspace/Makefile.com | 10 +++------- usr/src/lib/libjedec/Makefile.com | 7 ++----- usr/src/tools/make/Makefile.com | 2 ++ 5 files changed, 13 insertions(+), 16 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master index d2402d2fff..ce6879be35 100644 --- a/usr/src/Makefile.master +++ b/usr/src/Makefile.master @@ -827,12 +827,16 @@ COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH) # CCNEEDED = -lC CCEXTNEEDED = -lCrun -lCstd +NATIVECCNEEDED = -lC $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s $(__GNUC)CCEXTNEEDED = $(CCNEEDED) +$(__GNUC)NATIVECCNEEDED = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s CCNEEDED64 = -lCrun CCEXTNEEDED64 = -lCrun -lCstd +NATIVECCNEEDED64 = -lCrun $(__GNUC64)CCNEEDED64 = -L$(GCCLIBDIR) -lstdc++ -lgcc_s +$(__GNUC64)NATIVECCNEEDED64 = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s $(__GNUC64)CCEXTNEEDED = $(CCNEEDED64) # Libraries we expect to use natively on the build machine diff --git a/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com b/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com index 72a6b80cab..a5e79c04ca 100644 --- a/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com @@ -22,6 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2020 Joyent, Inc. # LIBRARY= kldap.a @@ -65,15 +66,12 @@ CERRWARN += -_gcc=-Wno-unused-function DYNFLAGS += $(KERBRUNPATH) # setting -L $(ROOT)/usr/lib/gss because libkdb_ldap needs mech_krb5 -LDLIBS += -L $(ROOT)/usr/lib/gss -L $(ROOTLIBDIR) -lkdb_ldap \ - -lc +LDLIBS += -L $(ROOT)/usr/lib/gss -L $(ROOTLIBDIR) -lkdb_ldap .KEEP_STATE: all: $(LIBS) -lint: lintcheck - # include library targets include $(SRC)/lib/krb5/Makefile.targ diff --git a/usr/src/lib/libidspace/Makefile.com b/usr/src/lib/libidspace/Makefile.com index 8cc60ffc4c..ef259c3d2f 100644 --- a/usr/src/lib/libidspace/Makefile.com +++ b/usr/src/lib/libidspace/Makefile.com @@ -10,7 +10,7 @@ # # -# Copyright (c) 2014 Joyent, Inc. All rights reserved. +# Copyright 2020 Joyent, Inc. # LIBRARY = libidspace.a @@ -23,18 +23,14 @@ include ../../Makefile.lib SRCDIR = ../common SRCS = ../../../common/idspace/id_space.c -LIBS = $(DYNLIB) $(LINTLIB) +LIBS = $(DYNLIB) -LDLIBS += -lc -lumem - -$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) +LDLIBS += -lumem .KEEP_STATE: all: $(LIBS) -lint: lintcheck - include ../../Makefile.targ objs/%.o pics/%.o: $(COMDIR)/%.c diff --git a/usr/src/lib/libjedec/Makefile.com b/usr/src/lib/libjedec/Makefile.com index 755004d099..a2138ed9ea 100644 --- a/usr/src/lib/libjedec/Makefile.com +++ b/usr/src/lib/libjedec/Makefile.com @@ -10,7 +10,7 @@ # # -# Copyright (c) 2018 Joyent, Inc. +# Copyright 2020 Joyent, Inc. # LIBRARY = libjedec.a @@ -19,8 +19,7 @@ OBJECTS = libjedec.o include ../../Makefile.lib -LIBS = $(DYNLIB) $(LINTLIB) -LDLIBS += -lc +LIBS = $(DYNLIB) CPPFLAGS += -I../common SRCDIR = ../common @@ -29,6 +28,4 @@ SRCDIR = ../common all: $(LIBS) -lint: lintcheck - include ../../Makefile.targ diff --git a/usr/src/tools/make/Makefile.com b/usr/src/tools/make/Makefile.com index 34074bb00a..8fbe1bc1b4 100644 --- a/usr/src/tools/make/Makefile.com +++ b/usr/src/tools/make/Makefile.com @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2020 Joyent, Inc. MAKE_INCLUDE= $(SRC)/cmd/make/include @@ -19,3 +20,4 @@ CFLAGS = $(NATIVE_CFLAGS) CFLAGS += $(CCVERBOSE) CCFLAGS = $(NATIVE_CCFLAGS) -_gcc4=-std=gnu++0x CPPFLAGS = -I$(MAKE_INCLUDE) $(MAKE_DEFS) +CCNEEDED = $(NATIVECCNEEDED) -- cgit v1.2.3 From 93fec3dabf64a3a6299b6973ba1d0260c667e1c0 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 22 Nov 2018 14:03:02 +0200 Subject: 12080 udapl_tavor: cast between incompatible function types Reviewed by: John Levon Approved by: Dan McDonald --- .../lib/udapl/udapl_tavor/common/dapl_evd_util.c | 91 +++++++++-------- .../lib/udapl/udapl_tavor/common/dapl_ia_util.c | 113 +++++++++++---------- 2 files changed, 106 insertions(+), 98 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/lib/udapl/udapl_tavor/common/dapl_evd_util.c b/usr/src/lib/udapl/udapl_tavor/common/dapl_evd_util.c index 19e2eaaa5d..b40dd626db 100644 --- a/usr/src/lib/udapl/udapl_tavor/common/dapl_evd_util.c +++ b/usr/src/lib/udapl/udapl_tavor/common/dapl_evd_util.c @@ -77,16 +77,16 @@ dapli_evd_event_alloc( * to create the default async evd. * * Input: - * ia_ptr + * ia_ptr * cno_ptr * qlen * evd_flags * * Output: - * evd_ptr_ptr + * evd_ptr_ptr * * Returns: - * none + * none * */ @@ -136,6 +136,13 @@ dapls_evd_internal_create( goto bail; } +#if 0 + /* + * Current implementation of dapls_ib_setup_async_callback() does + * nothing and returns DAT_SUCCESS. However, it is declared to expect + * function pointers with different signatures. We do leave the code + * block out till dapls_ib_setup_async_callback() is implemented. + */ dat_status = dapls_ib_setup_async_callback( ia_ptr, DAPL_ASYNC_CQ_COMPLETION, @@ -145,6 +152,7 @@ dapls_evd_internal_create( if (dat_status != DAT_SUCCESS) { goto bail; } +#endif /* * cq_notify is not required since when evd_wait is called * time we go and poll cq anyways. @@ -181,13 +189,13 @@ bail: * alloc and initialize an EVD struct * * Input: - * ia + * ia * * Output: - * evd_ptr + * evd_ptr * * Returns: - * none + * none * */ DAPL_EVD * @@ -250,14 +258,14 @@ bail: * alloc events into an EVD. * * Input: - * evd_ptr + * evd_ptr * qlen * * Output: - * NONE + * NONE * * Returns: - * DAT_SUCCESS + * DAT_SUCCESS * ERROR * */ @@ -328,13 +336,13 @@ bail: * error. * * Input: - * evd_ptr + * evd_ptr * * Output: - * none + * none * * Returns: - * status + * status * */ DAT_RETURN @@ -413,8 +421,7 @@ bail: #ifdef DAPL_DBG /* For debugging. */ void -dapli_evd_eh_print_cqe( - IN ib_work_completion_t cqe) +dapli_evd_eh_print_cqe(IN ib_work_completion_t cqe) { static char *optable[] = { "", @@ -481,7 +488,7 @@ dapli_evd_eh_print_cqe( * that the lock is held. * * Input: - * evd_ptr + * evd_ptr * * Output: * event @@ -518,8 +525,8 @@ dapli_evd_get_event( * entry to this function. * * Input: - * evd_ptr - * event + * evd_ptr + * event * * Output: * none @@ -532,7 +539,7 @@ dapli_evd_post_event( IN const DAT_EVENT *event_ptr) { DAT_RETURN dat_status; - DAPL_CNO *cno_to_trigger = NULL; + DAPL_CNO *cno_to_trigger = NULL; dapl_dbg_log(DAPL_DBG_TYPE_EVD, "dapli_evd_post_event: Called with event # %x\n", @@ -606,8 +613,8 @@ dapli_evd_post_event( * entry to this function. * * Input: - * evd_ptr - * event + * evd_ptr + * event * * Output: * none @@ -643,8 +650,8 @@ dapli_evd_post_event_nosignal( * format an overflow event for posting * * Input: - * evd_ptr - * event_ptr + * evd_ptr + * event_ptr * * Output: * none @@ -671,8 +678,8 @@ dapli_evd_format_overflow_event( * post an overflow event * * Input: - * async_evd_ptr - * evd_ptr + * async_evd_ptr + * evd_ptr * * Output: * none @@ -711,7 +718,7 @@ dapli_evd_get_and_init_event( IN DAPL_EVD *evd_ptr, IN DAT_EVENT_NUMBER event_number) { - DAT_EVENT *event_ptr; + DAT_EVENT *event_ptr; event_ptr = dapli_evd_get_event(evd_ptr); if (NULL == event_ptr) { @@ -734,7 +741,7 @@ dapls_evd_post_cr_arrival_event( DAT_CONN_QUAL conn_qual, DAT_CR_HANDLE cr_handle) { - DAT_EVENT *event_ptr; + DAT_EVENT *event_ptr; event_ptr = dapli_evd_get_and_init_event(evd_ptr, event_number); /* * Note event lock may be held on successful return @@ -765,7 +772,7 @@ dapls_evd_post_connection_event( IN DAT_COUNT private_data_size, IN DAT_PVOID private_data) { - DAT_EVENT *event_ptr; + DAT_EVENT *event_ptr; event_ptr = dapli_evd_get_and_init_event(evd_ptr, event_number); /* * Note event lock may be held on successful return @@ -793,7 +800,7 @@ dapls_evd_post_async_error_event( IN DAT_EVENT_NUMBER event_number, IN DAT_IA_HANDLE ia_handle) { - DAT_EVENT *event_ptr; + DAT_EVENT *event_ptr; event_ptr = dapli_evd_get_and_init_event(evd_ptr, event_number); /* * Note event lock may be held on successful return @@ -818,7 +825,7 @@ dapls_evd_post_software_event( IN DAT_EVENT_NUMBER event_number, IN DAT_PVOID pointer) { - DAT_EVENT *event_ptr; + DAT_EVENT *event_ptr; event_ptr = dapli_evd_get_and_init_event(evd_ptr, event_number); /* * Note event lock may be held on successful return @@ -911,13 +918,13 @@ dapls_evd_post_premature_events(IN DAPL_EP *ep_ptr) * * Input: * evd_ptr - * cqe_ptr + * cqe_ptr * * Output: - * event_ptr + * event_ptr * * Returns: - * none + * none * */ static DAT_BOOLEAN @@ -1206,10 +1213,10 @@ dapli_evd_cqe_to_event( * evd_ptr * * Output: - * nevents + * nevents * * Returns: - * none + * none * */ void @@ -1296,16 +1303,14 @@ dapls_evd_copy_cq( * timeout * * Output: - * return status + * return status * * Returns: - * none + * none * */ DAT_RETURN -dapls_evd_copy_events( - DAPL_EVD *evd_ptr, - DAT_TIMEOUT timeout) +dapls_evd_copy_events(DAPL_EVD *evd_ptr, DAT_TIMEOUT timeout) { dapl_ib_event_t evp_arr[NUM_EVENTS_PER_POLL]; dapl_ib_event_t *evpp_start; @@ -1584,16 +1589,14 @@ dapls_evd_copy_events( * evd_ptr * * Output: - * event + * event * * Returns: - * Status of operation + * Status of operation * */ DAT_RETURN -dapls_evd_cq_poll_to_event( - IN DAPL_EVD *evd_ptr, - OUT DAT_EVENT *event) +dapls_evd_cq_poll_to_event(IN DAPL_EVD *evd_ptr, OUT DAT_EVENT *event) { DAT_RETURN dat_status; ib_work_completion_t cur_cqe; diff --git a/usr/src/lib/udapl/udapl_tavor/common/dapl_ia_util.c b/usr/src/lib/udapl/udapl_tavor/common/dapl_ia_util.c index bc16ef69b4..714d60eac7 100644 --- a/usr/src/lib/udapl/udapl_tavor/common/dapl_ia_util.c +++ b/usr/src/lib/udapl/udapl_tavor/common/dapl_ia_util.c @@ -55,13 +55,13 @@ void dapli_ia_release_hca( * alloc and initialize an IA INFO struct * * Input: - * none + * none * * Output: - * ia_ptr + * ia_ptr * * Returns: - * none + * none * */ DAPL_IA * @@ -123,19 +123,18 @@ dapl_ia_alloc(DAT_PROVIDER * provider, DAPL_HCA * hca_ptr) * Performs an abrupt close of the IA * * Input: - * ia_ptr + * ia_ptr * * Output: - * none + * none * * Returns: - * status + * status * */ DAT_RETURN -dapl_ia_abrupt_close( - IN DAPL_IA *ia_ptr) +dapl_ia_abrupt_close(IN DAPL_IA *ia_ptr) { DAT_RETURN dat_status; DAPL_EP *ep_ptr, *next_ep_ptr; @@ -346,24 +345,23 @@ dapl_ia_abrupt_close( * Performs an graceful close of the IA * * Input: - * ia_ptr + * ia_ptr * * Output: - * none + * none * * Returns: - * status + * status * */ DAT_RETURN -dapl_ia_graceful_close( - IN DAPL_IA *ia_ptr) +dapl_ia_graceful_close(IN DAPL_IA *ia_ptr) { DAT_RETURN dat_status; DAT_RETURN cur_dat_status; DAPL_EVD *evd_ptr; - DAPL_LLIST_ENTRY *entry; + DAPL_LLIST_ENTRY *entry; DAPL_HCA *hca_ptr; dat_status = DAT_SUCCESS; @@ -491,13 +489,13 @@ dapli_ia_release_hca( * free an IA INFO struct * * Input: - * ia_ptr + * ia_ptr * * Output: - * one + * one * * Returns: - * none + * none * */ void @@ -535,10 +533,10 @@ dapls_ia_free(DAPL_IA *ia_ptr) * ep_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -563,10 +561,10 @@ dapl_ia_link_ep( * ep_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -590,10 +588,10 @@ dapl_ia_unlink_ep( * lmr_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -618,10 +616,10 @@ dapl_ia_link_lmr( * lmr_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -645,10 +643,10 @@ dapl_ia_unlink_lmr( * rmr_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -673,10 +671,10 @@ dapl_ia_link_rmr( * rmr_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -700,10 +698,10 @@ dapl_ia_unlink_rmr( * pz_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -728,10 +726,10 @@ dapl_ia_link_pz( * pz_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -755,10 +753,10 @@ dapl_ia_unlink_pz( * evd_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -783,10 +781,10 @@ dapl_ia_link_evd( * evd_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -810,10 +808,10 @@ dapl_ia_unlink_evd( * cno_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -838,10 +836,10 @@ dapl_ia_link_cno( * cno_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -865,10 +863,10 @@ dapl_ia_unlink_cno( * sp_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -893,10 +891,10 @@ dapl_ia_link_psp( * sp_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -930,10 +928,10 @@ dapls_ia_unlink_sp( * sp_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ DAPL_SP * @@ -980,10 +978,10 @@ dapls_ia_sp_search( * sp_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -1008,10 +1006,10 @@ dapl_ia_link_rsp( * srq_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -1036,10 +1034,10 @@ dapl_ia_link_srq( * srq_ptr * * Output: - * none + * none * * Returns: - * none + * none * */ void @@ -1060,6 +1058,13 @@ dapls_ia_setup_callbacks( { DAT_RETURN dat_status = DAT_SUCCESS; +#if 0 + /* + * Current implementation of dapls_ib_setup_async_callback() does + * nothing and returns DAT_SUCCESS. However, it is declared to expect + * function pointers with different signatures. We do leave the code + * block out till dapls_ib_setup_async_callback() is implemented. + */ /* unaffiliated handler */ dat_status = dapls_ib_setup_async_callback( @@ -1104,8 +1109,8 @@ dapls_ia_setup_callbacks( dat_status); goto bail; } - bail: +#endif return (dat_status); } -- cgit v1.2.3 From 0cad6fe6a45fed29aa5c115fda1fc16385145fce Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 22 Nov 2018 11:53:01 +0200 Subject: 11985 libfakekernel: cast between incompatible function types Reviewed by: John Levon Approved by: Dan McDonald --- usr/src/lib/libfakekernel/common/callout.c | 2 +- usr/src/lib/libfakekernel/common/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/lib/libfakekernel/common/callout.c b/usr/src/lib/libfakekernel/common/callout.c index b2e5048bab..6752e2f44a 100644 --- a/usr/src/lib/libfakekernel/common/callout.c +++ b/usr/src/lib/libfakekernel/common/callout.c @@ -46,7 +46,7 @@ timeout(void (*func)(void *), void *arg, clock_t delta) bzero(&sev, sizeof (sev)); sev.sigev_notify = SIGEV_THREAD; sev.sigev_value.sival_ptr = arg; - sev.sigev_notify_function = (sigev_notify_func_t)func; + sev.sigev_notify_function = (sigev_notify_func_t)(uintptr_t)func; err = timer_create(CLOCK_REALTIME, &sev, &tid); if (err != 0) return (NULL); diff --git a/usr/src/lib/libfakekernel/common/thread.c b/usr/src/lib/libfakekernel/common/thread.c index 7cfac712a8..31421a723b 100644 --- a/usr/src/lib/libfakekernel/common/thread.c +++ b/usr/src/lib/libfakekernel/common/thread.c @@ -70,7 +70,7 @@ thread_create( break; } - thr_func = (void *(*)(void *))func; + thr_func = (void *(*)(void *))(uintptr_t)func; rc = thr_create(NULL, 0, thr_func, arg, thr_flags, &newtid); if (rc != 0) cmn_err(CE_PANIC, "thread_create failed, rc=%d", rc); -- cgit v1.2.3 From 2bcbf80ce6c8a2fb827428428c350ebe4f91f7ab Mon Sep 17 00:00:00 2001 From: Peter Tribble Date: Thu, 6 Feb 2020 09:28:37 +0000 Subject: 12289 remove sunfire-specific code from libprtdiag Reviewed by: Toomas Soome Approved by: Dan McDonald --- usr/src/lib/libprtdiag/Makefile.com | 4 +- usr/src/lib/libprtdiag/common/display_sun4u.c | 6 +- usr/src/lib/libprtdiag/common/display_sun4v.c | 4 +- usr/src/lib/libprtdiag/common/kstat.c | 351 +-- usr/src/lib/libprtdiag/common/memory.c | 7 +- usr/src/lib/libprtdiag/inc/libprtdiag.h | 9 +- usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h | 113 +- usr/src/lib/libprtdiag/inc/reset_info.h | 108 - usr/src/lib/libprtdiag_psr/sparc/Makefile | 4 +- usr/src/lib/libprtdiag_psr/sparc/Makefile.com | 9 +- .../sparc/cherrystone/common/cherrystone.c | 8 +- .../libprtdiag_psr/sparc/daktari/common/daktari.c | 10 +- .../libprtdiag_psr/sparc/desktop/common/desktop.c | 34 +- .../libprtdiag_psr/sparc/javelin/common/javelin.c | 19 +- .../sparc/littleneck/common/littleneck.c | 10 +- usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c | 10 +- .../sparc/serengeti/common/serengeti.c | 6 +- usr/src/lib/libprtdiag_psr/sparc/sunfire/Makefile | 72 - .../libprtdiag_psr/sparc/sunfire/common/sunfire.c | 2284 -------------------- .../lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c | 18 +- usr/src/pkg/manifests/system-library-platform.mf | 4 +- 21 files changed, 80 insertions(+), 3010 deletions(-) delete mode 100644 usr/src/lib/libprtdiag/inc/reset_info.h delete mode 100644 usr/src/lib/libprtdiag_psr/sparc/sunfire/Makefile delete mode 100644 usr/src/lib/libprtdiag_psr/sparc/sunfire/common/sunfire.c (limited to 'usr/src/lib') diff --git a/usr/src/lib/libprtdiag/Makefile.com b/usr/src/lib/libprtdiag/Makefile.com index 6994883b47..406fcfc96f 100644 --- a/usr/src/lib/libprtdiag/Makefile.com +++ b/usr/src/lib/libprtdiag/Makefile.com @@ -21,6 +21,7 @@ # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# Copyright 2020 Peter Tribble. # # @@ -39,8 +40,7 @@ include $(SRC)/Makefile.psm LIBS = $(DYNLIB) $(LINTLIB) IFLAGS = -I ../../inc -I $(USR_PSM_INCL_DIR) IFLAGS += -I $(SRC)/cmd/picl/plugins/inc -IFLAGS += -I $(UTSBASE)/sun4u -IFLAGS += -I $(UTSBASE)/sun4u/sunfire +IFLAGS += -I $(UTSBASE)/sun4u IFLAGS += -I $(UTSBASE)/sun4u/serengeti CPPFLAGS = $(IFLAGS) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) diff --git a/usr/src/lib/libprtdiag/common/display_sun4u.c b/usr/src/lib/libprtdiag/common/display_sun4u.c index a68246600f..56e2716e38 100644 --- a/usr/src/lib/libprtdiag/common/display_sun4u.c +++ b/usr/src/lib/libprtdiag/common/display_sun4u.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ #include @@ -62,7 +63,6 @@ display(Sys_tree *tree, 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 */ sys_clk = -1; /* System clock freq. (in MHz) */ @@ -96,7 +96,7 @@ display(Sys_tree *tree, } /* Display the Memory Size */ - display_memorysize(tree, kstats, &grps, &memory_total); + display_memorysize(tree, kstats, &memory_total); /* Display platform specific configuration info */ display_platform_specific_header(); @@ -105,7 +105,7 @@ display(Sys_tree *tree, display_cpu_devices(tree); /* Display the Memory configuration */ - display_memoryconf(tree, &grps); + display_memoryconf(tree); /* Display all the IO cards. */ (void) display_io_devices(tree); diff --git a/usr/src/lib/libprtdiag/common/display_sun4v.c b/usr/src/lib/libprtdiag/common/display_sun4v.c index e4a2408537..9ec03878b5 100644 --- a/usr/src/lib/libprtdiag/common/display_sun4v.c +++ b/usr/src/lib/libprtdiag/common/display_sun4v.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ #include @@ -119,7 +120,6 @@ sun4v_display(Sys_tree *tree, Prom_node *root, int log, { 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 */ char machine[MAXSTRLEN]; int exit_code = 0; @@ -155,7 +155,7 @@ sun4v_display(Sys_tree *tree, Prom_node *root, int log, } /* Display the Memory Size */ - display_memorysize(tree, NULL, &grps, &memory_total); + display_memorysize(tree, NULL, &memory_total); /* Display the CPU devices */ sun4v_display_cpu_devices(plafh); diff --git a/usr/src/lib/libprtdiag/common/kstat.c b/usr/src/lib/libprtdiag/common/kstat.c index 1c29e96642..5aaf523441 100644 --- a/usr/src/lib/libprtdiag/common/kstat.c +++ b/usr/src/lib/libprtdiag/common/kstat.c @@ -22,10 +22,9 @@ /* * Copyright (c) 1999 by Sun Microsystems, Inc. * All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -54,369 +53,33 @@ /* * This module does the reading and interpreting of sun4u system - * kstats. These kstats are created by the following drivers: - * fhc, environ, sysctrl. Each board in the tree should have - * kstats created for it. There are also system wide kstats that - * are created. + * kstats. It is overlaid by a platform-specific implementation as + * appropriate. */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) + struct envctrl_kstat_data *ep) { - Board_node *bnode; - kstat_ctl_t *kc; - kstat_t *ksp; - kstat_named_t *knp; - int i; - struct hp_info *hp; - -#ifdef lint - ep = ep; -#endif - if ((kc = kstat_open()) == NULL) { - return; - } - - /* For each board in the system, read the kstats for it. */ - for (bnode = tree->bd_list; bnode != NULL; bnode = bnode->next) { - int board; - - /* - * Kstat instances numbers are set by fhc, ac, simmstat, - * and environ drivers based on their board# property. - */ - board = bnode->board_num; - bdp = &sys_kstat->bd_ksp_list[board]; - - /* Try to find an FHC instance for this board number */ - ksp = kstat_lookup(kc, UNIX, board, FHC_KSTAT_NAME); - - /* Atempt to read the FHC kstat */ - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) == -1)) { - ksp = NULL; - } - - /* Now read out the data if the kstat read OK */ - if (ksp != NULL) { - /* - * We set the kstats_ok flag to good here. If we - * fail one of the data reads, we set it to bad. - */ - bdp->fhc_kstats_ok = 1; - - /* - * For each data value, If the Kstat named struct - * is found, then get the data out. - */ - knp = kstat_data_lookup(ksp, CSR_KSTAT_NAMED); - if (knp != NULL) { - bdp->fhc_csr = knp->value.ul; - } else { - bdp->fhc_kstats_ok = 0; - } - knp = kstat_data_lookup(ksp, BSR_KSTAT_NAMED); - if (knp != NULL) { - bdp->fhc_bsr = knp->value.ul; - } else { - bdp->fhc_kstats_ok = 0; - } - } - - /* Try to find an AC instance for this board number */ - ksp = kstat_lookup(kc, UNIX, board, AC_KSTAT_NAME); - - /* Attempt to read the AC kstat. */ - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) == -1)) { - ksp = NULL; - } - - /* If the AC kstat exists, try to read the data from it. */ - if (ksp != NULL) { - /* - * We set the kstats_ok flag to good here. If we - * fail one of the data reads, we set it to bad. - */ - bdp->ac_kstats_ok = 1; - bdp->ac_memstat_ok = 1; - - /* - * For each data value, If the Kstat named struct - * is found, then get the data out. - */ - - knp = kstat_data_lookup(ksp, MEMCTL_KSTAT_NAMED); - if (knp != NULL) { - bdp->ac_memctl = knp->value.ull; - } else { - bdp->ac_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, MEMDECODE0_KSTAT_NAMED); - if (knp != NULL) { - bdp->ac_memdecode[0] = knp->value.ull; - } else { - bdp->ac_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, MEMDECODE1_KSTAT_NAMED); - if (knp != NULL) { - bdp->ac_memdecode[1] = knp->value.ull; - } else { - bdp->ac_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, BANK_0_KSTAT_NAMED); - if (knp != NULL) { - bdp->mem_stat[0].status = knp->value.c[0]; - bdp->mem_stat[0].condition = knp->value.c[1]; - } else { - bdp->ac_memstat_ok = 0; - } - - knp = kstat_data_lookup(ksp, BANK_1_KSTAT_NAMED); - if (knp != NULL) { - bdp->mem_stat[1].status = knp->value.c[0]; - bdp->mem_stat[1].condition = knp->value.c[1]; - } else { - bdp->ac_memstat_ok = 0; - } - - } - - /* Try to find an simmstat instance for this board number */ - ksp = kstat_lookup(kc, UNIX, board, SIMMSTAT_KSTAT_NAME); - - if (ksp != NULL) { - if (kstat_read(kc, ksp, NULL) == -1) { - bdp->simmstat_kstats_ok = 0; - } else { - bdp->simmstat_kstats_ok = 1; - (void) memcpy(&bdp->simm_status, ksp->ks_data, - sizeof (bdp->simm_status)); - } - } - - /* Try to find an overtemp kstat instance for this board */ - ksp = kstat_lookup(kc, UNIX, board, OVERTEMP_KSTAT_NAME); - - if (ksp != NULL) { - if (kstat_read(kc, ksp, NULL) == -1) { - bdp->temp_kstat_ok = 0; - } else { - bdp->temp_kstat_ok = 1; - (void) memcpy(&bdp->tempstat, ksp->ks_data, - sizeof (bdp->tempstat)); - /* XXX - this is for 2.5.1 testing. remove */ - if (sizeof (bdp->tempstat) > ksp->ks_data_size) - bdp->tempstat.trend = TREND_UNKNOWN; - } - } - } - - /* Read the kstats for the system control board */ - ksp = kstat_lookup(kc, UNIX, 0, SYSCTRL_KSTAT_NAME); - - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) == -1)) { - sys_kstat->sys_kstats_ok = 0; - ksp = NULL; - } - - if (ksp != NULL) { - sys_kstat->sys_kstats_ok = 1; - - knp = kstat_data_lookup(ksp, CSR_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->sysctrl = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, STAT1_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->sysstat1 = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, STAT2_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->sysstat2 = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, CLK_FREQ2_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->clk_freq2 = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, FAN_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->fan_status = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, KEY_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->keysw_status = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, POWER_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->power_state = - (enum power_state)knp->value.l; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, CLK_VER_KSTAT_NAME); - if (knp != NULL) { - sys_kstat->clk_ver = knp->value.c[0]; - } else { - /* - * the clock version register only appears - * on new clock boards - */ - sys_kstat->clk_ver = 0; - } - - } - - /* Read the kstats for the power supply stats */ - ksp = kstat_lookup(kc, UNIX, 0, PSSHAD_KSTAT_NAME); - - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) != -1)) { - sys_kstat->psstat_kstat_ok = 1; - (void) memcpy(&sys_kstat->ps_shadow[0], ksp->ks_data, - sizeof (sys_kstat->ps_shadow)); - } else { - sys_kstat->psstat_kstat_ok = 0; - } - - /* read the overtemp kstat for the system control board */ - /* Try to find an overtemp kstat instance for this board */ - ksp = kstat_lookup(kc, UNIX, CLOCK_BOARD_INDEX, OVERTEMP_KSTAT_NAME); - - if (ksp != NULL) { - if (kstat_read(kc, ksp, NULL) == -1) { - sys_kstat->temp_kstat_ok = 0; - } else { - sys_kstat->temp_kstat_ok = 1; - (void) memcpy(&sys_kstat->tempstat, ksp->ks_data, - sizeof (sys_kstat->tempstat)); - /* XXX - this is for 2.5.1 testing. remove */ - if (sizeof (sys_kstat->tempstat) > ksp->ks_data_size) - sys_kstat->tempstat.trend = TREND_UNKNOWN; - } - } - - /* Read the reset-info kstat from one of the boards. */ - ksp = kstat_lookup(kc, UNIX, 0, RESETINFO_KSTAT_NAME); - - if (ksp == NULL) { - sys_kstat->reset_kstats_ok = 0; - } else if (kstat_read(kc, ksp, NULL) == -1) { - sys_kstat->reset_kstats_ok = 0; - } else { - sys_kstat->reset_kstats_ok = 1; - (void) memcpy(&sys_kstat->reset_info, ksp->ks_data, - sizeof (sys_kstat->reset_info)); - } - - /* read kstats for hotplugged boards */ - for (i = 0, hp = &sys_kstat->hp_info[0]; i < MAX_BOARDS; i++, hp++) { - ksp = kstat_lookup(kc, UNIX, i, BDLIST_KSTAT_NAME); - - if (ksp == NULL) { - continue; - } - - if (kstat_read(kc, ksp, NULL) == -1) { - hp->kstat_ok = 0; - } else { - hp->kstat_ok = 1; - (void) memcpy(&hp->bd_info, ksp->ks_data, - sizeof (hp->bd_info)); - } - } - - /* read in the kstat for the fault list. */ - ksp = kstat_lookup(kc, UNIX, 0, FT_LIST_KSTAT_NAME); - - if (ksp == NULL) { - sys_kstat->ft_kstat_ok = 0; - } else { - if (kstat_read(kc, ksp, NULL) == -1) { - perror("kstat read"); - sys_kstat->ft_kstat_ok = 0; - return; - } - - sys_kstat->nfaults = ksp->ks_data_size / - sizeof (struct ft_list); - - sys_kstat->ft_array = - (struct ft_list *)malloc(ksp->ks_data_size); - - if (sys_kstat->ft_array == NULL) { - perror("Malloc"); - exit(2); - } - sys_kstat->ft_kstat_ok = 1; - (void) memcpy(sys_kstat->ft_array, ksp->ks_data, - ksp->ks_data_size); - } } /* * This function does the reading and interpreting of sun4u system - * kstats. These kstats are created by the following drivers: - * fhc, environ, sysctrl. Each board in the tree should have - * kstats created for it. There are also system wide kstats that - * are created. + * kstats. */ void read_sun4u_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat) { -#if 0 - Board_node *bnode; - kstat_t *ksp; - kstat_named_t *knp; - struct hp_info *hp; - struct envctrltwo_kstat_data *ecp; -#endif - kstat_ctl_t *kc; + kstat_ctl_t *kc; int i; - struct bd_kstat_data *bdp; struct envctrl_kstat_data *ep; if ((kc = kstat_open()) == NULL) { return; } -#ifdef lint - kc = kc; -#endif /* Initialize the kstats structure */ sys_kstat->sys_kstats_ok = 0; - sys_kstat->temp_kstat_ok = 0; - sys_kstat->reset_kstats_ok = 0; - sys_kstat->ft_kstat_ok = 0; sys_kstat->envctrl_kstat_ok = 0; - for (i = 0; i < MAX_BOARDS; i++) { - bdp = &sys_kstat->bd_ksp_list[i]; - bdp->ac_kstats_ok = 0; - bdp->fhc_kstats_ok = 0; - bdp->simmstat_kstats_ok = 0; - bdp->temp_kstat_ok = 0; - - sys_kstat->hp_info[i].kstat_ok = 0; - } for (i = 0; i < MAX_DEVS; i++) { ep = &sys_kstat->env_data; ep->ps_kstats[i].instance = I2C_NODEV; @@ -424,5 +87,5 @@ read_sun4u_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat) ep->encl_kstats[i].instance = I2C_NODEV; } - read_platform_kstats(tree, sys_kstat, bdp, ep); + read_platform_kstats(tree, sys_kstat, ep); } diff --git a/usr/src/lib/libprtdiag/common/memory.c b/usr/src/lib/libprtdiag/common/memory.c index 1e1aaff425..575f94e956 100644 --- a/usr/src/lib/libprtdiag/common/memory.c +++ b/usr/src/lib/libprtdiag/common/memory.c @@ -22,10 +22,9 @@ /* * Copyright (c) 1999-2001 by Sun Microsystems, Inc. * All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -86,7 +85,7 @@ static memory_seg_t *match_seg(uint64_t); /*ARGSUSED0*/ void display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, - struct grp_info *grps, struct mem_total *memory_total) + struct mem_total *memory_total) { log_printf(dgettext(TEXT_DOMAIN, "Memory size: "), 0); @@ -110,7 +109,7 @@ display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, /*ARGSUSED0*/ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { /* * This function is intentionally blank diff --git a/usr/src/lib/libprtdiag/inc/libprtdiag.h b/usr/src/lib/libprtdiag/inc/libprtdiag.h index e9361b8e9c..41e6227c18 100644 --- a/usr/src/lib/libprtdiag/inc/libprtdiag.h +++ b/usr/src/lib/libprtdiag/inc/libprtdiag.h @@ -21,13 +21,12 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. */ #ifndef _SYS_LIBPRTDIAG_H #define _SYS_LIBPRTDIAG_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -132,15 +131,15 @@ void decode_qlc_card_model_prop(Prom_node *card_node, struct io_card *card); */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep); + struct envctrl_kstat_data *ep); void read_sun4u_kstats(Sys_tree *, struct system_kstat_data *); /* * memory functions */ void display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, - struct grp_info *grps, struct mem_total *memory_total); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); + struct mem_total *memory_total); +void display_memoryconf(Sys_tree *tree); /* * prom functions diff --git a/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h b/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h index 7273d62b8d..c4038e4535 100644 --- a/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h +++ b/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h @@ -22,68 +22,45 @@ /* * Copyright (c) 1999 by Sun Microsystems, Inc. * All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ #ifndef _PDEVINFO_SUN4U_H #define _PDEVINFO_SUN4U_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include -#include -#include -#include #include #include #include -#include -#include -#include -#include #ifdef __cplusplus extern "C" { #endif -#define UNIX "unix" +/* + * These were formerly defined in sys/ac.h, which was specific to sunfire, + * but usage has leaked into generic code. + */ +#ifndef TRUE +#define TRUE (1) +#endif +#ifndef FALSE +#define FALSE (0) +#endif + +/* + * These were formerly defined as part of the board_type enum in sys/fhc.h, + * which was specific to sunfire, but usage has leaked into generic code. + */ +#define UNKNOWN_BOARD 1 +#define CPU_BOARD 2 /* Define names of nodes to search for */ -#define CPU_NAME "SUNW,UltraSPARC" #define SBUS_NAME "sbus" #define PCI_NAME "pci" #define FFB_NAME "SUNW,ffb" #define AFB_NAME "SUNW,afb" -struct mem_stat_data { - enum ac_bank_status status; /* bank status values */ - enum ac_bank_condition condition; /* bank conditions */ -}; - -struct bd_kstat_data { - u_longlong_t ac_memctl; /* Memctl register contents */ - u_longlong_t ac_memdecode[2]; /* memory decode registers . */ - int ac_kstats_ok; /* successful kstat read occurred */ - uint_t fhc_bsr; /* FHC Board Status Register */ - uint_t fhc_csr; /* FHC Control Status Register */ - int fhc_kstats_ok; /* successful kstat read occurred */ - uchar_t simm_status[SIMM_COUNT]; /* SIMM status */ - int simmstat_kstats_ok; /* successful read occurred */ - struct temp_stats tempstat; - int temp_kstat_ok; - struct mem_stat_data mem_stat[2]; /* raw kstat bank information */ - int ac_memstat_ok; /* successful read of memory status */ -}; - -/* - * Hot plug info structure. If a hotplug kstat is found, the bd_info - * structure from the kstat is filled in the the hp_info structure - * is marked OK. - */ -struct hp_info { - struct bd_info bd_info; - int kstat_ok; -}; - /* Environmental info for Tazmo */ struct envctrl_kstat_data { envctrl_ps_t ps_kstats[MAX_DEVS]; /* kstats for powersupplies */ @@ -106,69 +83,15 @@ struct envctrltwo_kstat_data { }; struct system_kstat_data { - uchar_t sysctrl; /* sysctrl register contents */ - uchar_t sysstat1; /* system status1 register contents. */ - uchar_t sysstat2; /* system status2 register contents. */ - uchar_t ps_shadow[SYS_PS_COUNT]; /* power supply shadow */ - int psstat_kstat_ok; - uchar_t clk_freq2; /* clock frequency register 2 contents */ - uchar_t fan_status; /* shadow fan status */ - uchar_t keysw_status; /* status of the key switch */ - enum power_state power_state; /* redundant power state */ - uchar_t clk_ver; /* clock version register */ int sys_kstats_ok; /* successful kstat read occurred */ - struct temp_stats tempstat; - int temp_kstat_ok; - struct reset_info reset_info; - int reset_kstats_ok; /* kstat read OK */ - struct bd_kstat_data bd_ksp_list[MAX_BOARDS]; - struct hp_info hp_info[MAX_BOARDS]; - struct ft_list *ft_array; /* fault array */ - int nfaults; /* number of faults in fault array */ - int ft_kstat_ok; /* Fault kstats OK */ struct envctrl_kstat_data env_data; /* environment data for Tazmo */ int envctrl_kstat_ok; struct envctrltwo_kstat_data envc_data; /* environ data for Javelin */ int envctrltwo_kstat_ok; }; -/* Description of a single memory group */ -struct grp { - int valid; /* active memory group present */ - u_longlong_t base; /* Phyiscal base of group */ - uint_t size; /* size in bytes */ - uint_t curr_size; /* current size in bytes */ - int board; /* board number */ - enum board_type type; /* board type */ - int group; /* group # on board (0 or 1) */ - int factor; /* interleave factor (0,2,4,8,16) */ - int speed; /* Memory speed (in ns) */ - char groupid; /* Alpha tag for group ID */ - enum ac_bank_status status; /* bank status values */ - enum ac_bank_condition condition; /* bank conditions */ -}; - -#define MAX_GROUPS 32 #define MAXSTRLEN 256 -/* Array of all possible groups in the system. */ -struct grp_info { - struct grp grp[MAX_GROUPS]; -}; - -/* A memory interleave structure */ -struct inter_grp { - u_longlong_t base; /* Physical base of group */ - int valid; - int count; - char groupid; -}; - -/* Array of all possible memory interleave structures */ -struct mem_inter { - struct inter_grp i_grp[MAX_GROUPS]; -}; - /* FFB info structure */ struct ffbinfo { int board; diff --git a/usr/src/lib/libprtdiag/inc/reset_info.h b/usr/src/lib/libprtdiag/inc/reset_info.h deleted file mode 100644 index 8f94813a6f..0000000000 --- a/usr/src/lib/libprtdiag/inc/reset_info.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (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) 1999 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ifndef _RESET_INFO_H -#define _RESET_INFO_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * All of the following data structures and defines come from sun4u server - * POST. If the data in POST changes, then these structures must reflect - * those changes. - */ - -#include /* To get MAX_BOARDS constant */ - -/* BDA bit assignments */ -#define BOARD_PRESENT (1<<0) -#define BOARD_OK (1<<1) -#define BOARD_TYPE_MSK (7<<2) -#define BOARD_TYPE(x) (((x) & BOARD_TYPE_MSK) >> 2) - -/* Board state mask and defines */ -#define BD_STATE_MASK 0x3 -#define BD_LPM_FZN 0 -#define BD_ONLINE_FAIL 1 -#define BD_NOT_PRESENT 2 -#define BD_ONLINE_NORMAL 3 - -/* define CPU 0 fields */ -#define CPU0_PRESENT (1<<8) -#define CPU0_OK (1<<9) -#define CPU0_FAIL_CODE_MSK (7<<10) - -/* define CPU 1 fields */ -#define CPU1_PRESENT (1<<16) -#define CPU1_OK (1<<17) -#define CPU1_FAIL_CODE_MSK (7<<18) - -/* supported board types */ -#define CPU_TYPE 0 -#define MEM_TYPE 1 /* CPU/MEM board with only memory */ -#define IO_TYPE1 2 -#define IO_TYPE2 3 -#define IO_TYPE3 4 -#define IO_TYPE4 5 /* same as IO TYPE 1 but no HM or PHY chip */ -#define CLOCK_TYPE 7 - -/* for CPU type UPA ports */ -typedef struct { - u_longlong_t afsr; /* Fault status register for CPU */ - u_longlong_t afar; /* Fault address register for CPU */ -} cpu_reset_state; - -/* For the clock board */ -typedef struct { - unsigned long clk_ssr_1; /* reset status for the clock board */ -} clock_reset_state; - -struct board_info { - u_longlong_t board_desc; - cpu_reset_state cpu[2]; /* could be a CPU */ - u_longlong_t ac_error_status; - u_longlong_t dc_shadow_chain; - uint_t fhc_csr; - uint_t fhc_rcsr; -}; - -struct reset_info { - int length; /* size of the structure */ - int version; /* Version of the structure */ - struct board_info bd_reset_info[MAX_BOARDS]; - clock_reset_state clk; /* one clock board */ - unsigned char tod_timestamp[7]; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* _RESET_INFO_H */ diff --git a/usr/src/lib/libprtdiag_psr/sparc/Makefile b/usr/src/lib/libprtdiag_psr/sparc/Makefile index 2755dcd558..5ca9074498 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/Makefile +++ b/usr/src/lib/libprtdiag_psr/sparc/Makefile @@ -21,11 +21,11 @@ # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# Copyright 2019 Peter Tribble. +# Copyright 2020 Peter Tribble. # # lib/libprtdiag_psr/sparc/Makefile -PRTDIAG_PLATFORMS= desktop tazmo javelin sunfire serengeti \ +PRTDIAG_PLATFORMS= desktop tazmo javelin serengeti \ littleneck daktari cherrystone \ lw8 ontario schumacher opl montoya monza diff --git a/usr/src/lib/libprtdiag_psr/sparc/Makefile.com b/usr/src/lib/libprtdiag_psr/sparc/Makefile.com index af44a80223..d3f93b3e06 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/Makefile.com +++ b/usr/src/lib/libprtdiag_psr/sparc/Makefile.com @@ -21,7 +21,7 @@ # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# Copyright 2019 Peter Tribble. +# Copyright 2020 Peter Tribble. # LIBRARY= libprtdiag_psr.a @@ -34,7 +34,7 @@ VERS= .1 # PSR_MACH= sun4u # -# PLATFORM_OBJECTS is defined in ./desktop ./wgs ./sunfire Makefiles +# PLATFORM_OBJECTS is defined in ./desktop ./wgs Makefiles # OBJECTS= $(PLATFORM_OBJECTS) @@ -56,9 +56,8 @@ CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-unused-function CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-address -IFLAGS += -I $(UTSBASE)/sun4u -IFLAGS += -I $(UTSCLOSED)/sun4u -IFLAGS += -I $(UTSCLOSED)/sun4u/sunfire -I $(UTSBASE)/sun4u/sunfire +IFLAGS += -I $(UTSBASE)/sun4u +IFLAGS += -I $(UTSCLOSED)/sun4u CPPFLAGS = $(IFLAGS) $(CPPFLAGS.master) LDLIBS += -L $(ROOT)/usr/platform/$(PSR_MACH)/lib -lprtdiag -lc DYNFLAGS += -R /usr/platform/$(PSR_MACH)/lib diff --git a/usr/src/lib/libprtdiag_psr/sparc/cherrystone/common/cherrystone.c b/usr/src/lib/libprtdiag_psr/sparc/cherrystone/common/cherrystone.c index 74731ac662..29e8703a5a 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/cherrystone/common/cherrystone.c +++ b/usr/src/lib/libprtdiag_psr/sparc/cherrystone/common/cherrystone.c @@ -21,6 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. */ /* @@ -29,8 +30,6 @@ * */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -75,7 +74,7 @@ void display_io_cards(struct io_card *list); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, struct system_kstat_data *kstats); void display_ffb(Board_node *board, int table); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); +void display_memoryconf(Sys_tree *tree); /* local functions */ static void disp_envc_status(void); @@ -229,9 +228,8 @@ display_cpus(Board_node *board) } } -/*ARGSUSED0*/ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { Board_node *bnode = tree->bd_list; diff --git a/usr/src/lib/libprtdiag_psr/sparc/daktari/common/daktari.c b/usr/src/lib/libprtdiag_psr/sparc/daktari/common/daktari.c index d4fc81913b..fd28266b86 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/daktari/common/daktari.c +++ b/usr/src/lib/libprtdiag_psr/sparc/daktari/common/daktari.c @@ -21,18 +21,17 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. */ /* * Daktari Platform specific functions. * - * called when : + * called when : * machine_type == MTYPE_DAKTARI * */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -85,7 +84,7 @@ void display_io_cards(struct io_card *list); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, struct system_kstat_data *kstats); void display_ffb(Board_node *board, int table); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); +void display_memoryconf(Sys_tree *tree); /* local functions */ static int disp_envc_status(void); @@ -241,9 +240,8 @@ display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats) (void) disp_fail_parts(tree); } -/*ARGSUSED*/ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { Board_node *bnode = tree->bd_list; diff --git a/usr/src/lib/libprtdiag_psr/sparc/desktop/common/desktop.c b/usr/src/lib/libprtdiag_psr/sparc/desktop/common/desktop.c index 29d72ee246..91c02cb8ae 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/desktop/common/desktop.c +++ b/usr/src/lib/libprtdiag_psr/sparc/desktop/common/desktop.c @@ -22,6 +22,7 @@ /* * Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. * * Desktop Platform specific functions. * @@ -31,8 +32,6 @@ * */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -89,15 +88,11 @@ extern int print_flag; * at runtime (desktop systems only) */ int error_check(Sys_tree *tree, struct system_kstat_data *kstats); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); int disp_fail_parts(Sys_tree *tree); void display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, struct system_kstat_data *kstats); void display_pci(Board_node *bnode); -void read_platform_kstats(Sys_tree *tree, - struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep); void display_sbus(Board_node *); @@ -130,22 +125,13 @@ error_check(Sys_tree *tree, struct system_kstat_data *kstats) } -void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) -{ -#ifdef lint - tree = tree; - grps = grps; -#endif -} - /* * disp_fail_parts * * Display the failed parts in the system. This function looks for * the status property in all PROM nodes. On systems where - * the PROM does not supports passing diagnostic information - * thruogh the device tree, this routine will be silent. + * the PROM does not support passing diagnostic information + * through the device tree, this routine will be silent. */ int disp_fail_parts(Sys_tree *tree) @@ -318,20 +304,6 @@ display_pci(Board_node *bnode) } } -void -read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) - -{ -#ifdef lint - tree = tree; - sys_kstat = sys_kstat; - bdp = bdp; - ep = ep; -#endif -} - - /* * local functions */ diff --git a/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c b/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c index 1327ae9248..cae193a670 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c +++ b/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c @@ -22,6 +22,7 @@ /* * Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. * * Javelin Platform specific functions. * @@ -67,7 +68,7 @@ extern int print_flag; * at runtime (workgroup server systems only) */ int error_check(Sys_tree *tree, struct system_kstat_data *kstats); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); +void display_memoryconf(Sys_tree *tree); int disp_fail_parts(Sys_tree *tree); void display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, @@ -78,7 +79,7 @@ void display_io_cards(struct io_card *list); void display_ffb(Board_node *, int); void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep); + struct envctrl_kstat_data *ep); /* local functions */ static int disp_envc_status(struct system_kstat_data *); @@ -129,7 +130,7 @@ dev_next_node_sibling(Prom_node *root, char *name) * DIMM sizes, DIMM socket names. */ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { Board_node *bnode; Prom_node *memory; @@ -144,9 +145,6 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) Prop *status_prop; char interleave[8]; int total_size = 0; -#ifdef lint - grps = grps; -#endif log_printf("\n", 0); log_printf("=========================", 0); @@ -752,11 +750,11 @@ display_ffb(Board_node *board, int table) /* * This module does the reading and interpreting of javelin system - * kstats. These kstats are created by the environ drivers. + * kstats. These kstats are created by the envctrl drivers. */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) + struct envctrl_kstat_data *ep) { kstat_ctl_t *kc; struct envctrltwo_kstat_data *ecp; @@ -765,11 +763,6 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, if ((kc = kstat_open()) == NULL) { return; } -#ifdef lint - tree = tree; - bdp = bdp; - ep = ep; -#endif /* read the envctrltwo kstats */ ecp = &sys_kstat->envc_data; diff --git a/usr/src/lib/libprtdiag_psr/sparc/littleneck/common/littleneck.c b/usr/src/lib/libprtdiag_psr/sparc/littleneck/common/littleneck.c index 89321c0455..828b26a95e 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/littleneck/common/littleneck.c +++ b/usr/src/lib/libprtdiag_psr/sparc/littleneck/common/littleneck.c @@ -21,16 +21,15 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. * * Littleneck Platform specific functions. * - * called when : + * called when : * machine_type == MTYPE_LITTLENECK * */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -81,7 +80,7 @@ void display_io_cards(struct io_card *list); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, struct system_kstat_data *kstats); void display_ffb(Board_node *board, int table); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); +void display_memoryconf(Sys_tree *tree); /* local functions */ static int disp_envc_status(void); @@ -231,9 +230,8 @@ display_cpus(Board_node *board) } } -/*ARGSUSED0*/ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { Board_node *bnode = tree->bd_list; diff --git a/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c b/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c index e12330a75a..640cda2970 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c +++ b/usr/src/lib/libprtdiag_psr/sparc/opl/common/opl.c @@ -21,10 +21,11 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. * * Opl Platform specific functions. * - * called when : + * called when : * machine_type == MTYPE_OPL */ @@ -85,12 +86,12 @@ void display_ffb(Board_node *, int); void display_sbus(Board_node *board); void display_cpu_devices(Sys_tree *tree); void display_cpus(Board_node *board); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); +void display_memoryconf(Sys_tree *tree); void display_io_cards(struct io_card *list); void display_io_devices(Sys_tree *tree); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, struct system_kstat_data *kstats); -Prop *find_prop(Prom_node *pnode, char *name); +Prop *find_prop(Prom_node *pnode, char *name); int do_piclinfo(int); int get_proc_mode(void); @@ -500,9 +501,8 @@ get_opl_mem_regs(Board_node *bnode) /* * Display memory information. */ -/*ARGSUSED*/ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { Board_node *bnode = tree->bd_list; uint64_t total_mem = 0, total_sys_mem = 0; diff --git a/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c b/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c index d77455e83d..6d95747413 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c +++ b/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c @@ -21,6 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. * * Serengeti Platform specific functions. * @@ -136,7 +137,7 @@ void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, void display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats); void get_failed_parts(void); int display_failed_parts(Sys_tree *tree); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); +void display_memoryconf(Sys_tree *tree); void print_us3_memory_line(int portid, int bank_id, uint64_t bank_size, char *bank_status, uint64_t dimm_size, uint32_t intlv, int seg_id); @@ -1766,9 +1767,8 @@ display_failed_parts(Sys_tree *tree) * This routine displays the memory configuration for all boards in the * system. */ -/*ARGSUSED0*/ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { Board_node *bnode = tree->bd_list; diff --git a/usr/src/lib/libprtdiag_psr/sparc/sunfire/Makefile b/usr/src/lib/libprtdiag_psr/sparc/sunfire/Makefile deleted file mode 100644 index 8bec1ea7d7..0000000000 --- a/usr/src/lib/libprtdiag_psr/sparc/sunfire/Makefile +++ /dev/null @@ -1,72 +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 2016 Gary Mills -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# lib/libprtdiag_psr/sparc/sunfire/Makefile - -UTSBASE = ../../../../uts - -PLATFORM_OBJECTS= sunfire.o - -include ../Makefile.com - -IFLAGS += -I$(USR_PLAT_DIR)/sun4u/include -I ../../../libprtdiag/inc -LINTFLAGS += $(IFLAGS) - -PLATFORM=SUNW,Ultra-Enterprise - -$(USR_PLAT_DIR)/$(PLATFORM)/lib/libprtdiag_psr.so.1 := FILEMODE= 0755 - -.KEEP_STATE: - -PLATLIBS= $(USR_PLAT_DIR)/$(PLATFORM)/lib/ - -install: all $(USR_PSM_LIBS) - -$(USR_PSM_LIB_DIR): - cd $(UTSBASE)/sun4u/sunfire; $(MAKE) $(USR_PSM_LIB_DIR) - -# -# install rule -# -$(USR_PSM_LIB_DIR)/%: % $(USR_PSM_LIB_DIR) - $(INS.file) - - -POFILE= libprtdiag_psr_sunfire.po -POFILES= sunfire.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/sunfire.c` - $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@ - $(RM) messages.po diff --git a/usr/src/lib/libprtdiag_psr/sparc/sunfire/common/sunfire.c b/usr/src/lib/libprtdiag_psr/sparc/sunfire/common/sunfire.c deleted file mode 100644 index cfb83f25a0..0000000000 --- a/usr/src/lib/libprtdiag_psr/sparc/sunfire/common/sunfire.c +++ /dev/null @@ -1,2284 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (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 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * Sunfire Platform specific functions. - * - * called when : - * machine_type == MTYPE_SUNFIRE - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pdevinfo.h" -#include "display.h" -#include "pdevinfo_sun4u.h" -#include "display_sun4u.h" -#include "libprtdiag.h" - -#if !defined(TEXT_DOMAIN) -#define TEXT_DOMAIN "SYS_TEST" -#endif - -/* Macros for manipulating UPA IDs and board numbers on Sunfire. */ -#define bd_to_upa(bd) ((bd) << 1) -#define upa_to_bd(upa) ((upa) >> 1) - -#define MAX_MSGS 64 - -extern int print_flag; - -/* - * these functions will overlay the symbol table of libprtdiag - * at runtime (sunfire systems only) - */ -int error_check(Sys_tree *tree, struct system_kstat_data *kstats); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); -int disp_fail_parts(Sys_tree *tree); -void display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, - struct grp_info *grps, struct mem_total *memory_total); -void display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats); -void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, - struct system_kstat_data *kstats); -void display_mid(int mid); -void display_pci(Board_node *); -void display_ffb(Board_node *, int); -void add_node(Sys_tree *, Prom_node *); -void resolve_board_types(Sys_tree *); - -/* local functions */ -static void build_mem_tables(Sys_tree *, struct system_kstat_data *, - struct grp_info *); -static void get_mem_total(struct mem_total *, struct grp_info *); -static int disp_fault_list(Sys_tree *, struct system_kstat_data *); -static int disp_err_log(struct system_kstat_data *); -static int disp_env_status(struct system_kstat_data *); -static int disp_keysw_and_leds(struct system_kstat_data *); -static void sunfire_disp_prom_versions(Sys_tree *); -static void erase_msgs(char **); -static void display_msgs(char **msgs, int board); -static void sunfire_disp_asic_revs(Sys_tree *, struct system_kstat_data *); -static void display_hp_boards(struct system_kstat_data *); -static int disp_parts(char **, u_longlong_t, int); -/* - * Error analysis routines. These routines decode data from specified - * error registers. They are meant to be used for decoding the fatal - * hardware reset data passed to the kernel by sun4u POST. - */ -static int analyze_cpu(char **, int, u_longlong_t); -static int analyze_ac(char **, u_longlong_t); -static int analyze_dc(int, char **, u_longlong_t); - -#define RESERVED_STR "Reserved" - -#define MAX_PARTS 5 -#define MAX_FRUS 5 - -#define MAXSTRLEN 256 - -/* Define special bits */ -#define UPA_PORT_A 0x1 -#define UPA_PORT_B 0x2 - - -/* - * These defines comne from async.h, but it does not get exported from - * uts/sun4u/sys, so they must be redefined. - */ -#define P_AFSR_ISAP 0x0000000040000000ULL /* incoming addr. parity err */ -#define P_AFSR_ETP 0x0000000020000000ULL /* ecache tag parity */ -#define P_AFSR_ETS 0x00000000000F0000ULL /* cache tag parity syndrome */ -#define ETS_SHIFT 16 - -/* List of parts possible */ -#define RSVD_PART 1 -#define UPA_PART 2 -#define UPA_A_PART 3 -#define UPA_B_PART 4 -#define SOFTWARE_PART 5 -#define AC_PART 6 -#define AC_ANY_PART 7 -#define DTAG_PART 8 -#define DTAG_A_PART 9 -#define DTAG_B_PART 10 -#define FHC_PART 11 -#define BOARD_PART 12 -#define BOARD_ANY_PART 13 -#define BOARD_CONN_PART 14 -#define BACK_PIN_PART 15 -#define BACK_TERM_PART 16 -#define CPU_PART 17 - -/* List of possible parts */ -static char *part_str[] = { - "", /* 0, a placeholder for indexing */ - "", /* 1, reserved strings shouldn't be printed */ - "UPA devices", /* 2 */ - "UPA Port A device", /* 3 */ - "UPA Port B device", /* 4 */ - "Software error", /* 5 */ - "Address Controller", /* 6 */ - "Undetermined Address Controller in system", /* 7 */ - "Data Tags", /* 8 */ - "Data Tags for UPA Port A", /* 9 */ - "Data Tags for UPA Port B", /* 10 */ - "Firehose Controller", /* 11 */ - "This Board", /* 12 */ - "Undetermined Board in system", /* 13 */ - "Board Connector", /* 14 */ - "Centerplane pins ", /* 15 */ - "Centerplane terminators", /* 16 */ - "CPU", /* 17 */ -}; - -/* Ecache parity error messages. Tells which bits are bad. */ -static char *ecache_parity[] = { - "Bits 7:0 ", - "Bits 15:8 ", - "Bits 21:16 ", - "Bits 24:22 " -}; - - -struct ac_error { - char *error; - int part[MAX_PARTS]; -}; - -typedef struct ac_error ac_err; - -/* - * Hardware error register meanings, failed parts and FRUs. The - * following strings are indexed for the bit positions of the - * corresponding bits in the hardware. The code checks bit x of - * the hardware error register and prints out string[x] if the bit - * is turned on. - * - * This database of parts which are probably failed and which FRU's - * to replace was based on knowledge of the Sunfire Programmers Spec. - * and discussions with the hardware designers. The order of the part - * lists and consequently the FRU lists are in the order of most - * likely cause first. - */ -static ac_err ac_errors[] = { - { /* 0 */ - "UPA Port A Error", - { UPA_A_PART, 0, 0, 0, 0 }, - }, - { /* 1 */ - "UPA Port B Error", - { UPA_B_PART, 0, 0, 0, 0 }, - }, - { /* 2 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 3 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 4 */ - "UPA Interrupt to unmapped destination", - { BOARD_PART, 0, 0, 0, 0 }, - }, - { /* 5 */ - "UPA Non-cacheable write to unmapped destination", - { BOARD_PART, 0, 0, 0, 0 }, - }, - { /* 6 */ - "UPA Cacheable write to unmapped destination", - { BOARD_PART, 0, 0, 0, 0 }, - }, - { /* 7 */ - "Illegal Write Received", - { BOARD_PART, 0, 0, 0, 0 }, - }, - { /* 8 */ - "Local Writeback match with line in state S", - { AC_PART, DTAG_PART, 0, 0, 0 }, - }, - { /* 9 */ - "Local Read match with valid line in Tags", - { AC_PART, DTAG_PART, 0, 0, 0 }, - }, - { /* 10 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 11 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 12 */ - "Tag and Victim were valid during lookup", - { AC_PART, DTAG_PART, 0, 0, 0 }, - }, - { /* 13 */ - "Local Writeback matches a victim in state S", - { AC_PART, CPU_PART, 0, 0, 0 }, - }, - { /* 14 */ - "Local Read matches valid line in victim buffer", - { AC_PART, CPU_PART, 0, 0, 0 }, - }, - { /* 15 */ - "Local Read victim bit set and victim is S state", - { AC_PART, CPU_PART, 0, 0, 0 }, - }, - { /* 16 */ - "Local Read Victim bit set and Valid Victim Buffer", - { AC_PART, CPU_PART, 0, 0, 0 }, - }, - { /* 17 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 18 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 19 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 20 */ - "UPA Transaction received in Sleep mode", - { AC_PART, 0, 0, 0, 0 }, - }, - { /* 21 */ - "P_FERR error P_REPLY received from UPA Port", - { CPU_PART, AC_PART, 0, 0, 0 }, - }, - { /* 22 */ - "Illegal P_REPLY received from UPA Port", - { CPU_PART, AC_PART, 0, 0, 0 }, - }, - { /* 23 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 24 */ - "Timeout on a UPA Master Port", - { AC_ANY_PART, BOARD_ANY_PART, 0, 0, 0 }, - }, - { /* 25 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 26 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 27 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 28 */ - "Coherent Transactions Queue Overflow Error", - { BACK_PIN_PART, BOARD_CONN_PART, AC_PART, AC_ANY_PART, 0 }, - }, - { /* 29 */ - "Non-cacheable Request Queue Overflow Error", - { AC_PART, AC_ANY_PART, 0, 0, 0 }, - }, - { /* 30 */ - "Non-cacheable Reply Queue Overflow Error", - { AC_PART, 0, 0, 0, 0 }, - }, - { /* 31 */ - "PREQ Queue Overflow Error", - { CPU_PART, AC_PART, 0, 0, 0 }, - }, - { /* 32 */ - "Foreign DID CAM Overflow Error", - { AC_PART, AC_ANY_PART, 0, 0, 0 }, - }, - { /* 33 */ - "FT->UPA Queue Overflow Error", - { BACK_PIN_PART, BOARD_CONN_PART, AC_PART, AC_ANY_PART, 0 }, - }, - { /* 34 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 35 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 36 */ - "UPA Port B Dtag Parity Error", - { DTAG_B_PART, AC_PART, 0, 0, 0 }, - }, - { /* 37 */ - "UPA Port A Dtag Parity Error", - { DTAG_A_PART, AC_PART, 0, 0, 0 }, - }, - { /* 38 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 39 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 40 */ - "UPA Bus Parity Error", - { UPA_PART, AC_PART, 0, 0, 0 }, - }, - { /* 41 */ - "Data ID Line Mismatch", - { BACK_PIN_PART, BOARD_CONN_PART, AC_PART, 0, 0 }, - }, - { /* 42 */ - "Arbitration Line Mismatch", - { BACK_PIN_PART, BOARD_CONN_PART, AC_PART, 0, 0 }, - }, - { /* 43 */ - "Shared Line Parity Mismatch", - { BACK_PIN_PART, BOARD_CONN_PART, AC_PART, 0, 0 }, - }, - { /* 44 */ - "FireTruck Control Line Parity Error", - { AC_PART, BACK_PIN_PART, 0, 0, 0 }, - }, - { /* 45 */ - "FireTruck Address Bus Parity Error", - { AC_PART, BACK_PIN_PART, 0, 0, 0 }, - }, - { /* 46 */ - "Internal RAM Parity Error", - { AC_PART, 0, 0, 0, 0 }, - }, - { /* 47 */ - NULL, - { RSVD_PART, 0, 0, 0, 0 }, - }, - { /* 48 */ - "Internal Hardware Error", - { AC_PART, 0, 0, 0, 0 }, - }, - { /* 49 */ - "FHC Communications Error", - { FHC_PART, AC_PART, 0, 0, 0 }, - }, - /* Bits 50-63 are reserved in this implementation. */ -}; - - -#define MAX_BITS (sizeof (ac_errors)/ sizeof (ac_err)) - -/* - * There are only two error bits in the DC shadow chain that are - * important. They indicate an overflow error and a parity error, - * respectively. The other bits are not error bits and should not - * be checked for. - */ -#define DC_OVERFLOW 0x2 -#define DC_PARITY 0x4 - -static char dc_overflow_txt[] = "Board %d DC %d Overflow Error"; -static char dc_parity_txt[] = "Board %d DC %d Parity Error"; - -/* defines for the sysio */ -#define UPA_APERR 0x4 - -int -error_check(Sys_tree *tree, struct system_kstat_data *kstats) -{ - int exit_code = 0; /* init to all OK */ - - /* - * silently check for any types of machine errors - */ - print_flag = 0; - if (disp_fail_parts(tree) || disp_fault_list(tree, kstats) || - disp_err_log(kstats) || disp_env_status(kstats)) { - /* set exit_code to show failures */ - exit_code = 1; - } - print_flag = 1; - - return (exit_code); -} - -/* - * disp_fail_parts - * - * Display the failed parts in the system. This function looks for - * the status property in all PROM nodes. On systems where - * the PROM does not supports passing diagnostic information - * thruogh the device tree, this routine will be silent. - */ -int -disp_fail_parts(Sys_tree *tree) -{ - int exit_code; - int system_failed = 0; - Board_node *bnode = tree->bd_list; - Prom_node *pnode; - - exit_code = 0; - - /* go through all of the boards looking for failed units. */ - while (bnode != NULL) { - /* find failed chips */ - pnode = find_failed_node(bnode->nodes); - if ((pnode != NULL) && !system_failed) { - system_failed = 1; - exit_code = 1; - if (print_flag == 0) { - return (exit_code); - } - log_printf("\n", 0); - log_printf(dgettext(TEXT_DOMAIN, - "Failed Field Replaceable Units (FRU) " - "in System:\n"), 0); - log_printf("==========================" - "====================\n", 0); - } - - while (pnode != NULL) { - void *value; - char *name; /* node name string */ - char *type; /* node type string */ - char *board_type = NULL; - - value = get_prop_val(find_prop(pnode, "status")); - name = get_node_name(pnode); - - /* sanity check of data retreived from PROM */ - if ((value == NULL) || (name == NULL)) { - pnode = next_failed_node(pnode); - continue; - } - - /* Find the board type of this board */ - if (bnode->board_type == CPU_BOARD) { - board_type = "CPU"; - } else { - board_type = "IO"; - } - - log_printf(dgettext(TEXT_DOMAIN, - "%s unavailable on %s Board #%d\n"), - name, board_type, bnode->board_num, 0); - - log_printf(dgettext(TEXT_DOMAIN, - "\tPROM fault string: %s\n"), value, 0); - - log_printf(dgettext(TEXT_DOMAIN, - "\tFailed Field Replaceable Unit is "), 0); - - /* - * Determine whether FRU is CPU module, system - * board, or SBus card. - */ - if ((name != NULL) && (strstr(name, "sbus"))) { - - log_printf(dgettext(TEXT_DOMAIN, - "SBus Card %d\n"), - get_sbus_slot(pnode), 0); - - } else if (((name = get_node_name(pnode->parent)) != - NULL) && (strstr(name, "pci"))) { - - log_printf(dgettext(TEXT_DOMAIN, - "PCI Card %d"), - get_pci_device(pnode), 0); - - } else if (((type = get_node_type(pnode)) != NULL) && - (strstr(type, "cpu"))) { - - log_printf(dgettext(TEXT_DOMAIN, - "UltraSPARC module " - "Board %d Module %d\n"), - get_id(pnode) >> 1, - get_id(pnode) & 0x1); - - } else { - log_printf(dgettext(TEXT_DOMAIN, - "%s board %d\n"), board_type, - bnode->board_num, 0); - } - pnode = next_failed_node(pnode); - } - bnode = bnode->next; - } - - if (!system_failed) { - log_printf("\n", 0); - log_printf(dgettext(TEXT_DOMAIN, - "No failures found in System\n"), 0); - log_printf("===========================\n", 0); - } - - if (system_failed) - return (1); - else - return (0); -} - -void -display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, - struct grp_info *grps, struct mem_total *memory_total) { - - /* Build the memory group tables and interleave data */ - build_mem_tables(tree, kstats, grps); - - /* display total usable installed memory */ - get_mem_total(memory_total, grps); - (void) log_printf(dgettext(TEXT_DOMAIN, - "Memory size: %4dMb\n"), memory_total->dram, 0); - - /* We display the NVSIMM size totals separately. */ - if (memory_total->nvsimm != 0) { - (void) log_printf(dgettext(TEXT_DOMAIN, - "NVSIMM size: %4dMb\n"), memory_total->nvsimm); - } -} - -/* - * This routine displays the memory configuration for all boards in the - * system. - */ -void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) -{ - int group; - char *status_str[] = { "Unknown", " Empty ", " Failed", " Active", - " Spare " }; - char *cond_str[] = { " Unknown ", " OK ", " Failing ", - " Failed ", " Uninit. " }; - -#ifdef lint - tree = tree; -#endif - /* Print the header for the memory section. */ - log_printf("\n", 0); - log_printf("=========================", 0); - log_printf(dgettext(TEXT_DOMAIN, " Memory "), 0); - log_printf("=========================", 0); - log_printf("\n", 0); - log_printf("\n", 0); - log_printf(" Intrlv. " - "Intrlv.\n", 0); - log_printf("Brd Bank MB Status Condition Speed Factor " - " With\n", 0); - log_printf("--- ----- ---- ------- ---------- ----- ------- " - "-------\n", 0); - - /* Print the Memory groups information. */ - for (group = 0; group < MAX_GROUPS; group++) { - struct grp *grp; - - grp = &grps->grp[group]; - - /* If this board is not a CPU or MEM board, skip it. */ - if ((grp->type != MEM_BOARD) && (grp->type != CPU_BOARD)) { - continue; - } - - if (grp->valid) { - log_printf("%2d ", grp->board, 0); - log_printf(" %1d ", grp->group, 0); - log_printf("%4d ", grp->size, 0); - log_printf("%7s ", status_str[grp->status], 0); - log_printf("%10s ", cond_str[grp->condition], 0); - log_printf("%3dns ", grp->speed, 0); - log_printf("%3d-way ", grp->factor, 0); - if (grp->factor > 1) { - log_printf("%4c", grp->groupid, 0); - } - log_printf("\n", 0); - } - } - -} - - -void -display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats) -{ - /* Display Hot plugged, disabled and failed boards */ - (void) display_hp_boards(kstats); - - /* Display failed units */ - (void) disp_fail_parts(tree); - - /* Display fault info */ - (void) disp_fault_list(tree, kstats); -} - -void -display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, - struct system_kstat_data *kstats) -{ - /* - * Now display the last powerfail time and the fatal hardware - * reset information. We do this under a couple of conditions. - * First if the user asks for it. The second is iof the user - * told us to do logging, and we found a system failure. - */ - if (flag) { - /* - * display time of latest powerfail. Not all systems - * have this capability. For those that do not, this - * is just a no-op. - */ - disp_powerfail(root); - - /* Display system environmental conditions. */ - (void) disp_env_status(kstats); - - /* Display ASIC Chip revs for all boards. */ - sunfire_disp_asic_revs(tree, kstats); - - /* Print the PROM revisions here */ - sunfire_disp_prom_versions(tree); - - /* - * Display the latest system fatal hardware - * error data, if any. The system holds this - * data in SRAM, so it does not persist - * across power-on resets. - */ - (void) disp_err_log(kstats); - } -} - -void -display_mid(int mid) -{ - log_printf(" %2d ", mid % 2, 0); -} - -/* - * display_pci - * Call the generic psycho version of this function. - */ -void -display_pci(Board_node *board) -{ - display_psycho_pci(board); -} - -/* - * display_ffb - * Display all FFBs on this board. It can either be in tabular format, - * or a more verbose format. - */ -void -display_ffb(Board_node *board, int table) -{ - Prom_node *ffb; - void *value; - struct io_card *card_list = NULL; - struct io_card card; - - if (board == NULL) - return; - - /* Fill in common information */ - card.display = 1; - card.board = board->board_num; - (void) sprintf(card.bus_type, "UPA"); - card.freq = sys_clk; - - for (ffb = dev_find_node(board->nodes, FFB_NAME); ffb != NULL; - ffb = dev_next_node(ffb, FFB_NAME)) { - if (table == 1) { - /* Print out in table format */ - - /* XXX - Get the slot number (hack) */ - card.slot = get_id(ffb); - - /* Find out if it's single or double buffered */ - (void) sprintf(card.name, "FFB"); - value = get_prop_val(find_prop(ffb, "board_type")); - if (value != NULL) - if ((*(int *)value) & FFB_B_BUFF) - (void) sprintf(card.name, "FFB, " - "Double Buffered"); - else - (void) sprintf(card.name, "FFB, " - "Single Buffered"); - - /* Print model number */ - card.model[0] = '\0'; - value = get_prop_val(find_prop(ffb, "model")); - if (value != NULL) - (void) sprintf(card.model, "%s", - (char *)value); - - card_list = insert_io_card(card_list, &card); - } else { - /* print in long format */ - char device[MAXSTRLEN]; - int fd = -1; - struct dirent *direntp; - DIR *dirp; - union strap_un strap; - struct ffb_sys_info fsi; - - /* Find the device node using upa address */ - value = get_prop_val(find_prop(ffb, "upa-portid")); - if (value == NULL) - continue; - - (void) sprintf(device, "%s@%x", FFB_NAME, - *(int *)value); - if ((dirp = opendir("/devices")) == NULL) - continue; - - while ((direntp = readdir(dirp)) != NULL) { - if (strstr(direntp->d_name, device) != NULL) { - (void) sprintf(device, "/devices/%s", - direntp->d_name); - fd = open(device, O_RDWR, 0666); - break; - } - } - (void) closedir(dirp); - - if (fd == -1) - continue; - - if (ioctl(fd, FFB_SYS_INFO, &fsi) < 0) - continue; - - log_printf("Board %d FFB Hardware Configuration:\n", - board->board_num, 0); - log_printf("-----------------------------------\n", 0); - - strap.ffb_strap_bits = fsi.ffb_strap_bits; - log_printf("\tBoard rev: %d\n", - (int)strap.fld.board_rev, 0); - log_printf("\tFBC version: 0x%x\n", fsi.fbc_version, 0); - log_printf("\tDAC: %s\n", - fmt_manf_id(fsi.dac_version, device), 0); - log_printf("\t3DRAM: %s\n", - fmt_manf_id(fsi.fbram_version, device), 0); - log_printf("\n", 0); - } - } - - display_io_cards(card_list); - free_io_cards(card_list); -} - -/* - * add_node - * - * This function adds a board node to the board structure where that - * that node's physical component lives. - */ -void -add_node(Sys_tree *root, Prom_node *pnode) -{ - int board; - Board_node *bnode; - char *name = get_node_name(pnode); - Prom_node *p; - - /* add this node to the Board list of the appropriate board */ - if ((board = get_board_num(pnode)) == -1) { - void *value; - - /* - * if it is a server, pci nodes and ffb nodes never have - * board number properties and software can find the board - * number from the reg property. It is derived from the - * high word of the 'reg' property, which contains the - * mid. - */ - if ((name != NULL) && - ((strcmp(name, FFB_NAME) == 0) || - (strcmp(name, "pci") == 0) || - (strcmp(name, "counter-timer") == 0))) { - /* extract the board number from the 'reg' prop. */ - if ((value = get_prop_val(find_prop(pnode, - "reg"))) == NULL) { - (void) printf("add_node() no reg property\n"); - exit(2); - } - board = (*(int *)value - 0x1c0) / 4; - } - } - - /* find the node with the same board number */ - if ((bnode = find_board(root, board)) == NULL) { - bnode = insert_board(root, board); - bnode->board_type = UNKNOWN_BOARD; - } - - /* now attach this prom node to the board list */ - /* Insert this node at the end of the list */ - pnode->sibling = NULL; - if (bnode->nodes == NULL) - bnode->nodes = pnode; - else { - p = bnode->nodes; - while (p->sibling != NULL) - p = p->sibling; - p->sibling = pnode; - } - -} - -/* - * Function resolve_board_types - * - * After the tree is walked and all the information is gathered, this - * function is called to resolve the type of each board. - */ -void -resolve_board_types(Sys_tree *tree) -{ - Board_node *bnode; - Prom_node *pnode; - char *type; - - bnode = tree->bd_list; - while (bnode != NULL) { - bnode->board_type = UNKNOWN_BOARD; - - pnode = dev_find_node(bnode->nodes, "fhc"); - type = get_prop_val(find_prop(pnode, "board-type")); - if (type == NULL) { - bnode = bnode->next; - continue; - } - - if (strcmp(type, CPU_BD_NAME) == 0) { - bnode->board_type = CPU_BOARD; - } else if (strcmp(type, MEM_BD_NAME) == 0) { - bnode->board_type = MEM_BOARD; - } else if (strcmp(type, DISK_BD_NAME) == 0) { - bnode->board_type = DISK_BOARD; - } else if (strcmp(type, IO_SBUS_FFB_BD_NAME) == 0) { - bnode->board_type = IO_SBUS_FFB_BOARD; - } else if (strcmp(type, IO_2SBUS_BD_NAME) == 0) { - bnode->board_type = IO_2SBUS_BOARD; - } else if (strcmp(type, IO_PCI_BD_NAME) == 0) { - bnode->board_type = IO_PCI_BOARD; - } else if (strcmp(type, IO_2SBUS_SOCPLUS_BD_NAME) == 0) { - bnode->board_type = IO_2SBUS_SOCPLUS_BOARD; - } else if (strcmp(type, IO_SBUS_FFB_SOCPLUS_BD_NAME) == 0) { - bnode->board_type = IO_SBUS_FFB_SOCPLUS_BOARD; - } - - bnode = bnode->next; - } - -} - -/* - * local functions - */ - -static void -sunfire_disp_prom_versions(Sys_tree *tree) -{ - Board_node *bnode; - - /* Display Prom revision header */ - log_printf("System Board PROM revisions:\n", 0); - log_printf("----------------------------\n", 0); - - /* For each board, print the POST and OBP versions */ - for (bnode = tree->bd_list; bnode != NULL; bnode = bnode->next) { - Prom_node *flashprom; /* flashprom device node */ - - /* find a flashprom node for this board */ - flashprom = dev_find_node(bnode->nodes, "flashprom"); - - /* If no flashprom node found, continue */ - if (flashprom == NULL) - continue; - - /* flashprom node found, display board# */ - log_printf("Board %2d: ", bnode->board_num, 0); - - disp_prom_version(flashprom); - } -} - - -/* - * functions that are only needed inside this library - */ - -/* - * build_mem_tables - * - * This routine builds the memory table which tells how much memory - * is present in each SIMM group of each board, what the interleave - * factors are, and the group ID of the interleave group. - * - * The algorithms used are: - * First fill in the sizes of groups. - * Next build lists of all groups with same physical base. - * From #of members in each list, interleave factor is - * determined. - * All members of a certain list get the same interleave - * group ID. - */ -static void -build_mem_tables(Sys_tree *tree, - struct system_kstat_data *kstats, - struct grp_info *grps) -{ - struct mem_inter inter_grps; /* temp structure for interleaves */ - struct inter_grp *intrp; - int group; - int i; - - /* initialize the interleave lists */ - for (i = 0, intrp = &inter_grps.i_grp[0]; i < MAX_GROUPS; i++, - intrp++) { - intrp->valid = 0; - intrp->count = 0; - intrp->groupid = '\0'; - intrp->base = 0; - } - - for (group = 0; group < MAX_GROUPS; group++) { - int found; - int board; - struct grp *grp; - struct bd_kstat_data *bksp; - uchar_t simm_reg; - Board_node *bnode; - - board = group/2; - bksp = &kstats->bd_ksp_list[board]; - grp = &grps->grp[group]; - grp->group = group % 2; - - /* - * Copy the board type field into the group record. - */ - if ((bnode = find_board(tree, board)) != NULL) { - grp->type = bnode->board_type; - } else { - grp->type = UNKNOWN_BOARD; - continue; - } - - /* Make sure we have kstats for this board */ - if (bksp->ac_kstats_ok == 0) { - /* Mark this group as invalid and move to next one */ - grp->valid = 0; - continue; - } - - /* Find the bank status property */ - if (bksp->ac_memstat_ok) { - grp->status = bksp->mem_stat[grp->group].status; - grp->condition = bksp->mem_stat[grp->group].condition; - } else { - grp->status = StUnknown; - grp->condition = ConUnknown; - } - - switch (grp->status) { - case StBad: - case StActive: - case StSpare: - break; - default: - grp->status = StUnknown; - break; - } - - switch (grp->condition) { - case ConOK: - case ConFailing: - case ConFailed: - case ConTest: - case ConBad: - break; - default: - grp->condition = ConUnknown; - break; - } - - /* base the group size off of the simmstat kstat. */ - if (bksp->simmstat_kstats_ok == 0) { - grp->valid = 0; - continue; - } - - /* Is it bank 0 or bank 1 */ - if (grp->group == 0) { - simm_reg = bksp->simm_status[0]; - } else { - simm_reg = bksp->simm_status[1]; - } - - /* Now decode the size field. */ - switch (simm_reg & 0x1f) { - case MEM_SIZE_64M: - grp->size = 64; - break; - case MEM_SIZE_256M: - grp->size = 256; - break; - case MEM_SIZE_1G: - grp->size = 1024; - break; - case MEM_SIZE_2G: - grp->size = 2048; - break; - default: - grp->valid = 0; - continue; - } - - /* Decode the speed field */ - switch ((simm_reg & 0x60) >> 5) { - case MEM_SPEED_50ns: - grp->speed = 50; - break; - case MEM_SPEED_60ns: - grp->speed = 60; - break; - case MEM_SPEED_70ns: - grp->speed = 70; - break; - case MEM_SPEED_80ns: - grp->speed = 80; - break; - } - - grp->valid = 1; - grp->base = GRP_BASE(bksp->ac_memdecode[grp->group]); - grp->board = board; - if (grp->group == 0) { - grp->factor = INTLV0(bksp->ac_memctl); - } else { /* assume it is group 1 */ - grp->factor = INTLV1(bksp->ac_memctl); - } - grp->groupid = '\0'; /* Not in a group yet */ - - /* - * find the interleave list this group belongs on. If the - * interleave list corresponding to this base address is - * not found, then create a new one. - */ - - i = 0; - intrp = &inter_grps.i_grp[0]; - found = 0; - while ((i < MAX_GROUPS) && !found && (intrp->valid != 0)) { - if ((intrp->valid != 0) && - (intrp->base == grp->base)) { - grp->groupid = intrp->groupid; - intrp->count++; - found = 1; - } - i++; - intrp++; - } - /* - * We did not find a matching base. So now i and intrp - * now point to the next interleave group in the list. - */ - if (!found) { - intrp->count++; - intrp->valid = 1; - intrp->groupid = 'A' + (char)i; - intrp->base = grp->base; - grp->groupid = intrp->groupid; - } - } -} - - -static void -get_mem_total(struct mem_total *mem_total, struct grp_info *grps) -{ - struct grp *grp; - int i; - - /* Start with total of zero */ - mem_total->dram = 0; - mem_total->nvsimm = 0; - - /* For now we ignore NVSIMMs. We might want to fix this later. */ - for (i = 0, grp = &grps->grp[0]; i < MAX_GROUPS; i++, grp++) { - if (grp->valid == 1 && grp->status == StActive) { - mem_total->dram += grp->size; - } - } -} - -static int -disp_fault_list(Sys_tree *tree, struct system_kstat_data *kstats) -{ - struct ft_list *ftp; - int i; - int result = 0; - time_t t; - - if (!kstats->ft_kstat_ok) { - return (result); - } - - for (i = 0, ftp = kstats->ft_array; i < kstats->nfaults; i++, ftp++) { - if (!result) { - log_printf("\n", 0); - log_printf("Detected System Faults\n", 0); - log_printf("======================\n", 0); - } - result = 1; - if (ftp->fclass == FT_BOARD) { - log_printf("Board %d fault: %s\n", ftp->unit, - ftp->msg, 0); - - /* - * If the fault on this board is PROM inherited, see - * if we can find some failed component information - * in the PROM device tree. The general solution - * would be to fix the fhc driver and have it put in - * more descriptive messages, but that's for another - * day. - */ - - if (ftp->type == FT_PROM) { - Board_node *bn; - Prom_node *pn; - char *str; - - bn = find_board(tree, ftp->unit); - /* - * If any nodes under this board have a - * status containing "fail", print it out. - */ - pn = find_failed_node(bn->nodes); - while (pn) { - str = get_prop_val(find_prop(pn, - "status")); - if (str != NULL) { - log_printf("Fault: %s\n", str, - 0); - } - - pn = next_failed_node(pn); - } - } - } else if ((ftp->type == FT_CORE_PS) || (ftp->type == FT_PPS)) { - log_printf("Unit %d %s failure\n", ftp->unit, - ftp->msg, 0); - } else if ((ftp->type == FT_OVERTEMP) && - (ftp->fclass == FT_SYSTEM)) { - log_printf("Clock board %s\n", ftp->msg, 0); - } else { - log_printf("%s failure\n", ftp->msg, 0); - } - - t = (time_t)ftp->create_time; - log_printf("\tDetected %s", - asctime(localtime(&t)), 0); - } - - if (!result) { - log_printf("\n", 0); - log_printf("No System Faults found\n", 0); - log_printf("======================\n", 0); - } - - log_printf("\n", 0); - - return (result); -} - - -/* - * disp_err_log - * - * Display the fatal hardware reset system error logs. These logs are - * collected by POST and passed up through the kernel to userland. - * They will not necessarily be present in all systems. Their form - * might also be different in different systems. - * - * NOTE - We are comparing POST defined board types here. Do not confuse - * them with kernel board types. The structure being analyzed in this - * function is created by POST. All the defines for it are in reset_info.h, - * which was ported from POST header files. - */ -static int -disp_err_log(struct system_kstat_data *kstats) -{ - int exit_code = 0; - int i; - struct reset_info *rst_info; - struct board_info *bdp; - char *err_msgs[MAX_MSGS]; /* holds all messages for a system board */ - int msg_idx; /* current msg number */ - int count; /* number added by last analyze call */ - char **msgs; - - /* start by initializing the err_msgs array to all NULLs */ - for (i = 0; i < MAX_MSGS; i++) { - err_msgs[i] = NULL; - } - - /* First check to see that the reset-info kstats are present. */ - if (kstats->reset_kstats_ok == 0) { - return (exit_code); - } - - rst_info = &kstats->reset_info; - - /* Everything is OK, so print out time/date stamp first */ - log_printf("\n", 0); - log_printf( - dgettext(TEXT_DOMAIN, - "Analysis of most recent Fatal Hardware Watchdog:\n"), - 0); - log_printf("======================================================\n", - 0); - log_printf("Log Date: %s\n", - get_time(&kstats->reset_info.tod_timestamp[0]), 0); - - /* initialize the vector and the message index. */ - msgs = err_msgs; - msg_idx = 0; - - /* Loop Through all of the boards. */ - bdp = &rst_info->bd_reset_info[0]; - for (i = 0; i < MAX_BOARDS; i++, bdp++) { - - /* Is there data for this board? */ - if ((bdp->board_desc & BD_STATE_MASK) == BD_NOT_PRESENT) { - continue; - } - - /* If it is a CPU Board, look for CPU data. */ - if (BOARD_TYPE(bdp->board_desc) == CPU_TYPE) { - /* analyze CPU 0 if present */ - if (bdp->board_desc & CPU0_OK) { - count = analyze_cpu(msgs, 0, - bdp->cpu[0].afsr); - msgs += count; - msg_idx += count; - } - - /* analyze CPU1 if present. */ - if (bdp->board_desc & CPU1_OK) { - count = analyze_cpu(msgs, 1, - bdp->cpu[1].afsr); - msgs += count; - msg_idx += count; - } - } - - /* Always Analyze the AC and the DCs on a board. */ - count = analyze_ac(msgs, bdp->ac_error_status); - msgs += count; - msg_idx += count; - - count = analyze_dc(i, msgs, bdp->dc_shadow_chain); - msgs += count; - msg_idx += count; - - if (msg_idx != 0) - display_msgs(err_msgs, i); - - erase_msgs(err_msgs); - - /* If any messages are logged, we have errors */ - if (msg_idx != 0) { - exit_code = 1; - } - - /* reset the vector and the message index */ - msg_idx = 0; - msgs = &err_msgs[0]; - } - - return (exit_code); -} - -static void -erase_msgs(char **msgs) -{ - int i; - - for (i = 0; (*msgs != NULL) && (i < MAX_MSGS); i++, msgs++) { - free(*msgs); - *msgs = NULL; - } -} - - -static void -display_msgs(char **msgs, int board) -{ - int i; - - /* display the header for this board */ - print_header(board); - - for (i = 0; (*msgs != NULL) && (i < MAX_MSGS); i++, msgs++) { - log_printf(*msgs, 0); - } -} - - - -/* - * disp_keysw_and_leds - * - * This routine displays the position of the keyswitch and the front panel - * system LEDs. The keyswitch can be in either normal, diagnostic, or - * secure position. The three front panel LEDs are of importance because - * the center LED indicates component failure on the system. - */ -static int -disp_keysw_and_leds(struct system_kstat_data *kstats) -{ - int board; - int diag_mode = 0; - int secure_mode = 0; - int result = 0; - - /* Check the first valid board to determeine the diag bit */ - /* Find the first valid board */ - for (board = 0; board < MAX_BOARDS; board++) { - if (kstats->bd_ksp_list[board].fhc_kstats_ok != 0) { - /* If this was successful, break out of loop */ - if ((kstats->bd_ksp_list[board].fhc_bsr & - FHC_DIAG_MODE) == 0) - diag_mode = 1; - break; - } - } - - /* - * Check the register on the clock-board to determine the - * secure bit. - */ - if (kstats->sys_kstats_ok) { - /* The secure bit is negative logic. */ - if (kstats->keysw_status == KEY_SECURE) { - secure_mode = 1; - } - } - - /* - * The system cannot be in diag and secure mode. This is - * illegal. - */ - if (secure_mode && diag_mode) { - result = 2; - return (result); - } - - /* Now print the keyswitch position. */ - log_printf("Keyswitch position is in ", 0); - - if (diag_mode) { - log_printf("Diagnostic Mode\n"); - } else if (secure_mode) { - log_printf("Secure Mode\n", 0); - } else { - log_printf("Normal Mode\n"); - } - - /* display the redundant power status */ - if (kstats->sys_kstats_ok) { - log_printf("System Power Status: ", 0); - - switch (kstats->power_state) { - case REDUNDANT: - log_printf("Redundant\n", 0); - break; - - case MINIMUM: - log_printf("Minimum Available\n", 0); - break; - - case BELOW_MINIMUM: - log_printf("Insufficient Power Available\n", 0); - break; - - default: - log_printf("Unknown\n", 0); - break; - } - } - - if (kstats->sys_kstats_ok) { - /* - * If the center LED is on, then we return a non-zero - * result. - */ - log_printf("System LED Status: GREEN YELLOW " - "GREEN\n", 0); - if ((kstats->sysctrl & SYS_LED_MID) != 0) { - log_printf("WARNING ", 0); - } else { - log_printf("Normal ", 0); - } - - /* - * Left LED is negative logic, center and right LEDs - * are positive logic. - */ - if ((kstats->sysctrl & SYS_LED_LEFT) == 0) { - log_printf("ON ", 0); - } else { - log_printf("OFF", 0); - } - - log_printf(" ", 0); - if ((kstats->sysctrl & SYS_LED_MID) != 0) { - log_printf("ON ", 0); - } else { - log_printf("OFF", 0); - } - - log_printf(" BLINKING", 0); - } - - log_printf("\n", 0); - return (result); -} - -/* - * disp_env_status - * - * This routine displays the environmental status passed up from - * device drivers via kstats. The kstat names are defined in - * kernel header files included by this module. - */ -static int -disp_env_status(struct system_kstat_data *kstats) -{ - struct bd_kstat_data *bksp; - int exit_code = 0; - int i; - uchar_t curr_temp; - int is4slot = 0; - - /* - * Define some message arrays to make life simpler. These - * messages correspond to definitions in for - * temperature trend (enum temp_trend) and temperature state - * (enum temp_state). - */ - static char *temp_trend_msg[] = { "unknown", - "rapidly falling", - "falling", - "stable", - "rising", - "rapidly rising", - "unknown (noisy)" - }; - static char *temp_state_msg[] = { " OK ", - "WARNING ", - " DANGER " - }; - - log_printf("\n", 0); - log_printf("=========================", 0); - log_printf(dgettext(TEXT_DOMAIN, " Environmental Status "), 0); - log_printf("=========================", 0); - log_printf("\n", 0); - - exit_code = disp_keysw_and_leds(kstats); - - if (!kstats->sys_kstats_ok) { - log_printf(dgettext(TEXT_DOMAIN, - "*** Error: Unavailable ***\n\n")); - return (1); - } - - /* - * for purposes within this routine, - * 5 slot behaves the same as a 4 slot - */ - if (SYS_TYPE(kstats->sysstat1) == SYS_4_SLOT) - is4slot = 1; - - log_printf("\n", 0); - log_printf("\nFans:\n", 0); - log_printf("-----\n", 0); - - log_printf("Unit Status\n", 0); - log_printf("---- ------\n", 0); - - log_printf("%-4s ", is4slot ? "Disk" : "Rack", 0); - /* Check the status of the Rack Fans */ - if ((kstats->fan_status & SYS_RACK_FANFAIL) == 0) { - log_printf("OK\n", 0); - } else { - log_printf("FAIL\n", 0); - exit_code = 1; - } - - if (!is4slot) { - /* - * keyswitch and ac box are on 8 & 16 slot only - */ - /* Check the status of the Keyswitch Fan assembly. */ - log_printf("%-4s ", "Key", 0); - if ((kstats->fan_status & SYS_KEYSW_FAN_OK) != 0) { - log_printf("OK\n", 0); - } else { - log_printf("FAIL\n", 0); - exit_code = 1; - } - - log_printf("%-4s ", "AC", 0); - if ((kstats->fan_status & SYS_AC_FAN_OK) != 0) { - log_printf("OK\n", 0); - } else { - log_printf("FAIL\n", 0); - exit_code = 1; - } - } else { - /* - * peripheral fan is on 4 slot only - * XXX might want to indicate transient states too - */ - if (kstats->psstat_kstat_ok) { - if (kstats->ps_shadow[SYS_P_FAN_INDEX] == PS_OK) { - log_printf("PPS OK\n", 0); - } else if (kstats->ps_shadow[SYS_P_FAN_INDEX] == - PS_FAIL) { - log_printf("PPS FAIL\n", 0); - exit_code = 1; - } - } - } - - log_printf("\n", 0); - - - log_printf("System Temperatures (Celsius):\n", 0); - log_printf("------------------------------\n", 0); - log_printf("Brd State Current Min Max Trend\n", 0); - log_printf("--- ------- ------- --- --- -----\n", 0); - - for (i = 0, bksp = &kstats->bd_ksp_list[0]; i < MAX_BOARDS; - i++, bksp++) { - - /* Make sure we have kstats for this board first */ - if (!bksp->temp_kstat_ok) { - continue; - } - log_printf("%2d ", i, 0); - - /* Print the current state of the temperature */ - log_printf("%s", temp_state_msg[bksp->tempstat.state], 0); - /* Set exit code for WARNING and DANGER */ - if (bksp->tempstat.state != 0) - exit_code = 1; - - /* Print the current temperature */ - curr_temp = bksp->tempstat.l1[bksp->tempstat.index % L1_SZ]; - log_printf(" %2d ", curr_temp, 0); - - /* Print the minimum recorded temperature */ - log_printf(" %2d ", bksp->tempstat.min, 0); - - /* Print the maximum recorded temperature */ - log_printf(" %2d ", bksp->tempstat.max, 0); - - /* Print the current trend in temperature (if available) */ - if (bksp->tempstat.version < 2) - log_printf("unknown\n", 0); - else - log_printf("%s\n", temp_trend_msg[bksp->tempstat.trend], 0); - } - if (kstats->temp_kstat_ok) { - log_printf("CLK ", 0); - - /* Print the current state of the temperature */ - log_printf("%s", temp_state_msg[kstats->tempstat.state], 0); - /* Set exit code for WARNING or DANGER */ - if (kstats->tempstat.state != 0) - exit_code = 1; - - /* Print the current temperature */ - curr_temp = kstats->tempstat.l1[kstats->tempstat.index % L1_SZ]; - log_printf(" %2d ", curr_temp, 0); - - /* Print the minimum recorded temperature */ - log_printf(" %2d ", kstats->tempstat.min, 0); - - /* Print the maximum recorded temperature */ - log_printf(" %2d ", kstats->tempstat.max, 0); - - /* Print the current trend in temperature (if available) */ - if (kstats->tempstat.version < 2) - log_printf("unknown\n\n", 0); - else - log_printf("%s\n\n", - temp_trend_msg[kstats->tempstat.trend], 0); - } else { - log_printf("\n"); - } - - log_printf("\n", 0); - log_printf("Power Supplies:\n", 0); - log_printf("---------------\n", 0); - log_printf("Supply Status\n", 0); - log_printf("--------- ------\n", 0); - if (kstats->psstat_kstat_ok) { - for (i = 0; i < SYS_PS_COUNT; i++) { - char *ps, *state; - - /* skip core power supplies that are not present */ - if (i <= SYS_PPS0_INDEX && kstats->ps_shadow[i] == - PS_OUT) - continue; - - /* Display the unit Number */ - switch (i) { - case 0: ps = "0"; break; - case 1: ps = "1"; break; - case 2: ps = "2"; break; - case 3: ps = "3"; break; - case 4: ps = "4"; break; - case 5: ps = "5"; break; - case 6: ps = "6"; break; - case 7: ps = is4slot ? "2nd PPS" : "7"; break; - - case SYS_PPS0_INDEX: ps = "PPS"; break; - case SYS_CLK_33_INDEX: ps = " System 3.3v"; break; - case SYS_CLK_50_INDEX: ps = " System 5.0v"; break; - case SYS_V5_P_INDEX: ps = " Peripheral 5.0v"; break; - case SYS_V12_P_INDEX: ps = " Peripheral 12v"; break; - case SYS_V5_AUX_INDEX: ps = " Auxiliary 5.0v"; break; - case SYS_V5_P_PCH_INDEX: ps = - " Peripheral 5.0v precharge"; - break; - case SYS_V12_P_PCH_INDEX: ps = - " Peripheral 12v precharge"; - break; - case SYS_V3_PCH_INDEX: ps = - " System 3.3v precharge"; break; - case SYS_V5_PCH_INDEX: ps = - " System 5.0v precharge"; break; - - /* skip the peripheral fan here */ - case SYS_P_FAN_INDEX: - continue; - } - - /* what is the state? */ - switch (kstats->ps_shadow[i]) { - case PS_OK: - state = "OK"; - break; - - case PS_FAIL: - state = "FAIL"; - exit_code = 1; - break; - - /* XXX is this an exit_code condition? */ - case PS_OUT: - state = "PPS Out"; - exit_code = 1; - break; - - case PS_UNKNOWN: - state = "Unknown"; - break; - - default: - state = "Illegal State"; - break; - } - - log_printf("%-32s %s\n", ps, state, 0); - } - } - - /* Check status of the system AC Power Source */ - log_printf("%-32s ", "AC Power", 0); - if ((kstats->sysstat2 & SYS_AC_FAIL) == 0) { - log_printf("OK\n", 0); - } else { - log_printf("failed\n", 0); - exit_code = 1; - } - log_printf("\n", 0); - - return (exit_code); -} - - -/* - * Many of the ASICs present in fusion machines have implementation and - * version numbers stored in the OBP device tree. These codes are displayed - * in this routine in an effort to aid Engineering and Field service - * in detecting old ASICs which may have bugs in them. - */ -static void -sunfire_disp_asic_revs(Sys_tree *tree, struct system_kstat_data *kstats) -{ - Board_node *bnode; - Prom_node *pnode; - int isplusbrd; - char *board_str[] = { "Uninitialized", "Unknown", "CPU", - "Memory", "Dual-SBus", "UPA-SBus", - "Dual-PCI", "Disk", "Clock", - "Dual-SBus-SOC+", "UPA-SBus-SOC+"}; - - /* Print the header */ - log_printf("\n", 0); - log_printf("=========================", 0); - log_printf(" HW Revisions ", 0); - log_printf("=========================", 0); - log_printf("\n", 0); - log_printf("\n", 0); - - /* Else this is a Sunfire or campfire */ - log_printf("ASIC Revisions:\n", 0); - log_printf("---------------\n", 0); - - /* Display Firetruck ASIC Revisions first */ - log_printf("Brd FHC AC SBus0 SBus1 PCI0 PCI1 FEPS", 0); - log_printf(" Board Type Attributes", 0); - log_printf("\n", 0); - log_printf("--- --- -- ----- ----- ---- ---- ----", 0); - log_printf(" ---------- ----------", 0); - log_printf("\n", 0); - - /* - * Display all of the FHC, AC, and chip revisions for the entire - * machine. The AC anf FHC chip revs are available from the device - * tree that was read out of the PROM, but the DC chip revs will be - * read via a kstat. The interfaces for this are not completely - * available at this time. - */ - bnode = tree->bd_list; - while (bnode != NULL) { - int *version; - int upa = bd_to_upa(bnode->board_num); - - /* Display the header with the board number */ - log_printf("%2d ", bnode->board_num, 0); - - /* display the FHC version */ - if ((pnode = dev_find_node(bnode->nodes, "fhc")) == NULL) { - log_printf(" ", 0); - } else { - if ((version = (int *)get_prop_val(find_prop(pnode, - "version#"))) == NULL) { - log_printf(" ", 0); - } else { - log_printf(" %d ", *version, 0); - } - } - - /* display the AC version */ - if ((pnode = dev_find_node(bnode->nodes, "ac")) == NULL) { - log_printf(" ", 0); - } else { - if ((version = (int *)get_prop_val(find_prop(pnode, - "version#"))) == NULL) { - log_printf(" ", 0); - } else { - log_printf(" %d ", *version, 0); - } - } - - /* Find sysio 0 on board and print rev */ - if ((pnode = find_device(bnode, upa, "sbus")) == NULL) { - log_printf(" ", 0); - } else { - if ((version = (int *)get_prop_val(find_prop(pnode, - "version#"))) == NULL) { - log_printf(" ", 0); - } else { - log_printf(" %d ", *version, 0); - } - } - - /* Find sysio 1 on board and print rev */ - if ((pnode = find_device(bnode, upa+1, "sbus")) == NULL) { - log_printf(" ", 0); - } else { - if ((version = (int *)get_prop_val(find_prop(pnode, - "version#"))) == NULL) { - log_printf(" ", 0); - } else { - log_printf(" %d ", *version, 0); - } - } - - /* Find Psycho 0 on board and print rev */ - if ((pnode = find_device(bnode, upa, "pci")) == NULL) { - log_printf(" ", 0); - } else { - if ((version = (int *)get_prop_val(find_prop(pnode, - "version#"))) == NULL) { - log_printf(" ", 0); - } else { - log_printf(" %d ", *version, 0); - } - } - - /* Find Psycho 1 on board and print rev */ - if ((pnode = find_device(bnode, upa+1, "pci")) == NULL) { - log_printf(" ", 0); - } else { - if ((version = (int *)get_prop_val(find_prop(pnode, - "version#"))) == NULL) { - log_printf(" ", 0); - } else { - log_printf(" %d ", *version, 0); - } - } - - /* Find the FEPS on board and print rev */ - if ((pnode = dev_find_node(bnode->nodes, "SUNW,hme")) != NULL) { - if ((version = (int *)get_prop_val(find_prop(pnode, - "hm-rev"))) != NULL) { - if (*version == 0xa0) { - log_printf(" 2.0 ", 0); - } else if (*version == 0x20) { - log_printf(" 2.1 ", 0); - } else { - log_printf(" %2x ", *version, 0); - } - } - } else - log_printf(" ", 0); - - /* print out the board type */ - isplusbrd = ISPLUSBRD(kstats->bd_ksp_list - [bnode->board_num].fhc_bsr); - - log_printf("%-16s", board_str[bnode->board_type], 0); - if (isplusbrd) - log_printf("100MHz Capable", 0); - else - log_printf("84MHz Capable", 0); - - log_printf("\n", 0); - bnode = bnode->next; - } - log_printf("\n", 0); - - /* Now display the FFB board component revisions */ - for (bnode = tree->bd_list; bnode != NULL; bnode = bnode->next) { - display_ffb(bnode, 0); - } -} - -static void -display_hp_boards(struct system_kstat_data *kstats) -{ - int i; - int j; - int hp_found = 0; - struct hp_info *hp; - char *state; - - for (i = 0, hp = &kstats->hp_info[0]; i < MAX_BOARDS; i++, hp++) { - if (!hp->kstat_ok) { - continue; - } - - hp_found = 1; - } - - /* return if there are no hotplug boards in the system. */ - if (!hp_found) { - return; - } - - if (hp_found != 0) { - log_printf("\n", 0); - log_printf("Detached Boards\n", 0); - log_printf("===============\n", 0); - log_printf(" Slot State Type Info\n", 0); - log_printf(" ---- --------- ------ ----" - "-------------------------------------\n", 0); - } - - /* Display all detached boards */ - for (i = 0, hp = &kstats->hp_info[0]; i < MAX_BOARDS; i++, hp++) { - struct cpu_info *cpu; - - if (hp->kstat_ok == 0) { - continue; - } - - - switch (hp->bd_info.state) { - case UNKNOWN_STATE: - state = "unknown"; - break; - - case ACTIVE_STATE: - state = "active"; - break; - - case LOWPOWER_STATE: - state = "low-power"; - break; - - case HOTPLUG_STATE: - state = "hot-plug"; - break; - - case DISABLED_STATE: - state = "disabled"; - break; - - case FAILED_STATE: - state = "failed"; - break; - - default: - state = "unknown"; - break; - } - - log_printf(" %2d %9s ", i, state, 0); - - switch (hp->bd_info.type) { - case MEM_BOARD: - log_printf("%-14s ", MEM_BD_NAME, 0); - break; - - case CPU_BOARD: - log_printf("%-14s ", CPU_BD_NAME, 0); - - /* Cannot display CPU info for disabled boards */ - if ((hp->bd_info.state == DISABLED_STATE) || - (hp->bd_info.state == FAILED_STATE)) { - break; - } - - /* Display both CPUs if present */ - cpu = &hp->bd_info.bd.cpu[0]; - for (j = 0; j < 2; j++, cpu++) { - log_printf("CPU %d: ", j, 0); - /* Print the rated speed of the CPU. */ - if (cpu->cpu_speed > 1) { - log_printf("%3d MHz", cpu->cpu_speed, - 0); - } else { - log_printf("no CPU ", 0); - continue; - } - - /* Display the size of the cache */ - if (cpu->cache_size != 0) { - log_printf(" %0.1fM ", - (float)cpu->cache_size / - (float)(1024*1024), 0); - } else { - log_printf(" ", 0); - } - } - break; - - case IO_2SBUS_BOARD: - log_printf("%-14s ", IO_2SBUS_BD_NAME, 0); - break; - - case IO_2SBUS_SOCPLUS_BOARD: - log_printf("%-14s ", IO_2SBUS_SOCPLUS_BD_NAME, 0); - break; - - case IO_SBUS_FFB_BOARD: - log_printf("%-14s ", IO_SBUS_FFB_BD_NAME, 0); - switch (hp->bd_info.bd.io2.ffb_size) { - case FFB_SINGLE: - log_printf("Single buffered FFB", 0); - break; - - case FFB_DOUBLE: - log_printf("Double buffered FFB", 0); - break; - - case FFB_NOT_FOUND: - log_printf("No FFB installed", 0); - break; - - default: - log_printf("Illegal FFB size", 0); - break; - } - break; - - case IO_SBUS_FFB_SOCPLUS_BOARD: - log_printf("%-14s ", IO_SBUS_FFB_SOCPLUS_BD_NAME, 0); - switch (hp->bd_info.bd.io2.ffb_size) { - case FFB_SINGLE: - log_printf("Single buffered FFB", 0); - break; - - case FFB_DOUBLE: - log_printf("Double buffered FFB", 0); - break; - - case FFB_NOT_FOUND: - log_printf("No FFB installed", 0); - break; - - default: - log_printf("Illegal FFB size", 0); - break; - } - break; - - case IO_PCI_BOARD: - log_printf("%-14s ", IO_PCI_BD_NAME, 0); - break; - - case DISK_BOARD: - log_printf("%-14s ", "disk", 0); - for (j = 0; j < 2; j++) { - log_printf("Disk %d:", j, 0); - if (hp->bd_info.bd.dsk.disk_pres[j]) { - log_printf(" Target: %2d ", - hp->bd_info.bd.dsk.disk_id[j], - 0); - } else { - log_printf(" no disk ", 0); - } - } - break; - - case UNKNOWN_BOARD: - case UNINIT_BOARD: - default: - log_printf("UNKNOWN ", 0); - break; - } - log_printf("\n"); - } -} - -/* - * Analysis functions: - * - * Most of the Fatal error data analyzed from error registers is not - * very complicated. This is because the FRUs for errors detected by - * most parts is either a CPU module, a FFB, or the system board - * itself. - * The analysis of the Address Controller errors is the most complicated. - * These errors can be caused by other boards as well as the local board. - */ - -/* - * analyze_cpu - * - * Analyze the CPU MFSR passed in and determine what type of fatal - * hardware errors occurred at the time of the crash. This function - * returns a pointer to a string to the calling routine. - */ -static int -analyze_cpu(char **msgs, int cpu_id, u_longlong_t afsr) -{ - int count = 0; - int i; - int syndrome; - char msgbuf[MAXSTRLEN]; - - if (msgs == NULL) { - return (count); - } - - if (afsr & P_AFSR_ETP) { - (void) sprintf(msgbuf, "CPU %d Ecache Tag Parity Error, ", - cpu_id); - - /* extract syndrome for afsr */ - syndrome = (afsr & P_AFSR_ETS) >> ETS_SHIFT; - - /* now concat the parity syndrome msg */ - for (i = 0; i < 4; i++) { - if ((0x1 << i) & syndrome) { - (void) strcat(msgbuf, ecache_parity[i]); - } - } - (void) strcat(msgbuf, "\n"); - *msgs++ = strdup(msgbuf); - count++; - } - - if (afsr & P_AFSR_ISAP) { - (void) sprintf(msgbuf, - "CPU %d Incoming System Address Parity Error\n", - cpu_id); - *msgs++ = strdup(msgbuf); - count++; - } - - return (count); -} - -/* - * analyze_ac - * - * This function checks the AC error register passed in and checks - * for any errors that occured during the fatal hardware reset. - */ -static int -analyze_ac(char **msgs, u_longlong_t ac_error) -{ - int i; - int count = 0; - char msgbuf[MAXSTRLEN]; - int tmp_cnt; - - if (msgs == NULL) { - return (count); - } - - for (i = 2; i < MAX_BITS; i++) { - if ((((u_longlong_t)0x1 << i) & ac_error) != 0) { - if (ac_errors[i].error != NULL) { - (void) sprintf(msgbuf, "AC: %s\n", - ac_errors[i].error); - *msgs++ = strdup(msgbuf); - count++; - - /* display the part that might cause this */ - tmp_cnt = disp_parts(msgs, ac_error, i); - count += tmp_cnt; - msgs += tmp_cnt; - } - } - } - - return (count); -} - -/* - * analyze_dc - * - * This routine checks the DC shdow chain and tries to determine - * what type of error might have caused the fatal hardware reset - * error. - */ -static int -analyze_dc(int board, char **msgs, u_longlong_t dc_error) -{ - int i; - int count = 0; - char msgbuf[MAXSTRLEN]; - - if (msgs == NULL) { - return (count); - } - - /* - * The DC scan data is contained in 8 bytes, one byte per - * DC. There are 8 DCs on a system board. - */ - - for (i = 0; i < 8; i++) { - if (dc_error & DC_OVERFLOW) { - (void) sprintf(msgbuf, dc_overflow_txt, board, i); - *msgs++ = strdup(msgbuf); - count++; - } - - if (dc_error & DC_PARITY) { - (void) sprintf(msgbuf, dc_parity_txt, board, i); - *msgs++ = strdup(msgbuf); - count++; - } - dc_error = dc_error >> 8; /* shift over to next byte */ - } - - return (count); -} - -static int -disp_parts(char **msgs, u_longlong_t ac_error, int type) -{ - int count = 0; - int part; - char msgbuf[MAXSTRLEN]; - int i; - - if (msgs == NULL) { - return (count); - } - - (void) sprintf(msgbuf, "\tThe error could be caused by:\n"); - *msgs++ = strdup(msgbuf); - count++; - - for (i = 0; (i < MAX_FRUS) && ac_errors[type].part[i]; i++) { - part = ac_errors[type].part[i]; - - if (part == UPA_PART) { - if (ac_error & UPA_PORT_A) { - part = UPA_A_PART; - } else if (ac_error & UPA_PORT_B) { - part = UPA_B_PART; - } - } - - if (part == DTAG_PART) { - if (ac_error & UPA_PORT_A) { - part = DTAG_A_PART; - } else if (ac_error & UPA_PORT_B) { - part = DTAG_B_PART; - } - } - - (void) sprintf(msgbuf, "\t\t%s\n", part_str[part]); - - *msgs++ = strdup(msgbuf); - count++; - } - - return (count); -} diff --git a/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c b/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c index 58d4634164..9b3e739f76 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c +++ b/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c @@ -22,6 +22,7 @@ /* * Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. * * Tazmo Platform specific functions. * @@ -67,7 +68,7 @@ extern int print_flag; * at runtime (workgroup server systems only) */ int error_check(Sys_tree *tree, struct system_kstat_data *kstats); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); +void display_memoryconf(Sys_tree *tree); int disp_fail_parts(Sys_tree *tree); void display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, @@ -78,7 +79,7 @@ void display_io_cards(struct io_card *list); void display_ffb(Board_node *, int); void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep); + struct envctrl_kstat_data *ep); /* local functions */ static int disp_envctrl_status(Sys_tree *, struct system_kstat_data *); @@ -132,7 +133,7 @@ dev_next_node_sibling(Prom_node *root, char *name) * DIMM sizes, DIMM socket names. */ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { Board_node *bnode; Prom_node *memory; @@ -147,9 +148,6 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) Prop *status_prop; char interleave[8]; int total_size = 0; -#ifdef lint - grps = grps; -#endif log_printf("\n", 0); log_printf("=========================", 0); @@ -755,11 +753,11 @@ display_ffb(Board_node *board, int table) /* * This module does the reading and interpreting of tazmo system - * kstats. These kstats are created by the environ driver: + * kstats. These kstats are created by the envctrl driver: */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) + struct envctrl_kstat_data *ep) { kstat_ctl_t *kc; kstat_t *ksp; @@ -767,10 +765,6 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, if ((kc = kstat_open()) == NULL) { return; } -#ifdef lint - tree = tree; - bdp = bdp; -#endif ep = &sys_kstat->env_data; diff --git a/usr/src/pkg/manifests/system-library-platform.mf b/usr/src/pkg/manifests/system-library-platform.mf index c683f2718e..1af1d2a8f5 100644 --- a/usr/src/pkg/manifests/system-library-platform.mf +++ b/usr/src/pkg/manifests/system-library-platform.mf @@ -21,7 +21,7 @@ # # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2019 Peter Tribble. +# Copyright 2020 Peter Tribble. # set name=pkg.fmri value=pkg:/system/library/platform@$(PKGVERS) @@ -157,8 +157,6 @@ $(sparc_ONLY)file path=usr/platform/SUNW,Sun-Fire/lib/libprtdiag_psr.so.1 $(sparc_ONLY)file path=usr/platform/SUNW,Ultra-2/lib/libprtdiag_psr.so.1 $(sparc_ONLY)file path=usr/platform/SUNW,Ultra-250/lib/libprtdiag_psr.so.1 $(sparc_ONLY)file path=usr/platform/SUNW,Ultra-4/lib/libprtdiag_psr.so.1 -$(sparc_ONLY)file \ - path=usr/platform/SUNW,Ultra-Enterprise/lib/libprtdiag_psr.so.1 $(sparc_ONLY)file path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)/ac.so.1 $(sparc_ONLY)file path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)/sbd.so.1 $(sparc_ONLY)file path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)/sysctrl.so.1 -- cgit v1.2.3 From 13b136d3061155363c62c9f6568d25b8b27da8f6 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 20 Jan 2020 01:26:16 -0800 Subject: 12295 librsc: wrong argument for sizeof Reviewed by: Matthias Scheler Reviewed by: Andrew Stormont Approved by: Robert Mustacchi --- usr/src/lib/librsc/sparc/mpxu/common/librsc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/lib/librsc/sparc/mpxu/common/librsc.c b/usr/src/lib/librsc/sparc/mpxu/common/librsc.c index 863c304fcc..c39719f473 100644 --- a/usr/src/lib/librsc/sparc/mpxu/common/librsc.c +++ b/usr/src/lib/librsc/sparc/mpxu/common/librsc.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ENXS platform-specific functions */ @@ -151,7 +149,7 @@ rscp_init(void) /* * 'erase' the rx buffer */ - (void) memset(rsc_rx_buffer, 0, sizeof (RSC_MAX_RX_BUFFER)); + (void) memset(rsc_rx_buffer, 0, sizeof (rsc_rx_buffer)); rsc_rx_resp_len = 0; rsc_rx_error = 0; rsc_rx_resp_type = DP_NULL_MSG; -- cgit v1.2.3 From 2944b91ec59a95e39012331cb055e960ae6d4489 Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 21 Feb 2020 03:29:22 -0800 Subject: 12334 fix gcc4 build 12322 kdb: removal of unused dependency recommended Reviewed by: Andy Stormont Reviewed by: Gordon Ross Approved by: Dan McDonald --- usr/src/Makefile.master | 6 +++++- usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com | 8 +++----- usr/src/lib/libjedec/Makefile.com | 4 +--- usr/src/tools/make/Makefile.com | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master index 127680a9e9..6ecaba4078 100644 --- a/usr/src/Makefile.master +++ b/usr/src/Makefile.master @@ -28,7 +28,7 @@ # Copyright 2015 Igor Kozhukhov # Copyright 2016 Toomas Soome # Copyright 2018 OmniOS Community Edition (OmniOSce) Association. -# Copyright 2019, Joyent, Inc. +# Copyright 2020 Joyent, Inc. # Copyright 2019 RackTop Systems. # @@ -813,12 +813,16 @@ COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH) # CCNEEDED = -lC CCEXTNEEDED = -lCrun -lCstd +NATIVECCNEEDED = -lC $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s $(__GNUC)CCEXTNEEDED = $(CCNEEDED) +$(__GNUC)NATIVECCNEEDED = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s CCNEEDED64 = -lCrun CCEXTNEEDED64 = -lCrun -lCstd +NATIVECCNEEDED64 = -lCrun $(__GNUC64)CCNEEDED64 = -L$(GCCLIBDIR) -lstdc++ -lgcc_s +$(__GNUC64)NATIVECCNEEDED64 = -R$(GCCLIBDIR) -L$(GCCLIBDIR) -lstdc++ -lgcc_s $(__GNUC64)CCEXTNEEDED = $(CCNEEDED64) # Libraries we expect to use natively on the build machine diff --git a/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com b/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com index 72a6b80cab..966241305e 100644 --- a/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com @@ -22,6 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2020 Joyent, Inc. # LIBRARY= kldap.a @@ -46,7 +47,7 @@ include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5 #override liblink INS.liblink= -$(RM) $@; $(SYMLINK) $(LIBLINKS)$(VERS) $@ -CPPFLAGS += -DHAVE_CONFIG_H \ +CPPFLAGS += -DHAVE_CONFIG_H \ -I$(SRC)/cmd/krb5/iprop \ -I$(SRC)/lib/krb5 \ -I$(SRC)/lib/krb5/kdb \ @@ -65,15 +66,12 @@ CERRWARN += -_gcc=-Wno-unused-function DYNFLAGS += $(KERBRUNPATH) # setting -L $(ROOT)/usr/lib/gss because libkdb_ldap needs mech_krb5 -LDLIBS += -L $(ROOT)/usr/lib/gss -L $(ROOTLIBDIR) -lkdb_ldap \ - -lc +LDLIBS += -L $(ROOT)/usr/lib/gss -L $(ROOTLIBDIR) -lkdb_ldap .KEEP_STATE: all: $(LIBS) -lint: lintcheck - # include library targets include $(SRC)/lib/krb5/Makefile.targ diff --git a/usr/src/lib/libjedec/Makefile.com b/usr/src/lib/libjedec/Makefile.com index 6b2f6da64d..9e9f198343 100644 --- a/usr/src/lib/libjedec/Makefile.com +++ b/usr/src/lib/libjedec/Makefile.com @@ -10,7 +10,7 @@ # # -# Copyright (c) 2018 Joyent, Inc. +# Copyright 2020 Joyent, Inc. # LIBRARY = libjedec.a @@ -28,6 +28,4 @@ SRCDIR = ../common all: $(LIBS) -lint: lintcheck - include ../../Makefile.targ diff --git a/usr/src/tools/make/Makefile.com b/usr/src/tools/make/Makefile.com index 34074bb00a..8fbe1bc1b4 100644 --- a/usr/src/tools/make/Makefile.com +++ b/usr/src/tools/make/Makefile.com @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2020 Joyent, Inc. MAKE_INCLUDE= $(SRC)/cmd/make/include @@ -19,3 +20,4 @@ CFLAGS = $(NATIVE_CFLAGS) CFLAGS += $(CCVERBOSE) CCFLAGS = $(NATIVE_CCFLAGS) -_gcc4=-std=gnu++0x CPPFLAGS = -I$(MAKE_INCLUDE) $(MAKE_DEFS) +CCNEEDED = $(NATIVECCNEEDED) -- cgit v1.2.3 From 1743a90d9abccc6cd1e57ef89729c674b859fc6e Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Tue, 27 Nov 2018 14:24:43 +0200 Subject: 12099 fm: cast between incompatible function types Reviewed by: Matthias Scheler Approved by: Robert Mustacchi --- usr/src/cmd/fm/fmd/common/fmd.c | 4 +- usr/src/cmd/fm/fmd/common/fmd.h | 3 +- usr/src/cmd/fm/fmd/common/fmd_api.c | 2 +- usr/src/cmd/fm/fmd/common/fmd_case.c | 8 ++-- usr/src/cmd/fm/fmd/common/fmd_case.h | 4 +- usr/src/cmd/fm/fmd/common/fmd_ckpt.c | 10 ++--- usr/src/cmd/fm/fmd/common/fmd_mdb.c | 23 ++++++---- usr/src/cmd/fm/fmd/common/fmd_module.c | 11 ++--- usr/src/cmd/fm/fmd/common/fmd_scheme.c | 65 ++++++++++++++++++---------- usr/src/cmd/fm/fmd/common/fmd_serd.c | 11 +++-- usr/src/cmd/fm/fmd/common/fmd_serd.h | 10 ++--- usr/src/cmd/fm/fmd/common/fmd_thread.c | 4 +- usr/src/cmd/fm/fmd/common/fmd_time.c | 11 +++-- usr/src/cmd/fm/fmdump/common/scheme.c | 9 ++-- usr/src/lib/fm/libfmd_snmp/common/module.c | 8 ++-- usr/src/lib/fm/libfmd_snmp/common/problem.c | 8 ++-- usr/src/lib/fm/libfmd_snmp/common/resource.c | 8 ++-- usr/src/lib/fm/libfmd_snmp/common/scheme.c | 18 +++++--- 18 files changed, 121 insertions(+), 96 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/cmd/fm/fmd/common/fmd.c b/usr/src/cmd/fm/fmd/common/fmd.c index 8177c81049..7369a68047 100644 --- a/usr/src/cmd/fm/fmd/common/fmd.c +++ b/usr/src/cmd/fm/fmd/common/fmd.c @@ -169,8 +169,8 @@ fmd_trmode_set(fmd_conf_param_t *pp, const char *value) else return (fmd_set_errno(EFMD_CONF_INVAL)); - fmd.d_thr_trace = (void (*)())func; - pp->cp_value.cpv_ptr = (void *)func; + fmd.d_thr_trace = func; + pp->cp_value.cpv_ptr = func; return (0); } diff --git a/usr/src/cmd/fm/fmd/common/fmd.h b/usr/src/cmd/fm/fmd/common/fmd.h index 272fa3c305..fa2d4710b7 100644 --- a/usr/src/cmd/fm/fmd/common/fmd.h +++ b/usr/src/cmd/fm/fmd/common/fmd.h @@ -36,6 +36,7 @@ extern "C" { #include #include #include +#include struct fmd_conf; /* see */ struct fmd_dispq; /* see */ @@ -89,7 +90,7 @@ typedef struct fmd { pthread_mutex_t d_thr_lock; /* lock for d_thr_list */ fmd_list_t d_thr_list; /* list of all fmd_thread_t's */ - void (*d_thr_trace)(); /* thread trace buffer function */ + fmd_tracebuf_f *d_thr_trace; /* thread trace buffer function */ int d_thr_sig; /* cached copy of client.thrsig */ pthread_mutex_t d_mod_lock; /* lock for d_mod_list */ diff --git a/usr/src/cmd/fm/fmd/common/fmd_api.c b/usr/src/cmd/fm/fmd/common/fmd_api.c index 008a55c90f..594e41896d 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_api.c +++ b/usr/src/cmd/fm/fmd/common/fmd_api.c @@ -1872,7 +1872,7 @@ fmd_doorthr_create(door_info_t *dip, void *(*crf)(void *), void *crarg, return (0); } - if ((new_tp = fmd_doorthread_create(mp, (fmd_thread_f *)crf, + if ((new_tp = fmd_doorthread_create(mp, (fmd_thread_f *)(uintptr_t)crf, crarg)) != NULL) { tid = new_tp->thr_tid; mp->mod_stats->ms_doorthrtotal.fmds_value.ui32++; diff --git a/usr/src/cmd/fm/fmd/common/fmd_case.c b/usr/src/cmd/fm/fmd/common/fmd_case.c index dff15220a7..9ffa939cd1 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_case.c +++ b/usr/src/cmd/fm/fmd/common/fmd_case.c @@ -1572,9 +1572,9 @@ fmd_case_rele_locked(fmd_case_t *cp) } int -fmd_case_insert_principal(fmd_case_t *cp, fmd_event_t *ep) +fmd_case_insert_principal(void *cp, fmd_event_t *ep) { - fmd_case_impl_t *cip = (fmd_case_impl_t *)cp; + fmd_case_impl_t *cip = cp; fmd_case_item_t *cit; fmd_event_t *oep; uint_t state; @@ -1611,9 +1611,9 @@ fmd_case_insert_principal(fmd_case_t *cp, fmd_event_t *ep) } int -fmd_case_insert_event(fmd_case_t *cp, fmd_event_t *ep) +fmd_case_insert_event(void *cp, fmd_event_t *ep) { - fmd_case_impl_t *cip = (fmd_case_impl_t *)cp; + fmd_case_impl_t *cip = cp; fmd_case_item_t *cit; uint_t state; int new; diff --git a/usr/src/cmd/fm/fmd/common/fmd_case.h b/usr/src/cmd/fm/fmd/common/fmd_case.h index 733826e91c..92b6a91de5 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_case.h +++ b/usr/src/cmd/fm/fmd/common/fmd_case.h @@ -130,8 +130,8 @@ extern void fmd_case_rele(fmd_case_t *); extern void fmd_case_rele_locked(fmd_case_t *); extern void fmd_case_update(fmd_case_t *); -extern int fmd_case_insert_principal(fmd_case_t *, fmd_event_t *); -extern int fmd_case_insert_event(fmd_case_t *, fmd_event_t *); +extern int fmd_case_insert_principal(void *, fmd_event_t *); +extern int fmd_case_insert_event(void *, fmd_event_t *); extern void fmd_case_insert_suspect(fmd_case_t *, nvlist_t *); extern void fmd_case_recreate_suspect(fmd_case_t *, nvlist_t *); diff --git a/usr/src/cmd/fm/fmd/common/fmd_ckpt.c b/usr/src/cmd/fm/fmd/common/fmd_ckpt.c index 4bae10f7b4..c923cbbb22 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_ckpt.c +++ b/usr/src/cmd/fm/fmd/common/fmd_ckpt.c @@ -894,7 +894,7 @@ fmd_ckpt_strptr(fmd_ckpt_t *ckp, fcf_stridx_t sid, const char *defstr) static void fmd_ckpt_restore_events(fmd_ckpt_t *ckp, fcf_secidx_t sid, - void (*func)(void *, fmd_event_t *), void *arg) + int (*func)(void *, fmd_event_t *), void *arg) { const fcf_event_t *fcfe; const fcf_sec_t *sp; @@ -942,7 +942,7 @@ fmd_ckpt_restore_events(fmd_ckpt_t *ckp, fcf_secidx_t sid, ep = fmd_event_recreate(FMD_EVT_PROTOCOL, &ftv, NULL, NULL, lp, fcfe->fcfe_offset, 0); fmd_event_hold(ep); - func(arg, ep); + (void) func(arg, ep); fmd_event_rele(ep); fcfe = (fcf_event_t *)((uintptr_t)fcfe + sp->fcfs_entsize); @@ -1050,10 +1050,10 @@ fmd_ckpt_restore_case(fmd_ckpt_t *ckp, fmd_module_t *mp, const fcf_sec_t *sp) } fmd_ckpt_restore_events(ckp, fcfc->fcfc_principal, - (void (*)(void *, fmd_event_t *))fmd_case_insert_principal, cp); + fmd_case_insert_principal, cp); fmd_ckpt_restore_events(ckp, fcfc->fcfc_events, - (void (*)(void *, fmd_event_t *))fmd_case_insert_event, cp); + fmd_case_insert_event, cp); /* * Once solved, treat suspects from resource cache as master copy. @@ -1105,7 +1105,7 @@ fmd_ckpt_restore_serd(fmd_ckpt_t *ckp, fmd_module_t *mp, const fcf_sec_t *sp) fmd_module_lock(mp); fmd_ckpt_restore_events(ckp, fcfd->fcfd_events, - (void (*)(void *, fmd_event_t *))fmd_serd_eng_record, + fmd_serd_eng_record, fmd_serd_eng_lookup(&mp->mod_serds, s)); fmd_module_unlock(mp); diff --git a/usr/src/cmd/fm/fmd/common/fmd_mdb.c b/usr/src/cmd/fm/fmd/common/fmd_mdb.c index 8ad141ab27..c24d0cee39 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_mdb.c +++ b/usr/src/cmd/fm/fmd/common/fmd_mdb.c @@ -208,8 +208,11 @@ trwalk_fini(mdb_walk_state_t *wsp) /*ARGSUSED*/ static int -trprint_msg(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid) +trprint_msg(uintptr_t addr, const void *arg, void *arg1) { + const fmd_tracerec_t *trp = arg; + uintptr_t tid = (uintptr_t)arg1; + if (tid == 0) mdb_printf("%3lu ", trp->tr_stack[trp->tr_depth]); else if (trp->tr_stack[trp->tr_depth] != tid) @@ -223,8 +226,10 @@ trprint_msg(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid) /*ARGSUSED*/ static int -trprint_cpp(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid) +trprint_cpp(uintptr_t addr, const void *arg, void *arg1) { + const fmd_tracerec_t *trp = arg; + uintptr_t tid = (uintptr_t)arg1; char file[64]; if (tid == 0) @@ -254,17 +259,19 @@ trprint_stack(const fmd_tracerec_t *trp) } static int -trprint_msg_stack(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid) +trprint_msg_stack(uintptr_t addr, const void *arg, void *arg1) { - int status = trprint_msg(addr, trp, tid); + const fmd_tracerec_t *trp = arg; + int status = trprint_msg(addr, trp, arg1); trprint_stack(trp); return (status); } static int -trprint_cpp_stack(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid) +trprint_cpp_stack(uintptr_t addr, const void *arg, void *arg1) { - int status = trprint_cpp(addr, trp, tid); + const fmd_tracerec_t *trp = arg; + int status = trprint_cpp(addr, trp, arg1); trprint_stack(trp); return (status); } @@ -272,7 +279,7 @@ trprint_cpp_stack(uintptr_t addr, const fmd_tracerec_t *trp, uintptr_t tid) static int fmd_trace(uintptr_t tid, uint_t flags, int argc, const mdb_arg_t *argv) { - int (*func)(uintptr_t, const fmd_tracerec_t *, uintptr_t); + int (*func)(uintptr_t, const void *, void *); uint_t opt_c = FALSE, opt_s = FALSE; if (mdb_getopts(argc, argv, @@ -293,7 +300,7 @@ fmd_trace(uintptr_t tid, uint_t flags, int argc, const mdb_arg_t *argv) func = opt_s ? trprint_msg_stack : trprint_msg; } - if (mdb_walk("fmd_trace", (mdb_walk_cb_t)func, (void *)tid) == -1) { + if (mdb_walk("fmd_trace", func, (void *)tid) == -1) { mdb_warn("failed to walk fmd_trace"); return (DCMD_ERR); } diff --git a/usr/src/cmd/fm/fmd/common/fmd_module.c b/usr/src/cmd/fm/fmd/common/fmd_module.c index ad3b8f424d..5fe1c701ce 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_module.c +++ b/usr/src/cmd/fm/fmd/common/fmd_module.c @@ -641,8 +641,7 @@ fmd_module_gc(fmd_module_t *mp) fmd_module_lock(mp); if ((info = mp->mod_info) != NULL) { - fmd_serd_hash_apply(&mp->mod_serds, - (fmd_serd_eng_f *)fmd_serd_eng_gc, NULL); + fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL); } fmd_module_unlock(mp); @@ -657,8 +656,7 @@ void fmd_module_trygc(fmd_module_t *mp) { if (fmd_module_trylock(mp)) { - fmd_serd_hash_apply(&mp->mod_serds, - (fmd_serd_eng_f *)fmd_serd_eng_gc, NULL); + fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_gc, NULL); fmd_module_unlock(mp); } } @@ -715,7 +713,7 @@ fmd_module_clrdirty(fmd_module_t *mp) if (mp->mod_flags & FMD_MOD_MDIRTY) { fmd_serd_hash_apply(&mp->mod_serds, - (fmd_serd_eng_f *)fmd_serd_eng_clrdirty, NULL); + fmd_serd_eng_clrdirty, NULL); fmd_buf_hash_commit(&mp->mod_bufs); } @@ -740,8 +738,7 @@ fmd_module_commit(fmd_module_t *mp) } if (mp->mod_flags & FMD_MOD_MDIRTY) { - fmd_serd_hash_apply(&mp->mod_serds, - (fmd_serd_eng_f *)fmd_serd_eng_commit, NULL); + fmd_serd_hash_apply(&mp->mod_serds, fmd_serd_eng_commit, NULL); fmd_buf_hash_commit(&mp->mod_bufs); } diff --git a/usr/src/cmd/fm/fmd/common/fmd_scheme.c b/usr/src/cmd/fm/fmd/common/fmd_scheme.c index 4ddad713a6..367ecde455 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_scheme.c +++ b/usr/src/cmd/fm/fmd/common/fmd_scheme.c @@ -142,20 +142,37 @@ fmd_scheme_fmd_unusable(nvlist_t *nvl) return (rv); } -/*ARGSUSED*/ static nvlist_t * -fmd_scheme_notranslate(nvlist_t *fmri, nvlist_t *auth) +fmd_scheme_notranslate(nvlist_t *fmri, nvlist_t *auth __unused) { (void) nvlist_xdup(fmri, &fmri, &fmd.d_nva); return (fmri); } -static long -fmd_scheme_notsup(void) +static ssize_t +fmd_scheme_notsup_nvl2str(nvlist_t *fmri __unused, char *arg1 __unused, + size_t arg2 __unused) +{ + return (fmd_set_errno(EFMD_FMRI_NOTSUP)); +} + +static int +fmd_scheme_notsup(nvlist_t *fmri __unused) { return (fmd_set_errno(EFMD_FMRI_NOTSUP)); } +static int +fmd_scheme_notsup2(nvlist_t *fmri1 __unused, nvlist_t *fmri2 __unused) +{ + return (fmd_set_errno(EFMD_FMRI_NOTSUP)); +} + +static void +fmd_scheme_vnop(void) +{ +} + static int fmd_scheme_nop(void) { @@ -167,29 +184,29 @@ fmd_scheme_nop(void) * the module, then this operation is implemented using the default function. */ static const fmd_scheme_ops_t _fmd_scheme_default_ops = { - (int (*)())fmd_scheme_nop, /* sop_init */ - (void (*)())fmd_scheme_nop, /* sop_fini */ - (ssize_t (*)())fmd_scheme_notsup, /* sop_nvl2str */ - (int (*)())fmd_scheme_nop, /* sop_expand */ - (int (*)())fmd_scheme_notsup, /* sop_present */ - (int (*)())fmd_scheme_notsup, /* sop_replaced */ - (int (*)())fmd_scheme_notsup, /* sop_service_state */ - (int (*)())fmd_scheme_notsup, /* sop_unusable */ - (int (*)())fmd_scheme_notsup, /* sop_contains */ - fmd_scheme_notranslate /* sop_translate */ + .sop_init = fmd_scheme_nop, + .sop_fini = fmd_scheme_vnop, + .sop_nvl2str = fmd_scheme_notsup_nvl2str, + .sop_expand = fmd_scheme_notsup, + .sop_present = fmd_scheme_notsup, + .sop_replaced = fmd_scheme_notsup, + .sop_service_state = fmd_scheme_notsup, + .sop_unusable = fmd_scheme_notsup, + .sop_contains = fmd_scheme_notsup2, + .sop_translate = fmd_scheme_notranslate }; static const fmd_scheme_ops_t _fmd_scheme_builtin_ops = { - (int (*)())fmd_scheme_nop, /* sop_init */ - (void (*)())fmd_scheme_nop, /* sop_fini */ - fmd_scheme_fmd_nvl2str, /* sop_nvl2str */ - (int (*)())fmd_scheme_nop, /* sop_expand */ - fmd_scheme_fmd_present, /* sop_present */ - fmd_scheme_fmd_replaced, /* sop_replaced */ - fmd_scheme_fmd_service_state, /* sop_service_state */ - fmd_scheme_fmd_unusable, /* sop_unusable */ - (int (*)())fmd_scheme_notsup, /* sop_contains */ - fmd_scheme_notranslate /* sop_translate */ + .sop_init = fmd_scheme_nop, + .sop_fini = fmd_scheme_vnop, + .sop_nvl2str = fmd_scheme_fmd_nvl2str, + .sop_expand = fmd_scheme_notsup, + .sop_present = fmd_scheme_fmd_present, + .sop_replaced = fmd_scheme_fmd_replaced, + .sop_service_state = fmd_scheme_fmd_service_state, + .sop_unusable = fmd_scheme_fmd_unusable, + .sop_contains = fmd_scheme_notsup2, + .sop_translate = fmd_scheme_notranslate }; /* diff --git a/usr/src/cmd/fm/fmd/common/fmd_serd.c b/usr/src/cmd/fm/fmd/common/fmd_serd.c index 166b565666..0c817ef07d 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_serd.c +++ b/usr/src/cmd/fm/fmd/common/fmd_serd.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -189,8 +187,9 @@ fmd_serd_eng_contains(fmd_serd_eng_t *sgp, fmd_event_t *ep) } int -fmd_serd_eng_record(fmd_serd_eng_t *sgp, fmd_event_t *ep) +fmd_serd_eng_record(void *ptr, fmd_event_t *ep) { + fmd_serd_eng_t *sgp = ptr; fmd_serd_elem_t *sep, *oep; /* @@ -253,7 +252,7 @@ fmd_serd_eng_reset(fmd_serd_eng_t *sgp) } void -fmd_serd_eng_gc(fmd_serd_eng_t *sgp) +fmd_serd_eng_gc(fmd_serd_eng_t *sgp, void *arg __unused) { fmd_serd_elem_t *sep, *nep; hrtime_t hrt; @@ -275,7 +274,7 @@ fmd_serd_eng_gc(fmd_serd_eng_t *sgp) } void -fmd_serd_eng_commit(fmd_serd_eng_t *sgp) +fmd_serd_eng_commit(fmd_serd_eng_t *sgp, void *arg __unused) { fmd_serd_elem_t *sep; @@ -290,7 +289,7 @@ fmd_serd_eng_commit(fmd_serd_eng_t *sgp) } void -fmd_serd_eng_clrdirty(fmd_serd_eng_t *sgp) +fmd_serd_eng_clrdirty(fmd_serd_eng_t *sgp, void *arg __unused) { sgp->sg_flags &= ~FMD_SERD_DIRTY; } diff --git a/usr/src/cmd/fm/fmd/common/fmd_serd.h b/usr/src/cmd/fm/fmd/common/fmd_serd.h index 3841f91999..48190a9058 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_serd.h +++ b/usr/src/cmd/fm/fmd/common/fmd_serd.h @@ -27,8 +27,6 @@ #ifndef _FMD_SERD_H #define _FMD_SERD_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -75,14 +73,14 @@ extern fmd_serd_eng_t *fmd_serd_eng_lookup(fmd_serd_hash_t *, const char *); extern void fmd_serd_eng_delete(fmd_serd_hash_t *, const char *); extern int fmd_serd_eng_contains(fmd_serd_eng_t *, fmd_event_t *); -extern int fmd_serd_eng_record(fmd_serd_eng_t *, fmd_event_t *); +extern int fmd_serd_eng_record(void *, fmd_event_t *); extern int fmd_serd_eng_fired(fmd_serd_eng_t *); extern int fmd_serd_eng_empty(fmd_serd_eng_t *); extern void fmd_serd_eng_reset(fmd_serd_eng_t *); -extern void fmd_serd_eng_gc(fmd_serd_eng_t *); -extern void fmd_serd_eng_commit(fmd_serd_eng_t *); -extern void fmd_serd_eng_clrdirty(fmd_serd_eng_t *); +extern void fmd_serd_eng_gc(fmd_serd_eng_t *, void *); +extern void fmd_serd_eng_commit(fmd_serd_eng_t *, void*); +extern void fmd_serd_eng_clrdirty(fmd_serd_eng_t *, void*); #ifdef __cplusplus } diff --git a/usr/src/cmd/fm/fmd/common/fmd_thread.c b/usr/src/cmd/fm/fmd/common/fmd_thread.c index cb0cb0745d..5de69238b5 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_thread.c +++ b/usr/src/cmd/fm/fmd/common/fmd_thread.c @@ -41,7 +41,7 @@ fmd_thread_xcreate(fmd_module_t *mp, pthread_t tid) tp->thr_func = NULL; tp->thr_arg = NULL; tp->thr_trdata = fmd_trace_create(); - tp->thr_trfunc = (fmd_tracebuf_f *)fmd.d_thr_trace; + tp->thr_trfunc = fmd.d_thr_trace; tp->thr_errdepth = 0; tp->thr_isdoor = 0; @@ -81,7 +81,7 @@ fmd_thread_create_cmn(fmd_module_t *mp, fmd_thread_f *func, void *arg, tp->thr_func = func; tp->thr_arg = arg; tp->thr_trdata = fmd_trace_create(); - tp->thr_trfunc = (fmd_tracebuf_f *)fmd.d_thr_trace; + tp->thr_trfunc = fmd.d_thr_trace; tp->thr_errdepth = 0; tp->thr_isdoor = isdoor; diff --git a/usr/src/cmd/fm/fmd/common/fmd_time.c b/usr/src/cmd/fm/fmd/common/fmd_time.c index ace772a476..a735ba03bf 100644 --- a/usr/src/cmd/fm/fmd/common/fmd_time.c +++ b/usr/src/cmd/fm/fmd/common/fmd_time.c @@ -186,7 +186,7 @@ fmd_time_tod2hrt(hrtime_t hrt_base, const fmd_timeval_t *tod_base, * period between 'hrt' and 't0', therefore to check which one came first, we * test their subtraction against the highest bit of mask, if the bit is not * set, then 't0' is earlier. This is equivalent to - * ((hrt - t0) & mask) < ((mask + 1) / 2) + * ((hrt - t0) & mask) < ((mask + 1) / 2) */ hrtime_t fmd_time_ena2hrt(hrtime_t hrt, uint64_t ena) @@ -366,6 +366,11 @@ fmd_native_cancel(pthread_t tid) (void) pthread_kill(tid, SIGALRM); } +static void +fmd_time_vnop(void) +{ +} + static void * fmd_time_nop(void) { @@ -374,10 +379,10 @@ fmd_time_nop(void) const fmd_timeops_t fmd_timeops_native = { (void *(*)())fmd_time_nop, /* fto_init */ - (void (*)())fmd_time_nop, /* fto_fini */ + (void (*)())fmd_time_vnop, /* fto_fini */ gettimeofday, /* fto_gettimeofday */ gethrtime, /* fto_gethrtime */ - (void (*)())fmd_time_nop, /* fto_addhrtime */ + (void (*)())fmd_time_vnop, /* fto_addhrtime */ fmd_native_wait, /* fto_waithrtime */ fmd_native_cancel, /* fto_waitcancel */ }; diff --git a/usr/src/cmd/fm/fmdump/common/scheme.c b/usr/src/cmd/fm/fmdump/common/scheme.c index 425fbd302c..20cad01a50 100644 --- a/usr/src/cmd/fm/fmdump/common/scheme.c +++ b/usr/src/cmd/fm/fmdump/common/scheme.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -79,6 +77,11 @@ fmd_scheme_notsup(void) return (-1); } +static void +fmd_scheme_vnop(void) +{ +} + static int fmd_scheme_nop(void) { @@ -91,7 +94,7 @@ fmd_scheme_nop(void) */ static const fmd_scheme_ops_t _fmd_scheme_default_ops = { (int (*)())fmd_scheme_nop, /* sop_init */ - (void (*)())fmd_scheme_nop, /* sop_fini */ + (void (*)())fmd_scheme_vnop, /* sop_fini */ (ssize_t (*)())fmd_scheme_notsup, /* sop_nvl2str */ }; diff --git a/usr/src/lib/fm/libfmd_snmp/common/module.c b/usr/src/lib/fm/libfmd_snmp/common/module.c index 6f6161f366..0521cf40fb 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/module.c +++ b/usr/src/lib/fm/libfmd_snmp/common/module.c @@ -270,9 +270,8 @@ modinfo_update(sunFmModule_update_ctx_t *update_ctx) return (SNMP_ERR_NOERROR); } -/*ARGSUSED*/ -static void -update_thread(void *arg) +__NORETURN static void * +update_thread(void *arg __unused) { /* * The current modinfo_update implementation offers minimal savings @@ -357,8 +356,7 @@ sunFmModuleTable_init(void) return (MIB_REGISTRATION_FAILED); } - if ((err = pthread_create(NULL, NULL, (void *(*)(void *))update_thread, - NULL)) != 0) { + if ((err = pthread_create(NULL, NULL, update_thread, NULL)) != 0) { (void) snmp_log(LOG_ERR, MODNAME_STR ": error creating update " "thread: %s\n", strerror(err)); return (MIB_REGISTRATION_FAILED); diff --git a/usr/src/lib/fm/libfmd_snmp/common/problem.c b/usr/src/lib/fm/libfmd_snmp/common/problem.c index dc1fc7a158..21835ec8a0 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/problem.c +++ b/usr/src/lib/fm/libfmd_snmp/common/problem.c @@ -274,9 +274,8 @@ problem_update(sunFmProblem_update_ctx_t *update_ctx) return (SNMP_ERR_NOERROR); } -/*ARGSUSED*/ -static void -update_thread(void *arg) +__NORETURN static void * +update_thread(void *arg __unused) { /* * The current problem_update implementation offers minimal savings @@ -348,8 +347,7 @@ sunFmProblemTable_init(void) return (MIB_REGISTRATION_FAILED); } - if ((err = pthread_create(NULL, NULL, (void *(*)(void *))update_thread, - NULL)) != 0) { + if ((err = pthread_create(NULL, NULL, update_thread, NULL)) != 0) { (void) snmp_log(LOG_ERR, MODNAME_STR ": error creating update " "thread: %s\n", strerror(err)); return (MIB_REGISTRATION_FAILED); diff --git a/usr/src/lib/fm/libfmd_snmp/common/resource.c b/usr/src/lib/fm/libfmd_snmp/common/resource.c index 59e202337e..7cf3e1131c 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/resource.c +++ b/usr/src/lib/fm/libfmd_snmp/common/resource.c @@ -265,9 +265,8 @@ rsrcinfo_update(sunFmResource_update_ctx_t *update_ctx) return (SNMP_ERR_NOERROR); } -/*ARGSUSED*/ -static void -update_thread(void *arg) +__NORETURN static void * +update_thread(void *arg __unused) { /* * The current rsrcinfo_update implementation offers minimal savings @@ -354,8 +353,7 @@ sunFmResourceTable_init(void) return (MIB_REGISTRATION_FAILED); } - if ((err = pthread_create(NULL, NULL, (void *(*)(void *))update_thread, - NULL)) != 0) { + if ((err = pthread_create(NULL, NULL, update_thread, NULL)) != 0) { (void) snmp_log(LOG_ERR, MODNAME_STR ": error creating update " "thread: %s\n", strerror(err)); return (MIB_REGISTRATION_FAILED); diff --git a/usr/src/lib/fm/libfmd_snmp/common/scheme.c b/usr/src/lib/fm/libfmd_snmp/common/scheme.c index 55c45a7ae3..771763f6d1 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/scheme.c +++ b/usr/src/lib/fm/libfmd_snmp/common/scheme.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -75,13 +73,19 @@ static fmd_scheme_t *sch_list; /* list of cached schemes */ static char *g_root; /* fmd root dir */ static struct topo_hdl *g_thp; -static long -fmd_scheme_notsup(void) +static ssize_t +fmd_scheme_notsup(nvlist_t *nv __unused, char *arg1 __unused, + size_t arg2 __unused) { errno = ENOTSUP; return (-1); } +static void +fmd_scheme_vnop(void) +{ +} + static int fmd_scheme_nop(void) { @@ -93,9 +97,9 @@ fmd_scheme_nop(void) * the module, then this operation is implemented using the default function. */ static const fmd_scheme_ops_t _fmd_scheme_default_ops = { - (int (*)())fmd_scheme_nop, /* sop_init */ - (void (*)())fmd_scheme_nop, /* sop_fini */ - (ssize_t (*)())fmd_scheme_notsup, /* sop_nvl2str */ + .sop_init = fmd_scheme_nop, /* sop_init */ + .sop_fini = fmd_scheme_vnop, /* sop_fini */ + .sop_nvl2str = fmd_scheme_notsup /* sop_nvl2str */ }; /* -- cgit v1.2.3 From 2c2b5e89f6b9617f543c1b581759525f4730690e Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Wed, 15 Mar 2017 16:12:45 +0000 Subject: 11275 gettimeofday should use comm page Reviewed by: Robert Mustacchi Reviewed by: Jerry Jelinek Reviewed by: Andrew Stormont Reviewed by: Garrett D'Amore Reviewed by: Andy Fiddaman Reviewed by: Toomas Soome Approved by: Dan McDonald --- usr/src/cmd/sgs/rtld/common/external.c | 24 ++++++++++--- usr/src/lib/libc/amd64/Makefile | 4 +-- usr/src/lib/libc/amd64/sys/gettimeofday.s | 60 ------------------------------- usr/src/lib/libc/i386/Makefile.com | 1 + usr/src/lib/libc/i386/sys/gettimeofday.c | 50 ++++++++++++++++++++++++++ usr/src/lib/libc/i386/sys/gettimeofday.s | 60 ------------------------------- 6 files changed, 73 insertions(+), 126 deletions(-) delete mode 100644 usr/src/lib/libc/amd64/sys/gettimeofday.s create mode 100644 usr/src/lib/libc/i386/sys/gettimeofday.c delete mode 100644 usr/src/lib/libc/i386/sys/gettimeofday.s (limited to 'usr/src/lib') diff --git a/usr/src/cmd/sgs/rtld/common/external.c b/usr/src/cmd/sgs/rtld/common/external.c index aca6522360..caade06cf1 100644 --- a/usr/src/cmd/sgs/rtld/common/external.c +++ b/usr/src/cmd/sgs/rtld/common/external.c @@ -22,7 +22,7 @@ /* * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2014 Garrett D'Amore - * Copyright 2016 Joyent, Inc. + * Copyright (c) 2017, Joyent, Inc. */ /* @@ -722,9 +722,9 @@ isalnum(int c) #if defined(__i386) || defined(__amd64) /* - * Instead of utilizing the comm page for clock_gettime, rtld uses the raw - * syscall instead. Doing so decreases the surface of symbols needed from libc - * for a modest performance cost. + * Instead of utilizing the comm page for clock_gettime and gettimeofday, rtld + * uses the raw syscall instead. Doing so decreases the surface of symbols + * needed from libc for a modest performance cost. */ extern int __clock_gettime_sys(clockid_t, struct timespec *); @@ -733,6 +733,22 @@ __clock_gettime(clockid_t clock_id, struct timespec *tp) { return (__clock_gettime_sys(clock_id, tp)); } + +int +gettimeofday(struct timeval *tv, void *tz) +{ + if (tv != NULL) { + /* + * Perform the same logic as the libc gettimeofday() when it + * lacks comm page support: Make the clock_gettime syscall and + * divide out the tv_usec field as required. + */ + __clock_gettime_sys(CLOCK_REALTIME, (timespec_t *)tv); + tv->tv_usec /= 1000; + } + + return (0); +} #endif /* defined(__i386) || defined(__amd64) */ /* diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index bc1a7d3516..eeccb496e8 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -21,11 +21,10 @@ # # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2016 Joyent, Inc. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore # Copyright 2018 Nexenta Systems, Inc. -# Copyright (c) 2019, Joyent, Inc. +# Copyright 2019 Joyent, Inc. # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # @@ -1190,6 +1189,7 @@ $(PORTI18N_COND:%=pics/%) := \ pics/arc4random.o := CPPFLAGS += -I$(SRC)/common/crypto/chacha pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS) +pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS) .KEEP_STATE: diff --git a/usr/src/lib/libc/amd64/sys/gettimeofday.s b/usr/src/lib/libc/amd64/sys/gettimeofday.s deleted file mode 100644 index 1948a008d4..0000000000 --- a/usr/src/lib/libc/amd64/sys/gettimeofday.s +++ /dev/null @@ -1,60 +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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "gettimeofday.s" - -#include "SYS.h" - - ANSI_PRAGMA_WEAK(gettimeofday,function) - -/* - * implements int gettimeofday(struct timeval *tp, void *tzp) - * - * note that tzp is always ignored - */ - - ENTRY(gettimeofday) -/* - * use long long gethrestime() - */ - pushq %rdi /* pointer to timeval */ - SYSFASTTRAP(GETHRESTIME) -/* - * gethrestime trap returns seconds in %eax, nsecs in %edx - * need to convert nsecs to usecs & store into area pointed - * to by struct timeval * argument. - */ - popq %rcx /* pointer to timeval */ - jrcxz 1f /* bail if we get a null pointer */ - movq %rax, (%rcx) /* store seconds into timeval ptr */ - movl $274877907, %eax /* divide by 1000 as impl. by gcc */ - imull %edx /* See Hacker's Delight pg 162 */ - sarl $6, %edx /* simplified by 0 <= nsec <= 1e9 */ - movq %rdx, 8(%rcx) /* store usecs into timeval ptr + 8. */ -1: - RETC /* return 0 */ - SET_SIZE(gettimeofday) - diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index 3d1f791b6b..8e0fa7cf0f 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -1255,6 +1255,7 @@ $(PORTI18N_COND:%=pics/%) := \ pics/arc4random.o := CPPFLAGS += -I$(SRC)/common/crypto/chacha pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS) +pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS) .KEEP_STATE: diff --git a/usr/src/lib/libc/i386/sys/gettimeofday.c b/usr/src/lib/libc/i386/sys/gettimeofday.c new file mode 100644 index 0000000000..c2396e582a --- /dev/null +++ b/usr/src/lib/libc/i386/sys/gettimeofday.c @@ -0,0 +1,50 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2017, Joyent, Inc. + */ + + +#include "thr_uberdata.h" +#include + +#pragma weak _gettimeofday = gettimeofday + +extern int __clock_gettime_sys(clockid_t, timespec_t *); + +int +gettimeofday(struct timeval *tv, void *tz) +{ + comm_page_t *cp = (comm_page_t *)__uberdata.ub_comm_page; + + /* + * Perform a NULL check before attempting to store the result directly. + * The old fasttrap logic would perform this same check, but after the + * call into hrestime(). + */ + if (tv == NULL) { + return (0); + } + + /* + * Since timeval and timespec structs feature the same effective types + * and layout of their members, the conversion can be done in-place. + */ + if (cp != NULL && __cp_can_gettime(cp) != 0) { + __cp_clock_gettime_realtime(cp, (struct timespec *)tv); + } else { + __clock_gettime_sys(CLOCK_REALTIME, (struct timespec *)tv); + } + /* Convert from tv_nsec to tv_usec */ + tv->tv_usec /= 1000; + return (0); +} diff --git a/usr/src/lib/libc/i386/sys/gettimeofday.s b/usr/src/lib/libc/i386/sys/gettimeofday.s deleted file mode 100644 index 1e21601aba..0000000000 --- a/usr/src/lib/libc/i386/sys/gettimeofday.s +++ /dev/null @@ -1,60 +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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "gettimeofday.s" - -#include "SYS.h" - - ANSI_PRAGMA_WEAK(gettimeofday,function) - -/ -/ implements int gettimeofday(struct timeval *tp, void *tzp) -/ -/ note that tzp is always ignored -/ - - ENTRY(gettimeofday) -/ -/ use long long gethrestime() -/ - SYSFASTTRAP(GETHRESTIME) -/ -/ gethrestime trap returns seconds in %eax, nsecs in %edx -/ need to convert nsecs to usecs & store into area pointed -/ to by struct timeval * argument. -/ - movl 4(%esp), %ecx / put ptr to timeval in %ecx - jecxz 1f / bail if we get a null pointer - movl %eax, (%ecx) / store seconds into timeval ptr - movl $274877907, %eax / divide by 1000 as impl. by gcc - imull %edx / See Hacker's Delight pg 162 - sarl $6, %edx / simplified by 0 <= nsec <= 1e9 - movl %edx, 4(%ecx) / store usecs into timeval ptr + 4. -1: - RETC / return 0 - SET_SIZE(gettimeofday) - - -- cgit v1.2.3 From 3d349c3119b5b6e21daba1ce004cf4625b25d67f Mon Sep 17 00:00:00 2001 From: Peter Tribble Date: Thu, 27 Feb 2020 10:05:51 +0000 Subject: 12342 bandwidth display badly formatted in flowstat, dlstat, and dladm Reviewed by: Andy Fiddaman Approved by: Robert Mustacchi --- usr/src/cmd/dladm/dladm.c | 9 +++---- usr/src/cmd/dlstat/dlstat.c | 26 +++++++++++--------- usr/src/cmd/flowstat/flowstat.c | 16 ++++++++----- usr/src/lib/libdladm/common/libdladm.c | 44 +++++++++++++++++----------------- 4 files changed, 52 insertions(+), 43 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c index 85ddea3c38..adb04d1d12 100644 --- a/usr/src/cmd/dladm/dladm.c +++ b/usr/src/cmd/dladm/dladm.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2020 Peter Tribble. */ #include @@ -1117,7 +1118,7 @@ typedef struct usage_fields_buf_s { char usage_rbytes[10]; char usage_opackets[9]; char usage_obytes[10]; - char usage_bandwidth[14]; + char usage_bandwidth[15]; } usage_fields_buf_t; static const ofmt_field_t usage_fields[] = { @@ -1133,7 +1134,7 @@ static const ofmt_field_t usage_fields[] = { offsetof(usage_fields_buf_t, usage_opackets), print_default_cb}, { "OBYTES", 11, offsetof(usage_fields_buf_t, usage_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(usage_fields_buf_t, usage_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}} ; @@ -1149,7 +1150,7 @@ typedef struct usage_l_fields_buf_s { char usage_l_etime[13]; char usage_l_rbytes[8]; char usage_l_obytes[8]; - char usage_l_bandwidth[14]; + char usage_l_bandwidth[15]; } usage_l_fields_buf_t; static const ofmt_field_t usage_l_fields[] = { @@ -1164,7 +1165,7 @@ static const ofmt_field_t usage_l_fields[] = { offsetof(usage_l_fields_buf_t, usage_l_rbytes), print_default_cb}, { "OBYTES", 9, offsetof(usage_l_fields_buf_t, usage_l_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(usage_l_fields_buf_t, usage_l_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}} ; diff --git a/usr/src/cmd/dlstat/dlstat.c b/usr/src/cmd/dlstat/dlstat.c index 63e844a895..915c2196d1 100644 --- a/usr/src/cmd/dlstat/dlstat.c +++ b/usr/src/cmd/dlstat/dlstat.c @@ -27,6 +27,10 @@ * Copyright 2017 Joyent, Inc. */ +/* + * Copyright 2020 Peter Tribble. + */ + #include #include #include @@ -414,7 +418,7 @@ typedef struct history_fields_buf_s { char h_rbytes[10]; char h_opackets[9]; char h_obytes[10]; - char h_bandwidth[14]; + char h_bandwidth[15]; } history_fields_buf_t; static ofmt_field_t history_fields[] = { @@ -430,7 +434,7 @@ static ofmt_field_t history_fields[] = { offsetof(history_fields_buf_t, h_opackets), print_default_cb}, { "OBYTES", 11, offsetof(history_fields_buf_t, h_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_fields_buf_t, h_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}}; @@ -443,7 +447,7 @@ typedef struct history_l_fields_buf_s { char hl_etime[13]; char hl_rbytes[8]; char hl_obytes[8]; - char hl_bandwidth[14]; + char hl_bandwidth[15]; } history_l_fields_buf_t; static ofmt_field_t history_l_fields[] = { @@ -458,7 +462,7 @@ static ofmt_field_t history_l_fields[] = { offsetof(history_l_fields_buf_t, hl_rbytes), print_default_cb}, { "OBYTES", 9, offsetof(history_l_fields_buf_t, hl_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_l_fields_buf_t, hl_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}} ; @@ -566,7 +570,7 @@ show_history_time(dladm_usage_t *history, void *arg) { show_history_state_t *state = arg; char buf[DLADM_STRSIZE]; - history_l_fields_buf_t ubuf; + history_l_fields_buf_t ubuf; time_t time; double bw; dladm_status_t status; @@ -751,7 +755,7 @@ do_show_history(int argc, char *argv[], const char *use) die("show-link -h requires a file"); if (optind == (argc-1)) { - uint32_t flags; + uint32_t flags; resource = argv[optind]; if (!state.hs_showall && @@ -1494,7 +1498,7 @@ static int show_queried_stats(dladm_handle_t dh, datalink_id_t linkid, void *arg) { show_state_t *state = arg; - int i; + int i; dladm_stat_chain_t *diff_stat; char linkname[DLPI_LINKNAME_MAX]; @@ -1639,7 +1643,7 @@ do_show(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; @@ -1840,7 +1844,7 @@ do_show_phys(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; @@ -2022,7 +2026,7 @@ do_show_link(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; @@ -2227,7 +2231,7 @@ do_show_aggr(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; diff --git a/usr/src/cmd/flowstat/flowstat.c b/usr/src/cmd/flowstat/flowstat.c index edfc844a94..23e973c8a2 100644 --- a/usr/src/cmd/flowstat/flowstat.c +++ b/usr/src/cmd/flowstat/flowstat.c @@ -31,6 +31,10 @@ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. */ +/* + * Copyright 2020 Peter Tribble. + */ + #include #include #include @@ -139,7 +143,7 @@ typedef struct history_fields_buf_s { char history_rbytes[10]; char history_opackets[9]; char history_obytes[10]; - char history_bandwidth[14]; + char history_bandwidth[15]; } history_fields_buf_t; static ofmt_field_t history_fields[] = { @@ -156,7 +160,7 @@ static ofmt_field_t history_fields[] = { offsetof(history_fields_buf_t, history_opackets), print_default_cb}, { "OBYTES", 11, offsetof(history_fields_buf_t, history_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_fields_buf_t, history_bandwidth), print_default_cb}, NULL_OFMT} ; @@ -167,7 +171,7 @@ typedef struct history_l_fields_buf_s { char history_l_etime[13]; char history_l_rbytes[8]; char history_l_obytes[8]; - char history_l_bandwidth[14]; + char history_l_bandwidth[15]; } history_l_fields_buf_t; static ofmt_field_t history_l_fields[] = { @@ -182,7 +186,7 @@ static ofmt_field_t history_l_fields[] = { offsetof(history_l_fields_buf_t, history_l_rbytes), print_default_cb}, { "OBYTES", 9, offsetof(history_l_fields_buf_t, history_l_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_l_fields_buf_t, history_l_bandwidth), print_default_cb}, NULL_OFMT} @@ -544,7 +548,7 @@ dump_all_flow_stats(dladm_flow_attr_t *attrp, void *arg, datalink_id_t linkid, int main(int argc, char *argv[]) { - dladm_status_t status; + dladm_status_t status; int option; boolean_t r_arg = B_FALSE; boolean_t t_arg = B_FALSE; @@ -782,7 +786,7 @@ show_history_time(dladm_usage_t *history, void *arg) { show_history_state_t *state = (show_history_state_t *)arg; char buf[DLADM_STRSIZE]; - history_l_fields_buf_t ubuf; + history_l_fields_buf_t ubuf; time_t time; double bw; dladm_flow_attr_t attr; diff --git a/usr/src/lib/libdladm/common/libdladm.c b/usr/src/lib/libdladm/common/libdladm.c index 81d3fb2990..d62f59218b 100644 --- a/usr/src/lib/libdladm/common/libdladm.c +++ b/usr/src/lib/libdladm/common/libdladm.c @@ -26,6 +26,10 @@ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. */ +/* + * Copyright 2020 Peter Tribble. + */ + #include #include #include @@ -66,23 +70,23 @@ static media_type_t media_type_table[] = { { DL_HDLC, "HDLC" }, { DL_CHAR, "SyncCharacter" }, { DL_CTCA, "CTCA" }, - { DL_FDDI, "FDDI" }, - { DL_FC, "FiberChannel" }, - { DL_ATM, "ATM" }, - { DL_IPATM, "ATM(ClassicIP)" }, - { DL_X25, "X.25" }, - { DL_IPX25, "X.25(ClassicIP)" }, - { DL_ISDN, "ISDN" }, - { DL_HIPPI, "HIPPI" }, - { DL_100VG, "100BaseVGEthernet" }, - { DL_100VGTPR, "100BaseVGTokenRing" }, - { DL_ETH_CSMA, "IEEE802.3" }, - { DL_100BT, "100BaseT" }, - { DL_FRAME, "FrameRelay" }, - { DL_MPFRAME, "MPFrameRelay" }, - { DL_ASYNC, "AsyncCharacter" }, - { DL_IPNET, "IPNET" }, - { DL_OTHER, "Other" } + { DL_FDDI, "FDDI" }, + { DL_FC, "FiberChannel" }, + { DL_ATM, "ATM" }, + { DL_IPATM, "ATM(ClassicIP)" }, + { DL_X25, "X.25" }, + { DL_IPX25, "X.25(ClassicIP)" }, + { DL_ISDN, "ISDN" }, + { DL_HIPPI, "HIPPI" }, + { DL_100VG, "100BaseVGEthernet" }, + { DL_100VGTPR, "100BaseVGTokenRing" }, + { DL_ETH_CSMA, "IEEE802.3" }, + { DL_100BT, "100BaseT" }, + { DL_FRAME, "FrameRelay" }, + { DL_MPFRAME, "MPFrameRelay" }, + { DL_ASYNC, "AsyncCharacter" }, + { DL_IPNET, "IPNET" }, + { DL_OTHER, "Other" } }; #define MEDIATYPECOUNT (sizeof (media_type_table) / sizeof (media_type_t)) @@ -575,11 +579,7 @@ dladm_bw2str(int64_t bw, char *buf) kbps = (bw%1000000)/1000; mbps = bw/1000000; if (kbps != 0) { - if (mbps == 0) - (void) snprintf(buf, DLADM_STRSIZE, "0.%03u", kbps); - else - (void) snprintf(buf, DLADM_STRSIZE, "%5u.%03u", mbps, - kbps); + (void) snprintf(buf, DLADM_STRSIZE, "%5u.%03u", mbps, kbps); } else { (void) snprintf(buf, DLADM_STRSIZE, "%5u", mbps); } -- cgit v1.2.3 From 7d8deab2c421c563ab11a55e623ed48109e237af Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Fri, 14 Feb 2020 11:58:47 +0000 Subject: 12306 XPG4v2 slave pty behaviour should generally be disabled Reviewed by: Robert Mustacchi Reviewed by: John Levon Approved by: Dan McDonald --- usr/src/cmd/ed/ed.c | 29 +- usr/src/cmd/zlogin/zlogin.c | 16 +- usr/src/head/stdlib.h | 15 +- usr/src/lib/libc/port/gen/pt.c | 47 ++- usr/src/lib/libc/port/mapfile-vers | 7 +- usr/src/lib/libc/port/sys/open.c | 123 +----- usr/src/man/man3lib/libc.3lib | 749 ++++++++++++++++++------------------- usr/src/man/man7d/pts.7d | 32 +- usr/src/uts/common/io/ldterm.c | 5 +- usr/src/uts/common/io/ptm.c | 11 +- usr/src/uts/common/io/pts.c | 13 +- usr/src/uts/common/os/streamio.c | 54 ++- usr/src/uts/common/sys/strsubr.h | 4 +- 13 files changed, 543 insertions(+), 562 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/cmd/ed/ed.c b/usr/src/cmd/ed/ed.c index e8593cadbf..a2fae9c409 100644 --- a/usr/src/cmd/ed/ed.c +++ b/usr/src/cmd/ed/ed.c @@ -24,7 +24,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Editor @@ -41,7 +41,7 @@ #include #include -static const char *msgtab[] = +static const char *msgtab[] = { "write or open on pipe failed", /* 0 */ "warning: expecting `w'", /* 1 */ @@ -161,7 +161,6 @@ static const char *msgtab[] = extern char *optarg; /* Value of argument */ extern int optind; /* Indicator of argument */ -extern int __xpg4; /* defined in xpg4.c; 0 if not xpg4-compiled program */ struct Fspec { char Ftabs[22]; @@ -253,15 +252,15 @@ static int fflg, shflg; static char prompt[16] = "*"; static int rflg; static int readflg; -static int eflg; -static int qflg = 0; -static int ncflg; -static int listn; -static int listf; -static int pflag; -static int flag28 = 0; /* Prevents write after a partial read */ -static int save28 = 0; /* Flag whether buffer empty at start of read */ -static long savtime; +static int eflg; +static int qflg = 0; +static int ncflg; +static int listn; +static int listf; +static int pflag; +static int flag28 = 0; /* Prevents write after a partial read */ +static int save28 = 0; /* Flag whether buffer empty at start of read */ +static long savtime; static char *name = "SHELL"; static char *rshell = "/usr/lib/rsh"; static char *val; @@ -466,7 +465,7 @@ main(int argc, char **argv) ; globp = "e"; fflg++; - } else /* editing with no file so set savtime to 0 */ + } else /* editing with no file so set savtime to 0 */ savtime = 0; eflg++; if ((tfname = tempnam("", "ea")) == NULL) { @@ -3061,8 +3060,8 @@ static char stdtabs[] = { 'f', 0, 1, 7, 11, 15, 19, 23, 0, /* FORTRAN */ 'p', 0, 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 0, /* PL/I */ -'s', 0, 1, 10, 55, 0, /* SNOBOL */ -'u', 0, 1, 12, 20, 44, 0, /* UNIVAC ASM */ +'s', 0, 1, 10, 55, 0, /* SNOBOL */ +'u', 0, 1, 12, 20, 44, 0, /* UNIVAC ASM */ 0 }; diff --git a/usr/src/cmd/zlogin/zlogin.c b/usr/src/cmd/zlogin/zlogin.c index dff46227f2..e942e66e71 100644 --- a/usr/src/cmd/zlogin/zlogin.c +++ b/usr/src/cmd/zlogin/zlogin.c @@ -24,7 +24,7 @@ * Copyright (c) 2014 Gary Mills * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2019 Joyent, Inc. - * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ /* @@ -115,8 +115,6 @@ static int pollerr = 0; static const char *pname; static char *username; -extern int __xpg4; /* 0 if not an xpg4/6-compiled program */ - /* * When forced_login is true, the user is not prompted * for an authentication password in the target zone. @@ -770,16 +768,8 @@ process_output(int in_fd, int out_fd) cc = read(in_fd, ibuf, ZLOGIN_BUFSIZ); if (cc == -1 && (errno != EINTR || dead)) return (-1); - if (cc == 0) { - /* - * A return value of 0 when calling read() on a terminal - * indicates end-of-file pre-XPG4 and no data available - * for XPG4 and above. - */ - if (__xpg4 == 0) - return (-1); - return (0); - } + if (cc == 0) + return (-1); /* EOF */ if (cc == -1) /* The read was interrupted. */ return (0); diff --git a/usr/src/head/stdlib.h b/usr/src/head/stdlib.h index 6b0d224e07..337311a978 100644 --- a/usr/src/head/stdlib.h +++ b/usr/src/head/stdlib.h @@ -28,7 +28,7 @@ /* * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. - * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ /* Copyright (c) 1988 AT&T */ @@ -250,6 +250,19 @@ extern int setenv(const char *, const char *, int); extern int unsetenv(const char *); #endif +/* + * In strict XPG4v2 mode, slave pseudo terminal devices behave differently. + * See the block comment in usr/src/lib/libc/port/gen/pt.c + */ +#if defined(_STRICT_SYMBOLS) && defined(_XPG4_2) +#ifdef __PRAGMA_REDEFINE_EXTNAME +#pragma redefine_extname unlockpt __unlockpt_xpg4 +#else +extern int __unlockpt_xpg4(int); +#define unlockpt __unlockpt_xpg4 +#endif +#endif /* defined(_STRICT_SYMBOLS) && defined(_XPG4_2) */ + #if defined(__EXTENSIONS__) || \ (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) extern char *canonicalize_file_name(const char *); diff --git a/usr/src/lib/libc/port/gen/pt.c b/usr/src/lib/libc/port/gen/pt.c index 26dd4dd376..3372f7133c 100644 --- a/usr/src/lib/libc/port/gen/pt.c +++ b/usr/src/lib/libc/port/gen/pt.c @@ -24,10 +24,12 @@ * Use is subject to license terms. */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ +/* + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ #pragma weak _ptsname = ptsname #pragma weak _grantpt = grantpt @@ -133,6 +135,45 @@ unlockpt(int fd) return (0); } +/* + * XPG4v2 requires that open of a slave pseudo terminal device + * provides the process with an interface that is identical to + * the terminal interface. + * + * To satisfy this, in strict XPG4v2 mode, this routine also sends + * a message down the stream that sets a flag in the kernel module + * so that additional actions are performed when opening an + * associated slave PTY device. When this happens, modules are + * automatically pushed onto the stream to provide terminal + * semantics and those modules are then informed that they should + * behave in strict XPG4v2 mode which modifies their behaviour. In + * particular, in strict XPG4v2 mode, empty blocks will be sent up + * the master side of the stream rather than being suppressed. + * + * Most applications do not expect this behaviour so it is only + * enabled for programs compiled in strict XPG4v2 mode (see + * stdlib.h). + */ +int +__unlockpt_xpg4(int fd) +{ + int ret; + + if ((ret = unlockpt(fd)) == 0) { + struct strioctl istr; + + istr.ic_cmd = PTSSTTY; + istr.ic_len = 0; + istr.ic_timout = 0; + istr.ic_dp = NULL; + + if (ioctl(fd, I_STR, &istr) < 0) + ret = -1; + } + + return (ret); +} + int grantpt(int fd) { diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers index e4cf0e299a..8f33fda6d4 100644 --- a/usr/src/lib/libc/port/mapfile-vers +++ b/usr/src/lib/libc/port/mapfile-vers @@ -27,7 +27,7 @@ # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright (c) 2013 Gary Mills # Copyright 2014 Garrett D'Amore -# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. +# Copyright 2020 OmniOS Community Edition (OmniOSce) Association. # # @@ -78,6 +78,11 @@ $if _x86 && _ELF64 $add amd64 $endif +SYMBOL_VERSION ILLUMOS_0.31 { + protected: + __unlockpt_xpg4; +} ILLUMOS_0.30; + SYMBOL_VERSION ILLUMOS_0.30 { protected: reallocf; diff --git a/usr/src/lib/libc/port/sys/open.c b/usr/src/lib/libc/port/sys/open.c index 067bb72d69..2ea6c567f4 100644 --- a/usr/src/lib/libc/port/sys/open.c +++ b/usr/src/lib/libc/port/sys/open.c @@ -22,44 +22,32 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ /* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ #include "lint.h" -#include #include #include #include -#include -#include -#include #include -#include -#include -#include #include #include "libc.h" -static int xpg4_fixup(int fd); -static void push_module(int fd); -static int isptsfd(int fd); -static void itoa(int i, char *ptr); - int __openat(int dfd, const char *path, int oflag, mode_t mode) { - int fd = syscall(SYS_openat, dfd, path, oflag, mode); - return (xpg4_fixup(fd)); + return (syscall(SYS_openat, dfd, path, oflag, mode)); } int __open(const char *path, int oflag, mode_t mode) { #if defined(_RETAIN_OLD_SYSCALLS) - int fd = syscall(SYS_open, path, oflag, mode); - return (xpg4_fixup(fd)); + return (syscall(SYS_open, path, oflag, mode)); #else return (__openat(AT_FDCWD, path, oflag, mode)); #endif @@ -70,114 +58,17 @@ __open(const char *path, int oflag, mode_t mode) int __openat64(int dfd, const char *path, int oflag, mode_t mode) { - int fd = syscall(SYS_openat64, dfd, path, oflag, mode); - return (xpg4_fixup(fd)); + return (syscall(SYS_openat64, dfd, path, oflag, mode)); } int __open64(const char *path, int oflag, mode_t mode) { #if defined(_RETAIN_OLD_SYSCALLS) - int fd = syscall(SYS_open64, path, oflag, mode); - return (xpg4_fixup(fd)); + return (syscall(SYS_open64, path, oflag, mode)); #else return (__openat64(AT_FDCWD, path, oflag, mode)); #endif } #endif /* !_LP64 */ - -/* - * XPG4v2 requires that open of a slave pseudo terminal device - * provides the process with an interface that is identical to - * the terminal interface. For a more detailed discussion, - * see bugid 4025044. - */ -static int -xpg4_fixup(int fd) -{ - if (libc__xpg4 != 0 && fd >= 0 && isptsfd(fd)) - push_module(fd); - return (fd); -} - -/* - * Check if the file matches an entry in the /dev/pts directory. - * Be careful to preserve errno. - */ -static int -isptsfd(int fd) -{ - char buf[TTYNAME_MAX]; - char *str1 = buf; - const char *str2 = "/dev/pts/"; - struct stat64 fsb, stb; - int oerrno = errno; - int rval = 0; - - if (fstat64(fd, &fsb) == 0 && S_ISCHR(fsb.st_mode)) { - /* - * Do this without strcpy() or strlen(), - * to avoid invoking the dynamic linker. - */ - while (*str2 != '\0') - *str1++ = *str2++; - /* - * Inline version of minor(dev), to avoid the dynamic linker. - */ - itoa(fsb.st_rdev & MAXMIN, str1); - if (stat64(buf, &stb) == 0) - rval = (stb.st_rdev == fsb.st_rdev); - } - errno = oerrno; - return (rval); -} - -/* - * Converts a number to a string (null terminated). - */ -static void -itoa(int i, char *ptr) -{ - int dig = 0; - int tempi; - - tempi = i; - do { - dig++; - tempi /= 10; - } while (tempi); - - ptr += dig; - *ptr = '\0'; - while (--dig >= 0) { - *(--ptr) = i % 10 + '0'; - i /= 10; - } -} - -/* - * Push modules to provide tty semantics - */ -static void -push_module(int fd) -{ - struct strioctl istr; - int oerrno = errno; - - istr.ic_cmd = PTSSTTY; - istr.ic_len = 0; - istr.ic_timout = 0; - istr.ic_dp = NULL; - if (ioctl(fd, I_STR, &istr) != -1) { - (void) ioctl(fd, __I_PUSH_NOCTTY, "ptem"); - (void) ioctl(fd, __I_PUSH_NOCTTY, "ldterm"); - (void) ioctl(fd, __I_PUSH_NOCTTY, "ttcompat"); - istr.ic_cmd = PTSSTTY; - istr.ic_len = 0; - istr.ic_timout = 0; - istr.ic_dp = NULL; - (void) ioctl(fd, I_STR, &istr); - } - errno = oerrno; -} diff --git a/usr/src/man/man3lib/libc.3lib b/usr/src/man/man3lib/libc.3lib index 3978eabae8..83df10408b 100644 --- a/usr/src/man/man3lib/libc.3lib +++ b/usr/src/man/man3lib/libc.3lib @@ -1,4 +1,5 @@ '\" te +.\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association. .\" Copyright 2014 Garrett D'Amore .\" Copyright (c) 2009, Sun Microsystems, Inc. All rights reserved. .\" Copyright 2016 Joyent, Inc. @@ -6,7 +7,7 @@ .\" 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] .\" Copyright 2011 by Delphix. All rights reserved. -.TH LIBC 3LIB "Dec 10, 2015" +.TH LIBC 3LIB "Feb 14, 2020" .SH NAME libc \- C library .SH DESCRIPTION @@ -43,54 +44,54 @@ l l . \fB__posix_sigwait\fR \fB__posix_ttyname_r\fR \fB__priocntl\fR \fB__priocntlset\fR \fB__pthread_cleanup_pop\fR \fB__pthread_cleanup_push\fR -\fB__sysconf_xpg5\fR \fB__xpg4\fR -\fB__xpg4_putmsg\fR \fB__xpg4_putpmsg\fR -\fB_Exit\fR \fB_altzone\fR -\fB_assert\fR \fB_cleanup\fR -\fB_ctype\fR \fB_daylight\fR -\fB_environ\fR \fB_exit\fR -\fB_exithandle\fR \fB_filbuf\fR -\fB_flsbuf\fR \fB_flushlbf\fR -\fB_getdate_err\fR \fB_getdate_err_addr\fR -\fB_iob\fR \fB_isnan\fR -\fB_isnand\fR \fB_lwp_cond_broadcast\fR -\fB_lwp_cond_reltimedwait\fR \fB_lwp_cond_signal\fR -\fB_lwp_cond_timedwait\fR \fB_lwp_cond_wait\fR -\fB_lwp_continue\fR \fB_lwp_info\fR -\fB_lwp_kill\fR \fB_lwp_mutex_lock\fR -\fB_lwp_mutex_trylock\fR \fB_lwp_mutex_unlock\fR -\fB_lwp_self\fR \fB_lwp_sema_init\fR -\fB_lwp_sema_post\fR \fB_lwp_sema_trywait\fR -\fB_lwp_sema_wait\fR \fB_lwp_suspend\fR -\fB_lwp_suspend2\fR \fB_modf\fR -\fB_nextafter\fR \fB_nsc_trydoorcall\fR -\fB_nss_XbyY_buf_alloc\fR \fB_nss_XbyY_buf_free\fR -\fB_nss_netdb_aliases\fR \fB_numeric\fR -\fB_scalb\fR \fB_sibuf\fR -\fB_sobuf\fR \fB_stack_grow\fR -\fB_sys_buslist\fR \fB_sys_cldlist\fR -\fB_sys_fpelist\fR \fB_sys_illlist\fR -\fB_sys_segvlist\fR \fB_sys_siginfolistp\fR -\fB_sys_siglist\fR \fB_sys_siglistn\fR -\fB_sys_siglistp\fR \fB_sys_traplist\fR -\fB_timezone\fR \fB_tolower\fR -\fB_toupper\fR \fB_tzname\fR -\fB_xftw\fR \fB\fR -\fBa64l\fR \fBabort\fR -\fBabs\fR \fBaccess\fR -\fBacct\fR \fBacl\fR -\fBaddrtosymstr\fR \fBaddsev\fR -\fBaddseverity\fR \fBadjtime\fR -\fBaio_cancel\fR \fBaio_error\fR -\fBaio_fsync\fR \fBaio_read\fR -\fBaio_return\fR \fBaio_suspend\fR -\fBaio_waitn\fR \fBaio_write\fR -\fBaiocancel\fR \fBaioread\fR -\fBaiowait\fR \fBaiowrite\fR -\fBalarm\fR \fBalphasort\fR -\fBaltzone\fR \fBascftime\fR -\fBasctime\fR \fBasctime_r\fR -\fBasprintf\fR +\fB__sysconf_xpg5\fR \fB__unlockpt_xpg4\fR +\fB__xpg4\fR \fB__xpg4_putmsg\fR +\fB__xpg4_putpmsg\fR \fB_Exit\fR +\fB_altzone\fR \fB_assert\fR +\fB_cleanup\fR \fB_ctype\fR +\fB_daylight\fR \fB_environ\fR +\fB_exit\fR \fB_exithandle\fR +\fB_filbuf\fR \fB_flsbuf\fR +\fB_flushlbf\fR \fB_getdate_err\fR +\fB_getdate_err_addr\fR \fB_iob\fR +\fB_isnan\fR \fB_isnand\fR +\fB_lwp_cond_broadcast\fR \fB_lwp_cond_reltimedwait\fR +\fB_lwp_cond_signal\fR \fB_lwp_cond_timedwait\fR +\fB_lwp_cond_wait\fR \fB_lwp_continue\fR +\fB_lwp_info\fR \fB_lwp_kill\fR +\fB_lwp_mutex_lock\fR \fB_lwp_mutex_trylock\fR +\fB_lwp_mutex_unlock\fR \fB_lwp_self\fR +\fB_lwp_sema_init\fR \fB_lwp_sema_post\fR +\fB_lwp_sema_trywait\fR \fB_lwp_sema_wait\fR +\fB_lwp_suspend\fR \fB_lwp_suspend2\fR +\fB_modf\fR \fB_nextafter\fR +\fB_nsc_trydoorcall\fR \fB_nss_XbyY_buf_alloc\fR +\fB_nss_XbyY_buf_free\fR \fB_nss_netdb_aliases\fR +\fB_numeric\fR \fB_scalb\fR +\fB_sibuf\fR \fB_sobuf\fR +\fB_stack_grow\fR \fB_sys_buslist\fR +\fB_sys_cldlist\fR \fB_sys_fpelist\fR +\fB_sys_illlist\fR \fB_sys_segvlist\fR +\fB_sys_siginfolistp\fR \fB_sys_siglist\fR +\fB_sys_siglistn\fR \fB_sys_siglistp\fR +\fB_sys_traplist\fR \fB_timezone\fR +\fB_tolower\fR \fB_toupper\fR +\fB_tzname\fR \fB_xftw\fR +\fB\fR \fBa64l\fR +\fBabort\fR \fBabs\fR +\fBaccess\fR \fBacct\fR +\fBacl\fR \fBaddrtosymstr\fR +\fBaddsev\fR \fBaddseverity\fR +\fBadjtime\fR \fBaio_cancel\fR +\fBaio_error\fR \fBaio_fsync\fR +\fBaio_read\fR \fBaio_return\fR +\fBaio_suspend\fR \fBaio_waitn\fR +\fBaio_write\fR \fBaiocancel\fR +\fBaioread\fR \fBaiowait\fR +\fBaiowrite\fR \fBalarm\fR +\fBalphasort\fR \fBaltzone\fR +\fBascftime\fR \fBasctime\fR +\fBasctime_r\fR \fBasprintf\fR \fBatexit\fR \fBatof\fR \fBatoi\fR \fBatol\fR \fBatoll\fR \fBatomic_add_16\fR @@ -152,10 +153,9 @@ l l . \fBbcmp\fR \fBbcopy\fR \fBbindtextdomain\fR \fBbind_textdomain_codeset\fR \fBbrk\fR \fBbsd_signal\fR -\fBbsearch\fR -\fBbtowc\fR \fBbtowc_l\fR -\fBbzero\fR \fBcalloc\fR -\fBcanonicalize_file_name\fR +\fBbsearch\fR \fBbtowc\fR +\fBbtowc_l\fR \fBbzero\fR +\fBcalloc\fR \fBcanonicalize_file_name\fR \fBcatclose\fR \fBcatgets\fR \fBcatopen\fR \fBcfgetispeed\fR \fBcfgetospeed\fR \fBcfsetispeed\fR @@ -163,22 +163,21 @@ l l . \fBchdir\fR \fBchmod\fR \fBchown\fR \fBchroot\fR \fBclearerr\fR \fBclearenv\fR -\fBclock\fR -\fBclock_getres\fR \fBclock_gettime\fR -\fBclock_nanosleep\fR \fBclock_settime\fR -\fBclose\fR \fBclosedir\fR -\fBclosefrom\fR \fBcloselog\fR -\fBcond_broadcast\fR \fBcond_destroy\fR -\fBcond_init\fR \fBcond_reltimedwait\fR -\fBcond_signal\fR \fBcond_timedwait\fR -\fBcond_wait\fR \fBconfstr\fR -\fBcreat\fR \fBcrypt\fR -\fBcrypt_genhash_impl\fR \fBcrypt_gensalt\fR -\fBcrypt_gensalt_impl\fR \fBcsetcol\fR -\fBcsetlen\fR \fBctermid\fR -\fBctermid_r\fR \fBctime\fR -\fBctime_r\fR \fBcuserid\fR -\fBdaemon\fR +\fBclock\fR \fBclock_getres\fR +\fBclock_gettime\fR \fBclock_nanosleep\fR +\fBclock_settime\fR \fBclose\fR +\fBclosedir\fR \fBclosefrom\fR +\fBcloselog\fR \fBcond_broadcast\fR +\fBcond_destroy\fR \fBcond_init\fR +\fBcond_reltimedwait\fR \fBcond_signal\fR +\fBcond_timedwait\fR \fBcond_wait\fR +\fBconfstr\fR \fBcreat\fR +\fBcrypt\fR \fBcrypt_genhash_impl\fR +\fBcrypt_gensalt\fR \fBcrypt_gensalt_impl\fR +\fBcsetcol\fR \fBcsetlen\fR +\fBctermid\fR \fBctermid_r\fR +\fBctime\fR \fBctime_r\fR +\fBcuserid\fR \fBdaemon\fR \fBdaylight\fR \fBdbm_clearerr\fR \fBdbm_close\fR \fBdbm_delete\fR \fBdbm_error\fR \fBdbm_fetch\fR @@ -203,9 +202,8 @@ l l . \fBdoor_ucred\fR \fBdoor_unbind\fR \fBdouble_to_decimal\fR \fBdrand48\fR \fBdup\fR \fBdup2\fR -\fBduplocale\fR -\fBeconvert\fR \fBecvt\fR -\fBenable_extended_FILE_stdio\fR +\fBduplocale\fR \fBeconvert\fR +\fBecvt\fR \fBenable_extended_FILE_stdio\fR \fBencrypt\fR \fBendgrent\fR \fBendnetgrent\fR \fBendpwent\fR \fBendspent\fR \fBendusershell\fR @@ -218,10 +216,9 @@ l l . \fBexeclp\fR \fBexecv\fR \fBexecve\fR \fBexecvp\fR \fBexit\fR \fBextended_to_decimal\fR -\fBfaccessat\fR -\fBfacl\fR \fBfattach\fR -\fBfchdir\fR \fBfchmod\fR -\fBfchmodat\fR +\fBfaccessat\fR \fBfacl\fR +\fBfattach\fR \fBfchdir\fR +\fBfchmod\fR \fBfchmodat\fR \fBfchown\fR \fBfchownat\fR \fBfchroot\fR \fBfclose\fR \fBfcloseall\fR \fBfcntl\fR @@ -239,69 +236,66 @@ l l . \fBfgetpwent_r\fR \fBfgets\fR \fBfgetspent\fR \fBfgetspent_r\fR \fBfgetwc\fR \fBfgetwc_l\fR -\fBfgetws\fR -\fBfile_to_decimal\fR \fBfileno\fR -\fBfinite\fR \fBflockfile\fR -\fBfmtmsg\fR \fBfnmatch\fR -\fBfopen\fR \fBfork\fR -\fBfork1\fR \fBforkall\fR -\fBforkallx\fR \fBforkx\fR -\fBfpathconf\fR \fBfpclass\fR -\fBfpgetmask\fR \fBfpgetround\fR -\fBfpgetsticky\fR \fBfprintf\fR -\fBfpsetmask\fR \fBfpsetround\fR -\fBfpsetsticky\fR \fBfputc\fR -\fBfputs\fR \fBfputwc\fR -\fBfputws\fR \fBfread\fR -\fBfree\fR \fBfreelocale\fR -\fBfreopen\fR +\fBfgetws\fR \fBfile_to_decimal\fR +\fBfileno\fR \fBfinite\fR +\fBflockfile\fR \fBfmtmsg\fR +\fBfnmatch\fR \fBfopen\fR +\fBfork\fR \fBfork1\fR +\fBforkall\fR \fBforkallx\fR +\fBforkx\fR \fBfpathconf\fR +\fBfpclass\fR \fBfpgetmask\fR +\fBfpgetround\fR \fBfpgetsticky\fR +\fBfprintf\fR \fBfpsetmask\fR +\fBfpsetround\fR \fBfpsetsticky\fR +\fBfputc\fR \fBfputs\fR +\fBfputwc\fR \fBfputws\fR +\fBfread\fR \fBfree\fR +\fBfreelocale\fR \fBfreopen\fR \fBfrexp\fR \fBfscanf\fR \fBfseek\fR \fBfseeko\fR -\fBfsetattr\fR -\fBfsetpos\fR \fBfstat\fR -\fBfstatat\fR \fBfstatfs\fR -\fBfstatvfs\fR \fBfsync\fR -\fBftell\fR \fBftello\fR -\fBftime\fR \fBftok\fR -\fBftruncate\fR \fBftrylockfile\fR -\fBftw\fR \fBfunc_to_decimal\fR -\fBfunlockfile\fR \fBfutimens\fR -\fBfutimesat\fR +\fBfsetattr\fR \fBfsetpos\fR +\fBfstat\fR \fBfstatat\fR +\fBfstatfs\fR \fBfstatvfs\fR +\fBfsync\fR \fBftell\fR +\fBftello\fR \fBftime\fR +\fBftok\fR \fBftruncate\fR +\fBftrylockfile\fR \fBftw\fR +\fBfunc_to_decimal\fR \fBfunlockfile\fR +\fBfutimens\fR \fBfutimesat\fR \fBfwide\fR \fBfwprintf\fR \fBfwrite\fR \fBfwscanf\fR \fBgconvert\fR \fBgcvt\fR \fBgetacct\fR \fBgetattrat\fR -\fBgetc\fR -\fBgetc_unlocked\fR \fBgetchar\fR -\fBgetchar_unlocked\fR \fBgetcontext\fR -\fBgetcpuid\fR \fBgetcwd\fR -\fBgetdate\fR \fBgetdate_err\fR -\fBgetdents\fR \fBgetdtablesize\fR -\fBgetegid\fR \fBgetenv\fR -\fBgeteuid\fR \fBgetexecname\fR -\fBgetextmntent\fR \fBgetgid\fR -\fBgetgrent\fR \fBgetgrent_r\fR -\fBgetgrgid\fR \fBgetgrgid_r\fR -\fBgetgrnam\fR \fBgetgrnam_r\fR -\fBgetgroups\fR \fBgethomelgroup\fR -\fBgethostid\fR \fBgethostname\fR -\fBgethrtime\fR \fBgethrvtime\fR -\fBgetisax\fR \fBgetitimer\fR -\fBgetloadavg\fR \fBgetlogin\fR -\fBgetlogin_r\fR \fBgetmntany\fR -\fBgetmntent\fR \fBgetmsg\fR -\fBget_nprocs\fR \fBget_nprocs_conf\fR -\fBgetnetgrent\fR \fBgetnetgrent_r\fR -\fBgetopt\fR \fBgetopt_clip\fR -\fBgetopt_long\fR \fBgetopt_long_only\fR -\fBgetpagesize\fR \fBgetpagesizes\fR -\fBgetpass\fR \fBgetpassphrase\fR -\fBgetpeerucred\fR \fBgetpflags\fR -\fBgetpgid\fR \fBgetpgrp\fR -\fBgetpid\fR \fBgetpmsg\fR -\fBgetppid\fR \fBgetppriv\fR -\fBgetpriority\fR \fBgetprogname\fR -\fBgetprojid\fR +\fBgetc\fR \fBgetc_unlocked\fR +\fBgetchar\fR \fBgetchar_unlocked\fR +\fBgetcontext\fR \fBgetcpuid\fR +\fBgetcwd\fR \fBgetdate\fR +\fBgetdate_err\fR \fBgetdents\fR +\fBgetdtablesize\fR \fBgetegid\fR +\fBgetenv\fR \fBgeteuid\fR +\fBgetexecname\fR \fBgetextmntent\fR +\fBgetgid\fR \fBgetgrent\fR +\fBgetgrent_r\fR \fBgetgrgid\fR +\fBgetgrgid_r\fR \fBgetgrnam\fR +\fBgetgrnam_r\fR \fBgetgroups\fR +\fBgethomelgroup\fR \fBgethostid\fR +\fBgethostname\fR \fBgethrtime\fR +\fBgethrvtime\fR \fBgetisax\fR +\fBgetitimer\fR \fBgetloadavg\fR +\fBgetlogin\fR \fBgetlogin_r\fR +\fBgetmntany\fR \fBgetmntent\fR +\fBgetmsg\fR \fBget_nprocs\fR +\fBget_nprocs_conf\fR \fBgetnetgrent\fR +\fBgetnetgrent_r\fR \fBgetopt\fR +\fBgetopt_clip\fR \fBgetopt_long\fR +\fBgetopt_long_only\fR \fBgetpagesize\fR +\fBgetpagesizes\fR \fBgetpass\fR +\fBgetpassphrase\fR \fBgetpeerucred\fR +\fBgetpflags\fR \fBgetpgid\fR +\fBgetpgrp\fR \fBgetpid\fR +\fBgetpmsg\fR \fBgetppid\fR +\fBgetppriv\fR \fBgetpriority\fR +\fBgetprogname\fR \fBgetprojid\fR \fBgetpw\fR \fBgetpwent\fR \fBgetpwent_r\fR \fBgetpwnam\fR \fBgetpwnam_r\fR \fBgetpwuid\fR @@ -320,10 +314,9 @@ l l . \fBgetutxid\fR \fBgetutxline\fR \fBgetvfsany\fR \fBgetvfsent\fR \fBgetvfsfile\fR \fBgetvfsspec\fR -\fBgetw\fR -\fBgetwc\fR \fBgetwc_l\fR -\fBgetwchar\fR \fBgetwchar_l\fR -\fBgetwd\fR +\fBgetw\fR \fBgetwc\fR +\fBgetwc_l\fR \fBgetwchar\fR +\fBgetwchar_l\fR \fBgetwd\fR \fBgetwidth\fR \fBgetws\fR \fBgetzoneid\fR \fBgetzoneidbyname\fR \fBgetzonenamebyid\fR \fBglob\fR @@ -337,27 +330,23 @@ l l . \fBindex\fR \fBinitgroups\fR \fBinitstate\fR \fBinnetgr\fR \fBinsque\fR \fBioctl\fR -\fBis_system_labeled\fR -\fBisaexec\fR +\fBis_system_labeled\fR \fBisaexec\fR \fBisalnum\fR \fBisalnum_l\fR \fBisalpha\fR \fBisalpha_l\fR \fBisascii\fR \fBisastream\fR -\fBisatty\fR -\fBisblank\fR \fBisblank_l\fR -\fBiscntrl\fR \fBiscntrl_l\fR -\fBisdigit\fR \fBisdigit_l\fR -\fBisenglish\fR +\fBisatty\fR \fBisblank\fR +\fBisblank_l\fR \fBiscntrl\fR +\fBiscntrl_l\fR \fBisdigit\fR +\fBisdigit_l\fR \fBisenglish\fR \fBisgraph\fR \fBisgraph_l\fR -\fBisideogram\fR -\fBislower\fR \fBislower_l\fR -\fBisnan\fR +\fBisideogram\fR \fBislower\fR +\fBislower_l\fR \fBisnan\fR \fBisnand\fR \fBisnanf\fR \fBisnumber\fR \fBisphonogram\fR \fBisprint\fR \fBisprint_l\fR \fBispunct\fR \fBispunct_l\fR -\fBissetugid\fR -\fBisspace\fR \fBisspace_l\fR -\fBisspecial\fR +\fBissetugid\fR \fBisspace\fR +\fBisspace_l\fR \fBisspecial\fR \fBisupper\fR \fBisupper_l\fR \fBiswalnum\fR \fBiswalnum_l\fR \fBiswalpha\fR \fBiswalpha_l\fR @@ -398,31 +387,29 @@ l l . \fBlsub\fR \fBlten\fR \fBlzero\fR \fBmadvise\fR \fBmakecontext\fR \fBmakeutx\fR -\fBmalloc\fR -\fBmblen\fR \fBmblen_l\fR -\fBmbrlen\fR \fBmbrlen_l\fR -\fBmbrtowc\fR \fBmbrtowc_l\fR -\fBmbsinit\fR \fBmbsinit_l\fR -\fBmbsnrtowcs\fR \fBmbsnrtowcs_l\fR -\fBmbsrtowcs\fR \fBmbsrtowcs_l\fR -\fBmbstowcs\fR \fBmbstowcs_l\fR -\fBmbtowc\fR \fBmbtowc_l\fR -\fBmemalign\fR \fBmembar_consumer\fR -\fBmembar_enter\fR \fBmembar_exit\fR -\fBmembar_producer\fR \fBmemccpy\fR -\fBmemchr\fR \fBmemcmp\fR -\fBmemcntl\fR \fBmemcpy\fR -\fBmeminfo\fR \fBmemmem\fR -\fBmemmove\fR +\fBmalloc\fR \fBmblen\fR +\fBmblen_l\fR \fBmbrlen\fR +\fBmbrlen_l\fR \fBmbrtowc\fR +\fBmbrtowc_l\fR \fBmbsinit\fR +\fBmbsinit_l\fR \fBmbsnrtowcs\fR +\fBmbsnrtowcs_l\fR \fBmbsrtowcs\fR +\fBmbsrtowcs_l\fR \fBmbstowcs\fR +\fBmbstowcs_l\fR \fBmbtowc\fR +\fBmbtowc_l\fR \fBmemalign\fR +\fBmembar_consumer\fR \fBmembar_enter\fR +\fBmembar_exit\fR \fBmembar_producer\fR +\fBmemccpy\fR \fBmemchr\fR +\fBmemcmp\fR \fBmemcntl\fR +\fBmemcpy\fR \fBmeminfo\fR +\fBmemmem\fR \fBmemmove\fR \fBmemset\fR \fBmincore\fR \fBmkdir\fR \fBmkdirat\fR \fBmkfifo\fR \fBmkfifoat\fR \fBmknod\fR \fBmknodat\fR -\fBmkstemp\fR -\fBmktemp\fR \fBmktime\fR -\fBmlock\fR \fBmlockall\fR -\fBmmap\fR \fBmmapobj\fR -\fBmodctl\fR +\fBmkstemp\fR \fBmktemp\fR +\fBmktime\fR \fBmlock\fR +\fBmlockall\fR \fBmmap\fR +\fBmmapobj\fR \fBmodctl\fR \fBmodf\fR \fBmodff\fR \fBmodutx\fR \fBmonitor\fR \fBmount\fR \fBmprotect\fR @@ -445,34 +432,31 @@ l l . \fBnfs_getfh\fR \fBnftw\fR \fBngettext\fR \fBnice\fR \fBnl_langinfo\fR \fBnl_langinfo_l\fR -\fBnrand48\fR -\fBnss_default_finders\fR \fBnss_delete\fR -\fBnss_endent\fR \fBnss_getent\fR -\fBnss_search\fR \fBnss_setent\fR -\fBntp_adjtime\fR \fBntp_gettime\fR -\fBopen\fR \fBopenat\fR -\fBopendir\fR \fBopenlog\fR -\fBoptarg\fR \fBopterr\fR -\fBoptind\fR \fBoptopt\fR -\fBp_online\fR \fBpathconf\fR -\fBpause\fR \fBpclose\fR -\fBpcsample\fR \fBperror\fR -\fBpfmt\fR \fBpipe\fR -\fBplock\fR \fBpoll\fR -\fBpopen\fR \fBport_alert\fR -\fBport_associate\fR \fBport_create\fR -\fBport_dissociate\fR \fBport_get\fR -\fBport_getn\fR \fBport_send\fR -\fBport_sendn\fR \fBposix_fadvise\fR -\fBposix_fallocate\fR \fBposix_madvise\fR -\fBposix_memalign\fR \fBposix_openpt\fR -\fBposix_spawn\fR \fBposix_spawn_file_actions_addclose\fR -\fBposix_spawn_file_actions_addclosefrom_np\fR \fBposix_spawn_file_actions_adddup2\fR -\fBposix_spawn_file_actions_addopen\fR -\fBposix_spawn_file_actions_destroy\fR -\fBposix_spawn_file_actions_init\fR -\fBposix_spawn_pipe_np\fR -\fBposix_spawnattr_destroy\fR +\fBnrand48\fR \fBnss_default_finders\fR +\fBnss_delete\fR \fBnss_endent\fR +\fBnss_getent\fR \fBnss_search\fR +\fBnss_setent\fR \fBntp_adjtime\fR +\fBntp_gettime\fR \fBopen\fR +\fBopenat\fR \fBopendir\fR +\fBopenlog\fR \fBoptarg\fR +\fBopterr\fR \fBoptind\fR +\fBoptopt\fR \fBp_online\fR +\fBpathconf\fR \fBpause\fR +\fBpclose\fR \fBpcsample\fR +\fBperror\fR \fBpfmt\fR +\fBpipe\fR \fBplock\fR +\fBpoll\fR \fBpopen\fR +\fBport_alert\fR \fBport_associate\fR +\fBport_create\fR \fBport_dissociate\fR +\fBport_get\fR \fBport_getn\fR +\fBport_send\fR \fBport_sendn\fR +\fBposix_fadvise\fR \fBposix_fallocate\fR +\fBposix_madvise\fR \fBposix_memalign\fR +\fBposix_openpt\fR \fBposix_spawn\fR +\fBposix_spawn_file_actions_addclose\fR \fBposix_spawn_file_actions_addclosefrom_np\fR +\fBposix_spawn_file_actions_adddup2\fR \fBposix_spawn_file_actions_addopen\fR +\fBposix_spawn_file_actions_destroy\fR \fBposix_spawn_file_actions_init\fR +\fBposix_spawn_pipe_np\fR \fBposix_spawnattr_destroy\fR \fBposix_spawnattr_getflags\fR \fBposix_spawnattr_getpgroup\fR \fBposix_spawnattr_getschedparam\fR \fBposix_spawnattr_getschedpolicy\fR \fBposix_spawnattr_getsigdefault\fR \fBposix_spawnattr_getsigignore_np\fR @@ -482,30 +466,29 @@ l l . \fBposix_spawnattr_setsigdefault\fR \fBposix_spawnattr_setsigignore_np\fR \fBposix_spawnattr_setsigmask\fR \fBposix_spawnp\fR \fBpread\fR \fBpreadv\fR -\fBprintf\fR -\fBprintstack\fR \fBpriocntl\fR -\fBpriocntlset\fR \fBpriv_addset\fR -\fBpriv_allocset\fR \fBpriv_copyset\fR -\fBpriv_delset\fR \fBpriv_emptyset\fR -\fBpriv_fillset\fR \fBpriv_freeset\fR -\fBpriv_getbyname\fR \fBpriv_getbynum\fR -\fBpriv_getsetbyname\fR \fBpriv_getsetbynum\fR -\fBpriv_gettext\fR \fBpriv_ineffect\fR -\fBpriv_intersect\fR \fBpriv_inverse\fR -\fBpriv_isemptyset\fR \fBpriv_isequalset\fR -\fBpriv_isfullset\fR \fBpriv_ismember\fR -\fBpriv_issubset\fR \fBpriv_set\fR -\fBpriv_set_to_str\fR \fBpriv_str_to_set\fR -\fBpriv_union\fR \fBprocessor_bind\fR -\fBprocessor_info\fR \fBprofil\fR -\fBpselect\fR \fBpset_assign\fR -\fBpset_bind\fR \fBpset_create\fR -\fBpset_destroy\fR \fBpset_getattr\fR -\fBpset_getloadavg\fR \fBpset_info\fR -\fBpset_list\fR \fBpset_setattr\fR -\fBpsiginfo\fR \fBpsignal\fR -\fBpthread_atfork\fR \fBpthread_attr_destroy\fR -\fBpthread_attr_get_np\fR +\fBprintf\fR \fBprintstack\fR +\fBpriocntl\fR \fBpriocntlset\fR +\fBpriv_addset\fR \fBpriv_allocset\fR +\fBpriv_copyset\fR \fBpriv_delset\fR +\fBpriv_emptyset\fR \fBpriv_fillset\fR +\fBpriv_freeset\fR \fBpriv_getbyname\fR +\fBpriv_getbynum\fR \fBpriv_getsetbyname\fR +\fBpriv_getsetbynum\fR \fBpriv_gettext\fR +\fBpriv_ineffect\fR \fBpriv_intersect\fR +\fBpriv_inverse\fR \fBpriv_isemptyset\fR +\fBpriv_isequalset\fR \fBpriv_isfullset\fR +\fBpriv_ismember\fR \fBpriv_issubset\fR +\fBpriv_set\fR \fBpriv_set_to_str\fR +\fBpriv_str_to_set\fR \fBpriv_union\fR +\fBprocessor_bind\fR \fBprocessor_info\fR +\fBprofil\fR \fBpselect\fR +\fBpset_assign\fR \fBpset_bind\fR +\fBpset_create\fR \fBpset_destroy\fR +\fBpset_getattr\fR \fBpset_getloadavg\fR +\fBpset_info\fR \fBpset_list\fR +\fBpset_setattr\fR \fBpsiginfo\fR +\fBpsignal\fR \fBpthread_atfork\fR +\fBpthread_attr_destroy\fR \fBpthread_attr_get_np\fR \fBpthread_attr_getdetachstate\fR \fBpthread_attr_getguardsize\fR \fBpthread_attr_getinheritsched\fR \fBpthread_attr_getschedparam\fR \fBpthread_attr_getschedpolicy\fR \fBpthread_attr_getscope\fR @@ -531,44 +514,43 @@ l l . \fBpthread_getconcurrency\fR \fBpthread_getschedparam\fR \fBpthread_getspecific\fR \fBpthread_join\fR \fBpthread_key_create\fR \fBpthread_key_create_once_np\fR -\fBpthread_key_delete\fR -\fBpthread_kill\fR \fBpthread_mutex_consistent\fR -\fBpthread_mutex_destroy\fR \fBpthread_mutex_getprioceiling\fR -\fBpthread_mutex_init\fR \fBpthread_mutex_lock\fR -\fBpthread_mutex_reltimedlock_np\fR \fBpthread_mutex_setprioceiling\fR -\fBpthread_mutex_timedlock\fR \fBpthread_mutex_trylock\fR -\fBpthread_mutex_unlock\fR \fBpthread_mutexattr_destroy\fR -\fBpthread_mutexattr_getprioceiling\fR \fBpthread_mutexattr_getprotocol\fR -\fBpthread_mutexattr_getpshared\fR \fBpthread_mutexattr_getrobust\fR -\fBpthread_mutexattr_gettype\fR \fBpthread_mutexattr_init\fR -\fBpthread_mutexattr_setprioceiling\fR \fBpthread_mutexattr_setprotocol\fR -\fBpthread_mutexattr_setpshared\fR \fBpthread_mutexattr_setrobust\fR -\fBpthread_mutexattr_settype\fR \fBpthread_once\fR -\fBpthread_rwlock_destroy\fR \fBpthread_rwlock_init\fR -\fBpthread_rwlock_rdlock\fR \fBpthread_rwlock_reltimedrdlock_np\fR -\fBpthread_rwlock_reltimedwrlock_np\fR \fBpthread_rwlock_timedrdlock\fR -\fBpthread_rwlock_timedwrlock\fR \fBpthread_rwlock_tryrdlock\fR -\fBpthread_rwlock_trywrlock\fR \fBpthread_rwlock_unlock\fR -\fBpthread_rwlock_wrlock\fR \fBpthread_rwlockattr_destroy\fR -\fBpthread_rwlockattr_getpshared\fR \fBpthread_rwlockattr_init\fR -\fBpthread_rwlockattr_setpshared\fR \fBpthread_self\fR -\fBpthread_setcancelstate\fR \fBpthread_setcanceltype\fR -\fBpthread_setconcurrency\fR \fBpthread_setspecific\fR -\fBpthread_sigmask\fR \fBpthread_setschedparam\fR -\fBpthread_setschedprio\fR \fBpthread_spin_destroy\fR -\fBpthread_spin_init\fR \fBpthread_spin_lock\fR -\fBpthread_spin_trylock\fR \fBpthread_spin_unlock\fR -\fBpthread_testcancel\fR \fBptsname\fR -\fBputacct\fR \fBputc\fR -\fBputc_unlocked\fR \fBputchar\fR -\fBputchar_unlocked\fR \fBputenv\fR -\fBputmsg\fR \fBputpmsg\fR -\fBputpwent\fR \fBputs\fR -\fBputspent\fR \fBpututline\fR -\fBpututxline\fR \fBputw\fR -\fBputwc\fR \fBputwchar\fR -\fBputws\fR \fBpwrite\fR -\fBpwritev\fR +\fBpthread_key_delete\fR \fBpthread_kill\fR +\fBpthread_mutex_consistent\fR \fBpthread_mutex_destroy\fR +\fBpthread_mutex_getprioceiling\fR \fBpthread_mutex_init\fR +\fBpthread_mutex_lock\fR \fBpthread_mutex_reltimedlock_np\fR +\fBpthread_mutex_setprioceiling\fR \fBpthread_mutex_timedlock\fR +\fBpthread_mutex_trylock\fR \fBpthread_mutex_unlock\fR +\fBpthread_mutexattr_destroy\fR \fBpthread_mutexattr_getprioceiling\fR +\fBpthread_mutexattr_getprotocol\fR \fBpthread_mutexattr_getpshared\fR +\fBpthread_mutexattr_getrobust\fR \fBpthread_mutexattr_gettype\fR +\fBpthread_mutexattr_init\fR \fBpthread_mutexattr_setprioceiling\fR +\fBpthread_mutexattr_setprotocol\fR \fBpthread_mutexattr_setpshared\fR +\fBpthread_mutexattr_setrobust\fR \fBpthread_mutexattr_settype\fR +\fBpthread_once\fR \fBpthread_rwlock_destroy\fR +\fBpthread_rwlock_init\fR \fBpthread_rwlock_rdlock\fR +\fBpthread_rwlock_reltimedrdlock_np\fR \fBpthread_rwlock_reltimedwrlock_np\fR +\fBpthread_rwlock_timedrdlock\fR \fBpthread_rwlock_timedwrlock\fR +\fBpthread_rwlock_tryrdlock\fR \fBpthread_rwlock_trywrlock\fR +\fBpthread_rwlock_unlock\fR \fBpthread_rwlock_wrlock\fR +\fBpthread_rwlockattr_destroy\fR \fBpthread_rwlockattr_getpshared\fR +\fBpthread_rwlockattr_init\fR \fBpthread_rwlockattr_setpshared\fR +\fBpthread_self\fR \fBpthread_setcancelstate\fR +\fBpthread_setcanceltype\fR \fBpthread_setconcurrency\fR +\fBpthread_setspecific\fR \fBpthread_sigmask\fR +\fBpthread_setschedparam\fR \fBpthread_setschedprio\fR +\fBpthread_spin_destroy\fR \fBpthread_spin_init\fR +\fBpthread_spin_lock\fR \fBpthread_spin_trylock\fR +\fBpthread_spin_unlock\fR \fBpthread_testcancel\fR +\fBptsname\fR \fBputacct\fR +\fBputc\fR \fBputc_unlocked\fR +\fBputchar\fR \fBputchar_unlocked\fR +\fBputenv\fR \fBputmsg\fR +\fBputpmsg\fR \fBputpwent\fR +\fBputs\fR \fBputspent\fR +\fBpututline\fR \fBpututxline\fR +\fBputw\fR \fBputwc\fR +\fBputwchar\fR \fBputws\fR +\fBpwrite\fR \fBpwritev\fR \fBqeconvert\fR \fBqecvt\fR \fBqfconvert\fR \fBqfcvt\fR \fBqgconvert\fR \fBqgcvt\fR @@ -586,58 +568,56 @@ l l . \fBre_comp\fR \fBre_exec\fR \fBread\fR \fBreaddir\fR \fBreaddir_r\fR \fBreadlink\fR -\fBreadlinkat\fR -\fBreadv\fR \fBrealloc\fR -\fBrealpath\fR \fBreboot\fR -\fBregcmp\fR \fBregcomp\fR -\fBregerror\fR \fBregex\fR -\fBregexec\fR \fBregfree\fR -\fBremove\fR \fBremque\fR -\fBrename\fR \fBrenameat\fR -\fBresetmnttab\fR \fBresolvepath\fR -\fBrewind\fR \fBrewinddir\fR -\fBrindex\fR \fBrmdir\fR -\fBrw_rdlock\fR \fBrw_read_held\fR -\fBrw_tryrdlock\fR \fBrw_trywrlock\fR -\fBrw_unlock\fR \fBrw_write_held\fR -\fBrw_wrlock\fR \fBrwlock_destroy\fR -\fBrwlock_init\fR \fBsbrk\fR -\fBscalb\fR \fBscandir\fR -\fBscanf\fR \fBsched_get_priority_max\fR -\fBsched_get_priority_min\fR \fBsched_getparam\fR -\fBsched_getscheduler\fR \fBsched_rr_get_interval\fR -\fBsched_setparam\fR \fBsched_setscheduler\fR -\fBsched_yield\fR \fBschedctl_exit\fR -\fBschedctl_init\fR \fBschedctl_lookup\fR -\fBschedctl_start\fR \fBschedctl_stop\fR -\fBseconvert\fR \fBseed48\fR -\fBseekdir\fR \fBselect\fR -\fBsem_close\fR \fBsem_destroy\fR -\fBsem_getvalue\fR \fBsem_init\fR -\fBsem_open\fR \fBsem_post\fR -\fBsem_reltimedwait_np\fR \fBsem_timedwait\fR -\fBsem_trywait\fR \fBsem_unlink\fR -\fBsem_wait\fR +\fBreadlinkat\fR \fBreadv\fR +\fBrealloc\fR \fBrealpath\fR +\fBreboot\fR \fBregcmp\fR +\fBregcomp\fR \fBregerror\fR +\fBregex\fR \fBregexec\fR +\fBregfree\fR \fBremove\fR +\fBremque\fR \fBrename\fR +\fBrenameat\fR \fBresetmnttab\fR +\fBresolvepath\fR \fBrewind\fR +\fBrewinddir\fR \fBrindex\fR +\fBrmdir\fR \fBrw_rdlock\fR +\fBrw_read_held\fR \fBrw_tryrdlock\fR +\fBrw_trywrlock\fR \fBrw_unlock\fR +\fBrw_write_held\fR \fBrw_wrlock\fR +\fBrwlock_destroy\fR \fBrwlock_init\fR +\fBsbrk\fR \fBscalb\fR +\fBscandir\fR \fBscanf\fR +\fBsched_get_priority_max\fR \fBsched_get_priority_min\fR +\fBsched_getparam\fR \fBsched_getscheduler\fR +\fBsched_rr_get_interval\fR \fBsched_setparam\fR +\fBsched_setscheduler\fR \fBsched_yield\fR +\fBschedctl_exit\fR \fBschedctl_init\fR +\fBschedctl_lookup\fR \fBschedctl_start\fR +\fBschedctl_stop\fR \fBseconvert\fR +\fBseed48\fR \fBseekdir\fR +\fBselect\fR \fBsem_close\fR +\fBsem_destroy\fR \fBsem_getvalue\fR +\fBsem_init\fR \fBsem_open\fR +\fBsem_post\fR \fBsem_reltimedwait_np\fR +\fBsem_timedwait\fR \fBsem_trywait\fR +\fBsem_unlink\fR \fBsem_wait\fR \fBsema_destroy\fR \fBsema_held\fR \fBsema_init\fR \fBsema_post\fR \fBsema_trywait\fR \fBsema_wait\fR \fBsemctl\fR \fBsemget\fR \fBsemids\fR \fBsemop\fR \fBsemtimedop\fR \fBsetattrat\fR -\fBsetbuf\fR -\fBsetbuffer\fR \fBsetcat\fR -\fBsetcontext\fR \fBsetegid\fR -\fBsetenv\fR \fBseteuid\fR -\fBsetgid\fR \fBsetgrent\fR -\fBsetgroups\fR \fBsethostname\fR -\fBsetitimer\fR \fBsetjmp\fR -\fBsetkey\fR \fBsetlabel\fR -\fBsetlinebuf\fR \fBsetlocale\fR -\fBsetlogmask\fR \fBsetnetgrent\fR -\fBsetpflags\fR \fBsetpgid\fR -\fBsetpgrp\fR \fBsetppriv\fR -\fBsetpriority\fR \fBsetprogname\fR -\fBsetpwent\fR +\fBsetbuf\fR \fBsetbuffer\fR +\fBsetcat\fR \fBsetcontext\fR +\fBsetegid\fR \fBsetenv\fR +\fBseteuid\fR \fBsetgid\fR +\fBsetgrent\fR \fBsetgroups\fR +\fBsethostname\fR \fBsetitimer\fR +\fBsetjmp\fR \fBsetkey\fR +\fBsetlabel\fR \fBsetlinebuf\fR +\fBsetlocale\fR \fBsetlogmask\fR +\fBsetnetgrent\fR \fBsetpflags\fR +\fBsetpgid\fR \fBsetpgrp\fR +\fBsetppriv\fR \fBsetpriority\fR +\fBsetprogname\fR \fBsetpwent\fR \fBsetrctl\fR \fBsetregid\fR \fBsetreuid\fR \fBsetrlimit\fR \fBsetsid\fR \fBsetspent\fR @@ -659,14 +639,13 @@ l l . \fBsiglongjmp\fR \fBsignal\fR \fBsigpause\fR \fBsigpending\fR \fBsigprocmask\fR \fBsigqueue\fR -\fBsigrelse\fR -\fBsigsend\fR \fBsigsendset\fR -\fBsigset\fR \fBsigsetjmp\fR -\fBsigstack\fR \fBsigsuspend\fR -\fBsigtimedwait\fR \fBsigwait\fR -\fBsigwaitinfo\fR \fBsingle_to_decimal\fR -\fBsleep\fR \fBsmt_pause\fR -\fBsnprintf\fR +\fBsigrelse\fR \fBsigsend\fR +\fBsigsendset\fR \fBsigset\fR +\fBsigsetjmp\fR \fBsigstack\fR +\fBsigsuspend\fR \fBsigtimedwait\fR +\fBsigwait\fR \fBsigwaitinfo\fR +\fBsingle_to_decimal\fR \fBsleep\fR +\fBsmt_pause\fR \fBsnprintf\fR \fBsprintf\fR \fBsrand\fR \fBsrand48\fR \fBsrandom\fR \fBsscanf\fR \fBssignal\fR @@ -674,16 +653,15 @@ l l . \fBstack_setbounds\fR \fBstack_violation\fR \fBstat\fR \fBstatfs\fR \fBstatvfs\fR \fBstime\fR -\fBstr2sig\fR -\fBstrcasecmp\fR \fBstrcasecmp_l\fR -\fBstrcat\fR \fBstrchr\fR -\fBstrcmp\fR \fBstrcoll\fR -\fBstrcpy\fR \fBstrcspn\fR -\fBstrdup\fR \fBstrerror\fR -\fBstrerror_l\fR \fBstrerror_r\fR -\fBstrfmon\fR \fBstrfmon_l\fR -\fBstrftime\fR \fBstrftime_l\fR -\fBstring_to_decimal\fR +\fBstr2sig\fR \fBstrcasecmp\fR +\fBstrcasecmp_l\fR \fBstrcat\fR +\fBstrchr\fR \fBstrcmp\fR +\fBstrcoll\fR \fBstrcpy\fR +\fBstrcspn\fR \fBstrdup\fR +\fBstrerror\fR \fBstrerror_l\fR +\fBstrerror_r\fR \fBstrfmon\fR +\fBstrfmon_l\fR \fBstrftime\fR +\fBstrftime_l\fR \fBstring_to_decimal\fR \fBstrlcat\fR \fBstrlcpy\fR \fBstrlen\fR \fBstrncasecmp\fR \fBstrncasecmp_l\fR \fBstrncat\fR @@ -702,23 +680,22 @@ l l . \fBswab\fR \fBswapcontext\fR \fBswapctl\fR \fBswprintf\fR \fBswscanf\fR \fBsymlink\fR -\fBsymlinkat\fR -\fBsync\fR \fBsync_instruction_memory\fR -\fBsysconf\fR \fBsysfs\fR -\fBsysinfo\fR \fBsyslog\fR -\fBsystem\fR \fBtcdrain\fR -\fBtcflow\fR \fBtcflush\fR -\fBtcgetattr\fR \fBtcgetpgrp\fR -\fBtcgetsid\fR \fBtcsendbreak\fR -\fBtcsetattr\fR \fBtcsetpgrp\fR -\fBtdelete\fR \fBtell\fR -\fBtelldir\fR \fBtempnam\fR -\fBtextdomain\fR \fBtfind\fR -\fBthr_continue\fR \fBthr_create\fR -\fBthr_exit\fR \fBthr_getconcurrency\fR -\fBthr_getprio\fR \fBthr_getspecific\fR -\fBthr_join\fR \fBthr_keycreate\fR -\fBthr_keycreate_once\fR +\fBsymlinkat\fR \fBsync\fR +\fBsync_instruction_memory\fR \fBsysconf\fR +\fBsysfs\fR \fBsysinfo\fR +\fBsyslog\fR \fBsystem\fR +\fBtcdrain\fR \fBtcflow\fR +\fBtcflush\fR \fBtcgetattr\fR +\fBtcgetpgrp\fR \fBtcgetsid\fR +\fBtcsendbreak\fR \fBtcsetattr\fR +\fBtcsetpgrp\fR \fBtdelete\fR +\fBtell\fR \fBtelldir\fR +\fBtempnam\fR \fBtextdomain\fR +\fBtfind\fR \fBthr_continue\fR +\fBthr_create\fR \fBthr_exit\fR +\fBthr_getconcurrency\fR \fBthr_getprio\fR +\fBthr_getspecific\fR \fBthr_join\fR +\fBthr_keycreate\fR \fBthr_keycreate_once\fR \fBthr_kill\fR \fBthr_main\fR \fBthr_min_stack\fR \fBthr_self\fR \fBthr_setconcurrency\fR \fBthr_setprio\fR @@ -727,42 +704,40 @@ l l . \fBthr_yield\fR \fBtime\fR \fBtimer_create\fR \fBtimer_delete\fR \fBtimer_getoverrun\fR \fBtimer_gettime\fR -\fBtimer_settime\fR -\fBtimes\fR \fBtimezone\fR -\fBtmpfile\fR \fBtmpnam\fR -\fBtmpnam_r\fR \fBtoascii\fR -\fBtolower\fR \fBtolower_l\fR -\fBtoupper\fR \fBtoupper_l\fR -\fBtowctrans\fR \fBtowctrans_l\fR -\fBtowlower\fR \fBtowlower_l\fR -\fBtowupper\fR \fBtowupper_l\fR -\fBtruncate\fR +\fBtimer_settime\fR \fBtimes\fR +\fBtimezone\fR \fBtmpfile\fR +\fBtmpnam\fR \fBtmpnam_r\fR +\fBtoascii\fR \fBtolower\fR +\fBtolower_l\fR \fBtoupper\fR +\fBtoupper_l\fR \fBtowctrans\fR +\fBtowctrans_l\fR \fBtowlower\fR +\fBtowlower_l\fR \fBtowupper\fR +\fBtowupper_l\fR \fBtruncate\fR \fBtsearch\fR \fBttyname\fR \fBttyname_r\fR \fBttyslot\fR \fBtwalk\fR \fBtzname\fR \fBtzset\fR \fBu8_strcmp\fR \fBu8_textprep_str\fR \fBu8_validate\fR -\fBuadmin\fR -\fBualarm\fR \fBuconv_u16tou32\fR -\fBuconv_u16tou8\fR \fBuconv_u32tou16\fR -\fBuconv_u32tou8\fR \fBuconv_u8tou16\fR -\fBuconv_u8tou32\fR \fBucred_free\fR -\fBucred_get\fR \fBucred_getegid\fR -\fBucred_geteuid\fR \fBucred_getgroups\fR -\fBucred_getpflags\fR \fBucred_getpid\fR -\fBucred_getprivset\fR \fBucred_getprojid\fR -\fBucred_getrgid\fR \fBucred_getruid\fR -\fBucred_getsgid\fR \fBucred_getsuid\fR -\fBucred_getzoneid\fR \fBucred_size\fR -\fBulckpwdf\fR \fBulimit\fR -\fBulltostr\fR \fBumask\fR -\fBumount\fR \fBumount2\fR -\fBuname\fR \fBungetc\fR -\fBungetwc\fR \fBunlink\fR -\fBunlinkat\fR \fBunlockpt\fR -\fBunordered\fR \fBunsetenv\fR -\fBupdwtmp\fR \fBupdwtmpx\fR -\fBuselocale\fR +\fBuadmin\fR \fBualarm\fR +\fBuconv_u16tou32\fR \fBuconv_u16tou8\fR +\fBuconv_u32tou16\fR \fBuconv_u32tou8\fR +\fBuconv_u8tou16\fR \fBuconv_u8tou32\fR +\fBucred_free\fR \fBucred_get\fR +\fBucred_getegid\fR \fBucred_geteuid\fR +\fBucred_getgroups\fR \fBucred_getpflags\fR +\fBucred_getpid\fR \fBucred_getprivset\fR +\fBucred_getprojid\fR \fBucred_getrgid\fR +\fBucred_getruid\fR \fBucred_getsgid\fR +\fBucred_getsuid\fR \fBucred_getzoneid\fR +\fBucred_size\fR \fBulckpwdf\fR +\fBulimit\fR \fBulltostr\fR +\fBumask\fR \fBumount\fR +\fBumount2\fR \fBuname\fR +\fBungetc\fR \fBungetwc\fR +\fBunlink\fR \fBunlinkat\fR +\fBunlockpt\fR \fBunordered\fR +\fBunsetenv\fR \fBupdwtmp\fR +\fBupdwtmpx\fR \fBuselocale\fR \fBusleep\fR \fBustat\fR \fButime\fR \fButimensat\fR \fButimes\fR \fButmpname\fR @@ -787,26 +762,24 @@ l l . \fBwcpcpy\fR \fBwcpncpy\fR \fBwcrtomb\fR \fBwcrtomb_l\fR \fBwcscasecmp\fR \fBwcscasecmp_l\fR -\fBwcscat\fR -\fBwcschr\fR \fBwcscmp\fR -\fBwcscoll\fR \fBwcscoll_l\fR -\fBwcscpy\fR \fBwcscspn\fR -\fBwcsdup\fR \fBwcsftime\fR -\fBwcslen\fR \fBwcsncat\fR -\fBwcsncasecmp\fR \fBwcsncasecmp_l\fR -\fBwcsncmp\fR \fBwcsncpy\fR -\fBwcsnrtombs\fR \fBwcsnrtombs_l\fR -\fBwcspbrk\fR \fBwcsrchr\fR -\fBwcsrtombs\fR \fBwcsrtombs_l\fR -\fBwcsspn\fR +\fBwcscat\fR \fBwcschr\fR +\fBwcscmp\fR \fBwcscoll\fR +\fBwcscoll_l\fR \fBwcscpy\fR +\fBwcscspn\fR \fBwcsdup\fR +\fBwcsftime\fR \fBwcslen\fR +\fBwcsncat\fR \fBwcsncasecmp\fR +\fBwcsncasecmp_l\fR \fBwcsncmp\fR +\fBwcsncpy\fR \fBwcsnrtombs\fR +\fBwcsnrtombs_l\fR \fBwcspbrk\fR +\fBwcsrchr\fR \fBwcsrtombs\fR +\fBwcsrtombs_l\fR \fBwcsspn\fR \fBwcsstr\fR \fBwcstod\fR \fBwcstof\fR \fBwcstoimax\fR \fBwcstok\fR \fBwcstol\fR \fBwcstold\fR \fBwcstoll\fR \fBwcstombs\fR \fBwctombs_l\fR -\fBwcstoul\fR -\fBwcstoull\fR \fBwcstoumax\fR -\fBwcswcs\fR +\fBwcstoul\fR \fBwcstoull\fR +\fBwcstoumax\fR \fBwcswcs\fR \fBwcswidth\fR \fBwcswidth_l\fR \fBwcsxfrm\fR \fBwcsxfrm_l\fR \fBwctob\fR \fBwctob_l\fR diff --git a/usr/src/man/man7d/pts.7d b/usr/src/man/man7d/pts.7d index 19f67addc1..6ac5bbcbd1 100644 --- a/usr/src/man/man7d/pts.7d +++ b/usr/src/man/man7d/pts.7d @@ -1,14 +1,13 @@ '\" te +.\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association. .\" Copyright 1992 Sun Microsystems .\" 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] -.TH PTS 7D "Aug 21, 1992" +.TH PTS 7D "Feb 29, 2020" .SH NAME pts \- STREAMS pseudo-tty slave driver .SH DESCRIPTION -.sp -.LP The pseudo-tty subsystem simulates a terminal connection, where the master side represents the terminal and the slave represents the user process's special device end point. In order to use the pseudo-tty subsystem, a node for the @@ -26,9 +25,10 @@ Only one open is allowed on a master device. Multiple opens are allowed on the slave device. After both the master and slave have been opened, the user has two file descriptors which are end points of a full duplex connection composed of two streams automatically connected at the master and slave drivers. The -user may then push modules onto either side of the stream pair. The user needs -to push the \fBptem\fR(7M) and \fBldterm\fR(7M) modules onto the slave side of -the pseudo-terminal subsystem to get terminal semantics. +user may then push modules onto either side of the stream pair. Unless compiled +in XPG4v2 mode (see below), the consumer needs to push the \fBptem\fR(7M) and +\fBldterm\fR(7M) modules onto the slave side of the pseudo-terminal subsystem +to get terminal semantics. .sp .LP The master and slave drivers pass all messages to their adjacent queues. Only @@ -48,14 +48,23 @@ device is not closed, the pseudo-tty subsystem will be available to another user to open the slave device. Since 0-length messages are used to indicate that the process on the slave side has closed and should be interpreted that way by the process on the master side, applications on the slave side should -not write 0-length messages. If that occurs, the write returns 0, and the -0-length message is discarded by the \fBptem\fR module. +not write 0-length messages. Unless the application is compiled in XPG4v2 mode +(see below) then any 0-length messages written on the slave side will be +discarded by the \fBptem\fR module. .sp .LP The standard STREAMS system calls can access the pseudo-tty devices. The slave devices support the \fBO_NDELAY\fR and \fBO_NONBLOCK\fR flags. -.SH EXAMPLES +.SH XPG4v2 MODE +XPG4v2 requires that open of a slave pseudo terminal device provides the +process with an interface that is identical to the terminal interface (without +having to explicitly push any modules to achieve this). It also requires that +0-length messages written on the slave side will be propagated to the master. .sp +Experience has shown, however, that most software does not expect slave pty +devices to operate in this manner and therefore this XPG4v2-compliant +behaviour is only enabled in XPG4v2/SUS (see \fBstandards\fR(5)) mode. +.SH EXAMPLES .in +2 .nf int fdm fds; @@ -73,7 +82,6 @@ ioctl(fds, I_PUSH, "ldterm"); /* push ldterm*/ .in -2 .SH FILES -.sp .ne 2 .na \fB\fB/dev/ptmx\fR\fR @@ -92,10 +100,8 @@ slave devices (M = 0 -> N-1) .RE .SH SEE ALSO -.sp -.LP \fBgrantpt\fR(3C), \fBptsname\fR(3C), \fBunlockpt\fR(3C), \fBldterm\fR(7M), -\fBptm\fR(7D), \fBptem\fR(7M) +\fBptm\fR(7D), \fBptem\fR(7M), \fBstandards\fR(5) .sp .LP \fISTREAMS Programming Guide\fR diff --git a/usr/src/uts/common/io/ldterm.c b/usr/src/uts/common/io/ldterm.c index 97a9c1a478..46669ace0c 100644 --- a/usr/src/uts/common/io/ldterm.c +++ b/usr/src/uts/common/io/ldterm.c @@ -22,7 +22,7 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright (c) 2018, Joyent, Inc. - * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -4087,7 +4087,8 @@ ldterm_dosig(queue_t *q, int sig, uchar_t c, int mtype, int mode) if (c != '\0') { if ((tp->t_echomp = allocb(4, BPRI_HI)) != NULL) { - if (ldterm_echo(c, WR(q), 4, tp) > 0) + if (ldterm_echo(c, WR(q), 4, tp) > 0 || + (tp->t_state & TS_ISPTSTTY)) putnext(WR(q), tp->t_echomp); else freemsg(tp->t_echomp); diff --git a/usr/src/uts/common/io/ptm.c b/usr/src/uts/common/io/ptm.c index 5904629295..472cbf6936 100644 --- a/usr/src/uts/common/io/ptm.c +++ b/usr/src/uts/common/io/ptm.c @@ -24,7 +24,9 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - +/* + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + */ /* * Pseudo Terminal Master Driver. @@ -521,6 +523,13 @@ ptmwput(queue_t *qp, mblk_t *mp) DBG(("ack the UNLKPT/ISPTM\n")); miocack(qp, mp, 0, 0); break; + case PTSSTTY: + mutex_enter(&ptmp->pt_lock); + ptmp->pt_state |= PTSTTY; + mutex_exit(&ptmp->pt_lock); + DBG(("ack PTSSTTY\n")); + miocack(qp, mp, 0, 0); + break; case ZONEPT: { zoneid_t z; diff --git a/usr/src/uts/common/io/pts.c b/usr/src/uts/common/io/pts.c index d67beb255a..ff2d91f566 100644 --- a/usr/src/uts/common/io/pts.c +++ b/usr/src/uts/common/io/pts.c @@ -25,7 +25,9 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - +/* + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + */ /* * Pseudo Terminal Slave Driver. @@ -106,6 +108,7 @@ #include #include #include +#include #include #include #include @@ -337,7 +340,6 @@ ptsopen( DDBGP("ptsopen: p = %p\n", (uintptr_t)ptsp); DDBG("ptsopen: state = %x\n", ptsp->pt_state); - ASSERT(ptsp->pt_minor == dminor); if ((ptsp->pt_state & PTLOCK) || !(ptsp->pt_state & PTMOPEN)) { @@ -347,7 +349,7 @@ ptsopen( } /* - * if already, open simply return... + * if already open, simply return... */ if (ptsp->pt_state & PTSOPEN) { ASSERT(rqp->q_ptr == ptsp); @@ -386,6 +388,9 @@ ptsopen( mutex_exit(&ptsp->pt_lock); mutex_exit(&ptms_lock); + if (ptsp->pt_state & PTSTTY) + STREAM(rqp)->sd_flag |= STRXPG4TTY; + qprocson(rqp); /* @@ -416,8 +421,6 @@ ptsopen( return (0); } - - /* * Find the address to private data identifying the slave's write * queue. Send a 0-length msg up the slave's read queue to designate diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c index 102c803f5f..3a5c1ecd19 100644 --- a/usr/src/uts/common/os/streamio.c +++ b/usr/src/uts/common/os/streamio.c @@ -25,7 +25,7 @@ /* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2017 Joyent, Inc. - * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ #include @@ -78,6 +78,7 @@ #include #include #include +#include #include /* @@ -231,6 +232,50 @@ push_mod(queue_t *qp, dev_t *devp, struct stdata *stp, const char *name, return (0); } +static int +xpg4_fixup(queue_t *qp, dev_t *devp, struct stdata *stp, cred_t *crp) +{ + static const char *ptsmods[] = { + "ptem", "ldterm", "ttcompat" + }; + dev_t dummydev = *devp; + struct strioctl strioc; + zoneid_t zoneid; + int32_t rval; + uint_t i; + + /* + * Push modules required for the slave PTY to have terminal + * semantics out of the box; this is required by XPG4v2. + * These three modules are flagged as single-instance so that + * the system will never end up with duplicate copies pushed + * onto a stream. + */ + + zoneid = crgetzoneid(crp); + for (i = 0; i < ARRAY_SIZE(ptsmods); i++) { + int error; + + error = push_mod(qp, &dummydev, stp, ptsmods[i], 0, + crp, zoneid); + if (error != 0) + return (error); + } + + /* + * Send PTSSTTY down the stream + */ + + strioc.ic_cmd = PTSSTTY; + strioc.ic_timout = 0; + strioc.ic_len = 0; + strioc.ic_dp = NULL; + + (void) strdoioctl(stp, &strioc, FNATIVE, K_TO_K, crp, &rval); + + return (0); +} + /* * Open a stream device. */ @@ -549,10 +594,15 @@ retryap: opendone: + if (error == 0 && + (stp->sd_flag & (STRISTTY|STRXPG4TTY)) == (STRISTTY|STRXPG4TTY)) { + error = xpg4_fixup(qp, devp, stp, crp); + } + /* * let specfs know that open failed part way through */ - if (error) { + if (error != 0) { mutex_enter(&stp->sd_lock); stp->sd_flag |= STREOPENFAIL; mutex_exit(&stp->sd_lock); diff --git a/usr/src/uts/common/sys/strsubr.h b/usr/src/uts/common/sys/strsubr.h index 306a2f6b29..43477446c2 100644 --- a/usr/src/uts/common/sys/strsubr.h +++ b/usr/src/uts/common/sys/strsubr.h @@ -28,7 +28,7 @@ */ /* - * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ #ifndef _SYS_STRSUBR_H @@ -288,7 +288,7 @@ typedef struct stdata { #define SNDMREAD 0x00008000 /* used for read notification */ #define OLDNDELAY 0x00010000 /* use old TTY semantics for */ /* NDELAY reads and writes */ - /* 0x00020000 unused */ +#define STRXPG4TTY 0x00020000 /* Use XPG4 TTY semantics */ /* 0x00040000 unused */ #define STRTOSTOP 0x00080000 /* block background writes */ #define STRCMDWAIT 0x00100000 /* someone is doing an _I_CMD */ -- cgit v1.2.3 From 6de7dd38d5e1d12791b18f60b9cad431c7d4b419 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Wed, 4 Mar 2020 18:23:40 +0000 Subject: 11861 hostbridge topo module should be hardened to handle empty busses Reviewed by: Yuri Pankov Reviewed by: Toomas Soome Reviewed by: Paul Winder Approved by: Joshua M. Clulow --- usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'usr/src/lib') diff --git a/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c b/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c index b8d89db32d..8968c70c95 100644 --- a/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c +++ b/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c @@ -93,6 +93,18 @@ pci_hostbridges_find(topo_mod_t *mod, tnode_t *ptn) pnode = di_drv_first_node(PCI, devtree); while (pnode != DI_NODE_NIL) { + /* + * We've seen cases where certain phantom PCI hostbridges have + * appeared on systems. If we encounter a host bridge without a + * bus address assigned to it, then we should skip processing it + * here as that indicates that it generally doesn't have any + * devices under it and we'll otherwise blow up in devinfo. + */ + if (di_bus_addr(pnode) == NULL) { + pnode = di_drv_next_node(pnode); + continue; + } + if (hb_process(mod, ptn, hbcnt, pnode) < 0) { if (hbcnt == 0) topo_node_range_destroy(ptn, HOSTBRIDGE); -- cgit v1.2.3 From 388488112189b484c639b410a453c22e93bdfb68 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Tue, 11 Feb 2020 16:23:41 +0000 Subject: 12304 risc-v dis instruction alignment too restrictive Reviewed by: Andy Fiddaman Reviewed by: Jason King Approved by: Dan McDonald --- usr/src/lib/libdisasm/common/dis_riscv.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/lib/libdisasm/common/dis_riscv.c b/usr/src/lib/libdisasm/common/dis_riscv.c index fa7cc30610..f246a19137 100644 --- a/usr/src/lib/libdisasm/common/dis_riscv.c +++ b/usr/src/lib/libdisasm/common/dis_riscv.c @@ -313,7 +313,7 @@ typedef void (*dis_riscv_func_t)(dis_handle_t *, uint32_t, struct dis_riscv_instr *, char *, size_t); typedef struct dis_riscv_instr { - const char *drv_name; + const char *drv_name; dis_riscv_itype_t drv_type; dis_riscv_func_t drv_print; uint_t drv_opcode; @@ -959,7 +959,7 @@ dis_riscv_fp_rm(dis_handle_t *dhp, uint32_t instr, #define DIS_RISCV_FP_R_RS2_IFP_NR(str, op, f3, rs2, f7) \ { str, DIS_RISCV_I_FP_R_RS2_TYPE, dis_riscv_fp_rs2_ifp_nr, op, f3, \ f7, rs2 } -#define DIS_RISCV_FP_RI(str, op, f3, f7) \ +#define DIS_RISCV_FP_RI(str, op, f3, f7) \ { str, DIS_RISCV_I_R_TYPE, dis_riscv_fp_r_fpi, op, f3, f7 } /* @@ -1300,7 +1300,7 @@ typedef struct dis_riscv_c_instr { const char *drv_c_name; dis_riscv_ctype_t drv_c_type; dis_riscv_c_func_t drv_c_print; - dis_riscv_c_class_t drv_c_class; + dis_riscv_c_class_t drv_c_class; uint_t drv_c_opcode; uint_t drv_c_funct; uint_t drv_c_mask; @@ -1680,7 +1680,7 @@ dis_riscv_c_int(dis_handle_t *dhp, uint32_t instr, #define DIS_RISCV_CFUNCT3(name, class, op, funct, print) \ { name, DIS_RISCV_C_FUNCT3, print, class, op, funct, 0, 0 } -#define DIS_RISCV_CMATCH(name, class, op, funct, mask, match, print) \ +#define DIS_RISCV_CMATCH(name, class, op, funct, mask, match, print) \ { name, DIS_RISCV_C_MATCH, print, class, op, funct, mask, match } static dis_riscv_c_instr_t dis_riscv_2byte[] = { @@ -1972,7 +1972,6 @@ dis_riscv_max_instrlen(dis_handle_t *dhp) static int dis_riscv_instrlen(dis_handle_t *dhp, uint64_t addr) { - int ret; uint16_t parcel; dhp->dh_addr = addr; @@ -1980,15 +1979,7 @@ dis_riscv_instrlen(dis_handle_t *dhp, uint64_t addr) if (dis_riscv_read_parcel(dhp, &parcel) != 0) return (-1); - /* - * Get length based on this parcel. Check for required alignment. 2-byte - * alignment was already taken care of when we read the parcel. - */ - ret = dis_riscv_decode_len(parcel); - if (ret >= 4 && (addr % 4) != 0) - return (-1); - - return (ret); + return (dis_riscv_decode_len(parcel)); } dis_arch_t dis_arch_riscv = { -- cgit v1.2.3 From 86b2c59a1c0693176ce8e6e5347f533716a6fcb0 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Thu, 27 Feb 2020 11:38:55 +0000 Subject: 12354 It should not be possible to create persistent VNICs over temporary objects Reviewed by: Peter Tribble Reviewed by: Dominik Hassler Approved by: Robert Mustacchi --- usr/src/lib/libdladm/common/libdladm.c | 3 +++ usr/src/lib/libdladm/common/libdladm.h | 5 +++-- usr/src/lib/libdladm/common/libdlvnic.c | 27 ++++++++++++++++++++------- 3 files changed, 26 insertions(+), 9 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/lib/libdladm/common/libdladm.c b/usr/src/lib/libdladm/common/libdladm.c index d62f59218b..eb099376a4 100644 --- a/usr/src/lib/libdladm/common/libdladm.c +++ b/usr/src/lib/libdladm/common/libdladm.c @@ -437,6 +437,9 @@ dladm_status2str(dladm_status_t status, char *buf) case DLADM_STATUS_INVALID_MTU: s = "MTU check failed, MTU outside of device's supported range"; break; + case DLADM_STATUS_PERSIST_ON_TEMP: + s = "can't create persistent object on top of temporary object"; + break; default: s = ""; break; diff --git a/usr/src/lib/libdladm/common/libdladm.h b/usr/src/lib/libdladm/common/libdladm.h index 36092f89a4..350c9c50f3 100644 --- a/usr/src/lib/libdladm/common/libdladm.h +++ b/usr/src/lib/libdladm/common/libdladm.h @@ -23,7 +23,7 @@ */ /* - * Copyright 2019 OmniOS Community Edition (OmniOSce) Association + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association */ #ifndef _LIBDLADM_H @@ -178,7 +178,8 @@ typedef enum { DLADM_STATUS_NO_IB_HW_RESOURCE, DLADM_STATUS_INVALID_PKEY_TBL_SIZE, DLADM_STATUS_PORT_NOPROTO, - DLADM_STATUS_INVALID_MTU + DLADM_STATUS_INVALID_MTU, + DLADM_STATUS_PERSIST_ON_TEMP } dladm_status_t; typedef enum { diff --git a/usr/src/lib/libdladm/common/libdlvnic.c b/usr/src/lib/libdladm/common/libdlvnic.c index 44f8bb2726..bad25e69ed 100644 --- a/usr/src/lib/libdladm/common/libdlvnic.c +++ b/usr/src/lib/libdladm/common/libdlvnic.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ #include @@ -405,6 +406,7 @@ dladm_vnic_create(dladm_handle_t handle, const char *vnic, datalink_id_t linkid, datalink_id_t vnic_id; datalink_class_t class; uint32_t media = DL_ETHER; + uint32_t link_flags; char name[MAXLINKNAMELEN]; uchar_t tmp_addr[MAXMACADDRLEN]; dladm_status_t status; @@ -420,6 +422,15 @@ dladm_vnic_create(dladm_handle_t handle, const char *vnic, datalink_id_t linkid, if ((flags & DLADM_OPT_ACTIVE) == 0) return (DLADM_STATUS_NOTSUP); + /* + * It's an anchor VNIC - linkid must be set to DATALINK_INVALID_LINKID + * and the VLAN id must be 0 + */ + if ((flags & DLADM_OPT_ANCHOR) != 0 && + (linkid != DATALINK_INVALID_LINKID || vid != 0)) { + return (DLADM_STATUS_BADARG); + } + is_vlan = ((flags & DLADM_OPT_VLAN) != 0); if (is_vlan && ((vid < 1 || vid > 4094))) return (DLADM_STATUS_VIDINVAL); @@ -429,18 +440,20 @@ dladm_vnic_create(dladm_handle_t handle, const char *vnic, datalink_id_t linkid, if (!dladm_vnic_macaddrtype2str(mac_addr_type)) return (DLADM_STATUS_INVALIDMACADDRTYPE); - if ((flags & DLADM_OPT_ANCHOR) == 0) { - if ((status = dladm_datalink_id2info(handle, linkid, NULL, - &class, &media, NULL, 0)) != DLADM_STATUS_OK) + if (!is_etherstub) { + if ((status = dladm_datalink_id2info(handle, linkid, + &link_flags, &class, &media, NULL, 0)) != DLADM_STATUS_OK) return (status); + /* Disallow persistent objects on top of temporary ones */ + if ((flags & DLADM_OPT_PERSIST) != 0 && + (link_flags & DLMGMT_PERSIST) == 0) + return (DLADM_STATUS_PERSIST_ON_TEMP); + + /* Links cannot be created on top of these object types */ if (class == DATALINK_CLASS_VNIC || class == DATALINK_CLASS_VLAN) return (DLADM_STATUS_BADARG); - } else { - /* it's an anchor VNIC */ - if (linkid != DATALINK_INVALID_LINKID || vid != 0) - return (DLADM_STATUS_BADARG); } /* -- cgit v1.2.3